Reusing indexing base from multi_array_ref

20 Jun
2005
20 Jun
'05
11:17 p.m.
Hi, Any comments? #include <iostream> #include <boost/multi_array.hpp> int main() { using std::cout; using std::endl; 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)]); // 3x9 A[4][2]=95; array_type::array_view<1>::type f = A[boost::indices[range()][2]]; assert(f[3]==A[4][2]); // Would like to have assert(f[3]==A[4][2]). f.reindex(1); assert(f[4]==A[4][2]); // Do I *have* to reindex in this way? What if the indexing base gets more complicated? }
7278
Age (days ago)
7278
Last active (days ago)
0 comments
1 participants
participants (1)
-
Sohail Somani