]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid a compiler error in symengine tests about mismatched operands. 17069/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 23 May 2024 16:39:54 +0000 (10:39 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 23 May 2024 16:39:54 +0000 (10:39 -0600)
While there also avoid a warning.

tests/symengine/sd_common_tests/batch_optimizer_05.h
tests/symengine/sd_common_tests/utilities.h

index bd3176a0a0215abdcac7a52b817f35805c4d46a9..fb3ed32307684cc4378e3b88b266c58ae9f02aa0 100644 (file)
@@ -35,7 +35,7 @@ template <int dim,
           enum SD::OptimizerType     opt_method,
           enum SD::OptimizationFlags opt_flags>
 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;
index ee52d5068cbc05a87f94d968dad697deb4f21def..3c0484b88032992c22b8f2a595fe298457810216 100644 (file)
@@ -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;
 }
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.