diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-08-06 14:20:21 +0200 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-08-06 14:20:21 +0200 |
commit | f36a545b0f814d8d35e87262dd80d4d8d8dc4405 (patch) | |
tree | 828927280b83f6f43eb0b30bc3c99c3d3546511e /modules/codec/c++/schema_math.hpp | |
parent | 25ccfc72c5851b2ff59daadad3aeef85b22a6bce (diff) |
Extended math setup. Need meta iteration for multi dim array :/
Diffstat (limited to 'modules/codec/c++/schema_math.hpp')
-rw-r--r-- | modules/codec/c++/schema_math.hpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/modules/codec/c++/schema_math.hpp b/modules/codec/c++/schema_math.hpp index 203b88a..ddf95a0 100644 --- a/modules/codec/c++/schema_math.hpp +++ b/modules/codec/c++/schema_math.hpp @@ -4,17 +4,25 @@ namespace saw { namespace schema { -template<typename T> -struct Complex {}; -template<typename T> -struct Quaternion { - static_assert(is_primitive<T>::value, "Quaternions assume a primitive type"); +/** + * Tensor Schema. I think I need this due to the amount of mathematical operators being able to be represented by this one construct. + */ +template<typename Inner, uint64_t... D> +struct Tensor { + static constexpr uint64_t Rank = sizeof...(D); + static constexpr std::array<uint64_t,Rank> Dimension{D...}; + static constexpr string_literal name = "Tensor"; }; -template<typename T, uint64_t D> -struct Euler { - static_assert(is_primitive<T>::value, "Quaternions assume a primitive type"); -}; +template<typename Inner> +using Scalar = Tensor<Inner>; + +template<typename Inner, uint64_t D> +using Vector = Tensor<Inner,D>; + +template<typename Inner, uint64_t D1, uint64_t D2> +using Matrix = Tensor<Inner,D1,D2>; + } } |