diff --git a/lib/simd/Grid_vector_unops.h b/lib/simd/Grid_vector_unops.h index e4942937..540a54f5 100644 --- a/lib/simd/Grid_vector_unops.h +++ b/lib/simd/Grid_vector_unops.h @@ -67,6 +67,14 @@ namespace Grid { } }; + template struct DivIntFunctor { + Integer y; + DivIntFunctor(Integer _y) : y(_y) {}; + scalar operator()(const scalar &a) const { + return Integer(a)/y; + } + }; + template struct RealFunctor { scalar operator()(const scalar &a) const { return real(a); @@ -131,6 +139,10 @@ namespace Grid { inline Grid_simd mod(const Grid_simd &r,Integer y) { return SimdApply(ModIntFunctor(y),r); } + template < class S, class V > + inline Grid_simd div(const Grid_simd &r,Integer y) { + return SimdApply(DivIntFunctor(y),r); + } //////////////////////////////////////////////////////////////////////////// // Allows us to assign into **conformable** real vectors from complex ////////////////////////////////////////////////////////////////////////////