This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

row major order versus column major order


I wrote:

> The only difference between multidimensional Fortran and C arrays
> is the order in which the subscripts appear.
> Fortran multidimensional array subscripts appear in order
> from least to most significant and C multidimensional array subscripts
> appear in reverse order from most to least significant so that
>
>         A(i1, i2, ..., iN) == A[1+iN]...[1+i2][1+i1]

But I should have written

        A(1+i1, 1+i2, ..., 1+iN) == A[iN]...[i2][i1]

or

        A(i1, i2, ..., iN) == A[iN-1]...[i2-1][i1-1]

I can get it right if I try all the different combinations;-)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]