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

Robert Cimrman cimrman3 at ntc.zcu.cz
Fri Jan 5 05:44:10 EST 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.

r.




More information about the SciPy-Dev mailing list