[SciPy-user] sparse stuff in numpy/scipy

Ed Schofield edschofield@gmail....
Sun Jul 1 15:23:34 CDT 2007

On 7/1/07, Bill Baxter <wbaxter@gmail.com> wrote:
> On 7/2/07, Antonino Ingargiola <tritemio@gmail.com> wrote:
> > 2007/7/1, dmitrey <openopt@ukr.net>:
> > > Hi all,
> > > I had heard there are some sparse matrix abilities in scipy (btw don't
> > > you think it's better to store those one in numpy?).
> > > However, neither dir(scipy), nor dir(numpy), nor
> > > http://www.scipy.org/Topical_Software doesn't tell me
> what should I use.
> >
> > Have you tried "import scipy.sparse"?
> ...
> As for scipy.sparse itself, it seems to be in need of some love.  I tried it
> a while back and it seemed that many standard ndarray functions that could
> be implemented simply weren't.  And you can't do any sort of fancy indexing,
> which is often a key part of assembling the system matrix for sparse linear
> systems (like those that arise from FEM or finite differences).

I added some fancy indexing support to lil_matrix and cs{rc}_matrix a
couple of years ago. The code is a nightmare. I couldn't think of a
better way to implement fancy indexing for sparse matrices, and still
can't. In some of the remaining cases my conclusion was that fancy
indexing couldn't be done efficiently at all, and I left these
unimplemented (with, hopefully, some useful error messages) rather
than implementing a slow, nasty algorithm.

But ideas and patches are welcome! ;)

-- Ed

More information about the SciPy-user mailing list