[Numpy-discussion] arrays are column-wise or row-wise?

Charles R Harris charlesr.harris at gmail.com
Tue Mar 28 09:21:10 CST 2006


Hi Brian,

On 3/28/06, Brian Blais <bblais at bryant.edu> wrote:
>
> Francesc Altet wrote:
> >
> > Nope. C arrangement of values is row-wise and Fortran is column-wise.
> > You are seeing row-wise ordering, so everything behaves as it should.
> >
>
> interesting.  I am coming from Matlab, where things are definitely
> column-wise
> organized.  I always assumed this was the C standard, but now that I think
> of it the
> C double array [][] is row-wise.


Matlab was originally written in Fortran by Cleve Moler as an easy to use
interface to LINPACK and EISPACK. If you google around you can probably find
the original free Fortran version out on the net somewhere. Matlab was
rewritten in C when John Little and Cleve Moler founded MathWorks but I
imagine the new version still called many Fortran subroutines for the heavy
lifting . You can find many other Fortran traces in Matlab. For instance,
Matlab array indices start at 1 in the traditional Fortran way.

On a side note, I believe that John Little's parents moved into the house
that my family built in Lincoln, MA.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20060328/09d6829f/attachment-0001.html 


More information about the Numpy-discussion mailing list