|
MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
|
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). | |
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.
|
inlineexplicit |
|
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:
|
inline |