summaryrefslogtreecommitdiff
path: root/modules/codec/c++
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-03-21 14:45:57 +0100
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-03-21 14:45:57 +0100
commit135c8751041961ef7f66502926d770b93539c252 (patch)
treea428374abaec913a029ad8f9d5a966b73274a02c /modules/codec/c++
parentec4e2ec0ec6261a402c71cc8d803c2d30bb3b48c (diff)
downloadforstio-forstio-135c8751041961ef7f66502926d770b93539c252.tar.gz
iterators and fill ops
Diffstat (limited to 'modules/codec/c++')
-rw-r--r--modules/codec/c++/math.hpp20
1 files changed, 20 insertions, 0 deletions
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<uint64_t D>
+class iterator final {
+public:
+ template<typename Func
+ void apply(Func&& func){
+ /// TODO !!!!
+ }
+};
namespace math {
+
/*
template<typename T, typename Encoding = FORSTIO_DEFAULT_DATA_ENCODING>
data<typename T::InnerType,Encoding> norm_2(const data<T,Encoding>& d){
@@ -149,5 +158,16 @@ data<schema::Vector<T,D>,Encoding> scale(
}
return sc_vec;
}
+
+template<typename T, uint64_t... Ds, typename Encoding = FORSTIO_DEFAULT_DATA_ENCODING>
+data<schema::Tensor<T,Ds...>, Encoding> fill(
+ const data<T,Encoding>& filler){
+ data<schema::Tensor<T,Ds...>, Encoding> tbf;
+
+ iterator<sizeof...(Ds)>::apply([&](const auto& index){
+ tbf.at(index) = filler;
+ }, {}, {{Ds...}});
+ return tbf;
+}
}
}