From 377e5d243659b14d581cd8295d011b1afe0193f9 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Wed, 2 Sep 2015 23:15:06 -0500 Subject: [PATCH] Bugfix: Promote VectorizedArray to a scalar type Now, every operation concerning Tensors are guarded with the EnableIfScalar type trait. Consequently, a VectorizedArray has also to be made a scalar type. --- include/deal.II/base/vectorization.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/include/deal.II/base/vectorization.h b/include/deal.II/base/vectorization.h index 1a34d8bb41..066905e958 100644 --- a/include/deal.II/base/vectorization.h +++ b/include/deal.II/base/vectorization.h @@ -47,11 +47,11 @@ // forward declarations DEAL_II_NAMESPACE_OPEN - template class VectorizedArray; - +template struct EnableIfScalar; DEAL_II_NAMESPACE_CLOSE + namespace std { template ::dealii::VectorizedArray @@ -65,9 +65,19 @@ namespace std } - DEAL_II_NAMESPACE_OPEN + +// Enable the EnableIfScalar type trait for VectorizedArray such +// that it can be used as a Number type in Tensor, etc. + +template +struct EnableIfScalar > +{ + typedef VectorizedArray::type> type; +}; + + /** * This generic class defines a unified interface to a vectorized data type. * For general template arguments, this class simply corresponds to the -- 2.39.5