From: Wolfgang Bangerth Date: Thu, 23 May 2024 16:39:54 +0000 (-0600) Subject: Avoid a compiler error in symengine tests about mismatched operands. X-Git-Tag: v9.6.0-rc1~231^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb211d6f8c5a17ace185aad13364ea43f0d48153;p=dealii.git Avoid a compiler error in symengine tests about mismatched operands. While there also avoid a warning. --- 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; }