diff --git a/src/include/base/types.h b/src/include/base/types.h index e1cb5ea..6b110fd 100644 --- a/src/include/base/types.h +++ b/src/include/base/types.h @@ -164,6 +164,14 @@ namespace CNORXZ template class UIndex; + // definition: ranges/prange.h + template + class PRange; + + // definition: ranges/prange.h + template + class PIndex; + // definition: ranges/crange.h class CRange; // classic range, trivial meta data diff --git a/src/include/ranges/prange.cc.h b/src/include/ranges/prange.cc.h index c283682..2774f0e 100644 --- a/src/include/ranges/prange.cc.h +++ b/src/include/ranges/prange.cc.h @@ -12,9 +12,9 @@ namespace CNORXZ template PIndex::PIndex(const RangePtr& range, SizeT pos) : - IndexInterface(pos), + IndexInterface(pos), mRangePtr(rangeCast(range)), - mIndex(mRangePtr->orig(),mRangePtr->parts()[pos]) + mOrig(mRangePtr->orig(),mRangePtr->parts()[pos]) {} template @@ -106,7 +106,7 @@ namespace CNORXZ } template - Sptr PIndex::range() const + Sptr::RangeType> PIndex::range() const { return mRangePtr; } @@ -130,13 +130,13 @@ namespace CNORXZ } template - const MetaT& PIndex::meta() const + const typename PIndex::MetaType& PIndex::meta() const { return mOrig->meta(); } template - PIndex& PIndex::at(const MetaT& metaPos) + PIndex& PIndex::at(const MetaType& metaPos) { mOrig->at(metaPos); mkPos(); @@ -178,7 +178,7 @@ namespace CNORXZ template PIndex& PIndex::operator()() { - mkPos() + mkPos(); return *this; } @@ -201,11 +201,13 @@ namespace CNORXZ IB::mPos = 0; for(const auto& x: mRangePtr->parts()){ if(x == opos){ - return *this; + return; } ++IB::mPos; } - CXZ_ERROR("meta position '" << metaPos << "' not part of range"); + CXZ_ERROR("meta position '" << mOrig->meta() << "' not part of range"); } } + +#endif diff --git a/src/include/ranges/prange.h b/src/include/ranges/prange.h index cd39093..a6e8775 100644 --- a/src/include/ranges/prange.h +++ b/src/include/ranges/prange.h @@ -15,7 +15,7 @@ namespace CNORXZ { public: - typedef public IndexInterface IB; + typedef IndexInterface IB; typedef PRange RangeType; typedef typename Index::MetaType MetaType; @@ -34,7 +34,7 @@ namespace CNORXZ UPos lmax() const; IndexId<0> id() const; - const MetaT& operator*() const; + const MetaType& operator*() const; SizeT dim() const; Sptr range() const; @@ -43,8 +43,8 @@ namespace CNORXZ UPos stepSize(const IndexId& id) const; String stringMeta() const; - const MetaT& meta() const; - PIndex& at(const MetaT& metaPos); + const MetaType& meta() const; + PIndex& at(const MetaType& metaPos); decltype(auto) xpr(const Sptr>& _this) const; template diff --git a/src/include/ranges/ranges.cc.h b/src/include/ranges/ranges.cc.h index 7537d90..71e3beb 100644 --- a/src/include/ranges/ranges.cc.h +++ b/src/include/ranges/ranges.cc.h @@ -5,6 +5,7 @@ #include "xindex.cc.h" #include "urange.cc.h" #include "crange.cc.h" +#include "prange.cc.h" #include "dindex.cc.h" #include "lindex.cc.h" #include "index_mul.cc.h" diff --git a/src/include/ranges/ranges.h b/src/include/ranges/ranges.h index 380ece0..422a2a1 100644 --- a/src/include/ranges/ranges.h +++ b/src/include/ranges/ranges.h @@ -3,8 +3,7 @@ #include "index_base.h" #include "mrange.h" #include "crange.h" -//#include "subrange.h" -//#include "value_range.h" +#include "prange.h" #include "xindex.h" #include "yrange.h" #include "dindex.h"