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::ic_0< Value, Parameters, Accumulator > Class Template Reference

IC(0) preconditioner for SPD compressed2D sparse matrices. More...

#include <ic_0.hpp>

Public Member Functions

 ic_0 (const matrix_type &A)
 Throws (through throw_or_abort) for a non-square A, and for a pivot that is zero, missing or, for a real Value, negative (issue 925).
template<typename VecX, typename VecB>
void solve (VecX &x, const VecB &b) const
 Solve (L*L^T)*x = b: forward (L*y=b), then backward (L^T*x=y).
template<typename VecX, typename VecB>
void adjoint_solve (VecX &x, const VecB &b) const
 Solve (L*L^T)^H * x = b.

Detailed Description

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

IC(0) preconditioner for SPD compressed2D sparse matrices.

Computes L such that L*L^T approximates A with the same sparsity pattern. For a complex Value that is L*L^T, not L*L^H: the factorization conjugates nothing, so it models a complex SYMMETRIC A (A^T == A), not a Hermitian one.

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

◆ ic_0()

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

Throws (through throw_or_abort) for a non-square A, and for a pivot that is zero, missing or, for a real Value, negative (issue 925).

A complex Value models a complex symmetric A, which has no sign, so only a zero pivot is rejected there.

Member Function Documentation

◆ adjoint_solve()

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

Solve (L*L^T)^H * x = b.

This used to delegate to solve(), commented "L*L^T is self-adjoint for real" – true, and wrong for complex: M = L*L^T has M^T == M, so M^H = conj(M), and M^-H is the same two solves with L conjugated. Delegating applied M^-1 instead, violating <M^-1 b, c> == <b, M^-H c> by 3.6e-02 on a complex-symmetric tridiagonal (#394's defect, for complex only). For a real Value conj is the identity, and this is solve() operation for operation.

◆ solve()

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

Solve (L*L^T)*x = b: forward (L*y=b), then backward (L^T*x=y).


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