Hi
I'm having a problem with the boost/multi_array and I'm hoping someone here
can help, or at least explain why the following doesn't work.
The problem: I have a multi_array of ints that I want to be able to view as
being either row major or column major to simplify a number algorithms. I
don't want to change the internal representation of the array (the default
c++ row major storage layout is fine), I just want to be able to interchange
the indexing order from array[row][col] to array[col][row] for the same
multi_array.
To do so, I attempted to define 2 array_views of the same multi_array with
different stride values, like this:
#include <iostream>
using namespace std;
#include
On 8/22/07, chris dion
Hi
I'm having a problem with the boost/multi_array and I'm hoping someone here can help, or at least explain why the following doesn't work.
What you are trying is not possible with the views (from your code it seems
you misunderstood the way they work - take a second look at the docs
herehttp://www.boost.org/libs/multi_array/doc/user.html#sec_views).
You can solve your problem with a multi_array_ref and a different storage
ordering. Here is an example:
using namespace boost;
typedef multi_array
participants (2)
-
chris dion
-
Server Levent Yilmaz