#ifndef GRID_TENSOR_UNARY_H #define GRID_TENSOR_UNARY_H namespace Grid { #define UNARY(func)\ template inline auto func(const iScalar &z) -> iScalar\ {\ iScalar ret;\ ret._internal = func( (z._internal));\ return ret;\ }\ template inline auto func(const iVector &z) -> iVector\ {\ iVector ret;\ for(int c1=0;c1 inline auto func(const iMatrix &z) -> iMatrix\ {\ iMatrix ret;\ for(int c1=0;c1 inline iScalar func(const iScalar &z,scal y) \ {\ iScalar ret;\ ret._internal = func(z._internal,y); \ return ret;\ }\ template inline iVector func(const iVector &z,scal y) \ {\ iVector ret;\ for(int c1=0;c1 inline iMatrix func(const iMatrix &z, scal y) \ {\ iMatrix ret;\ for(int c1=0;c1 inline auto toReal(const iScalar &z) -> typename iScalar::Realified { typename iScalar::Realified ret; ret._internal = toReal(z._internal); return ret; } template inline auto toReal(const iVector &z) -> typename iVector::Realified { typename iVector::Realified ret; for(int c1=0;c1 inline auto toReal(const iMatrix &z) -> typename iMatrix::Realified { typename iMatrix::Realified ret; for(int c1=0;c1 inline auto toComplex(const iScalar &z) -> typename iScalar::Complexified { typename iScalar::Complexified ret; ret._internal = toComplex(z._internal); return ret; } template inline auto toComplex(const iVector &z) -> typename iVector::Complexified { typename iVector::Complexified ret; for(int c1=0;c1 inline auto toComplex(const iMatrix &z) -> typename iMatrix::Complexified { typename iMatrix::Complexified ret; for(int c1=0;c1