From f36a545b0f814d8d35e87262dd80d4d8d8dc4405 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Wed, 6 Aug 2025 14:20:21 +0200 Subject: Extended math setup. Need meta iteration for multi dim array :/ --- modules/codec/c++/data_math.hpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'modules/codec/c++/data_math.hpp') diff --git a/modules/codec/c++/data_math.hpp b/modules/codec/c++/data_math.hpp index a5c50fc..7277168 100644 --- a/modules/codec/c++/data_math.hpp +++ b/modules/codec/c++/data_math.hpp @@ -1,10 +1,12 @@ #pragma once +#include "data.hpp" #include "schema_math.hpp" #include namespace saw { +/* template class data,encode::Native> { public: @@ -61,5 +63,40 @@ public: return mult; } }; +*/ + +template +class data, encode::Native> { +public: + using Schema = schema::Tensor; +private: + data, encode::Native> values_; +public: + data(): + values_{data>{{data{Dims}...}}} + {} + + data& at(const data, encode::Native>& index){ + return values_.at(index); + } + + const data& at(const data, encode::Native>& index) const { + return values_.at(index); + } + + data& operator()(const data, encode::Native>& index){ + return values_.at(index); + } + + const data& operator()(const data, encode::Native>& index) const { + return values_.at(index); + } + + data, encode::Native> operator+(const data, encode::Native>& rhs) const { + data, encode::Native> c; + + return {}; + } +}; } -- cgit v1.2.3