[MATRIX-SIG] matrix product in NumPy

Konrad Hinsen hinsen@ibs.ibs.fr
Fri, 14 Nov 1997 14:10:56 +0100


> This is a very simple question.
> Given two arrays: a = M x N and b = N x P
> How do I compute:
>  c = ab, such that c = M x P.
> The is the simple matrix product.
> 
> The function Numeric.dot, only seems to work
> for arrays of the same size a = M x N and b = M x N

If you use the latest version of NumPy, then dot() should do
what you want. In earlier versions, dot() calculated the
product between a and the *transpose* of b. The standard
matrix product was calculated by matrixmultiply() and that
function rests for compatibility (but is exactly equal to dot()
now).
-- 
-------------------------------------------------------------------------------
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
_______________