@@ -91,13 +91,6 @@ namespace ipa {
* \return The sum of the two vectors
*/
-/**
- * \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
@@ -112,6 +105,13 @@ namespace ipa {
* \return The vector divided by \a factor
*/
+/**
+ * \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
@@ -86,14 +86,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;
@@ -110,6 +102,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__ */