|
Boost Users : |
From: Sohail Somani (s.somani_at_[hidden])
Date: 2005-06-20 18:17:40
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?
}
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