* @relates Tensor
* @author Guido Kanschat, 2000
*/
-template <int dim, typename Number>
+template <int dim, typename Number, typename OtherNumber>
inline
-Number contract (const Tensor<1,dim,Number> &src1,
- const Tensor<1,dim,Number> &src2)
+typename ProductType<Number,OtherNumber>::type
+contract (const Tensor<1,dim,Number> &src1,
+ const Tensor<1,dim,OtherNumber> &src2)
{
- Number res = 0.;
+ typename ProductType<Number,OtherNumber>::type res = typename ProductType<Number,OtherNumber>::type();
for (unsigned int i=0; i<dim; ++i)
res += src1[i] * src2[i];
* @relates Tensor
* @author Wolfgang Bangerth, 2005
*/
-template <int dim, typename Number>
+template <int dim, typename Number, typename OtherNumber>
inline
-Number
+typename ProductType<Number,OtherNumber>::type
operator * (const Tensor<1,dim,Number> &src1,
- const Tensor<1,dim,Number> &src2)
+ const Tensor<1,dim,OtherNumber> &src2)
{
return contract(src1, src2);
}