Skip to content

Commit

Permalink
Remove redundant inline (#377)
Browse files Browse the repository at this point in the history
Co-authored-by: jmcarcell <[email protected]>
  • Loading branch information
jmcarcell and jmcarcell authored Oct 16, 2024
1 parent 9d63252 commit 22e85d7
Showing 1 changed file with 12 additions and 12 deletions.
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

0 comments on commit 22e85d7

Please sign in to comment.