multi_array index_gen or extent_gen store for reuse

Is it possible to store tuples of index or range values (or generators)
for later reuse? Consider the following:
typedef boost::multi_array

Levent wrote:
Is it possible to store tuples of index or range values (or generators) for later reuse? Consider the following:
typedef boost::multi_array
Arr; typedef Arr::index_range Ir; typedef ??? indices; Arr a(boost::extents[3][4][5]); Arr b(a); indices somerange = Arr::index_gen[Ir()][Ir(1,5)][Ir()<2]; b[somerange] = a[somerange]; // and so on What should `???' be?
thanks - Levent
it seems one answer is typedef boost::detail::multi_array::index_gen<3,3> indices; but is there anything as a part of the user interface?

Hi Levent, In this case, '???' should be: Arr::index_gen::gen_type<3,3>::type; gen_type is a type generator for specifying an the result of applying operator[] to an index_gen. It takes two unsigned integral arguments. The first specifies the number of dimensions of the original array (to which operator[] is being applied). The second specifies the number of dimensions in the resulting view. Hope this helps, ron On May 6, 2006, at 6:33 PM, Levent wrote:
Is it possible to store tuples of index or range values (or generators) for later reuse? Consider the following:
typedef boost::multi_array
Arr; typedef Arr::index_range Ir; typedef ??? indices; Arr a(boost::extents[3][4][5]); Arr b(a); indices somerange = Arr::index_gen[Ir()][Ir(1,5)][Ir()<2]; b[somerange] = a[somerange]; // and so on What should `???' be?
thanks - Levent
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Levent
-
Ronald Garcia