Matlab is a tool for doing numerical computations with matrices and vectors.
![](https://secure.gravatar.com/avatar/b24e93182e89a519546baa7bafe054ed.jpg?s=120&d=mm&r=g)
The subject line is from http://www.math.utah.edu/lab/ms/matlab/matlab.html I've seen little use of the words "matrix" or "vector" in the numarray stuff. These are one or two dimensional structures. The Numeric/numarray focus is on multidimensional arrays. Some years ago, Huaiyu Zhu made a number of postings advocating the introduction of a Python-based system permitting the usual matrix operations. It seems that the culmination of these efforts was Matpy (http://matpy.sourceforge.net/), which is not currently active. I was impressed with the case made by Huaiyu Zhu and have attempted to carry on in this direction. An outline of this work is at: http://www3.sympatico.ca/cjw/IntroToPyMatrix.pdf. This work was based on numarray, partly because it was generally considered to be the way ahead and partly because it purported to provide a class structure. numarray has proved to be a bit of a moving target. I am continuing this work in the hope that some class-based structures will come out of the current Numeric3 discussions. The hope is also that there is a need out there for matrix operations, as distinct from array operations. Colin W.
![](https://secure.gravatar.com/avatar/4d021a1d1319f36ad861ebef0eb5ba44.jpg?s=120&d=mm&r=g)
The Numeric/numarray focus is on multidimensional arrays.
Some years ago, Huaiyu Zhu made a number of postings advocating the introduction of a Python-based system permitting the usual matrix operations. It seems that the culmination of these
efforts was Matpy (http://matpy.sourceforge.net/), which is not currently active.
I remember his work. I really liked many of his suggestions, though it took him a while to recognize that a Matrix class has been distributed with Numeric from very early on. Yes, it needed work, and a few of his ideas were picked up on and included in Numeric's Matrix object. I would like to see a standard Matrix class (along with the record-array class) also be included with the universal array. By the way, I've been calling the array object uarray in the PEP (kind of parallel to ufunc), but if others have better alternatives, I'm certainly not against them. The problem with array is that it is taken by the arraymodule, which I don't want to try and replace at this point (I don't want to worry about backward compatibility with it...). I also like the name ndarray though. I haven't heard what others think. -Travis
![](https://secure.gravatar.com/avatar/b24e93182e89a519546baa7bafe054ed.jpg?s=120&d=mm&r=g)
Travis Oliphant wrote:
The Numeric/numarray focus is on multidimensional arrays.
Some years ago, Huaiyu Zhu made a number of postings advocating the introduction of a Python-based system permitting the usual matrix operations. It seems that the culmination of these
efforts was Matpy (http://matpy.sourceforge.net/), which is not currently active.
I remember his work. I really liked many of his suggestions, though it took him a while to recognize that a Matrix class has been distributed with Numeric from very early on.
numpy.pdf dated 03-07-18 has "For those users, the Matrix class provides a more intuitive interface. We defer discussion of the Matrix class until later." Page 51 of that document has: "Subclassing Subclassing Numeric arrays is not possible due to a limitation of Python. The approach taken in the Masked Array facility (“Masked Arrays” on page 97) is one answer. UserArray.py, described below, can be subclassed, but this is often unsatisfactory unless you put in a similar effort to that in MA." On the same page there is: "Matrix.py The Matrix.py python module defines a class Matrix which is a subclass of UserArray. The only differences between Matrix instances and UserArray instances is that the * operator on Matrix performs a matrix multiplication, as opposed to element-wise multiplication, and that the power operator ** is disallowed for Matrix instances." In view of the above, I can understand why Huaiyu Zhu took a while. His proposal was much more ambitious. Yes, I know that the power operator is implemented and that there is a random matrix but I hope that some attention is given to the functionality PyMatrix. I recognize that the implementation has some weakneses.
Yes, it needed work, and a few of his ideas were picked up on and included in Numeric's Matrix object.
I suggest that this overstates what was picked up.
I would like to see a standard Matrix class (along with the record-array class) also be included with the universal array.
Good, on both scores. I hope that the PEP will set out these ideas. Colin W.
![](https://secure.gravatar.com/avatar/4d021a1d1319f36ad861ebef0eb5ba44.jpg?s=120&d=mm&r=g)
I remember his work. I really liked many of his suggestions, though it took him a while to recognize that a Matrix class has been distributed with Numeric from very early on.
numpy.pdf dated 03-07-18 has
"For those users, the Matrix class provides a more intuitive interface. We defer discussion of the Matrix class until later."
[snip]
On the same page there is:
"Matrix.py The Matrix.py python module defines a class Matrix which is a subclass of UserArray. The only differences between Matrix instances and UserArray instances is that the * operator on Matrix performs a matrix multiplication, as opposed to element-wise multiplication, and that the power operator ** is disallowed for Matrix instances."
In view of the above, I can understand why Huaiyu Zhu took a while. His proposal was much more ambitious.
There is always a lag between documentation and implementation. I would be interested to understand what "more ambitious" elements are still not in Numeric's Matrix object (besides the addition of a language operator of course).
Yes, I know that the power operator is implemented and that there is a random matrix but I hope that some attention is given to the functionality PyMatrix. I recognize that the implementation has some weakneses.
Which aspects are you most interested in? I would be happy if you would consider placing something like PyMatrix under scipy_core instead of developing it separately.
Yes, it needed work, and a few of his ideas were picked up on and included in Numeric's Matrix object.
I suggest that this overstates what was picked up.
I disagree. I was the one who picked them up and I spent a bit of time doing it. I implemented the power method, the ability to build matrices in blocks, the string processing for building matrices, and a lot of the special attribute names for transpose, hermitian transpose, and so forth. There may be some attributes that weren't picked up, and a discussion of which attributes are most important is warranted.
Good, on both scores. I hope that the PEP will set out these ideas.
You are probably in a better position time-wise to outline what you think belongs in a Matrix class. I look forward to borrowing your ideas for inclusion in scipy_core. -Travis
![](https://secure.gravatar.com/avatar/b24e93182e89a519546baa7bafe054ed.jpg?s=120&d=mm&r=g)
Travis Oliphant wrote:
I remember his work. I really liked many of his suggestions, though it took him a while to recognize that a Matrix class has been distributed with Numeric from very early on.
numpy.pdf dated 03-07-18 has
"For those users, the Matrix class provides a more intuitive interface. We defer discussion of the Matrix class until later."
[snip]
On the same page there is:
"Matrix.py The Matrix.py python module defines a class Matrix which is a subclass of UserArray. The only differences between Matrix instances and UserArray instances is that the * operator on Matrix performs a matrix multiplication, as opposed to element-wise multiplication, and that the power operator ** is disallowed for Matrix instances."
In view of the above, I can understand why Huaiyu Zhu took a while. His proposal was much more ambitious.
There is always a lag between documentation and implementation. I would be interested to understand what "more ambitious" elements are still not in Numeric's Matrix object (besides the addition of a language operator of course).
Yes, I know that the power operator is implemented and that there is a random matrix but I hope that some attention is given to the functionality PyMatrix. I recognize that the implementation has some weakneses.
Which aspects are you most interested in? I would be happy if you would consider placing something like PyMatrix under scipy_core instead of developing it separately.
Yes, after the dust of the current activity settles, I would certainly be interested in exploring this although I would see a closer association with Numeric3 than with scipy.
Yes, it needed work, and a few of his ideas were picked up on and included in Numeric's Matrix object.
I suggest that this overstates what was picked up.
I disagree. I was the one who picked them up and I spent a bit of time doing it. I implemented the power method, the ability to build matrices in blocks, the string processing for building matrices, and a lot of the special attribute names for transpose, hermitian transpose, and so forth. There may be some attributes that weren't picked up, and a discussion of which attributes are most important is warranted.
Good, on both scores. I hope that the PEP will set out these ideas.
You are probably in a better position time-wise to outline what you think belongs in a Matrix class. I look forward to borrowing your ideas for inclusion in scipy_core.
My thoughts are largely in the current implementation of PyMatrix. Below is an extract from the most recent announcement. I propose to explore the changes needed to use Numeric3 with the new ufuncs. Do you have any feel for when Alpha binary versions will likely be available? Colin W. ------------------------------------------------------------------------ Downloads in the form of a Windows Installer (Inno) and a zip file are available at: http://www3.sympatico.ca/cjw/PyMatrix An /Introduction to PyMatrix/ is available: http://www3.sympatico.ca/cjw/PyMatrix/IntroToPyMatrix.pdf Information on the functions and methods of the matrix module is given at: http://www3.sympatico.ca/cjw/PyMatrix/Doc/matrix-summary.html
![](https://secure.gravatar.com/avatar/39916bae984cb93b797efd2b175f59c0.jpg?s=120&d=mm&r=g)
On Sun, 20 Feb 2005, "Colin J. Williams" apparently wrote:
The hope is also that there is a need out there for matrix operations, as distinct from array operations.
Absolutely. I use Numeric's Matrix class all the time (and long for additional functionality). I am uncertain why numarray did not adopt most of this class (especially its attribute list). Cheers, Alan Isaac
participants (3)
-
Alan G Isaac
-
Colin J. Williams
-
Travis Oliphant