diff --git a/src/include/array/array_base.cc.h b/src/include/array/array_base.cc.h index f22864e..4a668a5 100644 --- a/src/include/array/array_base.cc.h +++ b/src/include/array/array_base.cc.h @@ -100,7 +100,7 @@ namespace CNORXZ template COpRoot CArrayBase::operator()(const Sptr& i) const { - this->checkFormatCompatibility(toVec(i->deepFormat())); + //this->checkFormatCompatibility(toVec(i->deepFormat())); return coproot(*this, i); } @@ -109,7 +109,7 @@ namespace CNORXZ inline decltype(auto) CArrayBase::operator()(const SPack& pack) const { auto i = mindexPtr(pack); - this->checkFormatCompatibility(toVec(i->deepFormat())); + //this->checkFormatCompatibility(toVec(i->deepFormat())); return coproot(*this, i); } @@ -117,7 +117,7 @@ namespace CNORXZ inline decltype(auto) CArrayBase::operator()(const DPack& pack) const { auto i = yindexPtr(pack); - this->checkFormatCompatibility(toVec(i->deepFormat())); + //this->checkFormatCompatibility(toVec(i->deepFormat())); return coproot(*this, i); } @@ -223,7 +223,7 @@ namespace CNORXZ template OpRoot ArrayBase::operator()(const Sptr& i) { - this->checkFormatCompatibility(toVec(i->deepFormat())); + //this->checkFormatCompatibility(toVec(i->deepFormat())); return oproot(*this, i); } @@ -232,7 +232,7 @@ namespace CNORXZ inline decltype(auto) ArrayBase::operator()(const SPack& pack) { auto i = mindexPtr(pack); - this->checkFormatCompatibility(toVec(i->deepFormat())); + //this->checkFormatCompatibility(toVec(i->deepFormat())); return oproot(*this, i); } @@ -240,7 +240,7 @@ namespace CNORXZ inline decltype(auto) ArrayBase::operator()(const DPack& pack) { auto i = yindexPtr(pack); - this->checkFormatCompatibility(toVec(i->deepFormat())); + //this->checkFormatCompatibility(toVec(i->deepFormat())); return oproot(*this, i); } diff --git a/src/include/ranges/crange.cc.h b/src/include/ranges/crange.cc.h index 387e832..ed8c0d3 100644 --- a/src/include/ranges/crange.cc.h +++ b/src/include/ranges/crange.cc.h @@ -17,7 +17,7 @@ namespace CNORXZ return UPos(id == this->id() ? 1 : 0); } } - + /* template decltype(auto) CIndex::formatFrom(const Index& ind) const { @@ -34,7 +34,7 @@ namespace CNORXZ } return std::make_shared(*this); } - + */ template decltype(auto) CIndex::ifor(const Xpr& xpr, F&& f) const { diff --git a/src/include/ranges/crange.h b/src/include/ranges/crange.h index 6c344c0..2eaab0e 100644 --- a/src/include/ranges/crange.h +++ b/src/include/ranges/crange.h @@ -47,14 +47,14 @@ namespace CNORXZ CIndex& at(const SizeT& metaPos); COpRoot xpr(const Sptr& _this) const; - SizeT deepFormat() const { return 1; } - + SizeT deepFormat() const; + /* template decltype(auto) formatFrom(const Index& ind) const; template decltype(auto) slice(const Sptr& ind) const; - + */ template decltype(auto) ifor(const Xpr& xpr, F&& f) const; diff --git a/src/include/ranges/dindex.h b/src/include/ranges/dindex.h index 54ead2f..560ca50 100644 --- a/src/include/ranges/dindex.h +++ b/src/include/ranges/dindex.h @@ -54,8 +54,7 @@ namespace CNORXZ DType meta() const; DIndex& at(const DType& meta); DXpr xpr(const Sptr& _this) const; - - Vector deepFormat() const { return mI->deepFormat(); } + Vector deepFormat() const; DXpr ifor(const DXpr& xpr, std::function&& f) const; diff --git a/src/include/ranges/index_base.h b/src/include/ranges/index_base.h index 5a3753b..7e280b2 100644 --- a/src/include/ranges/index_base.h +++ b/src/include/ranges/index_base.h @@ -54,7 +54,7 @@ namespace CNORXZ decltype(auto) meta() const { return THIS().meta(); } I& at(const MetaType& meta) { return THIS().at(meta); } decltype(auto) xpr(const Sptr& _this) const { return THIS().xpr(_this); } - + /* template decltype(auto) formatTo(const Sptr& ind) const { return ind->formatFrom(THIS()); } @@ -62,7 +62,7 @@ namespace CNORXZ decltype(auto) formatFrom(const Index& ind) const // yes this is const, // changes only MIndex/YIndex format, in this case we can just copy the pointers to the sub-index instances { return THIS().formatFrom(ind); } - + */ decltype(auto) deepFormat() const { return THIS().deepFormat(); } //template diff --git a/src/include/ranges/mrange.cc.h b/src/include/ranges/mrange.cc.h index 42ae67e..e34a560 100644 --- a/src/include/ranges/mrange.cc.h +++ b/src/include/ranges/mrange.cc.h @@ -382,7 +382,7 @@ namespace CNORXZ ( [&](auto i) { return mIPack[i]->stepSize(id) * format()[i]; }, [](const auto&... ss) { return ( ss + ... ); }); } - + /* template template decltype(auto) GMIndex::formatFrom(const Index& ind) const @@ -392,7 +392,7 @@ namespace CNORXZ << " need index of at least the same dimension, got " << ind.dim()); return *this; } - + */ template String GMIndex::stringMeta() const { diff --git a/src/include/ranges/mrange.h b/src/include/ranges/mrange.h index 1ec4499..c9a20b6 100644 --- a/src/include/ranges/mrange.h +++ b/src/include/ranges/mrange.h @@ -63,8 +63,8 @@ namespace CNORXZ template decltype(auto) stepSize(const IndexId& id) const; - template - decltype(auto) formatFrom(const Index& ind) const; + //template + //decltype(auto) formatFrom(const Index& ind) const; String stringMeta() const; MetaType meta() const; diff --git a/src/include/ranges/srange.cc.h b/src/include/ranges/srange.cc.h index 60dde3c..d5b1faa 100644 --- a/src/include/ranges/srange.cc.h +++ b/src/include/ranges/srange.cc.h @@ -146,7 +146,7 @@ namespace CNORXZ { return 1; } - + /* template template decltype(auto) SIndex::formatFrom(const Index& ind) const @@ -165,7 +165,7 @@ namespace CNORXZ } return std::make_shared>(*this); } - + */ template template decltype(auto) SIndex::ifor(const Xpr& xpr, F&& f) const diff --git a/src/include/ranges/srange.h b/src/include/ranges/srange.h index 868537c..46feea8 100644 --- a/src/include/ranges/srange.h +++ b/src/include/ranges/srange.h @@ -49,13 +49,13 @@ namespace CNORXZ decltype(auto) xpr(const Sptr>& _this) const; SizeT deepFormat() const; - + /* template decltype(auto) formatFrom(const Index& ind) const; template decltype(auto) slice(const Sptr& ind) const; - + */ template decltype(auto) ifor(const Xpr& xpr, F&& f) const; diff --git a/src/include/ranges/urange.cc.h b/src/include/ranges/urange.cc.h index ebeeab5..82825c8 100644 --- a/src/include/ranges/urange.cc.h +++ b/src/include/ranges/urange.cc.h @@ -155,7 +155,7 @@ namespace CNORXZ return UPos(id == this->id() ? 1 : 0); } } - + /* template template decltype(auto) UIndex::formatFrom(const Index& ind) const @@ -174,7 +174,7 @@ namespace CNORXZ } return std::make_shared>(*this); } - + */ template template decltype(auto) UIndex::ifor(const Xpr& xpr, F&& f) const diff --git a/src/include/ranges/urange.h b/src/include/ranges/urange.h index 54a1923..f6ef6f1 100644 --- a/src/include/ranges/urange.h +++ b/src/include/ranges/urange.h @@ -56,13 +56,13 @@ namespace CNORXZ decltype(auto) xpr(const Sptr>& _this) const; SizeT deepFormat() const; - + /* template decltype(auto) formatFrom(const Index& ind) const; template decltype(auto) slice(const Sptr& ind) const; - + */ template decltype(auto) ifor(const Xpr& xpr, F&& f) const; diff --git a/src/include/ranges/yrange.h b/src/include/ranges/yrange.h index b5da566..f13989c 100644 --- a/src/include/ranges/yrange.h +++ b/src/include/ranges/yrange.h @@ -51,8 +51,8 @@ namespace CNORXZ Sptr range() const; UPos stepSize(const IndexId<0> id) const; - template - YIndex formatFrom(const Index& ind) const; + //template + //YIndex formatFrom(const Index& ind) const; String stringMeta() const; Vector meta() const; @@ -65,7 +65,7 @@ namespace CNORXZ YIndex& operator()(); const DPack& pack() const; - Vector deepFormat() const { CXZ_ERROR("implement!!!"); return Vector {1}; } + Vector deepFormat() const; const YFormat& format() const; const YFormat& lexFormat() const; YIndex& setFormat(const YFormat& bs); diff --git a/src/lib/ranges/crange.cc b/src/lib/ranges/crange.cc index 0802b8b..f3acd45 100644 --- a/src/lib/ranges/crange.cc +++ b/src/lib/ranges/crange.cc @@ -116,6 +116,10 @@ namespace CNORXZ return coproot(m.data(), _this); } + SizeT CIndex::deepFormat() const + { + return 1; + } /********************** * CRangeFactory * diff --git a/src/lib/ranges/dindex.cc b/src/lib/ranges/dindex.cc index 3c420c1..972042f 100644 --- a/src/lib/ranges/dindex.cc +++ b/src/lib/ranges/dindex.cc @@ -167,6 +167,11 @@ namespace CNORXZ return mI->xpr(_this->xptr()); } + Vector DIndex::deepFormat() const + { + return mI->deepFormat(); + } + DXpr DIndex::ifor(const DXpr& xpr, std::function&& f) const { return DXpr(mI->ifor(xpr, std::forward>(f)) ); diff --git a/src/lib/ranges/yrange.cc b/src/lib/ranges/yrange.cc index e7b0e29..b050def 100644 --- a/src/lib/ranges/yrange.cc +++ b/src/lib/ranges/yrange.cc @@ -367,6 +367,12 @@ namespace CNORXZ { return mIs; } + + Vector YIndex::deepFormat() const + { + CXZ_ERROR("implement!!!"); + return Vector {1}; + } const YFormat& YIndex::format() const {