|
Boost Users : |
From: Sohail Somani (s.somani_at_[hidden])
Date: 2005-06-20 18:25:06
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.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net