diff --git a/src/multi_array.cc b/src/multi_array.cc index 3592fc3..cf7a0b3 100644 --- a/src/multi_array.cc +++ b/src/multi_array.cc @@ -545,6 +545,12 @@ namespace MultiArrayTools { return false; } + + template + const T* MultiArray::data() const + { + return mCont.data(); + } /* template diff --git a/src/multi_array.h b/src/multi_array.h index 058c35f..713ea5e 100644 --- a/src/multi_array.h +++ b/src/multi_array.h @@ -224,6 +224,8 @@ namespace MultiArrayTools virtual bool isConst() const override; virtual bool isSlice() const override; + const T* data() const; + // virtual void manipulate(ManipulatorBase& mb, // const typename Range::IndexType& manBegin, // const typename Range::IndexType& manEnd); diff --git a/src/multi_array_header.h b/src/multi_array_header.h index 9b50760..a4cbc50 100644 --- a/src/multi_array_header.h +++ b/src/multi_array_header.h @@ -31,6 +31,8 @@ namespace MultiArrayTools typedef SingleIndex Space1dNI; typedef SingleIndex Mom1dNI; typedef SingleIndex EnsI; + typedef SingleIndex, RangeType::MOMENTUM> LinMomI; + typedef SingleIndex, RangeType::MOMENTUM> LinMom4dI; // ... // ===== Range Types ===== @@ -45,6 +47,8 @@ namespace MultiArrayTools typedef MultiRange Space3dNR; typedef MultiRange Mom3dNR; typedef SingleRange ValErrR; + typedef SingleRange, RangeType::MOMENTUM> LinMomR; + typedef SingleRange, RangeType::MOMENTUM> LinMom4dR; // ... } diff --git a/src/multi_array_operation.cc b/src/multi_array_operation.cc index 64911a4..1690196 100644 --- a/src/multi_array_operation.cc +++ b/src/multi_array_operation.cc @@ -123,6 +123,28 @@ namespace MultiArrayTools freeIndex(); return *this; } + + template + template + MultiArrayOperationRoot& + MultiArrayOperationRoot::operator=(ConstMultiArrayOperationRoot& in) + { + performAssignment(in); + freeIndex(); + return *this; + } + + + template + template + const MultiArrayOperationRoot& + MultiArrayOperationRoot::operator=(const ConstMultiArrayOperationRoot& in) + { + performAssignment(in); + freeIndex(); + return *this; + } + template template diff --git a/src/multi_array_operation.h b/src/multi_array_operation.h index 1aa590d..ae03cf9 100644 --- a/src/multi_array_operation.h +++ b/src/multi_array_operation.h @@ -67,10 +67,16 @@ namespace MultiArrayTools template MultiArrayOperationRoot& operator=(MultiArrayOperationRoot& in); - template const MultiArrayOperationRoot& operator=(const MultiArrayOperationRoot& in); + + template + MultiArrayOperationRoot& operator=(ConstMultiArrayOperationRoot& in); + + template + const MultiArrayOperationRoot& operator=(const ConstMultiArrayOperationRoot& in); + template MultiArrayOperationRoot& operator=(const MultiArrayOperation& in); diff --git a/src/name.cc b/src/name.cc index 1c26432..620f475 100644 --- a/src/name.cc +++ b/src/name.cc @@ -63,6 +63,16 @@ namespace MultiArrayTools } } + void Name::remove(const std::string& s) + { + for(size_t i = 0; i != mSub.size(); ++i){ + if(mSub[i].own() == s){ + mSub.erase(mSub.begin()+i); + break; + } + } + } + size_t Name::size() const { return mSub.size(); diff --git a/src/name.h b/src/name.h index 490def5..b213690 100644 --- a/src/name.h +++ b/src/name.h @@ -27,6 +27,7 @@ namespace MultiArrayTools const Name& get(size_t n) const; void autoName(size_t newSize); + void remove(const std::string& s); size_t size() const; private: