From 2a29a2a6a1784223a9caf1fae2a768fe550b5f64 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 16 Nov 2024 21:02:52 +0200 Subject: ipa: libipa: vector: Add element-wise min() and max() functions Add functions to calculate the element-wise minimum and maximum of two vectors or of a vector and a scalar. This will be used in algorithm implementations. Signed-off-by: Laurent Pinchart Reviewed-by: Milan Zamazal --- src/ipa/libipa/vector.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/ipa/libipa/vector.cpp') diff --git a/src/ipa/libipa/vector.cpp b/src/ipa/libipa/vector.cpp index c5a0ac74..d29c1642 100644 --- a/src/ipa/libipa/vector.cpp +++ b/src/ipa/libipa/vector.cpp @@ -176,6 +176,34 @@ namespace ipa { * \return This vector */ +/** + * \fn Vector::min(const Vector &other) const + * \brief Calculate the minimum of this vector and \a other element-wise + * \param[in] other The other vector + * \return The element-wise minimum of this vector and \a other + */ + +/** + * \fn Vector::min(T scalar) const + * \brief Calculate the minimum of this vector and \a scalar element-wise + * \param[in] scalar The scalar + * \return The element-wise minimum of this vector and \a scalar + */ + +/** + * \fn Vector::max(const Vector &other) const + * \brief Calculate the maximum of this vector and \a other element-wise + * \param[in] other The other vector + * \return The element-wise maximum of this vector and \a other + */ + +/** + * \fn Vector::max(T scalar) const + * \brief Calculate the maximum of this vector and \a scalar element-wise + * \param[in] scalar The scalar + * \return The element-wise maximum of this vector and \a scalar + */ + /** * \fn Vector::dot(const Vector &other) const * \brief Compute the dot product -- cgit v1.2.1