gko::preconditioner::Sor#
Successive Over-Relaxation preconditioner. Splits the matrix as \(A = D + L + U\) and applies a forward sweep weighted by the relaxation factor \(\omega \in (0, 2)\). The symmetric variant (SSOR) follows the forward sweep with a backward sweep, yielding a symmetric preconditioner suitable for symmetric Krylov solvers.
-
template<typename ValueType = default_precision, typename IndexType = int32>
class Sor # Inherits from
public gko::EnablePolymorphicObject<Sor<default_precision, int32>, LinOpFactory>
public gko::EnablePolymorphicAssignment<Sor<default_precision, int32>>
This class generates the (S)SOR preconditioner.
The SOR preconditioner starts from a splitting of the matrix \(A\) into \(A = D + L + U\), where \(L\) contains all entries below the diagonal, and \(U\) contains all entries above the diagonal. The application of the preconditioner is then defined as solving \(M x = y\) with
\[M = \frac{1}{\omega} (D + \omega L), \quad 0 < \omega < 2. \]\(\omega\) is known as the relaxation factor. The preconditioner can be made symmetric, leading to the SSOR preconditioner. Here, \(M\) is defined as\[M = \frac{1}{\omega (2 - \omega)} (D + \omega L) D^{-1} (D + \omega U) , \quad 0 < \omega < 2. \]This class is a factory, which will only generate the preconditioner. The resulting LinOp will represent the application of \(M^{-1}\).
- References
Saad, Y. Iterative Methods for Sparse Linear Systems. 2nd ed. SIAM, 2003, ch. 4.1. https://doi.org/10.1137/1.9780898718003
- Template Parameters:
ValueType – The value type of the internally used CSR matrix
IndexType – The index type of the internally used CSR matrix
Public Functions
-
inline const parameters_type &get_parameters()#
Returns the parameters used to construct the factory.
- Returns:
the parameters used to construct the factory.
-
inline const parameters_type &get_parameters() const#
Returns the parameters used to construct the factory.
- Returns:
the parameters used to construct the factory.
- std::shared_ptr<const LinOp> system_matrix,
Creates a new product from the given components.
The method will create an ComponentsType object from the arguments of this method, and pass it to the generate_impl() function which will create a new AbstractProductType.
Note
This function overrides the default LinOpFactory::generate to return a Factorization instead of a generic LinOp, which would need to be cast to Factorization again to access its factors. It is only necessary because smart pointers aren’t covariant.
- Template Parameters:
Args – types of arguments passed to the constructor of ComponentsType
- Parameters:
args – arguments passed to the constructor of ComponentsType
- Returns:
an instance of AbstractProductType
Public Static Functions
-
static inline parameters_type build()#
Creates a new parameter_type to set up the factory.
-
struct parameters_type #
Inherits from
public gko::enable_parameters_type<parameters_type, Sor>