MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
mtl::itl::pc::ssor< Matrix, Accumulator > Class Template Reference

SSOR preconditioner: one symmetric-SOR application from a zeroed vector. More...

#include <ssor.hpp>

Public Member Functions

 ssor (const Matrix &A, value_type omega=value_type(1))
template<typename VecX, typename VecB>
void solve (VecX &x, const VecB &b) const
template<typename VecX, typename VecB>
void adjoint_solve (VecX &x, const VecB &b) const
 adjoint_solve delegates to solve(), which is correct exactly when M is self-adjoint – that is, when A is Hermitian and omega is real, giving M = c X D^-1 X^H (see the header note).

Detailed Description

template<FieldMatrix Matrix, typename Accumulator = void>
class mtl::itl::pc::ssor< Matrix, Accumulator >

SSOR preconditioner: one symmetric-SOR application from a zeroed vector.

Accumulator is forwarded to the underlying smoother and selects the accumulation type for the off-diagonal row sum (see math/accumulator_traits.hpp). The default void keeps the naive value_type accumulation, so this is a widening of the old single-parameter interface rather than a change to it.

The matrix-type specialization lives in the smoother – smoother::sor has an O(nnz) compressed2D form – so this template needs only one definition and picks up sparse handling automatically.

Constructor & Destructor Documentation

◆ ssor()

template<FieldMatrix Matrix, typename Accumulator = void>
mtl::itl::pc::ssor< Matrix, Accumulator >::ssor ( const Matrix & A,
value_type omega = value_type(1) )
inlineexplicit

Member Function Documentation

◆ adjoint_solve()

template<FieldMatrix Matrix, typename Accumulator = void>
template<typename VecX, typename VecB>
void mtl::itl::pc::ssor< Matrix, Accumulator >::adjoint_solve ( VecX & x,
const VecB & b ) const
inline

adjoint_solve delegates to solve(), which is correct exactly when M is self-adjoint – that is, when A is Hermitian and omega is real, giving M = c X D^-1 X^H (see the header note).

It is NOT correct for a non-Hermitian A, where U != L^H and no rearrangement of the sweeps gives M^-H either.

Measured against <M^-1 b, c> == <b, M^-H c> on a 144x144 Laplacian: 3.5e-16 for a symmetric A, 2.6e-01 for a non-symmetric one. The second number is a property of the method, not a defect – SSOR of a non-symmetric A simply is not self-adjoint.

Consequences:

  • cg, gmres and the other eight solvers never call adjoint_solve and are unaffected either way.
  • bicg and qmr do call it, so ssor is usable with them for Hermitian A only. For a non-Hermitian A use ilu_0, which has a real adjoint.

◆ solve()

template<FieldMatrix Matrix, typename Accumulator = void>
template<typename VecX, typename VecB>
void mtl::itl::pc::ssor< Matrix, Accumulator >::solve ( VecX & x,
const VecB & b ) const
inline

The documentation for this class was generated from the following file:
  • /home/runner/work/mtl5/mtl5/include/mtl/itl/pc/ssor.hpp