[PYTHON MATRIX-SIG] Functions and names

Konrad HINSEN hinsenk@ere.umontreal.ca
Thu, 7 Mar 1996 19:08:08 -0500


> 
> I finally got time to take a look at Konrad's memo about functions
> and names for the matrix class. I have no objection to it.
> Except, I still want to be able to distinguish those actions which 
> modify self and those which return a new array, so that 

In my proposal there are no operations that modify an array.  I am not
sure they are needed at all. You can change elements by assignment
with indexing, and you can assign to shape.  In-place transposition is
not essential, because transposition returns a reference anyway (which
I discovered only today; I'll update my proposal to make this behaviour
optional, as for reshape()). I'd like to establish the principle that
with exception of indexing, no operation returns a reference by default.
Making a copy leads to fewer surprises and is therefore the better
default option.

In-place operations are more important for add-on packages like
linear algebra, and I agree that the naming scheme should make
the distinction clear. For example, one could have invert(m)
and inverse(m). But for other operations the choice is less
clear, e.g. for singular value decomposition.

-------------------------------------------------------------------------------
Konrad Hinsen                     | E-Mail: hinsenk@ere.umontreal.ca
Departement de chimie             | Tel.: +1-514-343-6111 ext. 3953
Universite de Montreal            | Fax:  +1-514-343-7586
C.P. 6128, succ. Centre-Ville     | Deutsch/Esperanto/English/Nederlands/
Montreal (QC) H3C 3J7             | Francais (phase experimentale)
-------------------------------------------------------------------------------

=================
MATRIX-SIG  - SIG on Matrix Math for Python

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