|
MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
|
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). | |
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.
|
inlineexplicit |
|
inline |
Backward relaxed sweep: rows iterated in descending order (n-1..0).
|
inline |
Forward relaxed sweep: rows iterated in ascending order.
|
inline |
Forward relaxed sweep (rows 0..n-1). Default application.