From: Wolfgang Bangerth Date: Thu, 18 Jan 2018 18:18:45 +0000 (-0700) Subject: Add static_asserts for complex-valued cases. X-Git-Tag: v9.0.0-rc1~555^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5757%2Fhead;p=dealii.git Add static_asserts for complex-valued cases. --- diff --git a/include/deal.II/lac/vector_operations_internal.h b/include/deal.II/lac/vector_operations_internal.h index 517ef3f76e..a485ab6d28 100644 --- a/include/deal.II/lac/vector_operations_internal.h +++ b/include/deal.II/lac/vector_operations_internal.h @@ -719,6 +719,17 @@ namespace internal VectorizedArray x, y; x.load(X+i); y.load(Y+i); + + // the following operation in VectorizedArray does an element-wise + // scalar product without taking into account complex values and + // the need to take the complex-conjugate of one argument. this + // may be a bug, but because all VectorizedArray classes only + // work on real scalars, it doesn't really matter very much. + // in any case, assert that we really don't get here for + // complex-valued objects + static_assert (numbers::NumberTraits::is_complex == false, + "This operation is not correctly implemented for " + "complex-valued objects."); return x * y; } @@ -867,6 +878,17 @@ namespace internal // may only load from W after storing in X because the pointers might // point to the same memory w.load(W+i); + + // the following operation in VectorizedArray does an element-wise + // scalar product without taking into account complex values and + // the need to take the complex-conjugate of one argument. this + // may be a bug, but because all VectorizedArray classes only + // work on real scalars, it doesn't really matter very much. + // in any case, assert that we really don't get here for + // complex-valued objects + static_assert (numbers::NumberTraits::is_complex == false, + "This operation is not correctly implemented for " + "complex-valued objects."); return x * w; }