Class SUNLinSolKLU

Inheritance Relationships

Base Type

Class Documentation

class amici::SUNLinSolKLU : public amici::SUNLinSolWrapper

SUNDIALS KLU sparse direct solver.

Public Types

enum StateOrdering

KLU state reordering (different from SuperLUMT ordering!)

Values:

enumerator AMD
enumerator COLAMD
enumerator natural

Public Functions

SUNLinSolKLU(N_Vector x, SUNMatrix 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)

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:

SUNMatrix getMatrix() const override

Get the matrix A (matrix solvers only).

Return

A

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: