From 65e7539666669e5382f219691c75005103fcbe97 Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Sun, 29 Jan 2023 23:42:12 +0100 Subject: [PATCH] for: replace * by () in position calculation --- src/include/ranges/prange.cc.h | 3 +-- src/include/xpr/for.cc.h | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/include/ranges/prange.cc.h b/src/include/ranges/prange.cc.h index a5bc54e..6637919 100644 --- a/src/include/ranges/prange.cc.h +++ b/src/include/ranges/prange.cc.h @@ -167,8 +167,7 @@ namespace CNORXZ template decltype(auto) PIndex::ifor(const Xpr& xpr, F&& f) const { - /*return For<0,Xpr,F>(this->pmax().val(), this->id(), xpr, std::forward(f));*/ - /*!!!!!*/ + return For<0,Xpr,F>(this->pmax().val(), this->id(), xpr, std::forward(f)); } template diff --git a/src/include/xpr/for.cc.h b/src/include/xpr/for.cc.h index cec435b..de2cdb3 100644 --- a/src/include/xpr/for.cc.h +++ b/src/include/xpr/for.cc.h @@ -28,16 +28,16 @@ namespace CNORXZ { if constexpr(std::is_same::type,NoF>::value){ for(SizeT i = 0; i != mSize; ++i){ - const auto pos = last + mExt * UPos(i); + const auto pos = last + mExt( UPos(i) ); mXpr(pos); } } else { typedef typename - std::remove_reference::type OutT; + std::remove_reference::type OutT; auto o = OutT(); for(SizeT i = 0; i != mSize; ++i){ - const auto pos = last + mExt * UPos(i); + const auto pos = last + mExt( UPos(i) ); mF(o, mXpr(pos)); } return o; @@ -49,15 +49,15 @@ namespace CNORXZ { if constexpr(std::is_same::type,NoF>::value){ for(SizeT i = 0; i != mSize; ++i){ - const auto pos = mExt * UPos(i); + const auto pos = mExt( UPos(i) ); mXpr(pos); } } else { - typedef typename std::remove_reference::type OutT; + typedef typename std::remove_reference::type OutT; auto o = OutT(); for(SizeT i = 0; i != mSize; ++i){ - const auto pos = mExt * UPos(i); + const auto pos = mExt( UPos(i) ); mF(o, mXpr(pos)); } return o; @@ -136,7 +136,7 @@ namespace CNORXZ constexpr decltype(auto) SFor::exec(const PosT& last) const { constexpr SPos i; - const auto pos = last + mExt * i; + const auto pos = last + mExt( i ); if constexpr(I < N-1){ return mF(mXpr(pos),exec(last)); } @@ -150,7 +150,7 @@ namespace CNORXZ constexpr decltype(auto) SFor::exec() const { constexpr SPos i; - const auto pos = mExt * i; + const auto pos = mExt( i ); if constexpr(I < N-1){ return mF(mXpr(pos),exec()); } @@ -164,7 +164,7 @@ namespace CNORXZ inline void SFor::exec2(const PosT& last) const { constexpr SPos i; - const auto pos = last + mExt * i; + const auto pos = last + mExt( i ); if constexpr(I < N-1){ mXpr(pos); exec2(last); @@ -180,7 +180,7 @@ namespace CNORXZ inline void SFor::exec2() const { constexpr SPos i; - const auto pos = mExt * i; + const auto pos = mExt( i ); if constexpr(I < N-1){ mXpr(pos); exec2(); @@ -232,7 +232,7 @@ namespace CNORXZ template inline decltype(auto) TFor::operator()(const PosT& last) const { - typedef typename std::remove_reference::type OutT; + typedef typename std::remove_reference::type OutT; int i = 0; const int size = static_cast(mSize); Vector ov; @@ -245,7 +245,7 @@ namespace CNORXZ auto xpr = mXpr; #pragma omp for for(i = 0; i < size; i++){ - const auto pos = last + mExt * UPos(i); + const auto pos = last + mExt( UPos(i) ); xpr(pos); } } @@ -262,7 +262,7 @@ namespace CNORXZ template inline decltype(auto) TFor::operator()() const { - typedef typename std::remove_reference::type OutT; + typedef typename std::remove_reference::type OutT; int i = 0; const int size = static_cast(mSize); Vector ov; @@ -275,7 +275,7 @@ namespace CNORXZ auto xpr = mXpr; #pragma omp for for(i = 0; i < size; i++){ - const auto pos = mExt * UPos(i); + const auto pos = mExt( UPos(i) ); xpr(pos); } }