12#ifndef __cxz_for_cc_h__
13#define __cxz_for_cc_h__
26 template <SizeT L,
class Xpr,
class F>
31 mExt(mXpr.rootSteps(mId)),
35 template <SizeT L,
class Xpr,
class F>
39 if constexpr(std::is_same<typename std::remove_reference<F>::type,
NoF>::value){
48 std::remove_reference<
decltype(mXpr(
last + mExt(
UPos(0) )))>::type
OutT;
58 template <SizeT L,
class Xpr,
class F>
61 if constexpr(std::is_same<typename std::remove_reference<F>::type,
NoF>::value){
63 const auto pos = mExt(
UPos(
i) );
69 typedef typename std::remove_reference<
decltype(mXpr(mExt(
UPos(0) )))>::type
OutT;
72 const auto pos = mExt(
UPos(
i) );
79 template <SizeT L,
class Xpr,
class F>
90 template <SizeT L,
class Xpr,
class F>
96 template <SizeT L,
class Xpr>
106 template <SizeT N, SizeT L,
class Xpr,
class F>
110 mExt(mXpr.rootSteps(mId)),
114 template <SizeT N, SizeT L,
class Xpr,
class F>
115 template <
class PosT>
118 if constexpr(std::is_same<F,NoF>::value){
127 template <SizeT N, SizeT L,
class Xpr,
class F>
130 if constexpr(std::is_same<F,NoF>::value){
139 template <SizeT N, SizeT L,
class Xpr,
class F>
146 template <SizeT N, SizeT L,
class Xpr,
class F>
147 template <SizeT I,
class PosT>
151 const auto pos =
last + mExt(
i );
152 if constexpr(I < N-1){
160 template <SizeT N, SizeT L,
class Xpr,
class F>
165 const auto pos = mExt(
i );
166 if constexpr(I < N-1){
174 template <SizeT N, SizeT L,
class Xpr,
class F>
175 template <SizeT I,
class PosT>
179 const auto pos =
last + mExt(
i );
180 if constexpr(I < N-1){
190 template <SizeT N, SizeT L,
class Xpr,
class F>
192 inline void SFor<N,L,Xpr,F>::exec2()
const
195 const auto pos = mExt(
i );
196 if constexpr(I < N-1){
210 template <SizeT N, SizeT L,
class Xpr,
class F>
216 template <SizeT N, SizeT L,
class Xpr>
226 template <SizeT L1, SizeT L2,
class Xpr,
class F>
233 mExt1(mXpr.rootSteps(mId1)),
234 mExt2(mXpr.rootSteps(mId2)),
239 template <SizeT L1, SizeT L2,
class Xpr,
class F>
240 template <
class PosT>
243 if constexpr(std::is_same<typename std::remove_reference<F>::type,
NoF>::value){
253 std::remove_reference<
decltype(mXpr((
last + mExt1(
UPos(0) )) + mExt2( mPart(
UPos(0) ) )))>::type
OutT;
264 template <SizeT L1, SizeT L2,
class Xpr,
class F>
267 if constexpr(std::is_same<typename std::remove_reference<F>::type,
NoF>::value){
276 typedef typename std::remove_reference<
decltype(mXpr(mExt1(
UPos(0) ) + mExt2( mPart(
UPos(0) ) )))>::type
OutT;
287 template <SizeT L1, SizeT L2,
class Xpr,
class F>
298 template <SizeT L1, SizeT L2,
class Xpr,
class F>
300 const Xpr&
xpr,
F&&
f)
305 template <SizeT L1, SizeT L2,
class Xpr,
class F>
316 template <SizeT L,
class Xpr,
class F>
321 mExt(mXpr.rootSteps(mId)),
333 template <SizeT L,
class Xpr,
class F>
334 template <
class PosT>
337 typedef typename std::remove_reference<
decltype(mXpr(
last + mExt(
UPos(0) )))>::type
OutT;
339 const int size =
static_cast<int>(mSize);
341 if constexpr(
not std::is_same<F,ZeroF>::value){
345#pragma omp parallel private(i)
349 for(
i = 0;
i < size;
i++){
355 if constexpr(
not std::is_same<F,ZeroF>::value){
364 template <SizeT L,
class Xpr,
class F>
367 typedef typename std::remove_reference<
decltype(mXpr(mExt(
UPos(0) )))>::type
OutT;
369 const int size =
static_cast<int>(mSize);
371 if constexpr(
not std::is_same<F,ZeroF>::value){
375#pragma omp parallel private(i)
379 for(
i = 0;
i < size;
i++){
380 const auto pos = mExt(
UPos(
i) );
385 if constexpr(
not std::is_same<F,ZeroF>::value){
394 template <SizeT L,
class Xpr,
class F>
406 template <SizeT N, SizeT L,
class Xpr,
class F>
410 mExt(mXpr.rootSteps(mId)),
414 template <SizeT N, SizeT L,
class Xpr,
class F>
415 template <
class PosT>
418 if constexpr(std::is_same<typename std::remove_reference<F>::type,
NoF>::value){
425 std::remove_reference<decltype(mXpr(mkEPos<N>(
SPos<0>(), mExt)))>::type
OutT;
433 template <SizeT N, SizeT L,
class Xpr,
class F>
436 if constexpr(std::is_same<typename std::remove_reference<F>::type,
NoF>::value){
443 std::remove_reference<decltype(mXpr(mkEPos<N>(
SPos<0>(), mExt)))>::type
OutT;
451 template <SizeT N, SizeT L,
class Xpr,
class F>
constexpr EFor(const IndexId< L > &id, const Xpr &xpr, F &&f)
constexpr decltype(auto) rootSteps(const IndexId< I > &id) const
decltype(auto) rootSteps(const IndexId< I > &id) const
constexpr For(SizeT size, const IndexId< L > &id, const Xpr &xpr, F &&f)
constexpr PFor(SizeT size, const IndexId< L1 > &id1, const IndexId< L2 > &id2, const SizeT *map, const Xpr &xpr, F &&f)
decltype(auto) rootSteps(const IndexId< I > &id) const
constexpr SFor(const IndexId< L > &id, const Xpr &xpr, F &&f)
constexpr decltype(auto) rootSteps(const IndexId< I > &id) const
decltype(auto) rootSteps(const IndexId< I > &id) const
constexpr TFor(SizeT size, const IndexId< L > &id, const Xpr &xpr, F &&f)
For expressions declarations.
constexpr decltype(auto) mkPFor(SizeT size, const IndexId< L1 > &id1, const IndexId< L2 > &id2, const Xpr &xpr, F &&f)
constexpr decltype(auto) mkSFor(const IndexId< L > &id, const Xpr &xpr, F &&f)
std::vector< T, Allocator< T > > Vector
decltype(auto) xpr(const Sptr< I > &i)
Sptr< Range > rangeCast(const RangePtr r)
constexpr decltype(auto) mkFor(SizeT size, const IndexId< L > &id, const Xpr &xpr, F &&f)