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

Gael Varoquaux gael.varoquaux at normalesup.org
Tue Jul 12 11:30:57 EDT 2011


On Mon, Jul 11, 2011 at 05:01:07PM -0400, Daniel Wheeler wrote:
> Hi, I am trying to find the eigenvalues and eigenvectors as well as
> the inverse for a large number of small matrices. The matrix size
> (MxM) will typically range from 2x2 to 8x8 at most. 

If you really care about speed, for matrices of this size you shouldn't
call a linear algebra pack, but simply precompute the close-form
solution. Here is sympy code that I used a while ago to generate fast
code to do inverse of SPD matrices.

G
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gen_sym_inv.py
Type: text/x-python
Size: 2553 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20110712/26ad33ad/attachment.py>


More information about the NumPy-Discussion mailing list