diff --git a/src/index_base.cc b/src/index_base.cc index bcc3baf..ac3e792 100644 --- a/src/index_base.cc +++ b/src/index_base.cc @@ -38,54 +38,6 @@ namespace MultiArrayTools //assert(not virt()); mName = nm.own(); } - - bool IndefinitIndexBase::link(IndefinitIndexBase* toLink) - { - //assert(not virt()); - if(toLink->rangeType() != rangeType() and toLink->name() == name()){ - assert(0); - // throw !! - } - if(toLink->rangeType() == rangeType() and toLink->name() == name()){ - if(mLinked == toLink){ - return true; // dont link twice the same - } - else if(mLinked == nullptr){ - mLinked = toLink; - return true; - } - else { - return mLinked->link(toLink); - } - } - else { - return false; - } - } - - void IndefinitIndexBase::freeLinked() - { - if(mLinked != nullptr){ - //mLinked->freeLinked(); - mLinked = nullptr; - } - if(mSoftLinked != nullptr){ - //mSoftLinked->freeLinked(); - mSoftLinked = nullptr; - } - } - - bool IndefinitIndexBase::linked() const - { - //assert(not virt()); - return mLinked != nullptr; - } - - bool IndefinitIndexBase::linkedTo(IndefinitIndexBase* link) const - { - //assert(not virt()); - return mLinked == link or mSoftLinked == link; - } void IndefinitIndexBase::setPos(size_t pos) { diff --git a/src/index_base.h b/src/index_base.h index c766b17..5037f14 100644 --- a/src/index_base.h +++ b/src/index_base.h @@ -39,13 +39,6 @@ namespace MultiArrayTools virtual MultiRangeType rangeType() const = 0; - virtual bool link(IndefinitIndexBase* toLink); - virtual void freeLinked(); - virtual bool linked() const; - virtual bool linkedTo(IndefinitIndexBase* link) const; - virtual void linkTo(IndefinitIndexBase* target) = 0; - virtual IndefinitIndexBase* getLinked(const std::string& name) = 0; - virtual void setPos(size_t pos); virtual void setPosRel(int relPos); @@ -72,9 +65,7 @@ namespace MultiArrayTools int mPos; size_t mMajorStep; - IndefinitIndexBase* mLinked = nullptr; IndefinitIndexBase* mMajor = nullptr; - IndefinitIndexBase* mSoftLinked = nullptr; }; template diff --git a/src/multi_array_operation.cc b/src/multi_array_operation.cc index 1690196..34010ea 100644 --- a/src/multi_array_operation.cc +++ b/src/multi_array_operation.cc @@ -36,7 +36,7 @@ namespace MultiArrayTools { //#error "WRITE MAOR INTRINSIC CONTRACT FUNCTION" //CHECK; - in.linkIndicesTo(MAOB::mIibPtr); + //CHECK; IndexType& iref = dynamic_cast(*MAOB::mIibPtr); //CHECK; @@ -51,7 +51,7 @@ namespace MultiArrayTools //assert(not std::isnan( get() )); } //CHECK; - MAOB::mIibPtr->freeLinked(); + } template @@ -90,7 +90,7 @@ namespace MultiArrayTools MultiArrayOperationRoot::operator=(const MultiArrayOperationRoot& in) { performAssignment(in); - freeIndex(); + return *this; } @@ -99,7 +99,7 @@ namespace MultiArrayTools MultiArrayOperationRoot::operator=(MultiArrayOperationRoot& in) { performAssignment(in); - freeIndex(); + return *this; } @@ -109,7 +109,7 @@ namespace MultiArrayTools MultiArrayOperationRoot::operator=(MultiArrayOperationRoot& in) { performAssignment(in); - freeIndex(); + return *this; } @@ -120,7 +120,7 @@ namespace MultiArrayTools MultiArrayOperationRoot::operator=(const MultiArrayOperationRoot& in) { performAssignment(in); - freeIndex(); + return *this; } @@ -130,7 +130,7 @@ namespace MultiArrayTools MultiArrayOperationRoot::operator=(ConstMultiArrayOperationRoot& in) { performAssignment(in); - freeIndex(); + return *this; } @@ -141,7 +141,7 @@ namespace MultiArrayTools MultiArrayOperationRoot::operator=(const ConstMultiArrayOperationRoot& in) { performAssignment(in); - freeIndex(); + return *this; } @@ -152,7 +152,7 @@ namespace MultiArrayTools MultiArrayOperationRoot::operator=(const MultiArrayOperation& in) { performAssignment(in); - freeIndex(); + return *this; } @@ -162,7 +162,7 @@ namespace MultiArrayTools MultiArrayOperationRoot::operator=(const MultiArrayContraction& in) { performAssignment(in); - freeIndex(); + return *this; } @@ -305,19 +305,6 @@ namespace MultiArrayTools return 1; } - template - IndefinitIndexBase* MultiArrayOperationRoot::getLinked(const std::string& name) const - { - return mIndex.getLinked(name); - } - - template - void MultiArrayOperationRoot::linkIndicesTo(IndefinitIndexBase* target) const - { - MAOB::mIibPtr = &mIndex; - MAOB::mIibPtr->linkTo(target); - } - template T& MultiArrayOperationRoot::get() { @@ -361,7 +348,6 @@ namespace MultiArrayTools template void MultiArrayOperationRoot::freeIndex() const { - MAOB::mIibPtr->freeLinked(); mIndex = mArrayRef.beginIndex(); MAOB::mIibPtr = &mIndex; MAOB::mIibPtr->name(mNm); @@ -428,7 +414,7 @@ namespace MultiArrayTools const std::string& indexName, const MAOps&... mao) const { - typename Range2::IndexType* ind = dynamic_cast( mIndex.getLinked(indexName) ); + // !!!!! return MultiArrayContraction, MAOps...>(cop, *ind, *this, mao...); @@ -443,7 +429,7 @@ namespace MultiArrayTools size_t end, const MAOps&... mao) const { - typename Range2::IndexType* ind = dynamic_cast( mIndex.getLinked(indexName) ); + // !!!! return MultiArrayContraction, MAOps...>(cop, *ind, begin, end, *this, mao...); @@ -508,19 +494,6 @@ namespace MultiArrayTools return 1; } - template - IndefinitIndexBase* ConstMultiArrayOperationRoot::getLinked(const std::string& name) const - { - return mIndex.getLinked(name); - } - - template - void ConstMultiArrayOperationRoot::linkIndicesTo(IndefinitIndexBase* target) const - { - MAOB::mIibPtr = &mIndex; - MAOB::mIibPtr->linkTo(target); - } - template const T& ConstMultiArrayOperationRoot::get() const { @@ -542,15 +515,6 @@ namespace MultiArrayTools return *this; } - template - void ConstMultiArrayOperationRoot::freeIndex() const - { - MAOB::mIibPtr->freeLinked(); - mIndex = mArrayRef.beginIndex(); - MAOB::mIibPtr = &mIndex; - MAOB::mIibPtr->name(mNm); - } - /******************************** * MultiArrayOperationMap * ********************************/ @@ -588,15 +552,10 @@ namespace MultiArrayTools std::cout << "map assignment: " << endIndex.pos() << " elements" << std::endl; - mRoot.linkIndicesTo( &mIndex ); - mRoot.linkIndicesTo( &mMF.index() ); - mMF.linkIndicesTo( &mIndex ); - in.linkIndicesTo( &mIndex ); + // !!!!! MultiArray cnt(mRoot->range()); MultiArrayOperationRoot cnto(cnt, mRoot.name()); - cnto.linkIndicesTo( &mIndex ); - cnto.linkIndicesTo( &mMF.index() ); for(mIndex.setPos(0), mMF.eval(); mIndex != endIndex; ++mIndex, mMF.eval()){ get() += in.get(); @@ -624,16 +583,9 @@ namespace MultiArrayTools std::cout << "map assignment: " << endIndex.pos() << " elements" << std::endl; - mRoot.linkIndicesTo( &mIndex ); - mRoot.linkIndicesTo( &mMF.index() ); - mMF.linkIndicesTo( &mIndex ); - in.linkIndicesTo( &mIndex ); - + //!!!!!!! MultiArray cnt(mRoot->range()); MultiArrayOperationRoot cnto(cnt, mRoot.name()); - cnto.linkIndicesTo( &mIndex ); - cnto.linkIndicesTo( &mMF.index() ); - for(mIndex.setPos(0), mMF.eval(); mIndex != endIndex; ++mIndex, mMF.eval()){ get() += in.get(); cnto.get() += 1.; @@ -651,24 +603,6 @@ namespace MultiArrayTools return 1; } - template - IndefinitIndexBase* MultiArrayOperationMap:: - getLinked(const std::string& name) const - { - return mRoot.getLinked(name); - } - - template - void MultiArrayOperationMap:: - linkIndicesTo(IndefinitIndexBase* target) const - { - mRoot.linkIndicesTo(target); - } - - template - void MultiArrayOperationMap::setInternalLinks() const - { } - template const T& MultiArrayOperationMap::get() const { @@ -685,27 +619,6 @@ namespace MultiArrayTools * MultiArrayOperation * *****************************/ - template - struct TupleIndicesLinker - { - template - static void linkTupleIndicesTo(IndexTuple& itp, IndefinitIndexBase* target) - { - std::get(itp).linkIndicesTo(target); - TupleIndicesLinker::linkTupleIndicesTo(itp, target); - } - }; - - template <> - struct TupleIndicesLinker<0> - { - template - static void linkTupleIndicesTo(IndexTuple& itp, IndefinitIndexBase* target) - { - std::get<0>(itp).linkIndicesTo(target); - } - }; - template struct OperationCall { @@ -745,37 +658,6 @@ namespace MultiArrayTools return op(std::get<0>(tp).get(), args.get()...); } }; - - template - struct LinkedIndexGetter - { - template - static IndefinitIndexBase* getLinked(const Tuple& optuple, - const std::string& name, - IndefinitIndexBase* current) - { - if(current == nullptr){ - current = std::get(optuple).getLinked(name); - LinkedIndexGetter::getLinked(optuple, name, current); - } - return current; - } - }; - - template <> - struct LinkedIndexGetter<0> - { - template - static IndefinitIndexBase* getLinked(const Tuple& optuple, - const std::string& name, - IndefinitIndexBase* current) - { - if(current == nullptr){ - current = std::get<0>(optuple).getLinked(name); - } - return current; - } - }; template MultiArrayOperation:: @@ -816,7 +698,7 @@ namespace MultiArrayTools const std::string& indexName, const MAOps2&... mao) const { - typename Range2::IndexType* ind = dynamic_cast( getLinked(indexName) ); + // !!! return MultiArrayContraction, MAOps2...>(cop, *ind, *this, mao...); } @@ -859,19 +741,6 @@ namespace MultiArrayTools return sizeof...(MAOps) + 1; } - template - IndefinitIndexBase* MultiArrayOperation::getLinked(const std::string& name) const - { - return LinkedIndexGetter::getLinked(mArgs, name, nullptr); - } - - template - void MultiArrayOperation::linkIndicesTo(IndefinitIndexBase* target) const - { - TupleIndicesLinker::linkTupleIndicesTo(mArgs, target); - } - - template const T& MultiArrayOperation::get() const { @@ -991,28 +860,6 @@ namespace MultiArrayTools return sizeof...(MAOps) + 1; } - template - IndefinitIndexBase* MultiArrayContraction::getLinked(const std::string& name) const - { - return LinkedIndexGetter::getLinked(mArgs, name, nullptr); - } - - template - void MultiArrayContraction::setInternalLinks() const - { - linkIndicesTo(&mRunIndex); - } - - template - void MultiArrayContraction::linkIndicesTo(IndefinitIndexBase* target) const - { - if(target != &mRunIndex){ - setInternalLinks(); - } - TupleIndicesLinker::linkTupleIndicesTo(mArgs, target); - } - - template const T& MultiArrayContraction::get() const { diff --git a/src/multi_array_operation.h b/src/multi_array_operation.h index ae03cf9..5cc2317 100644 --- a/src/multi_array_operation.h +++ b/src/multi_array_operation.h @@ -26,14 +26,10 @@ namespace MultiArrayTools virtual size_t argNum() const = 0; const IndefinitIndexBase& index() const; - virtual IndefinitIndexBase* getLinked(const std::string& name) const = 0; - virtual void linkIndicesTo(IndefinitIndexBase* target) const = 0; virtual const T& get() const = 0; - virtual void setInternalLinks() const {} - virtual void freeIndex() const; protected: mutable IndefinitIndexBase* mIibPtr = nullptr; @@ -145,16 +141,11 @@ namespace MultiArrayTools MultiArrayOperationRoot& operator[](const IndexType& ind); const MultiArrayOperationRoot& operator[](const IndexType& ind) const; - virtual IndefinitIndexBase* getLinked(const std::string& name) const override; - virtual void linkIndicesTo(IndefinitIndexBase* target) const override; - virtual T& get() override; virtual const T& get() const override; const Name& name() const; - virtual void freeIndex() const override; - const MultiArrayBase& getCont() const { return mArrayRef; } template @@ -224,16 +215,10 @@ namespace MultiArrayTools // set index -> implement !!!!! const ConstMultiArrayOperationRoot& operator[](const IndexType& ind) const; - - virtual IndefinitIndexBase* getLinked(const std::string& name) const override; - virtual void linkIndicesTo(IndefinitIndexBase* target) const override; - virtual const T& get() const override; const Name& name() const; - virtual void freeIndex() const override; - const MultiArrayBase& getCont() const { return mArrayRef; } template @@ -264,11 +249,6 @@ namespace MultiArrayTools MultiArrayOperationMap& operator=(const ConstMultiArrayOperationRoot& in); virtual size_t argNum() const override; - - virtual IndefinitIndexBase* getLinked(const std::string& name) const override; - virtual void linkIndicesTo(IndefinitIndexBase* target) const override; - - virtual void setInternalLinks() const override; virtual const T& get() const override; virtual T& get() override; @@ -319,9 +299,6 @@ namespace MultiArrayTools auto operator/(const MAOp2& sec) -> decltype(operator()(std::divides(), sec)); virtual size_t argNum() const override; - - virtual IndefinitIndexBase* getLinked(const std::string& name) const override; - virtual void linkIndicesTo(IndefinitIndexBase* target) const override; virtual const T& get() const override; @@ -377,14 +354,9 @@ namespace MultiArrayTools template auto operator/(const MAOp2& sec) -> decltype(operator()(std::divides(), sec)); - - virtual void setInternalLinks() const override; virtual size_t argNum() const override; - virtual IndefinitIndexBase* getLinked(const std::string& name) const override; - virtual void linkIndicesTo(IndefinitIndexBase* target) const override; - virtual const T& get() const override; protected: diff --git a/src/multi_range.cc b/src/multi_range.cc index dfc9128..72e63c5 100644 --- a/src/multi_range.cc +++ b/src/multi_range.cc @@ -237,17 +237,17 @@ namespace MultiArrayTools struct IndexSetter { template - static void setBegin(std::tuple& i, const std::tuple& r) + static void setBegin(MultiRange::IndexType& i, const MultiRange::SpaceType& r) { - std::get(i) = std::get(r).begin(); + *std::get(i) = std::get(r)->begin(); IndexSetter::setBegin(i,r); } template - static void setEnd(std::tuple& i, const std::tuple& r) + static void setEnd(MultiRange::IndexType& i, const MultiRange::SpaceType& r) { - std::get(i) = std::get(r).end(); - std::get(i) -= 1; + *std::get(i) = std::get(r)->end(); + *std::get(i) -= 1; IndexSetter::setEnd(i,r); } }; @@ -256,16 +256,16 @@ namespace MultiArrayTools struct IndexSetter<0> { template - static void setBegin(std::tuple& i, const std::tuple& r) + static void setBegin(MultiRange::IndexType& i, const MultiRange::SpaceType& r) { - std::get<0>(i) = std::get<0>(r).begin(); + *std::get<0>(i) = std::get<0>(r)->begin(); } template - static void setEnd(std::tuple& i, const std::tuple& r) + static void setEnd(MultiRange::IndexType& i, const MultiRange::SpaceType& r) { - std::get<0>(i) = std::get<0>(r).end(); - std::get<0>(i) -= 1; + *std::get<0>(i) = std::get<0>(r)->end(); + *std::get<0>(i) -= 1; } }; @@ -273,9 +273,9 @@ namespace MultiArrayTools struct RangeVecBuilder { template - static void buildRangeVec(std::vector& rvec, const std::tuple& rs) + static void buildRangeVec(std::vector& rvec, const MultiRange::SpaceType& rs) { - rvec.push_back(std::get(rs).type()); + rvec.push_back(std::get(rs)->type()); RangeVecBuilder::buildRangeVec(rvec, rs); } }; @@ -283,20 +283,20 @@ namespace MultiArrayTools struct RangeVecBuilder<0> { template - static void buildRangeVec(std::vector& rvec, const std::tuple& rs) + static void buildRangeVec(std::vector& rvec, const MultiRange::SpaceType& rs) { - rvec.push_back(std::get(rs).type()); + rvec.push_back(std::get(rs)->type()); } }; - + // HERE !!! template struct MetaPosGetter { template static void getMetaPos(std::tuple& target, - const std::tuple& source) + const typename MultiIndex::IndexPack& source) { - std::get(target) = std::get(source).getMetaPos(); + std::get(target) = std::get(source)->getMetaPos(); MetaPosGetter::getMetaPos(target, source); } }; @@ -306,9 +306,9 @@ namespace MultiArrayTools { template static void getMetaPos(std::tuple& target, - const std::tuple& source) + const typename MultiIndex::IndexPack& source) { - std::get<0>(target) = std::get<0>(source).getMetaPos(); + std::get<0>(target) = std::get<0>(source)->getMetaPos(); } }; @@ -527,55 +527,18 @@ namespace MultiArrayTools } template - bool MultiIndex::link(IndefinitIndexBase* toLink) + template + auto getIndex() -> decltype(*std::get(mIPack))& + //typename std::tuple_element >::type& MultiIndex::getIndex() { - if(toLink->rangeType() != rangeType() and - toLink->name() == IIB::name() and - not (IIB::name() == "master")){ - // throw !! - assert(0); - } - if(toLink->rangeType() == rangeType() and toLink->name() == IIB::name()){ - if(IIB::mLinked == toLink or IIB::mSoftLinked == toLink){ - return true; // dont link twice the same - } - else if(IIB::mLinked == nullptr and IIB::mSoftLinked == nullptr){ - IIB::mLinked = toLink; - return true; - } - else { - if(IIB::mLinked == nullptr){ - return IIB::mSoftLinked->link(toLink); - } - else { - return IIB::mLinked->link(toLink); - } - } - } - else { - if(linkLower(toLink)){ - IIB::mSoftLinked = IIB::mLinked; - IIB::mLinked = nullptr; - return true; - } - else { - return false; - } - } + return *std::get(mIPack); } template template - typename std::tuple_element >::type& MultiIndex::getIndex() + auto getIndex() const -> const decltype(*std::get(mIPack))& { - return std::get(mIPack); - } - - template - template - typename std::tuple_element >::type const& MultiIndex::getIndex() const - { - return std::get(mIPack); + return *std::get(mIPack); } template @@ -615,49 +578,12 @@ namespace MultiArrayTools return *this; } - template - bool MultiIndex::linkLower(IndefinitIndexBase* toLink) - { - bool res = false; - for(size_t i = 0; i != sizeof...(Indices); ++i){ - res |= get(i).link(toLink); - } - return res; - } - - template - void MultiIndex::linkTo(IndefinitIndexBase* target) - { - target->link(this); - for(size_t i = 0; i != sizeof...(Indices); ++i){ - get(i).linkTo(target); - } - } - template void MultiIndex::copyPos(const MultiIndex& in) { PositionCopy::copyPos(*this, in); } - template - IndefinitIndexBase* MultiIndex::getLinked(const std::string& name) - { - if(name == IIB::mName){ - return this; - } - - for(size_t i = 0; i != sizeof...(Indices); ++i){ - IndefinitIndexBase* iibPtr = get(i).getLinked(name); - if(iibPtr != nullptr){ - //CHECK; - return iibPtr; - } - } - //CHECK; - return nullptr; - } - template size_t MultiIndex::giveSubStepSize(IndefinitIndexBase* subIndex) { @@ -703,23 +629,25 @@ namespace MultiArrayTools ******************/ template - MultiRange::MultiRange(const Ranges&... rs) : mSpace(std::make_tuple(rs...)) {} + MultiRange::MultiRange(const std::shared_ptr&... rs) : mSpace(std::make_tuple(rs...)) {} template MultiRange::MultiRange(const SpaceType& space) : mSpace(space) {} template template - typename std::tuple_element >::type& MultiRange::getRange() + auto getRange() -> decltype(*std::get(mSpace))& + //typename std::tuple_element >::type& MultiRange::getRange() { - return std::get(mSpace); + return *std::get(mSpace); } template template - typename std::tuple_element >::type const& MultiRange::getRange() const + auto getRange() const -> const decltype(*std::get(mSpace))& + //typename std::tuple_element >::type const& MultiRange::getRange() const { - return std::get(mSpace); + return *std::get(mSpace); } template @@ -745,7 +673,7 @@ namespace MultiArrayTools template MultiIndex MultiRange::begin() const { - std::tuple is; + std::tuple...> is; IndexSetter::setBegin(is,mSpace); return MultiIndex(this, is); } @@ -753,7 +681,7 @@ namespace MultiArrayTools template MultiIndex MultiRange::end() const { - std::tuple is; + std::tuple...> is; IndexSetter::setEnd(is,mSpace); return ++MultiIndex(this, is); } diff --git a/src/multi_range.h b/src/multi_range.h index e5d788a..f263ff3 100644 --- a/src/multi_range.h +++ b/src/multi_range.h @@ -5,6 +5,7 @@ #include #include +#include #include "base_def.h" #include "range_base.h" @@ -17,9 +18,9 @@ namespace MultiArrayTools class MultiIndex : public IndexBase > { public: - typedef std::tuple IndexPack; + typedef std::tuple...> IndexPack; typedef IndefinitIndexBase IIB; - typedef IndexBase > IB; + typedef IndexBase...> > IB; typedef std::tuple MetaType; protected: @@ -38,12 +39,12 @@ namespace MultiArrayTools MultiIndex(const MultiIndex& in); MultiIndex& operator=(const MultiIndex& in); - MultiIndex(RangeBase > const* range); + MultiIndex(RangeBase...> > const* range); - MultiIndex(RangeBase > const* range, + MultiIndex(RangeBase...> > const* range, Indices&&... inds); - MultiIndex(RangeBase > const* range, + MultiIndex(RangeBase...> > const* range, const IndexPack& ipack); //virtual ~MultiIndex(); @@ -60,10 +61,12 @@ namespace MultiArrayTools virtual MultiRangeType rangeType() const override; template - typename std::tuple_element >::type& getIndex(); + auto getIndex() ->; + //typename std::tuple_element...> >::type& getIndex(); template - typename std::tuple_element >::type const& getIndex() const; + auto getIndex() const ->; + //typename std::tuple_element...> >::type const& getIndex() const; IndefinitIndexBase& get(size_t n); const IndefinitIndexBase& get(size_t n) const; @@ -79,12 +82,8 @@ namespace MultiArrayTools // dimension of MultiRange; includes ALL degrees of freedom virtual size_t dim() const override; - virtual bool link(IndefinitIndexBase* toLink) override; - virtual void linkTo(IndefinitIndexBase* target) override; + virtual void copyPos(const MultiIndex...>& in) override; - virtual void copyPos(const MultiIndex& in) override; - - virtual IndefinitIndexBase* getLinked(const std::string& name) override; virtual size_t giveSubStepSize(IndefinitIndexBase* subIndex) override; //virtual void eval() override; @@ -102,23 +101,24 @@ namespace MultiArrayTools { public: - typedef std::tuple SpaceType; - typedef typename RangeBase >::IndexType IndexType; + typedef std::tuple...> SpaceType; + typedef typename RangeBase >::IndexType + IndexType; DEFAULT_MEMBERS(MultiRange); - MultiRange(const Ranges&... rs); + MultiRange(const std::shared_ptr&... rs); MultiRange(const SpaceType& space); static const size_t dim = sizeof...(Ranges); - static MultiRange oType() { return MultiRange(); } - - template - typename std::tuple_element >::type& getRange(); + template // !!! return ref to range, not the corresp. shared ptr + auto getRange() -> ; + //typename std::tuple_element...> >::type& getRange(); - template - typename std::tuple_element >::type const& getRange() const; + template // !!! + auto getRange() const ->; + //typename std::tuple_element...> >::type const& getRange() const; size_t size() const override; const SpaceType& space() const; diff --git a/src/single_range.cc b/src/single_range.cc index aab76a8..3a328ec 100644 --- a/src/single_range.cc +++ b/src/single_range.cc @@ -347,31 +347,12 @@ namespace MultiArrayTools return in.pos(); } - template - void SingleIndex::linkTo(IndefinitIndexBase* target) - { - target->link(this); - } - template void SingleIndex::copyPos(const SingleIndex& in) { IIB::setPos(in.pos()); } - template - IndefinitIndexBase* SingleIndex::getLinked(const std::string& name) - { - //VCHECK(name); - //VCHECK(IIB::mName); - if(name == IIB::mName){ - return this; - } - else { - return nullptr; - } - } - template size_t SingleIndex::giveSubStepSize(IndefinitIndexBase* subIndex) { diff --git a/src/single_range.h b/src/single_range.h index f60ef5e..5ac2ea4 100644 --- a/src/single_range.h +++ b/src/single_range.h @@ -47,11 +47,8 @@ namespace MultiArrayTools virtual SingleIndex& atMeta(const U& metaPos); virtual size_t dim() const override; // = 1 - virtual void linkTo(IndefinitIndexBase* target) override; - virtual void copyPos(const SingleIndex& in) override; - virtual IndefinitIndexBase* getLinked(const std::string& name) override; virtual size_t giveSubStepSize(IndefinitIndexBase* subIndex) override; //virtual void eval() override;