spilu
- scipy.sparse.linalg.spilu(A, drop_tol=None, fill_factor=None, drop_rule=None, permc_spec=None, diag_pivot_thresh=None, relax=None, ,
Compute an incomplete LU decomposition for a sparse, square matrix.
The resulting object is an approximation to the inverse of A.
Sparse array to factorize. Most efficient when provided in CSC format. Other formats will be converted to CSC before factorization.
Drop tolerance (0 <= tol <= 1) for an incomplete LU decomposition.
(default: 1e-4)
Note that drop_tol primarily affects entries generated as fill-in during the ILU factorization; for matrices that produce little or no fill-in, changing this parameter may have no visible effect on the sparsity pattern of the factors.
Specifies the fill ratio upper bound (>= 1.0) for ILU. (default: 10)
Comma-separated string of drop rules to use.
Available rules: basic, prows, column, area,
secondary, dynamic, interp. (Default: basic,area)
See SuperLU documentation for details.
How to permute the columns of the matrix for sparsity preservation. (default: ‘COLAMD’)
NATURAL: natural ordering.
MMD_ATA: minimum degree ordering on the structure of A^T A.
MMD_AT_PLUS_A: minimum degree ordering on the structure of A^T+A.
COLAMD: approximate minimum degree column ordering
Threshold used for a diagonal entry to be an acceptable pivot. See SuperLU user’s guide for details [1]
Expert option for customizing the degree of relaxing supernodes. See SuperLU user’s guide for details [1]
Expert option for customizing the panel size. See SuperLU user’s guide for details [1]
Dictionary containing additional expert options to SuperLU.
See SuperLU user guide [1] (section 2.4 on the ‘Options’ argument)
for more details. For example, you can specify
options=dict(Equil=False, IterRefine='SINGLE'))
to turn equilibration off and perform a single iterative refinement.
Object, which has a solve method.
When a real array is factorized and the returned SuperLU object’s solve() method
is used with complex arguments an error is generated. Instead, cast the initial
array to complex and then factorize.
To improve the better approximation to the inverse, you may need to increase fill_factor AND decrease drop_tol.
The effect of drop_tol is matrix-dependent. In particular, drop_tol does not guarantee that existing off-diagonal entries will be removed; it controls dropping of candidate entries during factorization (often fill-in). For some sparsity patterns, the ILU factors can be identical to the full LU factors even for large drop_tol.
This function uses the SuperLU library.
>>> import numpy as np
>>> from scipy.sparse import csc_array
>>> from scipy.sparse.linalg import spilu
>>> A = csc_array([[1., 0., 0.], [