[SciPy-dev] new sparsetools + umfpack

Travis Oliphant oliphant at ee.byu.edu
Wed Jan 10 06:48:34 CST 2007


Robert Cimrman wrote:
> New sparsetools implementation does not require CSR/CSC column/row
> indices to be sorted in ascending order, while UMFPACK does. Currently,
> every call to umfpack module (e.g. via linsolve.solve) implicitly calls
> ensure_sorted_indices(inplace=True) method of CSR/CSC matrix, which is
> rather fast, but in many cases is not necessary and the overhead can
> become significant when solving lots of linear systems (e.g.
> FE-discretized evolutionary nonlinear PDEs) - in this case, only one
> call to ensure_sorted_indices() is necessary, then only values change,
> not the structure.
>
> Therefore, if there are no objections, I would like to remove the
> implicit call to ensure_sorted_indices() from umfpack and require user
> to call it explicitly (only if necessary) - an exception will be raised
> by umfpack if the matrix is not in correct form, so it cannot lead to
> hidden bugs. I will document this in linsolve, of course.
>   

Perhaps it would be useful to put a flag on sparse matrices 
(sorted_indices) or something like that which is true if the indices are 
sorted and updated when operations that could change it are encountered.

We place flags on nd arrays for exactly this purpose (certain algorithms 
require properties of the arrays which are not always guaranteed but 
which we don't want to force nor explicitly check all the time).

-Travis



More information about the Scipy-dev mailing list