# How to reuse permutation-orderings within scipy's SuperLU-wrapper?

i'm solving sparse linear equations within scipy 0.18 which internally resorts to SuperLU (after umfpack got removed due to license-issues).

Current, i'm doing a complete re-factorization in each iteration of my algorithm, but now i want to re-use the permutation-ordering (at least the column-permutation; but maybe even row-permutation) calculated in the first iteration. How can i achieve this in a nice way using scipy?

I got no previous usage-history of SuperLU (and also not much practical experience with sparse-algebra packages), but the user-guide makes me believe, that this should be done through the options-parameter.

Fact Specifies whether or not the factored form of the matrix A is supplied on entry, and if not, how the matrix A will be factorized base on the previous history, such as factor from scratch, reuse Pc and/or Pr, or reuse the data structures of L and U. fact can be one of:

– DOFACT: the matrix A will be factorized from scratch.

– SamePattern: the matrix A will be factorized assuming that a factorization of a matrix with the same sparsity pattern was performed prior to this one. Therefore, this factorization will reuse column permutation vector perm c.

– SampPattern SameRowPerm: the matrix A will be factorized assuming that a factorization of a matrix with the same sparsity pattern and similar numerical values was performed prior to this one. Therefore, this factorization will reuse both row and column permutation vectors perm r and perm c, both row and column scaling factors Dr and Dc, and the distributed data structure set up from the previous symbolic factorization

As an alternative, there is also the following within options:

ColPerm Specifies how to permute the columns of the matrix for sparsity preservation.

– NATURAL: natural ordering.

– MMD ATA: minimum degree ordering on the structure of AT A.

– MMD AT PLUS A: minimum degree ordering on the structure of AT + A.

– COLAMD: approximate minimum degree column ordering

– MY PERMC: use the ordering given in perm c input by the user.

## Questions

• Which part of SuperLU should i use to achieve my goal? One of the above? Something else?
• How can it be done within scipy?
• The ColPerm-parameter is missing MY_PERMC in scipy's docs (maybe it's not usable)
• Just came across your post since I wanted to do the same thing. In looking through the source, it is clear that perm_c perm_r can't be set beforehand through the interface. The changes in the C interface would be minorish to get it to work in case you need it bad. Nov 22, 2017 at 17:59