21 #ifndef RFFGEN_LINEAR_ALGEBRA_TENSOR_PRODUCT_HH
22 #define RFFGEN_LINEAR_ALGEBRA_TENSOR_PRODUCT_HH
24 #include "extractRowsAndCols.hh"
25 #include "../Util/at.hh"
26 #include "../Util/zero.hh"
30 namespace LinearAlgebra
36 template <
class Matrix,
class Vector1,
class Vector2>
39 auto result = zero<Matrix>();
41 for(
int i=0; i<numberOfRows<Matrix>(); ++i )
42 for(
int j=0; j<numberOfColumns<Matrix>(); ++j )
43 at(result,i,j) = v[i] * w[j];
52 template <
class Matrix,
class Vector>
55 return tensorProduct<Matrix>(v,v);
60 #endif // RFFGEN_LINEAR_ALGEBRA_TENSOR_PRODUCT_HH
Matrix tensorProduct(const Vector &v)
Compute tensor product .
Definition: tensorProduct.hh:53