Random access view in boost::multi_array
- by linai
Here is a boost example:
typedef boost::multi_array<double, 1> array_type;
typedef array_type::index index;
array_type A(boost::extents[100]);
for(index i = 0; i != A.size(); ++i) {
A[i] = (double)i;
}
// creating view
array_type::index_gen indices;
typedef boost::multi_array_types::index_range range;
…