From 6f320fe9e96abf10e190e667928d6430d3811745 Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Tue, 26 Feb 2019 18:56:57 +0100 Subject: [PATCH] still not better... --- src/include/map_range.cc.h | 4 +- src/include/map_range.h | 4 +- src/include/multi_array_operation.cc.h | 123 +++++++++++++++++++------ src/include/multi_array_operation.h | 89 +++++++++++++----- src/include/pack_num.h | 6 +- src/include/type_operations.h | 19 ++-- src/include/xfor/xfor.h | 72 +++++++-------- 7 files changed, 212 insertions(+), 105 deletions(-) diff --git a/src/include/map_range.cc.h b/src/include/map_range.cc.h index 2f661a6..939657c 100644 --- a/src/include/map_range.cc.h +++ b/src/include/map_range.cc.h @@ -29,7 +29,7 @@ namespace MultiArrayTools template inline void OpExpr::operator()(size_t mlast, - ExtType last) const + ExtType last) { constexpr size_t NEXT = Op::SIZE; const ExtType nxpos = last; @@ -42,7 +42,7 @@ namespace MultiArrayTools } template - inline void OpExpr::operator()(size_t mlast) const + inline void OpExpr::operator()(size_t mlast) { const ExtType last; constexpr size_t NEXT = Op::SIZE; diff --git a/src/include/map_range.h b/src/include/map_range.h index 0406c7c..129dd10 100644 --- a/src/include/map_range.h +++ b/src/include/map_range.h @@ -66,8 +66,8 @@ namespace MultiArrayTools OpExpr(const MapF& mapf, const IndexPack& ipack, const std::shared_ptr& oind, size_t step, Expr ex); - inline void operator()(size_t mlast, ExtType last) const; - inline void operator()(size_t mlast = 0) const; + inline void operator()(size_t mlast, ExtType last); + inline void operator()(size_t mlast = 0); auto rootSteps(std::intptr_t iPtrNum = 0) const -> ExtType; diff --git a/src/include/multi_array_operation.cc.h b/src/include/multi_array_operation.cc.h index 4b1abed..83e1cc0 100644 --- a/src/include/multi_array_operation.cc.h +++ b/src/include/multi_array_operation.cc.h @@ -109,18 +109,25 @@ namespace MultiArrayTools /***************************************** * OperationMaster::AssignmentExpr * *****************************************/ - + /* template OperationMaster::AssignmentExpr:: AssignmentExpr(OperationMaster& m, const OpClass& sec) : mM(m), mSec(sec) {} - + */ + template + OperationMaster::AssignmentExpr:: + AssignmentExpr(T* dataPtr, const OpClass& sec) : + mSec(sec), mDataPtr(dataPtr) {} + template inline void OperationMaster::AssignmentExpr:: - operator()(size_t start, ExtType last) const + operator()(size_t start, ExtType last) { //VCHECK(mSec.template get(last)); - mM.set(start, mSec.template get(last) ); + //mM.set(start, mSec.template get(last) ); + mDataPtr[start] = mSec.template get(last); + //AOp::sapply(mDataPtr[start], mSec.template get(last)); } template @@ -130,7 +137,30 @@ namespace MultiArrayTools { return mSec.rootSteps(iPtrNum); } + + template + OperationMaster::AddExpr:: + AddExpr(T* dataPtr, const OpClass& sec) : + mSec(sec), mDataPtr(dataPtr) {} + template + inline void OperationMaster::AddExpr:: + operator()(size_t start, ExtType last) + { + //VCHECK(mSec.template get(last)); + //mM.set(start, mSec.template get(last) ); + mDataPtr[start] += mSec.template get(last); + //AOp::sapply(mDataPtr[start], mSec.template get(last)); + } + + template + typename OperationMaster::AddExpr::ExtType + OperationMaster::AddExpr:: + rootSteps(std::intptr_t iPtrNum) const + { + return mSec.rootSteps(iPtrNum); + } + /************************* * OperationMaster * @@ -159,15 +189,17 @@ namespace MultiArrayTools template void OperationMaster::performAssignment(std::intptr_t blockIndexNum) { + /* AssignmentExpr ae(*this, mSecond); // Expression to be executed within loop if(mDoParallel){ - const auto ploop = mIndex.pifor( 1, mSecond.loop(ae) ); + auto ploop = mIndex.pifor( 1, mSecond.loop(ae) ); ploop(); // execute overall loop(s) and so internal hidden loops and so the inherited expressions } else { - const auto loop = mIndex.ifor( 1, mSecond.loop(ae) ); + auto loop = mIndex.ifor( 1, mSecond.loop(ae) ); loop(); // execute overall loop(s) and so internal hidden loops and so the inherited expressions } + */ } template @@ -186,11 +218,12 @@ namespace MultiArrayTools ConstOperationRoot(const MultiArrayBase& ma, const std::shared_ptr&... indices) : mDataPtr(ma.data()), + mOrigDataPtr(ma.data()), mIndex( ma.begin() ) { //VCHECK(ma.data()); mIndex(indices...); - mOff = mIndex.pos(); + //mOff = mIndex.pos(); } template @@ -198,35 +231,37 @@ namespace MultiArrayTools ConstOperationRoot(std::shared_ptr > maptr, const std::shared_ptr&... indices) : mDataPtr(maptr->data()), + mOrigDataPtr(maptr->data()), mIndex(maptr->begin()), mMaPtr(maptr) { mIndex(indices...); - mOff = mIndex.pos(); + //mOff = mIndex.pos(); } template ConstOperationRoot:: ConstOperationRoot(const T* data, const IndexType& ind) : mDataPtr(data), + mOrigDataPtr(data), mIndex( ind ) { - mOff = mIndex.pos(); + //mOff = mIndex.pos(); } template template inline T ConstOperationRoot::get(ET pos) const { - return mDataPtr[pos.val()+mOff]; + return mDataPtr[pos.val()/*+mOff*/]; } template template - inline const ConstOperationRoot& ConstOperationRoot::set(ET pos) const + inline ConstOperationRoot& ConstOperationRoot::set(ET pos) { mIndex = pos.val(); - mOff = mIndex.pos(); + mDataPtr = mOrigDataPtr + mIndex.pos(); return *this; } @@ -267,7 +302,7 @@ namespace MultiArrayTools template template - inline const StaticCast& StaticCast::set(ET pos) const + inline StaticCast& StaticCast::set(ET pos) { mOp.set(pos); return *this; @@ -311,7 +346,7 @@ namespace MultiArrayTools template template - inline const MetaOperationRoot& MetaOperationRoot::set(ET pos) const + inline MetaOperationRoot& MetaOperationRoot::set(ET pos) { assert(0); //(*mIndex) = pos.val(); @@ -342,38 +377,65 @@ namespace MultiArrayTools OperationRoot(MutableMultiArrayBase& ma, const std::shared_ptr&... indices) : mDataPtr(ma.data()), + mOrigDataPtr(ma.data()), mIndex( ma.begin() ) { mIndex(indices...); - mOff = mIndex.pos(); + //mOff = mIndex.pos(); } template OperationRoot:: OperationRoot(T* data, const IndexType& ind) : mDataPtr(data), + mOrigDataPtr(data), mIndex( ind ) { - mOff = mIndex.pos(); + //mOff = mIndex.pos(); } template template - OperationMaster,OpClass,Ranges...> OperationRoot::operator=(const OpClass& in) + OperationRoot& OperationRoot::operator=(const OpClass& in) + //OperationMaster,OpClass,Ranges...> OperationRoot::operator=(const OpClass& in) { - return OperationMaster,OpClass,Ranges...>(mDataPtr, in, mIndex, mDoParallel); + typename OperationMaster,OpClass,Ranges...>::AssignmentExpr ae(mDataPtr, in); + // Expression to be executed within loop + if(mDoParallel){ + auto ploop = mIndex.pifor( 1, in.loop(ae) ); + ploop(); // execute overall loop(s) and so internal hidden loops and so the inherited expressions + } + else { + auto loop = mIndex.ifor( 1, in.loop(ae) ); + loop(); // execute overall loop(s) and so internal hidden loops and so the inherited expressions + } + return *this; + //return OperationMaster,OpClass,Ranges...>(mDataPtr, in, mIndex, mDoParallel); } template template - OperationMaster,OpClass,Ranges...> OperationRoot::operator+=(const OpClass& in) + OperationRoot& OperationRoot::operator+=(const OpClass& in) + //OperationMaster,OpClass,Ranges...> OperationRoot::operator+=(const OpClass& in) { - return OperationMaster,OpClass,Ranges...>(mDataPtr, in, mIndex, mDoParallel); + typename OperationMaster,OpClass,Ranges...>::AddExpr ae(mDataPtr, in); + // Expression to be executed within loop + if(mDoParallel){ + auto ploop = mIndex.pifor( 1, in.loop(ae) ); + ploop(); // execute overall loop(s) and so internal hidden loops and so the inherited expressions + } + else { + auto loop = mIndex.ifor( 1, in.loop(ae) ); + loop(); // execute overall loop(s) and so internal hidden loops and so the inherited expressions + } + return *this; + //return OperationMaster,OpClass,Ranges...>(mDataPtr, in, mIndex, mDoParallel); } template - OperationMaster,OperationRoot,Ranges...> - OperationRoot::operator=(const OperationRoot& in) + OperationRoot& OperationRoot::operator=(const OperationRoot& in) + //OperationMaster,OperationRoot,Ranges...> + //OperationRoot::operator=(const OperationRoot& in) { return operator= >(in); } @@ -389,15 +451,15 @@ namespace MultiArrayTools template inline T OperationRoot::get(ET pos) const { - return mDataPtr[pos.val()+mOff]; + return mDataPtr[pos.val()/*+mOff*/]; } template template - inline const OperationRoot& OperationRoot::set(ET pos) const + inline OperationRoot& OperationRoot::set(ET pos) { mIndex = pos.val(); - mOff = mIndex.pos(); + mDataPtr = mOrigDataPtr + mIndex.pos(); return *this; } @@ -418,7 +480,8 @@ namespace MultiArrayTools template T* OperationRoot::data() const { - return mDataPtr + mIndex().pos(); + auto i = mIndex; + return mDataPtr + i().pos(); } template @@ -448,7 +511,7 @@ namespace MultiArrayTools template template - inline const OperationValue& OperationValue::set(ET pos) const + inline OperationValue& OperationValue::set(ET pos) { return *this; } @@ -498,7 +561,7 @@ namespace MultiArrayTools template template - inline const Operation& Operation::set(ET pos) const + inline Operation& Operation::set(ET pos) { PackNum::setOpPos(mOps,pos); return *this; @@ -539,7 +602,7 @@ namespace MultiArrayTools template template - inline const Contraction& Contraction::set(ET pos) const + inline Contraction& Contraction::set(ET pos) { mOp.set(pos); return *this; @@ -586,7 +649,7 @@ namespace MultiArrayTools template template - inline const SliceContraction& SliceContraction::set(ET pos) const + inline SliceContraction& SliceContraction::set(ET pos) { mOp.set(pos); return *this; diff --git a/src/include/multi_array_operation.h b/src/include/multi_array_operation.h index 31e997f..89846d5 100644 --- a/src/include/multi_array_operation.h +++ b/src/include/multi_array_operation.h @@ -91,7 +91,7 @@ namespace MultiArrayTools template struct SelfIdentity { - static inline T& sapply(T& a, const T& b) + static inline T& sapply(T& a, T b) { return a = b; } @@ -107,27 +107,57 @@ namespace MultiArrayTools private: AssignmentExpr() = default; - OperationMaster& mM; - const OpClass& mSec; - + //OperationMaster mM; + OpClass mSec; + T* mDataPtr; + public: static constexpr size_t LAYER = 0; static constexpr size_t SIZE = OpClass::SIZE; typedef decltype(mSec.rootSteps()) ExtType; - AssignmentExpr(OperationMaster& m, const OpClass& sec); + //AssignmentExpr(OperationMaster& m, const OpClass& sec); + AssignmentExpr(T* dataPtr, const OpClass& sec); AssignmentExpr(const AssignmentExpr& in) = default; AssignmentExpr(AssignmentExpr&& in) = default; - inline void operator()(size_t start = 0) const; - inline void operator()(size_t start, ExtType last) const; + inline void operator()(size_t start = 0); + inline void operator()(size_t start, ExtType last); auto rootSteps(std::intptr_t iPtrNum = 0) const -> ExtType; }; - + + class AddExpr + { + private: + AddExpr() = default; + + //OperationMaster mM; + OpClass mSec; + T* mDataPtr; + + public: + + static constexpr size_t LAYER = 0; + static constexpr size_t SIZE = OpClass::SIZE; + typedef decltype(mSec.rootSteps()) ExtType; + + //AssignmentExpr(OperationMaster& m, const OpClass& sec); + AddExpr(T* dataPtr, const OpClass& sec); + + AddExpr(const AddExpr& in) = default; + AddExpr(AddExpr&& in) = default; + + inline void operator()(size_t start = 0); + inline void operator()(size_t start, ExtType last); + + auto rootSteps(std::intptr_t iPtrNum = 0) const -> ExtType; + + }; + typedef T value_type; //typedef OperationBase OB; typedef ContainerRange CRange; @@ -180,7 +210,7 @@ namespace MultiArrayTools inline T get(ET pos) const; template - inline const ConstOperationRoot& set(ET pos) const; + inline ConstOperationRoot& set(ET pos); MExt rootSteps(std::intptr_t iPtrNum = 0) const; // nullptr for simple usage with decltype @@ -193,8 +223,9 @@ namespace MultiArrayTools //MultiArrayBase const& mArrayRef; const T* mDataPtr; - mutable IndexType mIndex; - mutable size_t mOff = 0; + const T* mOrigDataPtr; + IndexType mIndex; + //size_t mOff = 0; std::shared_ptr > mMaPtr; // never remove this ptr, otherwise we lose temporary container instances! }; @@ -202,7 +233,7 @@ namespace MultiArrayTools class StaticCast : public OperationTemplate > { private: - const Op& mOp; + Op mOp; public: @@ -219,7 +250,7 @@ namespace MultiArrayTools inline T get(ET pos) const; template - inline const StaticCast& set(ET pos) const; + inline StaticCast& set(ET pos); auto rootSteps(std::intptr_t iPtrNum = 0) const -> decltype(mOp.rootSteps(iPtrNum)); @@ -253,7 +284,7 @@ namespace MultiArrayTools inline value_type get(ET pos) const; template - inline const MetaOperationRoot& set(ET pos) const; + inline MetaOperationRoot& set(ET pos); MExt rootSteps(std::intptr_t iPtrNum = 0) const; // nullptr for simple usage with decltype @@ -284,7 +315,7 @@ namespace MultiArrayTools const std::shared_ptr&... indices); OperationRoot(T* data, const IndexType& ind); - + /* template OperationMaster,OpClass,Ranges...> operator=(const OpClass& in); @@ -292,14 +323,23 @@ namespace MultiArrayTools OperationMaster,OpClass,Ranges...> operator+=(const OpClass& in); OperationMaster,OperationRoot,Ranges...> operator=(const OperationRoot& in); + */ + template + OperationRoot& operator=(const OpClass& in); + + template + OperationRoot& operator+=(const OpClass& in); + + OperationRoot& operator=(const OperationRoot& in); + OperationRoot& par(); template inline T get(ET pos) const; template - inline const OperationRoot& set(ET pos) const; + inline OperationRoot& set(ET pos); MExt rootSteps(std::intptr_t iPtrNum = 0) const; // nullptr for simple usage with decltype @@ -316,8 +356,9 @@ namespace MultiArrayTools //MutableMultiArrayBase& mArrayRef; T* mDataPtr; - mutable IndexType mIndex; - mutable size_t mOff = 0; + T* mOrigDataPtr; + IndexType mIndex; + //size_t mOff = 0; bool mDoParallel = false; }; @@ -338,7 +379,7 @@ namespace MultiArrayTools inline T get(ET pos) const; template - inline const OperationValue& set(ET pos) const; + inline OperationValue& set(ET pos); MExt rootSteps(std::intptr_t iPtrNum = 0) const; // nullptr for simple usage with decltype @@ -415,7 +456,7 @@ namespace MultiArrayTools inline T get(ET pos) const; template - inline const Operation& set(ET pos) const; + inline Operation& set(ET pos); auto rootSteps(std::intptr_t iPtrNum = 0) const // nullptr for simple usage with decltype -> decltype(PackNum::mkSteps(iPtrNum, mOps)); @@ -473,7 +514,7 @@ namespace MultiArrayTools private: - const Op& mOp; + Op mOp; std::shared_ptr mInd; public: @@ -485,7 +526,7 @@ namespace MultiArrayTools inline T get(ET pos) const; template - inline const Contraction& set(ET pos) const; + inline Contraction& set(ET pos); auto rootSteps(std::intptr_t iPtrNum = 0) const // nullptr for simple usage with decltype -> decltype(mOp.rootSteps(iPtrNum)); @@ -509,7 +550,7 @@ namespace MultiArrayTools private: - const Op& mOp; + mutable Op mOp; mutable std::shared_ptr > mCont; mutable OperationRoot mTarOp; @@ -522,7 +563,7 @@ namespace MultiArrayTools inline const value_type& get(ET pos) const; template - inline const SliceContraction& set(ET pos) const; + inline SliceContraction& set(ET pos); auto rootSteps(std::intptr_t iPtrNum = 0) const // nullptr for simple usage with decltype -> decltype(mOp.rootSteps(iPtrNum)); diff --git a/src/include/pack_num.h b/src/include/pack_num.h index d9bf56e..d369b17 100644 --- a/src/include/pack_num.h +++ b/src/include/pack_num.h @@ -71,7 +71,7 @@ namespace MultiArrayHelper } template - static inline T mkOpExpr(std::shared_ptr f, const ETuple& pos, const OpTuple& ops, const Args&... args) + static inline T mkOpExpr(std::shared_ptr f, const ETuple& pos, const OpTuple& ops, Args... args) { typedef typename std::remove_reference(ops))>::type NextOpType; static_assert(LAST > NextOpType::SIZE, "inconsistent array positions"); @@ -116,7 +116,7 @@ namespace MultiArrayHelper } template - static inline void setOpPos(const OpTuple& ot, const ETuple& et) + static inline void setOpPos(OpTuple& ot, const ETuple& et) { typedef typename std::remove_reference(ot))>::type NextOpType; static_assert(LAST > NextOpType::SIZE, "inconsistent array positions"); @@ -203,7 +203,7 @@ namespace MultiArrayHelper } template - static inline void setOpPos(const OpTuple& ot, const ETuple& et) + static inline void setOpPos(OpTuple& ot, const ETuple& et) { typedef typename std::remove_reference(et))>::type NextOpType; static_assert(LAST > NextOpType::SIZE, "inconsistent array positions"); diff --git a/src/include/type_operations.h b/src/include/type_operations.h index 8508fb5..8f970d9 100644 --- a/src/include/type_operations.h +++ b/src/include/type_operations.h @@ -154,7 +154,10 @@ namespace MultiArrayTools friend OperationClass; }; - typedef struct v256 { alignas(32) double _x[4]; } v256; + struct v256 + { + alignas(32) double _x[4]; + }; template inline void xadd(double* o, const double* a, const double* b) @@ -173,16 +176,16 @@ namespace MultiArrayTools o[i] += a[i]; } } - - inline v256 operator+(const v256& a, const v256& b) + + inline v256 operator+(v256 a, v256 b) { - alignas(32) v256 o; + v256 o; xadd<4>( reinterpret_cast(&o), reinterpret_cast(&a), reinterpret_cast(&b) ); return o; } - inline v256& operator+=(v256& o, const v256& a) + inline v256& operator+=(v256& o, v256 a) { xsadd<4>( reinterpret_cast(&o), reinterpret_cast(&a) ); return o; @@ -190,7 +193,7 @@ namespace MultiArrayTools /* inline v256 operator-(const v256& a, const v256& b) { - alignas(32) v256 out; + v256 out; #pragma omp simd aligned(outp, ap, bp: 32) for(int i = 0; i < IN; ++i){ outp[i] = ap[i] - bp[i]; @@ -200,7 +203,7 @@ namespace MultiArrayTools inline v256 operator*(const v256& a, const v256& b) { - alignas(32) v256 out; + v256 out; #pragma omp simd aligned(outp, ap, bp: 32) for(int i = 0; i < IN; ++i){ outp[i] = ap[i] * bp[i]; @@ -210,7 +213,7 @@ namespace MultiArrayTools inline v256 operator/(const v256& a, const v256& b) { - alignas(32) v256 out; + v256 out; #pragma omp simd aligned(outp, ap, bp: 32) for(int i = 0; i < IN; ++i){ outp[i] = ap[i] / bp[i]; diff --git a/src/include/xfor/xfor.h b/src/include/xfor/xfor.h index 3cda525..7af5458 100644 --- a/src/include/xfor/xfor.h +++ b/src/include/xfor/xfor.h @@ -35,8 +35,8 @@ namespace MultiArrayHelper ExpressionBase& operator=(const ExpressionBase& in) = default; ExpressionBase& operator=(ExpressionBase&& in) = default; - virtual void operator()(size_t mlast, DExt last) const = 0; - virtual void operator()(size_t mlast = 0) const = 0; + virtual void operator()(size_t mlast, DExt last) = 0; + virtual void operator()(size_t mlast = 0) = 0; virtual DExt dRootSteps(std::intptr_t iPtrNum = 0) const = 0; virtual DExt dExtension() const = 0; @@ -127,9 +127,9 @@ namespace MultiArrayHelper Expr expr); - inline void operator()(size_t mlast, DExt last) const override final; - inline void operator()(size_t mlast, ExtType last) const; - inline void operator()(size_t mlast = 0) const override final; + inline void operator()(size_t mlast, DExt last) override final; + inline void operator()(size_t mlast, ExtType last); + inline void operator()(size_t mlast = 0) override final; DExt dRootSteps(std::intptr_t iPtrNum = 0) const override final; DExt dExtension() const override final; @@ -176,9 +176,9 @@ namespace MultiArrayHelper const vector* subset, Expr expr); - inline void operator()(size_t mlast, DExt last) const override final; - inline void operator()(size_t mlast, ExtType last) const; - inline void operator()(size_t mlast = 0) const override final; + inline void operator()(size_t mlast, DExt last) override final; + inline void operator()(size_t mlast, ExtType last) ; + inline void operator()(size_t mlast = 0) override final; DExt dRootSteps(std::intptr_t iPtrNum = 0) const override final; DExt dExtension() const override final; @@ -224,9 +224,9 @@ namespace MultiArrayHelper For(const IndexClass* indPtr, size_t step, Expr expr); - inline void operator()(size_t mlast, DExt last) const override final; - inline void operator()(size_t mlast, ExtType last) const; - inline void operator()(size_t mlast = 0) const override final; + inline void operator()(size_t mlast, DExt last) override final; + inline void operator()(size_t mlast, ExtType last) ; + inline void operator()(size_t mlast = 0) override final; PFor parallel() const; @@ -272,9 +272,9 @@ namespace MultiArrayHelper PFor(const IndexClass* indPtr, size_t step, Expr expr); - inline void operator()(size_t mlast, DExt last) const override final; - inline void operator()(size_t mlast, ExtType last) const; - inline void operator()(size_t mlast = 0) const override final; + inline void operator()(size_t mlast, DExt last) override final; + inline void operator()(size_t mlast, ExtType last) ; + inline void operator()(size_t mlast = 0) override final; DExt dRootSteps(std::intptr_t iPtrNum = 0) const override final; DExt dExtension() const override final; @@ -311,8 +311,8 @@ namespace MultiArrayHelper template DynamicExpression(Expr ex) : mNext( std::make_shared(ex) ) {} - inline void operator()(size_t mlast, DExt last) const override final; - inline void operator()(size_t mlast = 0) const override final; + inline void operator()(size_t mlast, DExt last) override final; + inline void operator()(size_t mlast = 0) override final; inline DExt dRootSteps(std::intptr_t iPtrNum = 0) const override final; inline DExt dExtension() const override final; @@ -345,9 +345,9 @@ namespace MultiArrayHelper ExpressionHolder(DynamicExpression expr); - inline void operator()(size_t mlast, DExt last) const override final; - inline void operator()(size_t mlast, ExtType last) const; - inline void operator()(size_t mlast = 0) const override final; + inline void operator()(size_t mlast, DExt last) override final; + inline void operator()(size_t mlast, ExtType last) ; + inline void operator()(size_t mlast = 0) override final; DExt dRootSteps(std::intptr_t iPtrNum = 0) const override final; DExt dExtension() const override final; @@ -391,14 +391,14 @@ namespace MultiArrayHelper } template - inline void For::operator()(size_t mlast, DExt last) const + inline void For::operator()(size_t mlast, DExt last) { operator()(mlast, *reinterpret_cast(last.first)); } template inline void For::operator()(size_t mlast, - ExtType last) const + ExtType last) { typedef typename IndexClass::RangeType RangeType; for(size_t pos = 0u; pos != ForBound::template bound(mMax); ++pos){ @@ -411,7 +411,7 @@ namespace MultiArrayHelper } template - inline void For::operator()(size_t mlast) const + inline void For::operator()(size_t mlast) { typedef typename IndexClass::RangeType RangeType; const ExtType last; @@ -484,14 +484,14 @@ namespace MultiArrayHelper } template - inline void PFor::operator()(size_t mlast, DExt last) const + inline void PFor::operator()(size_t mlast, DExt last) { operator()(mlast, *reinterpret_cast(last.first)); } template inline void PFor::operator()(size_t mlast, - ExtType last) const + ExtType last) { CHECK; typedef typename IndexClass::RangeType RangeType; @@ -511,7 +511,7 @@ namespace MultiArrayHelper } template - inline void PFor::operator()(size_t mlast) const + inline void PFor::operator()(size_t mlast) { CHECK; typedef typename IndexClass::RangeType RangeType; @@ -588,14 +588,14 @@ namespace MultiArrayHelper } template - inline void SingleExpression::operator()(size_t mlast, DExt last) const + inline void SingleExpression::operator()(size_t mlast, DExt last) { operator()(mlast, *reinterpret_cast(last.first)); } template inline void SingleExpression::operator()(size_t mlast, - ExtType last) const + ExtType last) { //typedef typename IndexClass::RangeType RangeType; const size_t pos = mIndPtr->pos(); @@ -605,7 +605,7 @@ namespace MultiArrayHelper } template - inline void SingleExpression::operator()(size_t mlast) const + inline void SingleExpression::operator()(size_t mlast) { //typedef typename IndexClass::RangeType RangeType; const ExtType last; @@ -672,14 +672,14 @@ namespace MultiArrayHelper } template - inline void SubExpr::operator()(size_t mlast, DExt last) const + inline void SubExpr::operator()(size_t mlast, DExt last) { operator()(mlast, *reinterpret_cast(last.first)); } template inline void SubExpr::operator()(size_t mlast, - ExtType last) const + ExtType last) { const size_t pos = (*mSubSet)[last.val()]; const size_t mnpos = mlast; @@ -688,7 +688,7 @@ namespace MultiArrayHelper } template - inline void SubExpr::operator()(size_t mlast) const + inline void SubExpr::operator()(size_t mlast) { const ExtType last; const size_t pos = (*mSubSet)[last.val()]; @@ -731,12 +731,12 @@ namespace MultiArrayHelper * DynamicExpression * ***************************/ - inline void DynamicExpression::operator()(size_t mlast, DExt last) const + inline void DynamicExpression::operator()(size_t mlast, DExt last) { (*mNext)(mlast,last); } - inline void DynamicExpression::operator()(size_t mlast) const + inline void DynamicExpression::operator()(size_t mlast) { (*mNext)(mlast); } @@ -759,13 +759,13 @@ namespace MultiArrayHelper ExpressionHolder::ExpressionHolder(DynamicExpression expr) : mExpr(expr) {} template - inline void ExpressionHolder::operator()(size_t mlast, DExt last) const + inline void ExpressionHolder::operator()(size_t mlast, DExt last) { mExpr(mlast,last); } template - inline void ExpressionHolder::operator()(size_t mlast, ExtType last) const + inline void ExpressionHolder::operator()(size_t mlast, ExtType last) { mExpr(mlast, std::make_pair @@ -774,7 +774,7 @@ namespace MultiArrayHelper } template - inline void ExpressionHolder::operator()(size_t mlast) const + inline void ExpressionHolder::operator()(size_t mlast) { mExpr(mlast); }