To: Discussion of Numerical Python <numpy-discussion@scipy.org> Message-ID: <CAN06oV9E2Xsf=tGbyqgXpnT4LHAN6TWTbuyi8gAGT-Vg2QAFjQ@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 On Wed, Jul 24, 2013 at 8:53 AM, St?fan van der Walt <stefan@sun.ac.za> wrote:
I agree. During the Numarray period, I developed a Matrix sub-class which provided:On Wed, Jul 24, 2013 at 2:15 AM, Chris Barker - NOAA Federal <chris.barker@noaa.gov> wrote:On Tue, Jul 23, 2013 at 6:09 AM, Pauli Virtanen <pav@iki.fi> wrote:The .H property has been implemented in Numpy matrices and Scipy's sparse matrices for many years.Then we're done. Numpy is an array package, NOT a matrix package, and while you can implement matrix math with arrays (and we do), having quick and easy mnemonics for common matrix math operations (but uncommon general purpose array operations) is not eh job of numpy. That's what the matrix object is for.I would argue that the ship sailed when we added .T already. Most users see no difference between the addition of .T and .H.
# PropertiesI think H was in there too.
A= property(fget= toArray,
doc= 'Deliver the data as an array.')
Adj= property(fget= getAdjoint,
doc= 'Deliver the adjoint matrix.')
Conj= property(fget= getConjugate,
doc= 'Deliver the conjugate of the matrix.')
Diag= property(fget= getDiagonal,
doc= 'Extract the diagonal as a row vector.')
lTri= property(fget= getLTri,
doc= 'Extract the lower triangular matrix, ' +
'ie. elements on and below the diagonal.')
Cond= property(fget= getCond,
doc= 'Deliver the 2-norm Condition number.')
Det= property(fget=getDeterminant,
doc= 'Deliver the determinant.')
EValues= property(fget= getEigenvalues,
doc= 'Deliver the eigenvalues.')
EVectors= property(fget= getEigenvectors,
doc= 'Deliver the eigenvectors.')
I= property(fget= getInverse,
doc= 'Deliver the inverse.')
Imag= property(fget= getImag,
doc= 'Return the imaginary part of the matrix.')
Norm= property(fget= getNorm,
doc= 'To calculate the 2-norm of the matrix.')
Real= property(fget= getReal,
doc= 'Return the real part of the matrix.')
Sqr= property(fget= getSqr,
doc= 'Return the square of each element.')
SVD= property(fget= getSVD,
doc= 'Return S, V, D (Singular Value Decomposition.')
T= property(fget= getTranspose,
doc= 'Deliver the transpose.')
uTri= property(fget= getUTri,
doc= 'Extract the upper triangular matrix, ' +
'ie. elements on and above the diagonal.'
I would argue that, in some sense, it should be promoted. Perhaps it's better as a separate module.The matrix class should probably be deprecated and removed from NumPy in the long run--being a second class citizen not used by the developers themselves is not sustainable. And, now that we have "dot" as a method, there's very little advantage to it.
St?fan
Colin W.