[PYTHON MATRIX-SIG] IEEE exceptions, casting, matrix multiplies, and default types

Hinsen Konrad hinsenk@ere.umontreal.ca
Fri, 3 Nov 1995 12:04:24 -0500

   [Note: Matrix_i creates a matrix of ints, Matrix_d creates one of doubles]
   2) Matrix_i(1,2,3) * Matrix_d(1.,2.,3.) == Matrix_d(1.,4.,6.) or raises exception

I see no reason why matrices should have different coercion rules (or
even none at all) than scalar numbers. So the result should be a
float matrix.

   4) add([1,2,3], [4,5,6]) == Matrix_?(5,7,9) where the question is what the  
   ? should be.

The rule should be that first the lists get transformed into matrices
of a certain type, and then addition proceeds using the normal coercion
rules. My suggestion for determining the global type of a list is that
it should be complex if at least one element is complex, else float
if at least one element is float, or otherwise integer.

That of course leaves two of your points as starting points for
extensive ideological fights ;-)

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