Class SUNLinSolPCG
Defined in File sundials_linsol_wrapper.h
Inheritance Relationships
Base Type
public amici::SUNLinSolWrapper
(Class SUNLinSolWrapper)
Class Documentation
-
class SUNLinSolPCG : public amici::SUNLinSolWrapper
SUNDIALS scaled preconditioned CG (Conjugate Gradient method) (PCG) solver.
Public Functions
-
SUNLinSolPCG(N_Vector y, int pretype, int maxl)
Create PCG solver.
- Parameters:
y –
pretype – Preconditioner type (PREC_NONE, PREC_LEFT, PREC_RIGHT, PREC_BOTH)
maxl – Maximum number of solver iterations
-
int setATimes(void *A_data, SUNATimesFn ATimes)
Sets the function pointer for ATimes (see sundials/sundials_linearsolver.h).
- Parameters:
A_data –
ATimes –
- Returns:
-
int setPreconditioner(void *P_data, SUNPSetupFn Pset, SUNPSolveFn Psol)
Sets function pointers for PSetup and PSolve routines inside of iterative linear solver objects (see sundials/sundials_linearsolver.h).
- Parameters:
P_data –
Pset –
Psol –
- Returns:
-
int setScalingVectors(N_Vector s, N_Vector nul)
Sets pointers to left/right scaling vectors for the linear system solve (see sundials/sundials_linearsolver.h).
- Parameters:
s –
nul –
- Returns:
-
int getNumIters() const
Returns the number of linear iterations performed in the last ‘Solve’ call.
- Returns:
Number of iterations
-
realtype getResNorm() const
Returns the final residual norm from the last ‘Solve’ call.
- Returns:
residual norm
-
N_Vector getResid() const
Get preconditioned initial residual (see sundials/sundials_linearsolver.h).
- Returns:
-
SUNLinSolPCG(N_Vector y, int pretype, int maxl)