summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ipa/libipa/vector.cpp14
-rw-r--r--src/ipa/libipa/vector.h16
2 files changed, 15 insertions, 15 deletions
diff --git a/src/ipa/libipa/vector.cpp b/src/ipa/libipa/vector.cpp
index 5851b9ae..d3d7c7ca 100644
--- a/src/ipa/libipa/vector.cpp
+++ b/src/ipa/libipa/vector.cpp
@@ -79,13 +79,6 @@ namespace ipa {
*/
/**
- * \fn Vector::operator*(const Vector<T, Rows> &other) const
- * \brief Compute the dot product
- * \param[in] other The other vector
- * \return The dot product of the two vectors
- */
-
-/**
* \fn Vector::operator*(T factor) const
* \brief Multiply the vector by a scalar
* \param[in] factor The factor
@@ -100,6 +93,13 @@ namespace ipa {
*/
/**
+ * \fn Vector::dot(const Vector<T, Rows> &other) const
+ * \brief Compute the dot product
+ * \param[in] other The other vector
+ * \return The dot product of the two vectors
+ */
+
+/**
* \fn constexpr T &Vector::x()
* \brief Convenience function to access the first element of the vector
* \return The first element of the vector
diff --git a/src/ipa/libipa/vector.h b/src/ipa/libipa/vector.h
index 5fb7ad7c..b8315dd0 100644
--- a/src/ipa/libipa/vector.h
+++ b/src/ipa/libipa/vector.h
@@ -82,14 +82,6 @@ public:
return ret;
}
- constexpr T operator*(const Vector<T, Rows> &other) const
- {
- T ret = 0;
- for (unsigned int i = 0; i < Rows; i++)
- ret += data_[i] * other[i];
- return ret;
- }
-
constexpr Vector<T, Rows> operator*(T factor) const
{
Vector<T, Rows> ret;
@@ -106,6 +98,14 @@ public:
return ret;
}
+ constexpr T dot(const Vector<T, Rows> &other) const
+ {
+ T ret = 0;
+ for (unsigned int i = 0; i < Rows; i++)
+ ret += data_[i] * other[i];
+ return ret;
+ }
+
#ifndef __DOXYGEN__
template<bool Dependent = false, typename = std::enable_if_t<Dependent || Rows >= 1>>
#endif /* __DOXYGEN__ */