[multi_array] Slices along the N'th dimension of a multi_array in a generic function

I have a generic function which will take in a boost::multi_array of
dimension size N. I need to take slices along the M'th < N dimension (known
at compile time). I can't figure out how to do this with the multi_array
library and associated ranges/array_views. Is there another way to do this
rather than building a boost::indices object directly? Besides the sliced
dimension, I will always want the entire ranges for the other ones.
I believe the problem is that the index_gen object needs different types as
we build the indices in parts. The following code shows what a hardcoded
example would look like for N = 4 and M = 3
const std::size_t n_1 = 3;
const std::size_t n_2 = 4;
const std::size_t n_3 = 5;
const std::size_t n_4 = 6;
typedef boost::multi_array

On Jun 24, 1:54 pm, Jesse Perla
I believe the problem is that the index_gen object needs different types as we build the indices in parts. The following code shows what a hardcoded example would look like for N = 4 and M = 3
Sorry to answer my own question, but I poked around in the code and
found that the member data is public. The following seems to solve my
problem (though I would still love suggestions on if it is the best
way to tackle this problem with multi_array):
boost::multi_array
participants (2)
-
Jesse Perla
-
jp