From 135c8751041961ef7f66502926d770b93539c252 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Sat, 21 Mar 2026 14:45:57 +0100 Subject: iterators and fill ops --- modules/codec/c++/math.hpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'modules/codec/c++/math.hpp') diff --git a/modules/codec/c++/math.hpp b/modules/codec/c++/math.hpp index d110b64..7524265 100644 --- a/modules/codec/c++/math.hpp +++ b/modules/codec/c++/math.hpp @@ -3,7 +3,16 @@ #include "data_math.hpp" namespace saw { +template +class iterator final { +public: + template data norm_2(const data& d){ @@ -149,5 +158,16 @@ data,Encoding> scale( } return sc_vec; } + +template +data, Encoding> fill( + const data& filler){ + data, Encoding> tbf; + + iterator::apply([&](const auto& index){ + tbf.at(index) = filler; + }, {}, {{Ds...}}); + return tbf; +} } } -- cgit v1.2.3