Stratax 0.3.1
Loading...
Searching...
No Matches
ArrayTraits.hpp
1#pragma once
2
3#include <type_traits>
4
5#include <stratax/containers/Matrix.hpp>
6#include <stratax/containers/Tensor.hpp>
7#include <stratax/containers/Vector.hpp>
8
9namespace stratax::core {
10
19template<typename A, typename T>
21
25template<typename From, typename To>
26struct RebindArray<container::Vector<From>, To>
27{
29};
30
34template<typename From, typename To>
35struct RebindArray<container::Matrix<From>, To>
36{
38};
39
43template<typename From, typename To>
44struct RebindArray<container::Tensor<From>, To>
45{
47};
48
55template<typename A, typename T>
56using rebind_array_t =
57 typename RebindArray<
58 std::remove_cvref_t<A>,
59 std::remove_cvref_t<T>
60 >::type;
61
68template<typename L, typename R, typename T>
70
74template<typename LValue, typename RValue, typename T>
76 container::Vector<LValue>,
77 container::Vector<RValue>,
78 T>
79{
81};
82
86template<typename LValue, typename RValue, typename T>
88 container::Matrix<LValue>,
89 container::Matrix<RValue>,
90 T>
91{
93};
94
98template<typename LValue, typename RValue, typename T>
100 container::Tensor<LValue>,
101 container::Tensor<RValue>,
102 T>
103{
105};
106
110template<typename LValue, typename RValue, typename T>
112 container::Vector<LValue>,
113 container::Matrix<RValue>,
114 T>
115{
117};
118
119template<typename LValue, typename RValue, typename T>
121 container::Matrix<LValue>,
122 container::Vector<RValue>,
123 T>
124{
126};
127
131template<typename LValue, typename RValue, typename T>
133 container::Vector<LValue>,
134 container::Tensor<RValue>,
135 T>
136{
138};
139
140template<typename LValue, typename RValue, typename T>
142 container::Tensor<LValue>,
143 container::Vector<RValue>,
144 T>
145{
147};
148
152template<typename LValue, typename RValue, typename T>
154 container::Matrix<LValue>,
155 container::Tensor<RValue>,
156 T>
157{
159};
160
161template<typename LValue, typename RValue, typename T>
163 container::Tensor<LValue>,
164 container::Matrix<RValue>,
165 T>
166{
168};
169
173template<typename L, typename R, typename T>
174using promote_array_t =
175 typename PromoteArray<
176 std::remove_cvref_t<L>,
177 std::remove_cvref_t<R>,
178 std::remove_cvref_t<T>
179 >::type;
180
181} // namespace stratax::core
Two-dimensional owning array of numeric values.
Definition Matrix.hpp:46
Arbitrary-rank owning array of numeric values.
Definition Tensor.hpp:50
One-dimensional owning array of numeric values.
Definition Vector.hpp:44
Determines the result container family for two Stratax arrays.
Rebinds a Stratax array container to a different value type.