|
MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
|
ILU(0) preconditioner for compressed2D sparse matrices. More...
#include <ilu_0.hpp>
Public Member Functions | |
| ilu_0 (const matrix_type &A) | |
| template<typename VecX, typename VecB> | |
| void | solve (VecX &x, const VecB &b) const |
| Solve (L*U)*x = b: forward substitution (L*y=b), then back substitution (U*x=y). | |
| template<typename VecX, typename VecB> | |
| void | adjoint_solve (VecX &x, const VecB &b) const |
| Solve (L*U)^H * x = b, i.e. | |
ILU(0) preconditioner for compressed2D sparse matrices.
Computes L and U factors with the same sparsity pattern as A.
Accumulator selects how the factorization and the triangular solves accumulate (see math/accumulator_traits.hpp and the header note). The default void keeps the naive value_type arithmetic unchanged.
|
inlineexplicit |
|
inline |
Solve (L*U)^H * x = b, i.e.
x = U^-H (L^-H b).
This used to delegate to solve(), commented "approximate". It is not an approximation – M = L*U is not self-adjoint unless A is symmetric, so delegating applies the wrong operator entirely. bicg and qmr are the only callers, and with a non-symmetric A both failed to converge at all rather than converging slowly (#394).
L and U are stored row-wise, but the adjoint needs COLUMN access: (U^H)(j,i) = conj(U(i,j)). Both triangular solves are therefore written in scatter form – once a component is final, push its contribution into the entries that depend on it – which reads the row storage exactly as it is laid out and needs no transposed copy.
|
inline |
Solve (L*U)*x = b: forward substitution (L*y=b), then back substitution (U*x=y).