ipa: libipa: vector: Add compound assignment operators

Extend the Vector class with compound assignment operators that match
the binary arithmetic operators.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
This commit is contained in:
Laurent Pinchart 2024-11-16 21:02:52 +02:00
parent f0d73c8758
commit 69544f5b7b
2 changed files with 115 additions and 0 deletions

View file

@ -120,6 +120,62 @@ namespace ipa {
* \return The element-wise division of this vector by \a scalar
*/
/**
* \fn Vector::operator+=(Vector const &other)
* \brief Add \a other element-wise to this vector
* \param[in] other The other vector
* \return This vector
*/
/**
* \fn Vector::operator+=(T scalar)
* \brief Add \a scalar element-wise to this vector
* \param[in] scalar The scalar
* \return This vector
*/
/**
* \fn Vector::operator-=(Vector const &other)
* \brief Subtract \a other element-wise from this vector
* \param[in] other The other vector
* \return This vector
*/
/**
* \fn Vector::operator-=(T scalar)
* \brief Subtract \a scalar element-wise from this vector
* \param[in] scalar The scalar
* \return This vector
*/
/**
* \fn Vector::operator*=(const Vector &other)
* \brief Multiply this vector by \a other element-wise
* \param[in] other The other vector
* \return This vector
*/
/**
* \fn Vector::operator*=(T scalar)
* \brief Multiply this vector by \a scalar element-wise
* \param[in] scalar The scalar
* \return This vector
*/
/**
* \fn Vector::operator/=(const Vector &other)
* \brief Divide this vector by \a other element-wise
* \param[in] other The other vector
* \return This vector
*/
/**
* \fn Vector::operator/=(T scalar)
* \brief Divide this vector by \a scalar element-wise
* \param[in] scalar The scalar
* \return This vector
*/
/**
* \fn Vector::dot(const Vector<T, Rows> &other) const
* \brief Compute the dot product