some clean ups

This commit is contained in:
Christian Zimmermann 2017-03-26 13:29:28 +02:00
parent a77d58d946
commit 344ae475ae
2 changed files with 1 additions and 136 deletions

View file

@ -52,31 +52,6 @@ namespace MultiArrayTools
MAOB::mIibPtr->freeLinked(); MAOB::mIibPtr->freeLinked();
} }
/*
template <typename T, class Range>
template <class RangeX>
MultiArrayOperationRoot<T,Range>&
MultiArrayOperationRoot<T,Range>::makeSlice(MultiArrayOperationRoot<T,RangeX>& in)
{
Slice<T,Range,RangeX>& sl = dynamic_cast<Slice<T,Range,RangeX>&>( mArrayRef );
sl.set(in.mArrayRef, name(), dynamic_cast<const typename RangeX::IndexType&>( in.index() ), in.name());
return *this;
}
template <typename T, class Range>
template <class RangeX>
const MultiArrayOperationRoot<T,Range>&
MultiArrayOperationRoot<T,Range>::makeConstSlice(const MultiArrayOperationRoot<T,RangeX>& in)
{
Slice<T,Range,RangeX>& sl = dynamic_cast<Slice<T,Range,RangeX>&>( mArrayRef );
sl.setConst(in.mArrayRef, name(), dynamic_cast<const typename RangeX::IndexType&>( in.index() ), in.name());
return *this;
}
*/
// CONST SLICE !!!!!
template <typename T, class Range> template <typename T, class Range>
MultiArrayOperationRoot<T,Range>:: MultiArrayOperationRoot<T,Range>::
MultiArrayOperationRoot(MutableMultiArrayBase<T,Range>& ma, MultiArrayOperationRoot(MutableMultiArrayBase<T,Range>& ma,
@ -117,10 +92,6 @@ namespace MultiArrayTools
MultiArrayOperationRoot<T,Range>& MultiArrayOperationRoot<T,Range>&
MultiArrayOperationRoot<T,Range>::operator=(MultiArrayOperationRoot<T,Range>& in) MultiArrayOperationRoot<T,Range>::operator=(MultiArrayOperationRoot<T,Range>& in)
{ {
//CHECK;
// if(mArrayRef.isSlice() and not mArrayRef.isInit()){
// return makeSlice(in);
//}
performAssignment(in); performAssignment(in);
freeIndex(); freeIndex();
return *this; return *this;
@ -131,10 +102,6 @@ namespace MultiArrayTools
MultiArrayOperationRoot<T,Range>& MultiArrayOperationRoot<T,Range>&
MultiArrayOperationRoot<T,Range>::operator=(MultiArrayOperationRoot<T,Range2>& in) MultiArrayOperationRoot<T,Range>::operator=(MultiArrayOperationRoot<T,Range2>& in)
{ {
//CHECK;
//if(mArrayRef.isSlice() and not mArrayRef.isInit()){
// return makeSlice(in);
//}
performAssignment(in); performAssignment(in);
freeIndex(); freeIndex();
return *this; return *this;
@ -146,11 +113,6 @@ namespace MultiArrayTools
const MultiArrayOperationRoot<T,Range>& const MultiArrayOperationRoot<T,Range>&
MultiArrayOperationRoot<T,Range>::operator=(const MultiArrayOperationRoot<T,Range2>& in) MultiArrayOperationRoot<T,Range>::operator=(const MultiArrayOperationRoot<T,Range2>& in)
{ {
//CHECK;
//if(mArrayRef.isSlice() and not mArrayRef.isInit()){
//CHECK;
// return makeConstSlice(in);
//}
performAssignment(in); performAssignment(in);
freeIndex(); freeIndex();
return *this; return *this;
@ -192,9 +154,6 @@ namespace MultiArrayTools
const std::string& indexName, const std::string& indexName,
const MAOps&... mao) const const MAOps&... mao) const
{ {
//typename Range2::IndexType ind;
//ind.name(indexName);
typename Range2::IndexType* ind = dynamic_cast<typename Range2::IndexType*>( mIndex.getLinked(indexName) ); typename Range2::IndexType* ind = dynamic_cast<typename Range2::IndexType*>( mIndex.getLinked(indexName) );
return MultiArrayContraction<T,ContractOperation,Range2, return MultiArrayContraction<T,ContractOperation,Range2,
MultiArrayOperationRoot<T,Range>, MultiArrayOperationRoot<T,Range>,
@ -210,9 +169,6 @@ namespace MultiArrayTools
size_t end, size_t end,
const MAOps&... mao) const const MAOps&... mao) const
{ {
//typename Range2::IndexType ind;
//ind.name(indexName);
typename Range2::IndexType* ind = dynamic_cast<typename Range2::IndexType*>( mIndex.getLinked(indexName) ); typename Range2::IndexType* ind = dynamic_cast<typename Range2::IndexType*>( mIndex.getLinked(indexName) );
return MultiArrayContraction<T,ContractOperation,Range2, return MultiArrayContraction<T,ContractOperation,Range2,
MultiArrayOperationRoot<T,Range>, MultiArrayOperationRoot<T,Range>,
@ -377,29 +333,6 @@ namespace MultiArrayTools
* ConstMultiArrayOperationBase * * ConstMultiArrayOperationBase *
**************************************/ **************************************/
/*
template <typename T, class Range>
template <class RangeX>
const ConstMultiArrayOperationRoot<T,Range>&
ConstMultiArrayOperationRoot<T,Range>::makeConstSlice(const ConstMultiArrayOperationRoot<T,RangeX>& in)
{
ConstSlice<T,Range,RangeX>& sl = dynamic_cast<ConstSlice<T,Range,RangeX>&>( mArrayRef );
sl.set(in.mArrayRef, name(), dynamic_cast<const typename RangeX::IndexType&>( in.index() ), in.name());
return *this;
}
template <typename T, class Range>
template <class RangeX>
const ConstMultiArrayOperationRoot<T,Range>&
ConstMultiArrayOperationRoot<T,Range>::makeConstSlice(const MultiArrayOperationRoot<T,RangeX>& in)
{
ConstSlice<T,Range,RangeX>& sl = dynamic_cast<ConstSlice<T,Range,RangeX>&>( mArrayRef );
sl.set(in.mArrayRef, name(), dynamic_cast<const typename RangeX::IndexType&>( in.index() ), in.name());
return *this;
}
*/
// CONST SLICE !!!!!
template <typename T, class Range> template <typename T, class Range>
ConstMultiArrayOperationRoot<T,Range>:: ConstMultiArrayOperationRoot<T,Range>::
@ -441,47 +374,6 @@ namespace MultiArrayTools
//mIndex.name(nm); //mIndex.name(nm);
} }
/*
template <typename T, class Range>
const ConstMultiArrayOperationRoot<T,Range>&
ConstMultiArrayOperationRoot<T,Range>::operator=(const ConstMultiArrayOperationRoot<T,Range>& in)
{
//CHECK;
if(mArrayRef.isSlice() and not mArrayRef.isInit()){
return makeConstSlice(in);
}
assert(0);
return *this;
}
template <typename T, class Range>
template <class Range2>
const ConstMultiArrayOperationRoot<T,Range>&
ConstMultiArrayOperationRoot<T,Range>::operator=(const ConstMultiArrayOperationRoot<T,Range2>& in)
{
//CHECK;
if(mArrayRef.isSlice() and not mArrayRef.isInit()){
//CHECK;
return makeConstSlice(in);
}
assert(0);
return *this;
}
template <typename T, class Range>
template <class Range2>
const ConstMultiArrayOperationRoot<T,Range>&
ConstMultiArrayOperationRoot<T,Range>::operator=(const MultiArrayOperationRoot<T,Range2>& in)
{
//CHECK;
if(mArrayRef.isSlice() and not mArrayRef.isInit()){
//CHECK;
return makeConstSlice(in);
}
assert(0);
return *this;
}
*/
template <typename T, class Range> template <typename T, class Range>
template <class Operation, class... MAOps> template <class Operation, class... MAOps>
MultiArrayOperation<T,Operation,ConstMultiArrayOperationRoot<T,Range>, MAOps...> MultiArrayOperation<T,Operation,ConstMultiArrayOperationRoot<T,Range>, MAOps...>

View file

@ -368,33 +368,6 @@ namespace MultiArrayTools
mutable typename Range::IndexType mRunIndex; mutable typename Range::IndexType mRunIndex;
}; };
/*
template <typename T, class ContractOperation, class Range, class... MAOps>
class MultiArrayContraction : public MultiArrayOperation<T,ContractOperation,MAOps...>
{
public:
typedef MultiArrayOperationBase<T> MAOB;
typedef MultiArrayOperation<T,ContractOperation,MAOps...> 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" #include "multi_array_operation.cc"