]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Restrict tests requiring C++11 3901/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 2 Feb 2017 15:30:10 +0000 (16:30 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 2 Feb 2017 22:11:00 +0000 (23:11 +0100)
include/deal.II/base/vectorization.h
tests/base/symmetric_tensor_36.with_cxx11=on.output [moved from tests/base/symmetric_tensor_36.output with 100% similarity]
tests/mpi/parallel_vector_20.cc

index 2a9ed1b809dd2e57f4898bcd9175767d7706bb69..7b1f874184be2a14807b34c59578471b64fc953b 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <deal.II/base/config.h>
 #include <deal.II/base/exceptions.h>
+#include <deal.II/base/template_constraints.h>
 
 #include <cmath>
 
@@ -78,6 +79,42 @@ struct EnableIfScalar<VectorizedArray<Number> >
 };
 
 
+
+#ifndef DEAL_II_WITH_CXX11
+// Specify the types for the implemented multiplications explicitly
+
+template <typename Number>
+struct ProductType<Number, VectorizedArray<Number> >
+{
+  typedef VectorizedArray<Number> type;
+};
+
+template <typename Number>
+struct ProductType<VectorizedArray<Number>, Number>
+{
+  typedef VectorizedArray<Number> type;
+};
+
+// In contrast to scalar types for which the product of a float and a double
+// variable would be a double variable, the implemented type here really is
+// VectorizedArray<float>. Since VectorizedArray<double> is only half as
+// wide as VectorizedArray<float>, we would have to throw away half of the
+// vector otherwise.
+template<>
+struct ProductType<double, VectorizedArray<float> >
+{
+  typedef VectorizedArray<float> type;
+};
+
+template<>
+struct ProductType<VectorizedArray<float>, double>
+{
+  typedef VectorizedArray<float> type;
+};
+#endif
+
+
+
 /**
  * This generic class defines a unified interface to a vectorized data type.
  * For general template arguments, this class simply corresponds to the
index fb9ed93be5b7ac930d018f40aeb28dbf34f7e0a1..fe2a8bdeca7a45f514ddd543165663541fbffecc 100644 (file)
@@ -39,7 +39,7 @@ void test()
   read_write_vector.local_element(0) = 1.;
   read_write_vector.local_element(1) = 2.;
 
-  v.import(read_write_vector, VectorOperation::values::insert);
+  v.import(read_write_vector, VectorOperation::insert);
 
   AssertThrow(v.local_element(0) == 1., ExcInternalError());
   AssertThrow(v.local_element(1) == 2., ExcInternalError());
@@ -51,7 +51,7 @@ void test()
   read_write_vector.local_element(0) = 1.;
   read_write_vector.local_element(1) = 2.;
 
-  v.import(read_write_vector, VectorOperation::values::insert);
+  v.import(read_write_vector, VectorOperation::insert);
 
   AssertThrow(v.local_element(0) == my_id+1, ExcInternalError());
   AssertThrow(v.local_element(1) == my_id+1, ExcInternalError());

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.