diff options
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>; + } } |