From: Matthias Maier Date: Thu, 19 Mar 2020 23:40:27 +0000 (-0500) Subject: base/tensor.h: remove redundant recursion step X-Git-Tag: v9.2.0-rc1~398^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=992c54268539cd353a8a32a8c90ac76b2b847638;p=dealii.git base/tensor.h: remove redundant recursion step --- diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index 05bae7e4ca..553d7fcf25 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -1945,25 +1945,6 @@ inline DEAL_II_CONSTEXPR DEAL_II_ALWAYS_INLINE return tmp; } -/** - * Entrywise multiplication of two tensor objects of rank 1. - * - * @relatesalso Tensor - */ -template -inline DEAL_II_CONSTEXPR DEAL_II_ALWAYS_INLINE - Tensor<1, dim, typename ProductType::type> - schur_product(const Tensor<1, dim, Number> & src1, - const Tensor<1, dim, OtherNumber> &src2) -{ - Tensor<1, dim, typename ProductType::type> tmp(src1); - - for (unsigned int i = 0; i < dim; ++i) - tmp[i] *= src2[i]; - - return tmp; -} - /** * Entrywise multiplication of two tensor objects of general rank. * @@ -1986,10 +1967,11 @@ inline DEAL_II_CONSTEXPR DEAL_II_ALWAYS_INLINE schur_product(const Tensor & src1, const Tensor &src2) { - Tensor::type> tmp(src1); + Tensor::type> tmp; for (unsigned int i = 0; i < dim; ++i) - tmp[i] = schur_product(src1[i], src2[i]); + tmp[i] = schur_product(Tensor(src1[i]), + Tensor(src2[i])); return tmp; }