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

SOR smoother with relaxation parameter omega. More...

#include <sor.hpp>

Public Member Functions

 sor (const Matrix &A, value_type omega=value_type(1))
template<typename VecX, typename VecB>
VecX & operator() (VecX &x, const VecB &b) const
 Forward relaxed sweep (rows 0..n-1). Default application.
template<typename VecX, typename VecB>
VecX & forward (VecX &x, const VecB &b) const
 Forward relaxed sweep: rows iterated in ascending order.
template<typename VecX, typename VecB>
VecX & backward (VecX &x, const VecB &b) const
 Backward relaxed sweep: rows iterated in descending order (n-1..0).

Detailed Description

template<FieldMatrix Matrix, typename Accumulator = void>
class mtl::itl::smoother::sor< Matrix, Accumulator >

SOR smoother with relaxation parameter omega.

omega=1.0 reduces to Gauss-Seidel. operator() runs a forward (ascending-row) relaxed sweep; forward()/backward() expose the sweep direction explicitly (backward_sor / symmetric_sor build on them). All variants carry the optional Accumulator unchanged.

The sweeps are const: they mutate only the caller's x, never a member (A_, omega_ and dia_inv_ are all read-only during a sweep). That is what lets pc::ssor hold one as a member and still expose a const solve() (#405), without reaching for mutable. Applies to jacobi and gauss_seidel too.

Constructor & Destructor Documentation

◆ sor()

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

Member Function Documentation

◆ backward()

template<FieldMatrix Matrix, typename Accumulator = void>
template<typename VecX, typename VecB>
VecX & mtl::itl::smoother::sor< Matrix, Accumulator >::backward ( VecX & x,
const VecB & b ) const
inline

Backward relaxed sweep: rows iterated in descending order (n-1..0).

◆ forward()

template<FieldMatrix Matrix, typename Accumulator = void>
template<typename VecX, typename VecB>
VecX & mtl::itl::smoother::sor< Matrix, Accumulator >::forward ( VecX & x,
const VecB & b ) const
inline

Forward relaxed sweep: rows iterated in ascending order.

◆ operator()()

template<FieldMatrix Matrix, typename Accumulator = void>
template<typename VecX, typename VecB>
VecX & mtl::itl::smoother::sor< Matrix, Accumulator >::operator() ( VecX & x,
const VecB & b ) const
inline

Forward relaxed sweep (rows 0..n-1). Default application.


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