#ifndef GRID_MATH_OUTER_H #define GRID_MATH_OUTER_H namespace Grid { /////////////////////////////////////////////////////////////////////////////////////// // outerProduct Scalar x Scalar -> Scalar // Vector x Vector -> Matrix /////////////////////////////////////////////////////////////////////////////////////// template inline auto outerProduct (const iVector& lhs,const iVector& rhs) -> iMatrix { typedef decltype(outerProduct(lhs._internal[0],rhs._internal[0])) ret_t; iMatrix ret; for(int c1=0;c1 inline auto outerProduct (const iScalar& lhs,const iScalar& rhs) -> iScalar { typedef decltype(outerProduct(lhs._internal,rhs._internal)) ret_t; iScalar ret; ret._internal = outerProduct(lhs._internal,rhs._internal); return ret; } inline ComplexF outerProduct(const ComplexF &l, const ComplexF& r) { return l*r; } inline ComplexD outerProduct(const ComplexD &l, const ComplexD& r) { return l*r; } inline RealF outerProduct(const RealF &l, const RealF& r) { return l*r; } inline RealD outerProduct(const RealD &l, const RealD& r) { return l*r; } } #endif