Discussion: new operators for numerical computation
Konrad Hinsen
hinsen at cnrs-orleans.fr
Thu Jul 20 12:18:38 EDT 2000
Gregory Lielens <gregory.lielens at fft.be> writes:
> For Nd arrays, there is indeed more possibilities, and I fear adressing
> all of them could be too much to ask to "simple" infix operators....
> I propose to extend the meaning of the matrix multiply to Nd arrays as
> a=b at c <=> a(i1,...,in,j1,...,jm) = b(i1,...,in,k) * c(k,j1,...,jm)
That is indeed the most common generalization, and it also covers
the vector dot product when 1d arrays are used. In fact, this is what
the function Numeric.dot() implements!
> imho Division (right and left) belongs to pure matrices, and can not
> really be generalized
> I feel that way because I am not aware of a well defined inverse for a
> Nd array ...(should someone be interrested in this I could post a
> discussion I had with Travis Oliphant, from NumPy group)
You can always define a suitable inverse as long as it reduces to the
standard matrix inverse for square 2d arrays. However, there is hardly
any point in doing so without having a motivation to define such
inverses. I am not aware of any useful definitions either. The most
general kind of inverse I know is the pseudo-inverse (also known as
generalized inverse or Moore-Penrose inverse) which covers all 2d
matrices and reduces to the matrix inverse for the case of a square
and non-singular matrix. It is implemented in NumPy by
LinearAlgebra.generalized_inverse().
--
-------------------------------------------------------------------------------
Konrad Hinsen | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.55.69
Rue Charles Sadron | Fax: +33-2.38.63.15.17
45071 Orleans Cedex 2 | Deutsch/Esperanto/English/
France | Nederlands/Francais
-------------------------------------------------------------------------------
More information about the Python-list
mailing list