From b68d898909e346df6bfd02e516f101867ee6ed21 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 18 Nov 2024 20:54:15 +0200 Subject: ipa: libipa: vector: Add scalar constructor The default constructor leaves the vector data uninitialized. Add a constructor to fill the vector with copies of a scalar value, and fix the documentation of the default constructor. Signed-off-by: Laurent Pinchart Reviewed-by: Milan Zamazal --- src/ipa/libipa/vector.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/ipa/libipa/vector.h') diff --git a/src/ipa/libipa/vector.h b/src/ipa/libipa/vector.h index 3168835b..5fb7ad7c 100644 --- a/src/ipa/libipa/vector.h +++ b/src/ipa/libipa/vector.h @@ -35,6 +35,11 @@ class Vector public: constexpr Vector() = default; + constexpr explicit Vector(T scalar) + { + data_.fill(scalar); + } + constexpr Vector(const std::array &data) { for (unsigned int i = 0; i < Rows; i++) -- cgit v1.2.1