Loading...
Searching...
No Matches
terra::linalg::solvers::Jacobi< OperatorT > Class Template Reference

Jacobi iterative solver for linear systems. More...

#include <jacobi.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 = SolutionVectorType::ScalarType
 Scalar type for computations.
 

Public Member Functions

 Jacobi (const SolutionVectorType &inverse_diagonal, const int iterations, const SolutionVectorType &tmp, const ScalarType omega=1.0)
 Construct a Jacobi solver.
 
void solve_impl (OperatorType &A, SolutionVectorType &x, const RHSVectorType &b)
 Solve the linear system using Jacobi iteration. Applies the update rule for the specified number of iterations.
 
SolutionVectorTypeget_inverse_diagonal ()
 

Detailed Description

template<OperatorLike OperatorT>
class terra::linalg::solvers::Jacobi< OperatorT >

Jacobi iterative solver for linear systems.

Satisfies the SolverLike concept (see solver.hpp). Uses a diagonal preconditioner and supports relaxation. The update rule is:

\[ x^{(k+1)} = x^{(k)} + \omega D^{-1} (b - Ax^{(k)}) \]

where \( D \) is the diagonal of \( A \) and \( \omega \) is the relaxation parameter.

Template Parameters
OperatorTOperator type (must satisfy OperatorLike).

Member Typedef Documentation

◆ OperatorType

template<OperatorLike OperatorT>
using terra::linalg::solvers::Jacobi< OperatorT >::OperatorType = OperatorT

Operator type to be solved.

◆ RHSVectorType

template<OperatorLike OperatorT>
using terra::linalg::solvers::Jacobi< OperatorT >::RHSVectorType = DstOf< OperatorType >

Right-hand side vector type.

◆ ScalarType

template<OperatorLike OperatorT>
using terra::linalg::solvers::Jacobi< OperatorT >::ScalarType = SolutionVectorType::ScalarType

Scalar type for computations.

◆ SolutionVectorType

template<OperatorLike OperatorT>
using terra::linalg::solvers::Jacobi< OperatorT >::SolutionVectorType = SrcOf< OperatorType >

Solution vector type.

Constructor & Destructor Documentation

◆ Jacobi()

template<OperatorLike OperatorT>
terra::linalg::solvers::Jacobi< OperatorT >::Jacobi ( const SolutionVectorType inverse_diagonal,
const int  iterations,
const SolutionVectorType tmp,
const ScalarType  omega = 1.0 
)
inline

Construct a Jacobi solver.

Parameters
inverse_diagonalInverse of the diagonal of the operator.
iterationsNumber of Jacobi iterations to perform.
tmpTemporary vector for workspace.
omegaRelaxation parameter (default 1.0).

Member Function Documentation

◆ get_inverse_diagonal()

template<OperatorLike OperatorT>
SolutionVectorType & terra::linalg::solvers::Jacobi< OperatorT >::get_inverse_diagonal ( )
inline

◆ solve_impl()

template<OperatorLike OperatorT>
void terra::linalg::solvers::Jacobi< OperatorT >::solve_impl ( OperatorType A,
SolutionVectorType x,
const RHSVectorType b 
)
inline

Solve the linear system using Jacobi iteration. Applies the update rule for the specified number of iterations.

Parameters
AOperator (matrix).
xSolution vector (output).
bRight-hand side vector (input).

The documentation for this class was generated from the following file: