return tmp;
}
-/**
- * Entrywise multiplication of two tensor objects of rank 1.
- *
- * @relatesalso Tensor
- */
-template <int dim, typename Number, typename OtherNumber>
-inline DEAL_II_CONSTEXPR DEAL_II_ALWAYS_INLINE
- Tensor<1, dim, typename ProductType<Number, OtherNumber>::type>
- schur_product(const Tensor<1, dim, Number> & src1,
- const Tensor<1, dim, OtherNumber> &src2)
-{
- Tensor<1, dim, typename ProductType<Number, OtherNumber>::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.
*
schur_product(const Tensor<rank, dim, Number> & src1,
const Tensor<rank, dim, OtherNumber> &src2)
{
- Tensor<rank, dim, typename ProductType<Number, OtherNumber>::type> tmp(src1);
+ Tensor<rank, dim, typename ProductType<Number, OtherNumber>::type> tmp;
for (unsigned int i = 0; i < dim; ++i)
- tmp[i] = schur_product(src1[i], src2[i]);
+ tmp[i] = schur_product(Tensor<rank - 1, dim, Number>(src1[i]),
+ Tensor<rank - 1, dim, OtherNumber>(src2[i]));
return tmp;
}