From: Daniel Arndt Date: Wed, 14 Aug 2019 03:12:13 +0000 (-0400) Subject: Remove DEAL_II_CONSTEXPR for linfty and l1 X-Git-Tag: v9.2.0-rc1~1208^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57ea4b6fb60938b874dded8460b162d3e7e48ffa;p=dealii.git Remove DEAL_II_CONSTEXPR for linfty and l1 --- diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index 441411e9c2..a44eaca119 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -2491,8 +2491,8 @@ cofactor(const Tensor<2, dim, Number> &t) * @author Wolfgang Bangerth, 2012 */ template -inline DEAL_II_CONSTEXPR Number - l1_norm(const Tensor<2, dim, Number> &t) +inline Number +l1_norm(const Tensor<2, dim, Number> &t) { Number max = internal::NumberType::value(0.0); for (unsigned int j = 0; j < dim; ++j) @@ -2517,8 +2517,8 @@ inline DEAL_II_CONSTEXPR Number * @author Wolfgang Bangerth, 2012 */ template -inline DEAL_II_CONSTEXPR Number - linfty_norm(const Tensor<2, dim, Number> &t) +inline Number +linfty_norm(const Tensor<2, dim, Number> &t) { Number max = internal::NumberType::value(0.0); for (unsigned int i = 0; i < dim; ++i) diff --git a/tests/tensors/constexpr_tensor.cc b/tests/tensors/constexpr_tensor.cc index fc8c59fdac..49748c3ae7 100644 --- a/tests/tensors/constexpr_tensor.cc +++ b/tests/tensors/constexpr_tensor.cc @@ -168,17 +168,25 @@ main() constexpr double ref_init[3][3] = {{1., 2., 3.}, {0., 1., 2.}, {0., 0., 1}}; constexpr Tensor<2, 3> ref{ref_init}; Assert(transposed == ref, ExcInternalError()); - DEAL_II_CONSTEXPR const auto dummy = scalar_product(a, ref); - DEAL_II_CONSTEXPR const auto dummy_2 = contract<0, 0>(a, ref); - DEAL_II_CONSTEXPR const auto dummy_3 = double_contract<0, 0, 1, 1>(a, ref); - DEAL_II_CONSTEXPR const auto dummy_4 = schur_product(a, ref); - DEAL_II_CONSTEXPR const auto dummy_5 = a * ref; - DEAL_II_CONSTEXPR const auto middle = outer_product(a, a); - DEAL_II_CONSTEXPR const auto dummy_6 = contract3(a, middle, a); - DEAL_II_CONSTEXPR const auto dummy_7 = adjugate(a); - DEAL_II_CONSTEXPR const auto dummy_8 = cofactor(a); - DEAL_II_CONSTEXPR const auto dummy_9 = l1_norm(a); - DEAL_II_CONSTEXPR const auto dummy_10 = linfty_norm(a); + DEAL_II_CONSTEXPR const auto dummy = scalar_product(a, ref); + DEAL_II_CONSTEXPR const auto dummy_2 = contract<0, 0>(a, ref); + DEAL_II_CONSTEXPR const auto dummy_3 = double_contract<0, 0, 1, 1>(a, ref); + DEAL_II_CONSTEXPR const auto dummy_4 = schur_product(a, ref); + DEAL_II_CONSTEXPR const auto dummy_5 = a * ref; + DEAL_II_CONSTEXPR const auto middle = outer_product(a, a); + DEAL_II_CONSTEXPR const auto dummy_6 = contract3(a, middle, a); + DEAL_II_CONSTEXPR const auto dummy_7 = adjugate(a); + DEAL_II_CONSTEXPR const auto dummy_8 = cofactor(a); + } + + { + constexpr Tensor<1, 3> dummy_1; + constexpr Tensor<0, 3> dummy_0; + DEAL_II_CONSTEXPR auto product_result = dummy_1 * dummy_1; + DEAL_II_CONSTEXPR auto constraction_result = + contract<0, 0>(dummy_1, dummy_1); + DEAL_II_CONSTEXPR auto outer_product_result = + outer_product(dummy_0, dummy_0); } deallog << "OK" << std::endl;