[SciPy-Dev] Sparse boolean specification

Pauli Virtanen pav at iki.fi
Mon Apr 22 12:29:36 EDT 2013


22.04.2013 19:08, J.J. Green kirjoitti:
> Pauli Virtanen wrote:
> 
>> The drawback here is that `==`, `<=`, `>=` become somewhat
>> useless for sparse matrices as it tends to produce matrices
>> filled with True. But I think this cannot be helped.
> 
> Can't you then just have a sparse structure which also hold
> the 'empty' value (whether it be true or false), then the 
> non-empty cells are the opposite value.  Thus !a just changed
> the 'empty' value and leaves the matrix structure otherwise
> unchanged ?

Yes, that's one option, but it involves significantly more work,
introducing even more sparse matrix types in addition to the current 6.

-- 
Pauli Virtanen





More information about the SciPy-Dev mailing list