Skip to content

Commit

Permalink
Merge pull request #16802 from bangerth/fix-test
Browse files Browse the repository at this point in the history
Fix compilation of a test.
  • Loading branch information
masterleinad committed Mar 28, 2024
2 parents 16f23ad + 8687f62 commit c660c0d
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions tests/symengine/symengine_tensor_operations_04.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,20 @@ test_tensor()
using Tensor_SD_number_t = Tensor<rank, dim, SD_number_t>;
using Tensor_t = Tensor<rank, dim, double>;

// Fill two tensors with ones and twos, respectively.
Tensor_t t_a, t_b;
for (auto it = t_a.begin_raw(); it != t_a.end_raw(); ++it)
*it = 1.0;
for (auto it = t_b.begin_raw(); it != t_b.end_raw(); ++it)
*it = 2.0;
if constexpr (rank > 0)
{
for (unsigned int i = 0; i < Tensor_t::n_independent_components; ++i)
t_a[Tensor_t::unrolled_to_component_indices(i)] = 1.0;
for (unsigned int i = 0; i < Tensor_t::n_independent_components; ++i)
t_b[Tensor_t::unrolled_to_component_indices(i)] = 2.0;
}
else
{
t_a = 1.0;
t_b = 2.0;
}

const Tensor_SD_number_t symb_t_a =
SD::make_tensor_of_symbols<rank, dim>("a");
Expand Down

0 comments on commit c660c0d

Please sign in to comment.