diff --git a/lib/math/Grid_math_tensors.h b/lib/math/Grid_math_tensors.h index a0424576..32ca78e5 100644 --- a/lib/math/Grid_math_tensors.h +++ b/lib/math/Grid_math_tensors.h @@ -34,62 +34,64 @@ public: // Scalar no action // template using tensor_reduce_level = typename iScalar::tensor_reduce_level >; - iScalar()=default; + iScalar() = default; + /* + iScalar(const iScalar ©me)=default; + iScalar(iScalar &©me)=default; + iScalar & operator= (const iScalar ©me) = default; + iScalar & operator= (iScalar &©me) = default; + */ iScalar(scalar_type s) : _internal(s) {};// recurse down and hit the constructor for vector_type iScalar(const Zero &z){ *this = zero; }; - iScalar & operator= (const Zero &hero){ - zeroit(*this); - return *this; - } - friend strong_inline void vstream(iScalar &out,const iScalar &in){ - vstream(out._internal,in._internal); - } + iScalar & operator= (const Zero &hero){ + zeroit(*this); + return *this; + } + friend strong_inline void vstream(iScalar &out,const iScalar &in){ + vstream(out._internal,in._internal); + } + friend strong_inline void zeroit(iScalar &that){ + zeroit(that._internal); + } + friend strong_inline void prefetch(iScalar &that){ + prefetch(that._internal); + } + friend strong_inline void permute(iScalar &out,const iScalar &in,int permutetype){ + permute(out._internal,in._internal,permutetype); + } - - friend strong_inline void zeroit(iScalar &that){ - zeroit(that._internal); - } - friend strong_inline void prefetch(iScalar &that){ - prefetch(that._internal); - } - friend strong_inline void permute(iScalar &out,const iScalar &in,int permutetype){ - permute(out._internal,in._internal,permutetype); - } - - // Unary negation - friend strong_inline iScalar operator -(const iScalar &r) { - iScalar ret; - ret._internal= -r._internal; - return ret; - } - // *=,+=,-= operators inherit from corresponding "*,-,+" behaviour - strong_inline iScalar &operator *=(const iScalar &r) { - *this = (*this)*r; - return *this; - } - strong_inline iScalar &operator -=(const iScalar &r) { - *this = (*this)-r; - return *this; - } - strong_inline iScalar &operator +=(const iScalar &r) { - *this = (*this)+r; - return *this; - } - - strong_inline vtype & operator ()(void) { - return _internal; - } - - strong_inline const vtype & operator ()(void) const { - return _internal; - } - - operator ComplexD () const { return(TensorRemove(_internal)); }; - operator RealD () const { return(real(TensorRemove(_internal))); } - - // convert from a something to a scalar - template::value, T>::type* = nullptr > strong_inline auto operator = (T arg) -> iScalar + // Unary negation + friend strong_inline iScalar operator -(const iScalar &r) { + iScalar ret; + ret._internal= -r._internal; + return ret; + } + // *=,+=,-= operators inherit from corresponding "*,-,+" behaviour + strong_inline iScalar &operator *=(const iScalar &r) { + *this = (*this)*r; + return *this; + } + strong_inline iScalar &operator -=(const iScalar &r) { + *this = (*this)-r; + return *this; + } + strong_inline iScalar &operator +=(const iScalar &r) { + *this = (*this)+r; + return *this; + } + strong_inline vtype & operator ()(void) { + return _internal; + } + strong_inline const vtype & operator ()(void) const { + return _internal; + } + + operator ComplexD () const { return(TensorRemove(_internal)); }; + operator RealD () const { return(real(TensorRemove(_internal))); } + + // convert from a something to a scalar + template::value, T>::type* = nullptr > strong_inline auto operator = (T arg) -> iScalar { _internal = vtype(arg); return *this; @@ -125,6 +127,12 @@ public: enum { TensorLevel = GridTypeMapper::TensorLevel + 1}; iVector(const Zero &z){ *this = zero; }; iVector() =default; + /* + iVector(const iVector ©me)=default; + iVector(iVector &©me)=default; + iVector & operator= (const iVector ©me) = default; + iVector & operator= (iVector &©me) = default; + */ iVector & operator= (const Zero &hero){ zeroit(*this); @@ -205,8 +213,12 @@ public: iMatrix(const Zero &z){ *this = zero; }; iMatrix() =default; - - + /* + iMatrix(const iMatrix ©me)=default; + iMatrix(iMatrix &©me)=default; + iMatrix & operator= (const iMatrix ©me) = default; + iMatrix & operator= (iMatrix &©me) = default; + */ iMatrix & operator= (const Zero &hero){ zeroit(*this); return *this;