[Numpy-discussion] Re : Array of matrices - Inverse and dot

josef.pktd@gmai... josef.pktd@gmai...
Mon Jan 26 09:47:23 CST 2009

On Mon, Jan 26, 2009 at 10:25 AM, Jean-Baptiste Rudant
<boogaloojb@yahoo.fr> wrote:
> Thank you, but my example was bad. I have to deal with matrices which can be
> 100*100.
> ________________________________
> De : David Cournapeau <cournape@gmail.com>
> À : Discussion of Numerical Python <numpy-discussion@scipy.org>
> Envoyé le : Lundi, 26 Janvier 2009, 16h18mn 33s
> Objet : Re: [Numpy-discussion] Array of matrices - Inverse and dot
> On Mon, Jan 26, 2009 at 11:59 PM, Jean-Baptiste Rudant
> <boogaloojb@yahoo.fr> wrote:
>> Hello,
>> I would like to operate in an easy and efficient way (without python
>> loop) with arrays of matrices.
>> Suppose a and b are some arrays of N1*N2 matrices of size 3*3, I would
>> like
>> to calculate  inv_a and dot_ab, which would be arrays of N1*N2
>>  (3*3)-matrices, such as :
> If you only care about 3*3 matrices, I would consider using
> "developed" formula of a 3x3 matrix inverse coded in numpy. numpy.inv
> will be quite slow for such small matrices anyway (all the machinery
> to call the underlying C code being almost certainly the bottleneck).
> David

There is numpy.tensordot and numpy.tensorinv which looks like it might
be doing what you want, but I never used it.


More information about the Numpy-discussion mailing list