def spilu(A, drop_tol=None, fill_factor=None, drop_rule=None, permc_spec=None,<EOL>diag_pivot_thresh=None, relax=None, panel_size=None, options=None):
if not isspmatrix_csc(A):<EOL><INDENT>A = csc_matrix(A)<EOL>warn('<STR_LIT>', SparseEfficiencyWarning)<EOL><DEDENT>A.sort_indices()<EOL>A = A.asfptype()  <EOL>M, N = A.shape<EOL>if (M != N):<EOL><INDENT>raise ValueError("<STR_LIT>")  <EOL><DEDENT>_options = dict(ILU_DropRule=drop_rule, ILU_DropTol=drop_tol,<EOL>ILU_FillFactor=fill_factor,<EOL>DiagPivotThresh=diag_pivot_thresh, ColPerm=permc_spec,<EOL>PanelSize=panel_size, Relax=relax)<EOL>if options is not None:<EOL><INDENT>_options.update(options)<EOL><DEDENT>return _superlu.gstrf(N, A.nnz, A.data, A.indices, A.indptr,<EOL>ilu=True, options=_options)<EOL>
Compute an incomplete LU decomposition for a sparse, square matrix.

The resulting object is an approximation to the inverse of `A`.

Parameters
----------
A : (N, N) array_like
    Sparse matrix to factorize
drop_tol : float, optional
    Drop tolerance (0 <= tol <= 1) for an incomplete LU decomposition.
    (default: 1e-4)
fill_factor : float, optional
    Specifies the fill ratio upper bound (>= 1.0) for ILU. (default: 10)
drop_rule : str, optional
    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.
milu : str, optional
    Which version of modified ILU to use. (Choices: ``silu``,
    ``smilu_1``, ``smilu_2`` (default), ``smilu_3``.)

Remaining other options
    Same as for `splu`

Returns
-------
invA_approx : scipy.sparse.linalg.SuperLU
    Object, which has a ``solve`` method.

See also
--------
splu : complete LU decomposition

Notes
-----
To improve the better approximation to the inverse, you may need to
increase `fill_factor` AND decrease `drop_tol`.

This function uses the SuperLU library.