Preconditioned Conjugate Gradient (PCG) iterative solver for symmetric positive definite linear systems. More...
#include <pcg.hpp>
Public Types | |
| using | OperatorType = OperatorT |
| Operator type to be solved. | |
| using | SolutionVectorType = SrcOf< OperatorType > |
| Solution vector type. | |
| using | RHSVectorType = DstOf< OperatorType > |
| Right-hand side vector type. | |
| using | ScalarType = typename SolutionVectorType::ScalarType |
| Scalar type for computations. | |
Public Member Functions | |
| PCG (const IterativeSolverParameters ¶ms, const std::shared_ptr< util::Table > &statistics, const std::vector< SolutionVectorType > &tmps) | |
| Construct a PCG solver with default identity preconditioner. | |
| PCG (const IterativeSolverParameters ¶ms, const std::shared_ptr< util::Table > &statistics, const std::vector< SolutionVectorType > &tmps, const PreconditionerT preconditioner) | |
| Construct a PCG solver with a custom preconditioner. | |
| void | set_tag (const std::string &tag) |
| Set a tag string for statistics output. | |
| void | solve_impl (OperatorType &A, SolutionVectorType &x, const RHSVectorType &b) |
| Solve the linear system \( Ax = b \) using PCG. Calls the iterative solver and updates statistics. | |
Preconditioned Conjugate Gradient (PCG) iterative solver for symmetric positive definite linear systems.
See, e.g.,
Satisfies the SolverLike concept (see solver.hpp). Supports optional preconditioning.
| OperatorT | Operator type (must satisfy OperatorLike). |
| PreconditionerT | Preconditioner type (must satisfy SolverLike, defaults to IdentitySolver). |
| using terra::linalg::solvers::PCG< OperatorT, PreconditionerT >::OperatorType = OperatorT |
Operator type to be solved.
| using terra::linalg::solvers::PCG< OperatorT, PreconditionerT >::RHSVectorType = DstOf< OperatorType > |
Right-hand side vector type.
| using terra::linalg::solvers::PCG< OperatorT, PreconditionerT >::ScalarType = typename SolutionVectorType::ScalarType |
Scalar type for computations.
| using terra::linalg::solvers::PCG< OperatorT, PreconditionerT >::SolutionVectorType = SrcOf< OperatorType > |
Solution vector type.
|
inline |
Construct a PCG solver with default identity preconditioner.
| params | Iterative solver parameters. |
| statistics | Shared pointer to statistics table. |
| tmps | Temporary vectors for workspace. (At least 4 vectors are required.) |
|
inline |
Construct a PCG solver with a custom preconditioner.
| params | Iterative solver parameters. |
| statistics | Shared pointer to statistics table. |
| tmps | Temporary vectors for workspace. (At least 4 vectors are required.) |
| preconditioner | Preconditioner solver. |
|
inline |
Set a tag string for statistics output.
| tag | Tag string. |
|
inline |
Solve the linear system \( Ax = b \) using PCG. Calls the iterative solver and updates statistics.
| A | Operator (matrix). |
| x | Solution vector (output). |
| b | Right-hand side vector (input). |
< Residual vector.
< Search direction vector.
< Temporary vector for A*p.
< Preconditioned residual vector.