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 the matrix in zero-based CSR (Compressed Sparse Row) format.
Constructor
The constructor accepts an optional string of solver options (see Solver Options).
Input Format
The matrix \(A\) must be provided as a sparse_csr_mat with zero-based indexing.
The required fields are:
n— the number of rows (and columns) of the square matrix;nnz— the number of non-zero entries;row_ptr— an array of lengthn + 1, whererow_ptr[i]is the index of the first non-zero entry in rowi;col_idx— an array of lengthnnzholding the column indices of the non-zero entries;data— an array of lengthnnzholding the 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 the 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) |