MultiArray - issue with views and striding.
Can anyone help shed light on the following?
Suppose I have a 1d-array of size 10 (index base is 0). If I create a view
on [0,10), strided by 3, shouldn't the size of the result be 4,
corresponding to indices 0, 3, 6 and 9? Instead I get 3.
Please forgive me if I'm off the mark here, as I'm new to boost in general
and
MultiArray in particular.
The relevant line (assuming len => size) in boost/multi_array/base.hpp seems
to be
index len = (finish - start) / index_factor;
(boost::detail::multi_array::multi_array_impl_base<>::generate_array_view()
line 427).
I would have written
index len = 1 + (finish - 1 - start) / index_factor;
The following code sample should make all clear. Any clarification greatly
appreciated.
Cheers,
Ben
typedef boost::multi_array
participants (1)
-
Nasatyr, Ben (London)