[SciPy-dev] sparsetools - new and (hopefully) improved!

Robert Cimrman cimrman3 at ntc.zcu.cz
Fri Jan 5 04:44:10 CST 2007

Nathan Bell wrote:
> On 1/4/07, Robert Cimrman <cimrman3 at ntc.zcu.cz> wrote:
>> Hi Nathan, I have not had time to look at your code yet (just returned
>> from holidays) but the description looks great!
>> One umfpack-related note - the solver requires the CSC/CSR column/row
>> indices sorted in ascending order. Does your implementation contain a
>> function to ensure_sorted_indices()?
> Not currently, but it would be trivial to add.  Converting from
> CSR<->CSC (a linear time operation) has the side effect of sorting the
> column/row indices.  Two conversions (CSR->CSC->CSR) would produce the
> desired result in the original format.
> I will add ensure_sorted_indices() to csr_matrix and csc_matrix.

Good! Going CSR->CSC->CSR would be too inefficient, IMHO. Maybe we could 
add a flag to the CSR/CSC matrix class saying that it has sorted indices 
to make the check trivial. It should be added as keyword argument to the 
matrix constructor, too.


More information about the Scipy-dev mailing list