17 Mar
2014
17 Mar
'14
4:54 a.m.
"M.-A. Lemburg" <mal@egenix.com> wrote:
Indeed. Numpy already uses a .T property for this.
Ah, good trick :-)
It is a better trick than you would expect. Matlab and Fortran matrix transpose has complexity O(M*N) for a rank M x N matrix. NumPy's .T attribute has complexity O(1) With Numpy, we can put .T into matrix expressions with impunity. Now THAT is a good trick :-) I am not aware of any other system where memory access is so flexible that matrix transposition can be done in O(1) time. Regards, Sturla