From 344ae475ae0ccab7b2e3c9918626038e8c2083bd Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Sun, 26 Mar 2017 13:29:28 +0200 Subject: [PATCH] some clean ups --- src/multi_array_operation.cc | 110 +---------------------------------- src/multi_array_operation.h | 27 --------- 2 files changed, 1 insertion(+), 136 deletions(-) diff --git a/src/multi_array_operation.cc b/src/multi_array_operation.cc index e8c6dc5..151c354 100644 --- a/src/multi_array_operation.cc +++ b/src/multi_array_operation.cc @@ -52,31 +52,6 @@ namespace MultiArrayTools MAOB::mIibPtr->freeLinked(); } - /* - template - template - MultiArrayOperationRoot& - MultiArrayOperationRoot::makeSlice(MultiArrayOperationRoot& in) - { - Slice& sl = dynamic_cast&>( mArrayRef ); - sl.set(in.mArrayRef, name(), dynamic_cast( in.index() ), in.name()); - return *this; - } - - - template - template - const MultiArrayOperationRoot& - MultiArrayOperationRoot::makeConstSlice(const MultiArrayOperationRoot& in) - { - Slice& sl = dynamic_cast&>( mArrayRef ); - sl.setConst(in.mArrayRef, name(), dynamic_cast( in.index() ), in.name()); - return *this; - } - */ - - // CONST SLICE !!!!! - template MultiArrayOperationRoot:: MultiArrayOperationRoot(MutableMultiArrayBase& ma, @@ -117,10 +92,6 @@ namespace MultiArrayTools MultiArrayOperationRoot& MultiArrayOperationRoot::operator=(MultiArrayOperationRoot& in) { - //CHECK; - // if(mArrayRef.isSlice() and not mArrayRef.isInit()){ - // return makeSlice(in); - //} performAssignment(in); freeIndex(); return *this; @@ -131,10 +102,6 @@ namespace MultiArrayTools MultiArrayOperationRoot& MultiArrayOperationRoot::operator=(MultiArrayOperationRoot& in) { - //CHECK; - //if(mArrayRef.isSlice() and not mArrayRef.isInit()){ - // return makeSlice(in); - //} performAssignment(in); freeIndex(); return *this; @@ -146,11 +113,6 @@ namespace MultiArrayTools const MultiArrayOperationRoot& MultiArrayOperationRoot::operator=(const MultiArrayOperationRoot& in) { - //CHECK; - //if(mArrayRef.isSlice() and not mArrayRef.isInit()){ - //CHECK; - // return makeConstSlice(in); - //} performAssignment(in); freeIndex(); return *this; @@ -192,9 +154,6 @@ namespace MultiArrayTools const std::string& indexName, const MAOps&... mao) const { - //typename Range2::IndexType ind; - //ind.name(indexName); - typename Range2::IndexType* ind = dynamic_cast( mIndex.getLinked(indexName) ); return MultiArrayContraction, @@ -210,9 +169,6 @@ namespace MultiArrayTools size_t end, const MAOps&... mao) const { - //typename Range2::IndexType ind; - //ind.name(indexName); - typename Range2::IndexType* ind = dynamic_cast( mIndex.getLinked(indexName) ); return MultiArrayContraction, @@ -377,30 +333,7 @@ namespace MultiArrayTools * ConstMultiArrayOperationBase * **************************************/ - /* - template - template - const ConstMultiArrayOperationRoot& - ConstMultiArrayOperationRoot::makeConstSlice(const ConstMultiArrayOperationRoot& in) - { - ConstSlice& sl = dynamic_cast&>( mArrayRef ); - sl.set(in.mArrayRef, name(), dynamic_cast( in.index() ), in.name()); - return *this; - } - - template - template - const ConstMultiArrayOperationRoot& - ConstMultiArrayOperationRoot::makeConstSlice(const MultiArrayOperationRoot& in) - { - ConstSlice& sl = dynamic_cast&>( mArrayRef ); - sl.set(in.mArrayRef, name(), dynamic_cast( in.index() ), in.name()); - return *this; - } - */ - - // CONST SLICE !!!!! - + template ConstMultiArrayOperationRoot:: ConstMultiArrayOperationRoot(const MultiArrayBase& ma, @@ -441,47 +374,6 @@ namespace MultiArrayTools //mIndex.name(nm); } - /* - template - const ConstMultiArrayOperationRoot& - ConstMultiArrayOperationRoot::operator=(const ConstMultiArrayOperationRoot& in) - { - //CHECK; - if(mArrayRef.isSlice() and not mArrayRef.isInit()){ - return makeConstSlice(in); - } - assert(0); - return *this; - } - - template - template - const ConstMultiArrayOperationRoot& - ConstMultiArrayOperationRoot::operator=(const ConstMultiArrayOperationRoot& in) - { - //CHECK; - if(mArrayRef.isSlice() and not mArrayRef.isInit()){ - //CHECK; - return makeConstSlice(in); - } - assert(0); - return *this; - } - - template - template - const ConstMultiArrayOperationRoot& - ConstMultiArrayOperationRoot::operator=(const MultiArrayOperationRoot& in) - { - //CHECK; - if(mArrayRef.isSlice() and not mArrayRef.isInit()){ - //CHECK; - return makeConstSlice(in); - } - assert(0); - return *this; - } - */ template template MultiArrayOperation, MAOps...> diff --git a/src/multi_array_operation.h b/src/multi_array_operation.h index c09e96b..33da214 100644 --- a/src/multi_array_operation.h +++ b/src/multi_array_operation.h @@ -368,33 +368,6 @@ namespace MultiArrayTools mutable typename Range::IndexType mRunIndex; }; - - /* - template - class MultiArrayContraction : public MultiArrayOperation - { - public: - typedef MultiArrayOperationBase MAOB; - typedef MultiArrayOperation MAO; - - MultiArrayContraction(const ContractOperation& cop, - const typename Range::IndexType& runIndex, - const MAOps&... mao); - - MultiArrayContraction(const ContractOperation& cop, - const typename Range::IndexType& runIndex, - size_t begin, - size_t end, - const MAOps&... mao); - - virtual const T& get() const override; - - protected: - typename Range::IndexType mBeginIndex; - typename Range::IndexType mEndIndex; - mutable typename Range::IndexType mRunIndex; - }; - */ } #include "multi_array_operation.cc"