Merge branch 'restructure-rename' of rqcd.ur.de:czimmermann/multi_array into restructure-rename

This commit is contained in:
Christian Zimmermann 2021-06-26 00:41:33 +02:00
commit 9946a8d416

View file

@ -588,24 +588,10 @@ namespace MultiArrayTools
return this->template asx<IPlus<T>>(in,i); return this->template asx<IPlus<T>>(in,i);
} }
template <bool VABLE = false> template <bool VABLE, template <typename> class F, typename TarOp, class OpClass>
struct VExec inline void vexec(TarOp& th, const OpClass& in)
{
template <template <typename> class F, typename TarOp, class OpClass>
static inline void exec(TarOp& th, const OpClass& in)
{
typedef typename TarOp::value_type T;
IAccess<T,F<T>> tmp;
th.template asx<decltype(tmp)>(in)();
}
};
template <>
struct VExec<true>
{
template <template <typename> class F, typename TarOp, class OpClass>
static inline void exec(TarOp& th, const OpClass& in)
{ {
if constexpr(VABLE){
CHECK; CHECK;
typedef typename TarOp::value_type T; typedef typename TarOp::value_type T;
auto x = th.template asx<IVAccess<T,F<T>>>(in); auto x = th.template asx<IVAccess<T,F<T>>>(in);
@ -618,13 +604,18 @@ namespace MultiArrayTools
th.template asx<IAccess<T,F<T>>>(in)(); th.template asx<IAccess<T,F<T>>>(in)();
} }
} }
}; else {
typedef typename TarOp::value_type T;
IAccess<T,F<T>> tmp;
th.template asx<decltype(tmp)>(in)();
}
}
template <typename T, class... Ranges> template <typename T, class... Ranges>
template <class OpClass> template <class OpClass>
OperationRoot<T,Ranges...>& OperationRoot<T,Ranges...>::operator=(const OpClass& in) OperationRoot<T,Ranges...>& OperationRoot<T,Ranges...>::operator=(const OpClass& in)
{ {
VExec<OpClass::VABLE>::template exec<identity>(*this,in); vexec<OpClass::VABLE,identity>(*this,in);
return *this; return *this;
} }
@ -632,7 +623,7 @@ namespace MultiArrayTools
template <class OpClass> template <class OpClass>
OperationRoot<T,Ranges...>& OperationRoot<T,Ranges...>::operator+=(const OpClass& in) OperationRoot<T,Ranges...>& OperationRoot<T,Ranges...>::operator+=(const OpClass& in)
{ {
VExec<OpClass::VABLE>::template exec<xxxplus>(*this,in); vexec<OpClass::VABLE,xxxplus>(*this,in);
return *this; return *this;
} }
@ -803,7 +794,7 @@ namespace MultiArrayTools
template <class OpClass> template <class OpClass>
ParallelOperationRoot<T,Ranges...>& ParallelOperationRoot<T,Ranges...>::operator=(const OpClass& in) ParallelOperationRoot<T,Ranges...>& ParallelOperationRoot<T,Ranges...>::operator=(const OpClass& in)
{ {
VExec<OpClass::VABLE>::template exec<identity>(*this,in); vexec<OpClass::VABLE,identity>(*this,in);
return *this; return *this;
} }
@ -811,7 +802,7 @@ namespace MultiArrayTools
template <class OpClass> template <class OpClass>
ParallelOperationRoot<T,Ranges...>& ParallelOperationRoot<T,Ranges...>::operator+=(const OpClass& in) ParallelOperationRoot<T,Ranges...>& ParallelOperationRoot<T,Ranges...>::operator+=(const OpClass& in)
{ {
VExec<OpClass::VABLE>::template exec<xxxplus>(*this,in); vexec<OpClass::VABLE,xxxplus>(*this,in);
return *this; return *this;
} }