assignExpr function

This commit is contained in:
Christian Zimmermann 2019-05-10 18:14:13 +02:00
parent 33d321d529
commit 8e91aae948
3 changed files with 14 additions and 1 deletions

View file

@ -53,7 +53,7 @@ namespace MultiArrayTools
class OpExpr
{
public:
typedef typename Index::OIType OIType;
//typedef typename Index::OIType OIType;
//typedef SingleIndex<typename Op::value_type,STYPE> OIType;
static constexpr size_t LAYER = Expr::LAYER + 1;
static constexpr size_t SIZE = Expr::SIZE + Op::SIZE;

View file

@ -367,6 +367,15 @@ namespace MultiArrayTools
return mIndex.ifor(1,in.loop(AssignmentExpr<T,OpClass>(mOrigDataPtr,in)));
}
template <typename T, class... Ranges>
template <class OpClass>
auto OperationRoot<T,Ranges...>::assignExpr(const OpClass& in) const
-> decltype(in.loop(AssignmentExpr<T,OpClass>(mOrigDataPtr,in)))
{
static_assert( OpClass::SIZE == decltype(in.rootSteps())::SIZE, "Ext Size mismatch" );
return in.loop(AssignmentExpr<T,OpClass>(mOrigDataPtr,in));
}
template <typename T, class... Ranges>
template <class OpClass, class Index>
auto OperationRoot<T,Ranges...>::assign(const OpClass& in, const std::shared_ptr<Index>& i) const

View file

@ -315,6 +315,10 @@ namespace MultiArrayTools
auto assign(const OpClass& in) const
-> decltype(mIndex.ifor(1,in.loop(AssignmentExpr<T,OpClass>(mOrigDataPtr,in))));
template <class OpClass>
auto assignExpr(const OpClass& in) const
-> decltype(in.loop(AssignmentExpr<T,OpClass>(mOrigDataPtr,in)));
template <class OpClass, class Index>
auto assign(const OpClass& in, const std::shared_ptr<Index>& i) const
-> decltype(i->ifor(1,in.loop(AssignmentExpr2<T,OperationRoot<T,Ranges...>,OpClass>