This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
row major order versus column major order
- To: gsl-discuss at sources dot redhat dot com
- Subject: row major order versus column major order
- From: "E. Robert Tisdale" <edwin at netwood dot net>
- Date: Thu, 20 Jul 2000 20:23:40 +0000
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;-)