[Numpy-discussion] inverting and calculating eigenvalues for many small matrices

Daniel Wheeler daniel.wheeler2 at gmail.com
Tue Jul 12 12:23:19 EDT 2011


On Tue, Jul 12, 2011 at 11:19 AM, Sturla Molden <sturla at molden.no> wrote:
> Den 11.07.2011 23:01, skrev Daniel Wheeler:
> To make the loop over N matrices fast, there is nothing that beats a
> loop in C or Fortran (or Cython) if you have a 3D array. And that brings
> us to the second issue, which is that it would be nice if the solvers in
> numpy.linalg (and scipy.linalg) were vectorized for 3D arrays.

Amen.

> Another question is if you really need to compute the inverse. A matrix
> inversion and subsequent matrix multiplication can be replaced by
> solving a linear system, which only takes half the amount of computation.

Good idea. One possibility for avoiding cython for the inverse is to
populate a sparse matrix in pysparse (or scipy) with the small
matrices and then linear solve as I don't need the explicit inverse.
However, that doesn't help with the eigenvalues.

-- 
Daniel Wheeler



More information about the NumPy-Discussion mailing list