[Bf-committers] Change Representation and Initialisation of Matrices to Conform with Standard Notation

Domino Marama domino at dominodesigns.info
Fri Dec 9 14:27:07 CET 2011


On Fri, 2011-12-09 at 23:57 +1100, Andrew Hale wrote:
> Also, note that MatLab stores arrays in column major format but still uses
> matrix[row, column] for indexing entries.

numpy also uses row, column indexing

http://docs.scipy.org/doc/numpy/reference/generated/numpy.matrix.html

>>> import numpy
>>> m = numpy.matrix("1 2; 3 4; 5 6")
>>> m
matrix([[1, 2],
        [3, 4],
        [5, 6]])
>>> m[0]
matrix([[1, 2]])
>>> m[0,1]
2

This is the order I'd expect for any matrix implementation without
reading any docs too..




More information about the Bf-committers mailing list