diff --git a/src/array.hpp b/src/array.hpp index 8df3b3697fedc411c78f34c799e085864b50b7a7..f3710a17f8e25f03ae5297463cccfd839444ddee 100644 --- a/src/array.hpp +++ b/src/array.hpp @@ -419,6 +419,15 @@ public: static_assert(Shape::size == detail::ShapeType<Dims...>::size, "incompatible shapes"); return {data(), Base::size(), shape}; } + + /** Fill with value */ + void fill(const Scalar& value) + { + const size_t n = Base::size(); + + for (size_t i = 0; i < n; ++i) + data_[i] = value; + } }; /**