10 #include "Utilities/GenerateInstantiations.hpp"
13 namespace TestHelpers::TensorExpressions {
39 template <
typename DataType,
typename RhsSymmetry,
40 typename RhsTensorIndexTypeList,
typename TensorIndexA,
41 typename TensorIndexB>
43 const TensorIndexA& tensorindex_a,
44 const TensorIndexB& tensorindex_b) noexcept {
45 const Tensor<DataType, RhsSymmetry, RhsTensorIndexTypeList> rhs_tensor(5_st);
47 const auto R_ab = rhs_tensor(tensorindex_a, tensorindex_b);
54 const size_t dim_a = tmpl::at_c<RhsTensorIndexTypeList, 0>::dim;
55 const size_t dim_b = tmpl::at_c<RhsTensorIndexTypeList, 1>::dim;
57 for (
size_t i = 0; i < dim_a; i++) {
58 for (
size_t j = 0; j < dim_b; j++) {
63 CHECK(R_ab.compute_rhs_tensor_index(index_order_ab, index_order_ab, ij) ==
66 CHECK(R_ab.compute_rhs_tensor_index(index_order_ba, index_order_ab, ij) ==
107 typename DataType,
template <
size_t, UpLo,
typename>
class TensorIndexTypeA,
108 template <
size_t, UpLo,
typename>
class TensorIndexTypeB,
UpLo ValenceA,
109 UpLo ValenceB,
typename TensorIndexA,
typename TensorIndexB>
111 const TensorIndexA& tensorindex_a,
112 const TensorIndexB& tensorindex_b) noexcept {
113 #define DIM_A(data) BOOST_PP_TUPLE_ELEM(0, data)
114 #define DIM_B(data) BOOST_PP_TUPLE_ELEM(1, data)
115 #define FRAME(data) BOOST_PP_TUPLE_ELEM(2, data)
117 #define CALL_TEST_COMPUTE_RHS_TENSOR_INDEX_RANK_2_IMPL(_, data) \
118 test_compute_rhs_tensor_index_rank_2_impl< \
119 DataType, Symmetry<2, 1>, \
120 index_list<TensorIndexTypeA<DIM_A(data), ValenceA, FRAME(data)>, \
121 TensorIndexTypeB<DIM_B(data), ValenceB, FRAME(data)>>>( \
122 tensorindex_a, tensorindex_b);
127 #undef CALL_TEST_COMPUTE_RHS_TENSOR_INDEX_RANK_2_IMPL
136 typename DataType,
template <
size_t, UpLo,
typename>
class TensorIndexType,
137 UpLo Valence,
typename TensorIndexA,
typename TensorIndexB>
139 const TensorIndexA& tensorindex_a,
140 const TensorIndexB& tensorindex_b) noexcept {
141 #define DIM(data) BOOST_PP_TUPLE_ELEM(0, data)
142 #define FRAME(data) BOOST_PP_TUPLE_ELEM(1, data)
144 #define CALL_TEST_COMPUTE_RHS_TENSOR_INDEX_RANK_2_IMPL(_, data) \
145 test_compute_rhs_tensor_index_rank_2_impl< \
146 DataType, Symmetry<1, 1>, \
147 index_list<TensorIndexType<DIM(data), Valence, FRAME(data)>, \
148 TensorIndexType<DIM(data), Valence, FRAME(data)>>, \
149 TensorIndexA, TensorIndexB>(tensorindex_a, tensorindex_b);
154 #undef CALL_TEST_COMPUTE_RHS_TENSOR_INDEX_RANK_2_IMPL