[SciPy-User] Vectorize matrix inversion

Davide Fiocco davide_fiocco at yahoo.it
Mon May 9 06:08:39 EDT 2011


Thanks to all of you!

> (The standard recommendation is "avoid that inv", which is however not
> always avoidable.)

As _most_ of the time I'll be dealing with 2x2xP matrices, I think
I'll stick to something

det = foo[0,0,:]*foo[1,1,:] - foo[1,0,:]*foo[0,1,:]
bar[0,0,:] = foo[1,1,:]/det
bar[0,1,:] = - foo[0,1,:]/det
bar[1,1,:] = foo[0,0,:]/det
bar[1,0,:] = - foo[1,0,:]/det

and change my indexing habit in the meantime.

Thanks again!



More information about the SciPy-User mailing list