multi_array_operation: member access class for array-type members -> sub operations...
This commit is contained in:
parent
312074c486
commit
e80c71aa62
2 changed files with 25 additions and 0 deletions
|
@ -170,6 +170,7 @@ namespace MultiArrayTools
|
||||||
{
|
{
|
||||||
ExtType last = rootSteps();
|
ExtType last = rootSteps();
|
||||||
last.zero();
|
last.zero();
|
||||||
|
// TODO: ask MA container for data (ptr)!!!
|
||||||
IOp::f(mDataPtr,opIndexResolve<OIA>(start,last),mSec,last.next());
|
IOp::f(mDataPtr,opIndexResolve<OIA>(start,last),mSec,last.next());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -145,9 +145,32 @@ namespace MultiArrayTools
|
||||||
template <class F>
|
template <class F>
|
||||||
using VFunc = decltype(mkVFunc(std::declval<F>()));
|
using VFunc = decltype(mkVFunc(std::declval<F>()));
|
||||||
|
|
||||||
|
|
||||||
|
template <typename T, class F, class... Indices>
|
||||||
|
class OpAccess
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
std::tuple<std::shared_ptr<Indices>...> mInds;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static constexpr bool ISSTATIC = false;
|
||||||
|
|
||||||
|
template <typename Op, class ExtType>
|
||||||
|
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 <typename T, class F>
|
template <typename T, class F>
|
||||||
struct IAccess
|
struct IAccess
|
||||||
{
|
{
|
||||||
|
static constexpr bool ISSTATIC = true;
|
||||||
typedef T value_type;
|
typedef T value_type;
|
||||||
typedef T in_type;
|
typedef T in_type;
|
||||||
static constexpr size_t VSIZE = sizeof(value_type) / sizeof(in_type);
|
static constexpr size_t VSIZE = sizeof(value_type) / sizeof(in_type);
|
||||||
|
@ -162,6 +185,7 @@ namespace MultiArrayTools
|
||||||
template <typename T, class F>
|
template <typename T, class F>
|
||||||
struct IVAccess
|
struct IVAccess
|
||||||
{
|
{
|
||||||
|
static constexpr bool ISSTATIC = true;
|
||||||
typedef typename VType<T>::type value_type;
|
typedef typename VType<T>::type value_type;
|
||||||
typedef T in_type;
|
typedef T in_type;
|
||||||
static constexpr size_t VSIZE = sizeof(value_type) / sizeof(in_type);
|
static constexpr size_t VSIZE = sizeof(value_type) / sizeof(in_type);
|
||||||
|
|
Loading…
Reference in a new issue