]> https://gitweb.dealii.org/ - dealii.git/commitdiff
extend gla/extract_subvector_to to complex-valued PETSc
authorDenis Davydov <davydden@gmail.com>
Tue, 29 Mar 2016 07:03:16 +0000 (09:03 +0200)
committerDenis Davydov <davydden@gmail.com>
Tue, 29 Mar 2016 18:48:46 +0000 (20:48 +0200)
tests/gla/extract_subvector_to.cc

index 18828a0efc00d1da2696b3db3cf4044dd60f9c56..8a765e7b31710f34c22848211d916eb17305d82d 100644 (file)
@@ -47,7 +47,7 @@ void test (VectorType &vector)
   std::vector<typename VectorType::value_type> values1 (indices.size());
   vector.extract_subvector_to (indices, values1);
   for (unsigned int j=0; j<vector.size()/2; ++j)
-    AssertThrow (values1[j] == 2*j, ExcInternalError());
+    AssertThrow (get_real_assert_zero_imag(values1[j]) == 2*j, ExcInternalError());
 
   // do the same with the version of the function that takes iterators
   std::vector<typename VectorType::value_type> values2 (indices.size());
@@ -55,7 +55,7 @@ void test (VectorType &vector)
                                indices.end(),
                                values2.begin());
   for (unsigned int j=0; j<vector.size()/2; ++j)
-    AssertThrow (values2[j] == 2*j, ExcInternalError());
+    AssertThrow (get_real_assert_zero_imag(values2[j]) == 2*j, ExcInternalError());
 
   // done
   if (myid==0)

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.