Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucla-cs!ucla-seas!pantheon!willing From: willing@pantheon.seas.ucla.edu (Scott Willingham) Newsgroups: comp.lang.c Subject: Re: Column-wise data storage for matrices in C, any advantage(s)? Keywords: store data in rows/columns, memory traffic, gaxpy rich Message-ID: <1748@lee.SEAS.UCLA.EDU> Date: 2 Feb 91 03:03:58 GMT References: <1991Feb1.214342.4982@portia.Stanford.EDU> Sender: news@SEAS.UCLA.EDU Distribution: na Organization: University of California at Los Angeles, EE dept. Lines: 16 In article <1991Feb1.214342.4982@portia.Stanford.EDU> fangchin@elaine46.stanford.edu (Chin Fang) writes: >... >Now, note that this algorithm requires most rapid changes in indixing occuring >in COLUMNS, not rows! > >I believe in default C design, data is stored in rows (discussed in K&R II) >instead in columns. It is almost very common these days people use >array of pointers to array as a way to simulate 2d matrices so that ... It seems to me that this is just a matter of syntax. Whether you assign the first or second _index_ of a C array to correspond to a matrix row or column is arbitrary. You just must be consistent in your usage throughout the algorithm. -- Scott D. Willingham