Re: [Boost-users] Reusing indexing base from multi_array_ref

20 Jun
2005
20 Jun
'05
11:25 p.m.
I should be slightly more careful, version without accesses below: #include <boost/multi_array.hpp> int main() { typedef boost::multi_array<double, 2> array_type; typedef boost::multi_array_ref<double,2> array_type_ref; typedef array_type::index_range range; typedef boost::multi_array_types::extent_range extent_range; array_type A(boost::extents[extent_range(1,4)][extent_range(1,10)]); // [1,4),[1,10) A[3][9]=95; array_type::array_view<1>::type f = A[boost::indices[range()][9]]; assert(f[2]==A[3][9]); // Would like to have assert(f[3]==A[3][9]). f.reindex(1); assert(f[3]==A[3][9]); // Do I *have* to reindex in this way? } Thanks.
7278
Age (days ago)
7278
Last active (days ago)
0 comments
1 participants
participants (1)
-
Sohail Somani