Boost logo

Boost Users :

From: James N. Knight (nate_at_[hidden])
Date: 2004-04-01 20:30:00

I am trying to sort a multi_array along a dimension that is not the last.
In other words, I can sort the rows of a 2D multi_array like so:

  typedef boost::multi_array<double, 2> array_type;
  typedef array_type::iterator iterator2;
  typedef array_type::template subarray<1>::type::iterator iterator1;

  array_type A(boost::extents[10][10]);

  for (iterator2 i = A.begin(); i!=A.end(); ++i){

What I can't seem to do is sort the columns. Is there a way I can create
a view with the dimensions reordered? Or, can I somehow create a strided
iterator that will do the job (select the values in a column)? I would
like to avoid transposing the array. Pointers to the relevant documentation
or suggestions are appreciated.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at