def spilu(A, drop_tol=None, fill_factor=None, drop_rule=None, permc_spec=None, diag_pivot_thresh=None, relax=None, panel_size=None, options=None):
 if (not isspmatrix_csc(A)):
  A = csc_matrix(A)
  warn('splu requires CSC matrix format', SparseEfficiencyWarning)
 A.sort_indices()
 A = A.asfptype()
 (M, N) = A.shape
 if (M != N):
  raise ValueError('can only factor square matrices')
 _options = dict(ILU_DropRule=drop_rule, ILU_DropTol=drop_tol, ILU_FillFactor=fill_factor, DiagPivotThresh=diag_pivot_thresh, ColPerm=permc_spec, PanelSize=panel_size, Relax=relax)
 if (options is not None):
  _options.update(options)
 return _superlu.gstrf(N, A.nnz, A.data, A.indices, A.indptr, ilu=True, options=_options)

def spilu ( A , drop_tol = None , fill_factor = None , drop_rule = None , permc_spec = None , diag_pivot_thresh = None , relax = None , panel_size = None , options = None ) : if ( not isspmatrix_csc ( A ) ) : A = csc_matrix ( A ) warn ( 'splu requires CSC matrix format' , SparseEfficiencyWarning ) A . sort_indices ( ) A = A . asfptype ( ) ( M , N ) = A . shape if ( M != N ) : raise ValueError ( 'can only factor square matrices' ) _options = dict ( ILU_DropRule = drop_rule , ILU_DropTol = drop_tol , ILU_FillFactor = fill_factor , DiagPivotThresh = diag_pivot_thresh , ColPerm = permc_spec , PanelSize = panel_size , Relax = relax ) if ( options is not None ) : _options . update ( options ) return _superlu . gstrf ( N , A . nnz , A . data , A . indices , A . indptr , ilu = True , options = _options )
compute an incomplete lu decomposition for a sparse .