From bb211d6f8c5a17ace185aad13364ea43f0d48153 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 23 May 2024 10:39:54 -0600 Subject: [PATCH] Avoid a compiler error in symengine tests about mismatched operands. While there also avoid a warning. --- tests/symengine/sd_common_tests/batch_optimizer_05.h | 2 +- tests/symengine/sd_common_tests/utilities.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/symengine/sd_common_tests/batch_optimizer_05.h b/tests/symengine/sd_common_tests/batch_optimizer_05.h index bd3176a0a0..fb3ed32307 100644 --- a/tests/symengine/sd_common_tests/batch_optimizer_05.h +++ b/tests/symengine/sd_common_tests/batch_optimizer_05.h @@ -35,7 +35,7 @@ template void -test_serialization(const int n_runs, TimerOutput &timer) +test_serialization(const unsigned int n_runs, TimerOutput &timer) { deallog << std::string(80, '-') << std::endl; deallog << "Dim: " << dim << std::endl; diff --git a/tests/symengine/sd_common_tests/utilities.h b/tests/symengine/sd_common_tests/utilities.h index ee52d5068c..3c0484b880 100644 --- a/tests/symengine/sd_common_tests/utilities.h +++ b/tests/symengine/sd_common_tests/utilities.h @@ -27,7 +27,7 @@ make_tensor(const NumberType &val) out[i][i] = 1.0; for (unsigned int i = 0; i < out.n_independent_components; ++i) - out[out.unrolled_to_component_indices(i)] += i + val; + out[out.unrolled_to_component_indices(i)] += NumberType(i) + val; return out; } @@ -41,7 +41,7 @@ make_symm_tensor(const NumberType &val) out[i][i] = 1.0; for (unsigned int i = 0; i < out.n_independent_components; ++i) - out[out.unrolled_to_component_indices(i)] += i + val; + out[out.unrolled_to_component_indices(i)] += NumberType(i) + val; return out; } -- 2.39.5