Class SUNLinSolKLU
Defined in File sundials_linsol_wrapper.h
Inheritance Relationships
Base Type
public amici::SUNLinSolWrapper
(Class SUNLinSolWrapper)
Class Documentation
-
class SUNLinSolKLU : public amici::SUNLinSolWrapper
SUNDIALS KLU sparse direct solver.
Public Types
Public Functions
-
SUNLinSolKLU(N_Vector x, SUNMatrixWrapper A)
Create KLU solver with given matrix.
- Parameters:
x – A template for cloning vectors needed within the solver.
A – sparse matrix
-
SUNLinSolKLU(AmiVector const &x, int nnz, int sparsetype, StateOrdering ordering = StateOrdering::COLAMD)
Create KLU solver and matrix to operate on.
- Parameters:
x – A template for cloning vectors needed within the solver.
nnz – Number of non-zeros in matrix A
sparsetype – Sparse matrix type (CSC_MAT, CSR_MAT)
ordering –
-
void reInit(int nnz, int reinit_type)
Reinitializes memory and flags for a new factorization (symbolic and numeric) to be conducted at the next solver setup call.
For more details see sunlinsol/sunlinsol_klu.h
- Parameters:
nnz – Number of non-zeros
reinit_type – SUNKLU_REINIT_FULL or SUNKLU_REINIT_PARTIAL
-
void setOrdering(StateOrdering ordering)
Sets the ordering used by KLU for reducing fill in the linear solve.
- Parameters:
ordering –
-
bool is_singular() const
Checks whether the linear system is singular.
- Returns:
boolean indicating whether the linear system is singular (condition number < 1/machine precision)
-
SUNLinSolKLU(N_Vector x, SUNMatrixWrapper A)