This commit is contained in:
Christian Zimmermann 2020-09-14 16:30:42 +02:00
parent dcce9a5eea
commit 5c9443cd63
2 changed files with 13 additions and 0 deletions

View file

@ -239,6 +239,15 @@ namespace MultiArrayTools
( std::array<std::shared_ptr<HighLevelOpBase<ROP>>,2>({mOp, in.mOp}) ) ); ( std::array<std::shared_ptr<HighLevelOpBase<ROP>>,2>({mOp, in.mOp}) ) );
} }
template <class F, class ROP, class... ROPs>
HighLevelOpHolder<ROP> mkSFunc(const HighLevelOpHolder<ROP>& a, const HighLevelOpHolder<ROPs>&... as)
{
constexpr size_t N = sizeof...(ROPs)+1;
return HighLevelOpHolder<ROP>
( std::make_shared<HighLevelOp<ROP,F,N>>
( std::array<std::shared_ptr<HighLevelOpBase<ROP>>,N>({a.op(), as.op()...}) ) );
}
template <class ROP> template <class ROP>
template <class... Indices> template <class... Indices>
HighLevelOpHolder<ROP>& HighLevelOpHolder<ROP>::xassign(const HighLevelOpHolder& in, HighLevelOpHolder<ROP>& HighLevelOpHolder<ROP>::xassign(const HighLevelOpHolder& in,

View file

@ -155,6 +155,7 @@ namespace MultiArrayTools
HighLevelOpHolder operator-(const HighLevelOpHolder& in) const; HighLevelOpHolder operator-(const HighLevelOpHolder& in) const;
HighLevelOpHolder operator/(const HighLevelOpHolder& in) const; HighLevelOpHolder operator/(const HighLevelOpHolder& in) const;
template <class... Indices> template <class... Indices>
HighLevelOpHolder& xassign(const HighLevelOpHolder& in, HighLevelOpHolder& xassign(const HighLevelOpHolder& in,
const std::shared_ptr<DynamicIndex>& di, const std::shared_ptr<DynamicIndex>& di,
@ -171,6 +172,9 @@ namespace MultiArrayTools
const std::shared_ptr<Indices>&... inds); const std::shared_ptr<Indices>&... inds);
}; };
template <class F, class ROP, class... ROPs>
HighLevelOpHolder<ROP> mkSFunc(const HighLevelOpHolder<ROP>& a, const HighLevelOpHolder<ROPs>&... as);
template <class ROP> template <class ROP>
HighLevelOpHolder<ROP> mkHLO(const ROP& op); HighLevelOpHolder<ROP> mkHLO(const ROP& op);