ComputeRhsTensorIndexRank0TestHelpers.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 
10 #include "Utilities/TMPL.hpp"
11 
12 namespace TestHelpers::TensorExpressions {
13 
14 /// \ingroup TestingFrameworkGroup
15 /// \brief Test that the computed tensor multi-index of a rank 0 RHS Tensor is
16 /// equivalent to the given LHS tensor multi-index
17 ///
18 /// \tparam DataType the type of data being stored in the Tensors
19 template <typename DataType>
21  const Tensor<DataType> rhs_tensor{};
22  // Get TensorExpression from RHS tensor
23  const auto R = rhs_tensor();
24 
25  const std::array<size_t, 0> index_order = {};
26 
27  const std::array<size_t, 0> tensor_multi_index = {};
28  CHECK(R.compute_rhs_tensor_index(index_order, index_order,
29  tensor_multi_index) == tensor_multi_index);
30 }
31 
32 } // namespace TestHelpers::TensorExpressions
TensorExpression.hpp
cstddef
std::array
Tensor.hpp
TestHelpers::TensorExpressions::test_compute_rhs_tensor_index_rank_0
void test_compute_rhs_tensor_index_rank_0() noexcept
Test that the computed tensor multi-index of a rank 0 RHS Tensor is equivalent to the given LHS tenso...
Definition: ComputeRhsTensorIndexRank0TestHelpers.hpp:20
TMPL.hpp