im com
This commit is contained in:
parent
14bf7d003c
commit
8b23a173da
2 changed files with 18 additions and 5 deletions
|
@ -161,6 +161,15 @@ namespace MultiArrayTools
|
|||
return Operation<T,std::divides<T>,OperationClass,Second>(*mOc, in);
|
||||
}
|
||||
|
||||
template <typename T, class OperationClass>
|
||||
template <class IndexType>
|
||||
auto OperationTemplate<T,OperationClass>::c(std::shared_ptr<IndexType>& ind) const
|
||||
-> Contraction<T,OperationClass,IndexType>
|
||||
{
|
||||
return Contraction<T,OperationClass,IndexType>(*mOc, ind);
|
||||
}
|
||||
|
||||
|
||||
/*************************
|
||||
* OperationMaster *
|
||||
*************************/
|
||||
|
|
|
@ -109,6 +109,10 @@ namespace MultiArrayTools
|
|||
auto operator/(const Second& in) const
|
||||
-> Operation<T,std::divides<T>,OperationClass,Second>;
|
||||
|
||||
template <class IndexType>
|
||||
auto c(std::shared_ptr<IndexType>& ind) const
|
||||
-> Contraction<T,OperationClass,IndexType>;
|
||||
|
||||
private:
|
||||
OperationClass* mOc;
|
||||
};
|
||||
|
@ -223,15 +227,15 @@ namespace MultiArrayTools
|
|||
mutable BlockResult<T> mRes;
|
||||
};
|
||||
|
||||
template <typename T, class Op>
|
||||
template <typename T, class Op, class IndexType>
|
||||
class Contraction : public OperationTemplate<T,Contraction<T,Op> >
|
||||
{
|
||||
public:
|
||||
|
||||
typedef T value_type;
|
||||
typedef OperationTemplate<T,Contraction<T,Op> > OT;
|
||||
typedef OperationTemplate<T,Contraction<T,Op,IndexType> > OT;
|
||||
|
||||
Contraction(const Op& op);
|
||||
Contraction(const Op& op, std::shared_ptr<IndexType> ind);
|
||||
|
||||
const BlockResult<T>& get() const;
|
||||
|
||||
|
@ -241,8 +245,8 @@ namespace MultiArrayTools
|
|||
protected:
|
||||
|
||||
const Op& mOp;
|
||||
std::shared_ptr<IndexType> mInd;
|
||||
mutable BlockResult<T> mRes;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue