scipy/scipy — pull request #287 by scopatz (2012-08-13 06:50:28+00:00)
Title: Sparse solve(), expm(), and inv()

Some top level linear algebra functions, such as matrix exponentials, for sparse matrices are missing. For small & sparse systems such functions normally end up producing dense results. However, for large & very sparse systems these functions are far more likely to have sparse results as well. It is this use case which is being addressed by this PR.

The goal of this PR was to add expm() - a Pade approximate exponential method - to sparse matrices. However, this involved also writing the sparse equivalent of ``scipy.linalg.solve()``, which solves ``Ax=B`` linear equations where B may be a vector or a matrix. Currently, ``scipy.sparse.linalg.spsolve()`` only solves ``Ax=b`` type equations where b must be a vector.

Incidentally, the inv() method comes along for free by noting that ``A.inv() == solve(A, I)`` where I is the identity matrix.

Tests and docs are included in this PR.