Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Mathematica uses the ILU0 procedures automatically to precondition large sparse linear systems; e.g.

LinearSolve[mat, rhs, 
   Method -> {Krylov, Preconditioner -> ILU0}]; // Timing

I wish to have the incomplete factorization of the large sparse matrix A in a standalone procedure.

I would be grateful if someone could give some tips or written code to provide the ILU0 or ILUT approximate inverses as standalone procedures.

share|improve this question
1  
?*`*ILU* will reveal which internal functions do this. You might want to experiment with them and figure out their calling syntax. –  Szabolcs Jun 14 '12 at 8:21
    
There was some discussion on this in MathGroup, but nothing too concrete showed up. –  J. M. Jun 14 '12 at 8:21
    
@Szabolcs: it seems to suffice just giving the SparseArray[] object to SparseArray`SparseMatrixILU[] ; one can then set the Method option to either "ILU0" or "ILUT" as needed. One can then use LowerTriangularize[] and UpperTriangularize[] to extract the needed factors from the compressed SparseArray[] representation. –  J. M. Jun 14 '12 at 8:43
    
@J.M. Can you post that as an answer? I'm not familiar enough with ILU. –  Szabolcs Jun 14 '12 at 8:48
    
@Szabolcs: Maybe after some more experimentation; it seems I got lucky with my initial examples, and extracting the factors isn't as simple as I thought it was. But the output of SparseArray`SparseMatrixILU[] is similar to the output of LUDecomposition[] as expected: the compressed matrix where the $\mathbf L$ and $\mathbf U$ factors are packed, and a permutation matrix represented as an integer permutation... –  J. M. Jun 14 '12 at 8:53
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.