Path: utzoo!attcan!uunet!husc6!mailrus!uflorida!novavax!hcx1!hcx2!dougs From: dougs@hcx2.SSD.HARRIS.COM Newsgroups: comp.lang.misc Subject: Re: Row/Column Major Definition and His Message-ID: <44600002@hcx2> Date: 6 Sep 88 12:31:00 GMT References: <16512@apple.Apple.COM> Lines: 25 Nf-ID: #R:apple.Apple.COM:16512:hcx2:44600002:000:860 Nf-From: hcx2.SSD.HARRIS.COM!dougs Sep 6 08:31:00 1988 Row and/or column major refers to the way the arrays are stored in memory. This is only relevant for 2D or greater dimensioned arrays. Row major means that as you move through *sequentially addressed* memory locations, the right-most subscript of an array reference will increase fastest. Column major means the left-most subscript varies fastest. When you dealt with graphs or arrays in school, the most usual way for you to envision them was probably row-major. a(1,1..4) 5 6 7 8 a(2,1..4) 6 1 8 0 a(3,1..4) 2 8 4 7 ... It is interesting to note that almost all languages have array accessing defined as row-major (C, Pascal, blah-blah-blah) but FORTRAN is column major. Why? .... Douglas G. Scofield dougs@hcx2.ssd.harris.com Harris Computer Systems Division 2101 W. Cypress Creek Rd. Ft. Lauderdale, FL 33069