From 50923ef0c66fbec880b4ad52e3e5d2a5d6631c3e Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Tue, 20 Jun 2023 21:17:43 -0500 Subject: [PATCH] Test symengine/symengine_tensor_operations_04: fix test compilation This partially reverts 7ad068984b29f5712dd2bed5742459a9e2030ac3 This part has been commited and merged accidentally (partly due to our CI not testing any symengine artifacts). Unfortunately, the anticipated replacement of `begin_raw()` by `unrolled_to_component_indices(i)` does not work as intended. It is neither implemented for Tensor of rank 0, nor for SymmetricTensor of rank 4. --- .../symengine_tensor_operations_04.cc | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/tests/symengine/symengine_tensor_operations_04.cc b/tests/symengine/symengine_tensor_operations_04.cc index 2a908985ee..767900b392 100644 --- a/tests/symengine/symengine_tensor_operations_04.cc +++ b/tests/symengine/symengine_tensor_operations_04.cc @@ -104,12 +104,10 @@ test_tensor() using Tensor_t = Tensor; Tensor_t t_a, t_b; - for (unsigned int i = 0; i < Tensor_t::n_independent_components; ++i) - { - const auto index = t_a.unrolled_to_component_index(i); - t_a[index] = 1.0; - t_b[index] = 2.0; - } + 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; const Tensor_SD_number_t symb_t_a = SD::make_tensor_of_symbols("a"); @@ -130,13 +128,10 @@ test_symmetric_tensor() using Tensor_t = SymmetricTensor; Tensor_t t_a, t_b; - for (unsigned int i = 0; i < Tensor_t::n_independent_components; ++i) - { - const auto index = t_a.unrolled_to_component_index(i); - t_a[index] = 1.0; - t_b[index] = 2.0; - } - + 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; const Tensor_SD_number_t symb_t_a = SD::make_symmetric_tensor_of_symbols("a"); -- 2.39.5