From e80c71aa620ce528b75fd6f63e0fb876d96ee44e Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Thu, 1 Jul 2021 01:51:10 +0200 Subject: [PATCH] multi_array_operation: member access class for array-type members -> sub operations... --- src/include/multi_array_operation.cc.h | 1 + src/include/multi_array_operation.h | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/include/multi_array_operation.cc.h b/src/include/multi_array_operation.cc.h index e3b8161..99ce205 100644 --- a/src/include/multi_array_operation.cc.h +++ b/src/include/multi_array_operation.cc.h @@ -170,6 +170,7 @@ namespace MultiArrayTools { ExtType last = rootSteps(); last.zero(); + // TODO: ask MA container for data (ptr)!!! IOp::f(mDataPtr,opIndexResolve(start,last),mSec,last.next()); } diff --git a/src/include/multi_array_operation.h b/src/include/multi_array_operation.h index 01126f6..d90cbf7 100644 --- a/src/include/multi_array_operation.h +++ b/src/include/multi_array_operation.h @@ -145,9 +145,32 @@ namespace MultiArrayTools template using VFunc = decltype(mkVFunc(std::declval())); + + template + class OpAccess + { + private: + std::tuple...> mInds; + + public: + static constexpr bool ISSTATIC = false; + + template + inline void operator()(T*& t, size_t pos, const Op& op, ExtType e) + { + F::selfApply(t[pos](mInds), op.get(e)); // s.th. like that + // TODO for classes related to the r.h.s.: + // forward get(e) to elements returned by get(e) until basic types are reached + // (also same for rootSteps etc...) !!!! + // introduce traits !!!! + // !!!! + } + }; + template struct IAccess { + static constexpr bool ISSTATIC = true; typedef T value_type; typedef T in_type; static constexpr size_t VSIZE = sizeof(value_type) / sizeof(in_type); @@ -162,6 +185,7 @@ namespace MultiArrayTools template struct IVAccess { + static constexpr bool ISSTATIC = true; typedef typename VType::type value_type; typedef T in_type; static constexpr size_t VSIZE = sizeof(value_type) / sizeof(in_type);