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

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.

Detailed Description

template<Field Value, typename Parameters = mat::parameters<>, typename Accumulator = void>
class mtl::itl::pc::ilu_0< Value, Parameters, Accumulator >

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.

Constructor & Destructor Documentation

◆ ilu_0()

template<Field Value, typename Parameters = mat::parameters<>, typename Accumulator = void>
mtl::itl::pc::ilu_0< Value, Parameters, Accumulator >::ilu_0 ( const matrix_type & A)
inlineexplicit

Member Function Documentation

◆ adjoint_solve()

template<Field Value, typename Parameters = mat::parameters<>, typename Accumulator = void>
template<typename VecX, typename VecB>
void mtl::itl::pc::ilu_0< Value, Parameters, Accumulator >::adjoint_solve ( VecX & x,
const VecB & b ) const
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.

◆ solve()

template<Field Value, typename Parameters = mat::parameters<>, typename Accumulator = void>
template<typename VecX, typename VecB>
void mtl::itl::pc::ilu_0< Value, Parameters, Accumulator >::solve ( VecX & x,
const VecB & b ) const
inline

Solve (L*U)*x = b: forward substitution (L*y=b), then back substitution (U*x=y).


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