#ifndef GRID_TENSOR_LOGICAL_H #define GRID_TENSOR_LOGICAL_H namespace Grid { #define LOGICAL_BINOP(Op)\ template strong_inline iScalar operator Op (const iScalar& lhs,const iScalar& rhs) \ {\ iScalar ret;\ ret._internal = lhs._internal Op rhs._internal ;\ return ret;\ }\ template strong_inline iScalar operator Op (const iScalar& lhs,Integer rhs) \ {\ typename iScalar::scalar_type t; t=rhs;\ typename iScalar::tensor_reduced srhs; srhs=t;\ return lhs Op srhs;\ }\ template strong_inline iScalar operator Op (Integer lhs,const iScalar& rhs) \ {\ typename iScalar::scalar_type t;t=lhs;\ typename iScalar::tensor_reduced slhs;slhs=t;\ return slhs Op rhs;\ } LOGICAL_BINOP(|); LOGICAL_BINOP(&); LOGICAL_BINOP(||); LOGICAL_BINOP(&&); } #endif