|
Boost Users : |
Subject: [Boost-users] [multi_array] deduce logical shape of "parent" multi_array from view
From: alfC (alfredo.correa_at_[hidden])
Date: 2010-01-29 03:03:25
Hi, I am programming and adaptor of the HDF5 library to handle, to
some extend, multi_arrays in an elegant way.
It turns out that when I try to save a multi_array_view, with strides
and offsets, etc. HD5F still needs to know the logical size (shape) of
the parent array (the one that has contiguous elements in memory). The
paradox is that in order to save an array view I need to know the
original array.
The question is, is there an (elegant) way to reconstruct the shape of
the original array just from the multi_array_view.
For moments it seems imposible because array_view doesn't know even
the dimensionality of the "parent" array (or it does?).
The task is further complicated because many members that may have
this information are actually private or protected within
multi_array_view.
This is an example of what I want:
multi_array<2> A(extents[10][10]);
multi_array_view<1> Aview = A[3][indeces[range(0,10,2)]];
desired_function(Aview); --> returns 10, 10.
Thanks,
Alfredo
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net