]> https://gitweb.dealii.org/ - dealii.git/commitdiff
expand testing
authorMenno Fraters <menno.fraters@outlook.com>
Fri, 28 Feb 2020 23:50:57 +0000 (15:50 -0800)
committerMenno Fraters <menno.fraters@outlook.com>
Wed, 4 Mar 2020 19:11:27 +0000 (11:11 -0800)
tests/tensors/constexpr_tensor.cc

index 11b026535fc2beb6361cb0cb6e5133794260e319..53c08dfb5b5433c9b53e2c39045b27e2d96fc0a2 100644 (file)
@@ -186,6 +186,19 @@ main()
             << std::endl;
     Assert(determinant(dummy_9) - 1. < 1e-8, ExcInternalError());
 
+    // check wheter the output is the same as the input. For example, it could
+    // have been transposed.
+    Vector<double> unrolled_a(9);
+    a.unroll<double>(unrolled_a);
+    Vector<double> unrolled_dummy_9(9);
+    dummy_9.unroll<double>(unrolled_dummy_9);
+    for (size_t i = 0; i < unrolled_a.size(); i++)
+      {
+        Assert(std::fabs(unrolled_a[i] - unrolled_dummy_9[i]) < 1e-8,
+               ExcInternalError());
+      }
+
+
 
     constexpr double       non_orthogonal_init[3][3] = {{1., 2., 3.},
                                                   {1., 1.5, 2.},

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.