lis
The lis solver supports the following input types.
- data type: D (
doubleonly) - index type:
std::int32_t,std::int64_t
lis is an iterative solver from the Lis library.
It requires a matrix in zero-based CSR (Compressed Sparse Row) format.
Constructor
The constructor accepts an optional string of solver options (see Solver Options below).
Input Format
The matrix \(A\) must be provided as a sparse_csr_mat with zero-based indexing.
Fields required:
n— number of rows (and columns) of the square matrix,nnz— number of non-zero entries,row_ptr— array of lengthn+1, whererow_ptr[i]is the index of the first non-zero in rowi,col_idx— array of lengthnnz, column indices of the non-zero entries,data— array of lengthnnz, values of the non-zero entries.
The right-hand side \(B\) is a dense full_mat with n_rows = N and n_cols = NRHS.
Usage Example
Solver Options
Call the set_option method to change solver options after construction.
All available options are documented in the official Lis documentation. Commonly used options include:
| Option | Description |
|---|---|
-i <method> |
Iterative solver, e.g., cg, bicgstab, gmres, fgmres |
-p <precond> |
Preconditioner, e.g., none, ilu, ssor |
-ilu_fill <n> |
ILU fill-in level |
-maxiter <n> |
Maximum number of iterations |
-tol <val> |
Convergence tolerance |
-print <level> |
Verbosity level (0=none, 1=summary, 2=iterations) |