This is the mail archive of the gsl-discuss@sourceware.org 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]
Other format: [Raw text]

column-major



--- On Tue, 9/15/09, Gerard Jungman <jungman@lanl.gov> wrote:

> We need to simply allow for the existence of the
> column-major
> world. It's only fair. And it's a simple variation to
> encode
> in any of our data structures.
> 
> Every serious C++ vector/matrix library allows for both
> column-major
> and row-major layout, because they know people need it.
> Templates, or
> other gymnastics, are not required. You just have to decide
> that you
> want it.
> 
>

Could someone, please, explain to me the difference between
column and row major data storage.

I understand it that a multi-dim data is stored in a memory block
which is accessed via

A[i,j,k] = (k*Nj+j)*Ni+i
A[i,j,k] = (i*Nj+j)*Nk+k

Is this correct? or there is more to it? which is which?
If this is correct, what is the big deal with this?
Package which supports one, supports the other automatically.
Left multiplication becomes right multiplication and vice versa. Am I wrong?

Thanks

ZF


      


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