Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant inline #377

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions utils/include/edm4hep/utils/vector_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,57 +235,57 @@ namespace utils {
} // namespace utils

template <edm4hep::Vector2D V>
inline constexpr V operator+(const V& v1, const V& v2) {
constexpr V operator+(const V& v1, const V& v2) {
return {edm4hep::utils::vector_x(v1) + edm4hep::utils::vector_x(v2),
edm4hep::utils::vector_y(v1) + edm4hep::utils::vector_y(v2)};
}

template <edm4hep::Vector3D V>
inline constexpr V operator+(const V& v1, const V& v2) {
constexpr V operator+(const V& v1, const V& v2) {
return {edm4hep::utils::vector_x(v1) + edm4hep::utils::vector_x(v2),
edm4hep::utils::vector_y(v1) + edm4hep::utils::vector_y(v2),
edm4hep::utils::vector_z(v1) + edm4hep::utils::vector_z(v2)};
}

template <edm4hep::Vector4D V>
inline constexpr V operator+(const V& v1, const V& v2) {
constexpr V operator+(const V& v1, const V& v2) {
return {edm4hep::utils::vector_x(v1) + edm4hep::utils::vector_x(v2),
edm4hep::utils::vector_y(v1) + edm4hep::utils::vector_y(v2),
edm4hep::utils::vector_z(v1) + edm4hep::utils::vector_z(v2),
edm4hep::utils::vector_t(v1) + edm4hep::utils::vector_t(v2)};
}

template <edm4hep::Vector2D V>
inline constexpr auto operator*(const V& v1, const V& v2) {
constexpr auto operator*(const V& v1, const V& v2) {
return edm4hep::utils::vector_x(v1) * edm4hep::utils::vector_x(v2) +
edm4hep::utils::vector_y(v1) * edm4hep::utils::vector_y(v2);
}

template <edm4hep::Vector3D V>
inline constexpr auto operator*(const V& v1, const V& v2) {
constexpr auto operator*(const V& v1, const V& v2) {
return edm4hep::utils::vector_x(v1) * edm4hep::utils::vector_x(v2) +
edm4hep::utils::vector_y(v1) * edm4hep::utils::vector_y(v2) +
edm4hep::utils::vector_z(v1) * edm4hep::utils::vector_z(v2);
}

template <edm4hep::Vector4D V>
inline constexpr auto operator*(const V& v1, const V& v2) {
constexpr auto operator*(const V& v1, const V& v2) {
return (edm4hep::utils::vector_x(v1) * edm4hep::utils::vector_x(v2) +
edm4hep::utils::vector_y(v1) * edm4hep::utils::vector_y(v2) +
edm4hep::utils::vector_z(v1) * edm4hep::utils::vector_z(v2)) -
edm4hep::utils::vector_t(v1) * edm4hep::utils::vector_t(v2);
}

template <edm4hep::Vector2D V>
inline constexpr V operator*(const double d, const V& v) {
constexpr V operator*(const double d, const V& v) {
using VT = edm4hep::utils::ValueType<V>;
const VT x = d * edm4hep::utils::vector_x(v);
const VT y = d * edm4hep::utils::vector_y(v);
return {x, y};
}

template <edm4hep::Vector3D V>
inline constexpr V operator*(const double d, const V& v) {
constexpr V operator*(const double d, const V& v) {
using VT = edm4hep::utils::ValueType<V>;
const VT x = d * edm4hep::utils::vector_x(v);
const VT y = d * edm4hep::utils::vector_y(v);
Expand All @@ -294,7 +294,7 @@ inline constexpr V operator*(const double d, const V& v) {
}

template <edm4hep::Vector4D V>
inline constexpr V operator*(const double d, const V& v) {
constexpr V operator*(const double d, const V& v) {
using VT = edm4hep::utils::ValueType<V>;
const VT x = d * edm4hep::utils::vector_x(v);
const VT y = d * edm4hep::utils::vector_y(v);
Expand All @@ -304,17 +304,17 @@ inline constexpr V operator*(const double d, const V& v) {
}

template <edm4hep::VectorND V>
inline constexpr V operator*(const V& v, const double d) {
constexpr V operator*(const V& v, const double d) {
return d * v;
}

template <edm4hep::VectorND V>
inline constexpr V operator-(const V& v1, const V& v2) {
constexpr V operator-(const V& v1, const V& v2) {
return v1 + (-1. * v2);
}

template <edm4hep::VectorND V>
inline constexpr V operator/(const V& v, const double d) {
constexpr V operator/(const V& v, const double d) {
return (1. / d) * v;
}

Expand Down
Loading