From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3990 invoked by alias); 18 Sep 2009 03:51:37 -0000 Received: (qmail 3982 invoked by uid 22791); 18 Sep 2009 03:51:36 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from web110501.mail.gq1.yahoo.com (HELO web110501.mail.gq1.yahoo.com) (67.195.8.249) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Fri, 18 Sep 2009 03:51:32 +0000 Received: (qmail 45500 invoked by uid 60001); 18 Sep 2009 03:51:30 -0000 Message-ID: <868201.45309.qm@web110501.mail.gq1.yahoo.com> Received: from [24.185.43.112] by web110501.mail.gq1.yahoo.com via HTTP; Thu, 17 Sep 2009 20:51:30 PDT Date: Fri, 18 Sep 2009 03:51:00 -0000 From: Z F Subject: column-major To: GSL Discuss Mailing List In-Reply-To: <1253062217.23092.973.camel@manticore.lanl.gov> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gsl-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sourceware.org X-SW-Source: 2009-q3/txt/msg00055.txt.bz2 --- On Tue, 9/15/09, Gerard Jungman 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