#ifndef GRID_MATH_TRACE_H #define GRID_MATH_TRACE_H namespace Grid { ////////////////////////////////////////////////////////////////// // Traces: both all indices and a specific index. Indices must be // either scalar or matrix ///////////////////////////////////////////////////////////////// inline ComplexF trace( const ComplexF &arg){ return arg;} inline ComplexD trace( const ComplexD &arg){ return arg;} inline RealF trace( const RealF &arg){ return arg;} inline RealD trace( const RealD &arg){ return arg;} template inline auto trace(const iMatrix &arg) -> iScalar { iScalar ret; zeroit(ret._internal); for(int i=0;i inline auto trace(const iScalar &arg) -> iScalar { iScalar ret; ret._internal=trace(arg._internal); return ret; } } #endif