[MATRIX-SIG] Matrix class (obviously)

Konrad Hinsen hinsen@ibs.ibs.fr
Mon, 10 Nov 1997 10:01:03 +0100


> Not to start a food fight, Konrad, but to anyone used to using any of the
> major linear solver packages, NOT solving the system in place would violate
> the principal of least surprise.

True, but not everyone is used to these packages, and other high-level
tools (e.g. Matlab) don't destroy the input data either. Besides, side
effects can be much worse in NumPy - the array data space being
overwritten might have been used by several array objects! Anyway, the
long-term goal should be to have both options.

> I can certainly code up an LU in Python + Numerical as an example. Wouldn't
> match the speed of a C version but it might not be too terrible for a big
> enough system. And, I could show how to package such things in a proper OO
> fashion. I'll assign this to myself as homework.

Speaking about OO... There isn't much of it in the current NumPy
version - there's the array object, and everything else is just a bunch
of functions. For good reasons, as those who participated in the early
discussions may remember.

Still it would be worthwhile to continue with the original idea of
providing a full-featured matrix class on top of the basic arrays.
All the linear algebra operations could be fitted in there in a much
nicer way.

And since I am in "dream mode" anyway, let's continue. How would one
best implement something like that? A complete Python wrapper eats
some efficiency, and makes it difficult to implement individual
methods in C. But there's Jim Fulton's ExtensionClass module. If NumPy
arrays were such an extension class, the basic matrix object (with C
methods) could be a C subclass of arrays, and the "final" matrix
object a Python subclass, adding the methods that can easily be
written in Python.

So just in case someone is looking for a nice side project to kill
some spare time...
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                          | E-Mail: hinsen@ibs.ibs.fr
Laboratoire de Dynamique Moleculaire   | Tel.: +33-4.76.88.99.28
Institut de Biologie Structurale       | Fax:  +33-4.76.88.54.94
41, av. des Martyrs                    | Deutsch/Esperanto/English/
38027 Grenoble Cedex 1, France         | Nederlands/Francais
-------------------------------------------------------------------------------

_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________