Hi all,

I have got a very basic question. I noted that when initializing a blitz array as a fortranArray the data get mapped differently. (At least when I print the array with cout it appears so.) I wanted to make sure I understand this correctly and whether the way I deal with it is right. so, questions about the code below:

1) allocating a fortranArray maps preexisting data differently? (it's not an artifact of cout that I see the array differently when I print it)
2) given 1), one needs to order the data accordingly.

Thanks for your help!

#include <iostream>
#include <cstdlib>
#include <blitz/array.h>
using namespace std;
using namespace blitz;

int main(int argc, char *argv[])
// directly allocate an array
Array<double,2> G(2,2);
G = 0.3,0.7,0.4,0.6;
cout << "G = " << endl;
cout << G << endl;

// map an array from existing data
double trans[] = {0.3,0.7,0.4,0.6};
Array<double,2> Gmapped(trans,shape(2,2),neverDeleteData);
cout << "Gmapped = " << endl;
cout << Gmapped << endl;

// map an array from existing data as a fortran array
Array<double,2> Gfort(trans,shape(2,2),neverDeleteData,FortranArray<2>());
cout << "Gfort = " << endl;
cout << Gfort << endl;

cout << "it seems FortranArray maps the data rowwise." << endl;

// reorder data and map an array from existing data as a fortran array
double trans2[] = {0.3,0.4,0.7,0.6};
Array<double,2> Gfort2(trans2,shape(2,2),neverDeleteData,FortranArray<2>());
cout << "Gfort2 = " << endl;
cout << Gfort2 << endl;

return(0) ;