10 #include "Utilities/GenerateInstantiations.hpp"
13 namespace TestHelpers::TensorExpressions {
43 template <
typename DataType,
typename RhsSymmetry,
44 typename RhsTensorIndexTypeList,
typename TensorIndexA,
45 typename TensorIndexB,
typename TensorIndexC>
47 const TensorIndexA& tensorindex_a,
const TensorIndexB& tensorindex_b,
48 const TensorIndexC& tensorindex_c) noexcept {
49 const Tensor<DataType, RhsSymmetry, RhsTensorIndexTypeList> rhs_tensor(5_st);
51 const auto R_abc = rhs_tensor(tensorindex_a, tensorindex_b, tensorindex_c);
54 TensorIndexA::value, TensorIndexB::value, TensorIndexC::value};
56 TensorIndexA::value, TensorIndexC::value, TensorIndexB::value};
58 TensorIndexB::value, TensorIndexA::value, TensorIndexC::value};
60 TensorIndexB::value, TensorIndexC::value, TensorIndexA::value};
62 TensorIndexC::value, TensorIndexA::value, TensorIndexB::value};
64 TensorIndexC::value, TensorIndexB::value, TensorIndexA::value};
66 const size_t dim_a = tmpl::at_c<RhsTensorIndexTypeList, 0>::dim;
67 const size_t dim_b = tmpl::at_c<RhsTensorIndexTypeList, 1>::dim;
68 const size_t dim_c = tmpl::at_c<RhsTensorIndexTypeList, 2>::dim;
70 for (
size_t i = 0; i < dim_a; i++) {
71 for (
size_t j = 0; j < dim_b; j++) {
72 for (
size_t k = 0; k < dim_c; k++) {
81 CHECK(R_abc.compute_rhs_tensor_index(index_order_abc, index_order_abc,
84 CHECK(R_abc.compute_rhs_tensor_index(index_order_acb, index_order_abc,
87 CHECK(R_abc.compute_rhs_tensor_index(index_order_bac, index_order_abc,
90 CHECK(R_abc.compute_rhs_tensor_index(index_order_bca, index_order_abc,
93 CHECK(R_abc.compute_rhs_tensor_index(index_order_cab, index_order_abc,
96 CHECK(R_abc.compute_rhs_tensor_index(index_order_cba, index_order_abc,
147 template <
typename DataType,
148 template <
size_t, UpLo,
typename>
class TensorIndexTypeA,
149 template <
size_t, UpLo,
typename>
class TensorIndexTypeB,
150 template <
size_t, UpLo,
typename>
class TensorIndexTypeC,
151 UpLo ValenceA,
UpLo ValenceB,
UpLo ValenceC,
typename TensorIndexA,
152 typename TensorIndexB,
typename TensorIndexC>
154 const TensorIndexA& tensorindex_a,
const TensorIndexB& tensorindex_b,
155 const TensorIndexC& tensorindex_c) noexcept {
156 #define DIM_A(data) BOOST_PP_TUPLE_ELEM(0, data)
157 #define DIM_B(data) BOOST_PP_TUPLE_ELEM(1, data)
158 #define DIM_C(data) BOOST_PP_TUPLE_ELEM(2, data)
159 #define FRAME(data) BOOST_PP_TUPLE_ELEM(3, data)
161 #define CALL_TEST_COMPUTE_RHS_TENSOR_INDEX_RANK_3_IMPL(_, data) \
162 test_compute_rhs_tensor_index_rank_3_impl< \
163 DataType, Symmetry<3, 2, 1>, \
164 index_list<TensorIndexTypeA<DIM_A(data), ValenceA, FRAME(data)>, \
165 TensorIndexTypeB<DIM_B(data), ValenceB, FRAME(data)>, \
166 TensorIndexTypeC<DIM_C(data), ValenceC, FRAME(data)>>>( \
167 tensorindex_a, tensorindex_b, tensorindex_c);
170 (1, 2, 3), (1, 2, 3), (1, 2, 3),
173 #undef CALL_TEST_COMPUTE_RHS_TENSOR_INDEX_RANK_3_IMPL
182 template <
typename DataType,
183 template <
size_t, UpLo,
typename>
class TensorIndexTypeAB,
184 template <
size_t, UpLo,
typename>
class TensorIndexTypeC,
185 UpLo ValenceAB,
UpLo ValenceC,
typename TensorIndexA,
186 typename TensorIndexB,
typename TensorIndexC>
188 const TensorIndexA& tensorindex_a,
const TensorIndexB& tensorindex_b,
189 const TensorIndexC& tensorindex_c) noexcept {
190 #define DIM_AB(data) BOOST_PP_TUPLE_ELEM(0, data)
191 #define DIM_C(data) BOOST_PP_TUPLE_ELEM(1, data)
192 #define FRAME(data) BOOST_PP_TUPLE_ELEM(2, data)
194 #define CALL_TEST_COMPUTE_RHS_TENSOR_INDEX_RANK_3_IMPL(_, data) \
195 test_compute_rhs_tensor_index_rank_3_impl< \
196 DataType, Symmetry<2, 2, 1>, \
197 index_list<TensorIndexTypeAB<DIM_AB(data), ValenceAB, FRAME(data)>, \
198 TensorIndexTypeAB<DIM_AB(data), ValenceAB, FRAME(data)>, \
199 TensorIndexTypeC<DIM_C(data), ValenceC, FRAME(data)>>>( \
200 tensorindex_a, tensorindex_b, tensorindex_c);
205 #undef CALL_TEST_COMPUTE_RHS_TENSOR_INDEX_RANK_3_IMPL
213 template <
typename DataType,
214 template <
size_t, UpLo,
typename>
class TensorIndexTypeAC,
215 template <
size_t, UpLo,
typename>
class TensorIndexTypeB,
216 UpLo ValenceAC,
UpLo ValenceB,
typename TensorIndexA,
217 typename TensorIndexB,
typename TensorIndexC>
219 const TensorIndexA& tensorindex_a,
const TensorIndexB& tensorindex_b,
220 const TensorIndexC& tensorindex_c) noexcept {
221 #define DIM_AC(data) BOOST_PP_TUPLE_ELEM(0, data)
222 #define DIM_B(data) BOOST_PP_TUPLE_ELEM(1, data)
223 #define FRAME(data) BOOST_PP_TUPLE_ELEM(2, data)
225 #define CALL_TEST_COMPUTE_RHS_TENSOR_INDEX_RANK_3_IMPL(_, data) \
226 test_compute_rhs_tensor_index_rank_3_impl< \
227 DataType, Symmetry<2, 1, 2>, \
228 index_list<TensorIndexTypeAC<DIM_AC(data), ValenceAC, FRAME(data)>, \
229 TensorIndexTypeB<DIM_B(data), ValenceB, FRAME(data)>, \
230 TensorIndexTypeAC<DIM_AC(data), ValenceAC, FRAME(data)>>>( \
231 tensorindex_a, tensorindex_b, tensorindex_c);
236 #undef CALL_TEST_COMPUTE_RHS_TENSOR_INDEX_RANK_3_IMPL
244 template <
typename DataType,
245 template <
size_t, UpLo,
typename>
class TensorIndexTypeA,
246 template <
size_t, UpLo,
typename>
class TensorIndexTypeBC,
247 UpLo ValenceA,
UpLo ValenceBC,
typename TensorIndexA,
248 typename TensorIndexB,
typename TensorIndexC>
250 const TensorIndexA& tensorindex_a,
const TensorIndexB& tensorindex_b,
251 const TensorIndexC& tensorindex_c) noexcept {
252 #define DIM_A(data) BOOST_PP_TUPLE_ELEM(0, data)
253 #define DIM_BC(data) BOOST_PP_TUPLE_ELEM(1, data)
254 #define FRAME(data) BOOST_PP_TUPLE_ELEM(2, data)
256 #define CALL_TEST_COMPUTE_RHS_TENSOR_INDEX_RANK_3_IMPL(_, data) \
257 test_compute_rhs_tensor_index_rank_3_impl< \
258 DataType, Symmetry<2, 1, 1>, \
259 index_list<TensorIndexTypeA<DIM_A(data), ValenceA, FRAME(data)>, \
260 TensorIndexTypeBC<DIM_BC(data), ValenceBC, FRAME(data)>, \
261 TensorIndexTypeBC<DIM_BC(data), ValenceBC, FRAME(data)>>>( \
262 tensorindex_a, tensorindex_b, tensorindex_c);
267 #undef CALL_TEST_COMPUTE_RHS_TENSOR_INDEX_RANK_3_IMPL
275 template <
typename DataType,
276 template <
size_t, UpLo,
typename>
class TensorIndexType,
UpLo Valence,
277 typename TensorIndexA,
typename TensorIndexB,
typename TensorIndexC>
279 const TensorIndexA& tensorindex_a,
const TensorIndexB& tensorindex_b,
280 const TensorIndexC& tensorindex_c) noexcept {
281 #define DIM(data) BOOST_PP_TUPLE_ELEM(0, data)
282 #define FRAME(data) BOOST_PP_TUPLE_ELEM(1, data)
284 #define CALL_TEST_COMPUTE_RHS_TENSOR_INDEX_RANK_3_IMPL(_, data) \
285 test_compute_rhs_tensor_index_rank_3_impl< \
286 DataType, Symmetry<1, 1, 1>, \
287 index_list<TensorIndexType<DIM(data), Valence, FRAME(data)>, \
288 TensorIndexType<DIM(data), Valence, FRAME(data)>, \
289 TensorIndexType<DIM(data), Valence, FRAME(data)>>>( \
290 tensorindex_a, tensorindex_b, tensorindex_c);
295 #undef CALL_TEST_COMPUTE_RHS_TENSOR_INDEX_RANK_3_IMPL