[SciPy-Dev] 64-bit sparse matrix indices

Pauli Virtanen pav@iki...
Fri Dec 14 03:37:58 CST 2012


Hi,

I've been looking a bit at making sparse matrices work with 64-bit
indices:

    https://github.com/pv/scipy-work/commits/ticket/1307

The motivation is that 32-bit indices on 64-bit machines don't allow
representing sparse matrices with large nnz.

One option A (currently there) is to allow both int32 and int64 as
indices, and use the larger one only when required by nnz.

The second option B would be to just use intp for everything.

The problem with A is that I'm far from certain that I found all the
corner cases yet, and I'm fairly certain there are some undiscovered
bugs still somewhere. The test suite doesn't yet have the level of
coverage on this issue I'd be comfortable with.

The problem with B is that on 64-bit systems, it it increases the
memory needs of sparse matrices by about 50%. However, as a solution
it's more robust and elegant.

Opinions on how it should work?

    Pauli




More information about the SciPy-Dev mailing list