gko::solver::Bicg#

Biconjugate gradient. Generalises CG to non-symmetric systems by maintaining two coupled Krylov sequences (one with A, one with Aᵀ). Cheap per iteration but the convergence is erratic — Bicgstab is usually preferred in practice.

template<typename ValueType = default_precision>
class Bicg #

Inherits from

  • public gko::EnableLinOp<Bicg<default_precision>>

  • public gko::solver::EnablePreconditionedIterativeSolver<default_precision, Bicg<default_precision>>

  • public gko::Transposable

BICG or the Biconjugate gradient method is a Krylov subspace solver.

Being a generic solver, it is capable of solving general matrices, including non-s.p.d matrices. Though, the memory and the computational requirement of the BiCG solver are higher than of its s.p.d solver counterpart, it has the capability to solve generic systems.

BiCG is based on the bi-Lanczos tridiagonalization method and in exact arithmetic should terminate in at most \( N \) iterations ( \( 2N \) matrix-vector products — one with \( A \) and one with \( A^H \)). It couples two Krylov sequences and maintains residuals \( r_k \), shadow residuals \( \tilde r_k \), and search directions \( p_k, \tilde p_k \) that satisfy the biorthogonality conditions \( \tilde r_i^H r_j = 0 \) for \( i \ne j \). Each iteration performs the coupled update

\[ \alpha_k = \frac{\tilde r_k^H r_k}{\tilde p_k^H A p_k}, \qquad r_{k+1} = r_k - \alpha_k\, A\, p_k, \qquad \tilde r_{k+1} = \tilde r_k - \alpha_k\, A^H\, \tilde p_k. \]
It forms the basis of cheaper variants such as BiCGSTAB and CGS, which avoid the explicit \( A^H \) apply.

References

  • Fletcher, R. Conjugate gradient methods for indefinite systems. Numerical Analysis (Dundee 1975), Lecture Notes in Mathematics 506, Springer, 1976. https://doi.org/10.1007/BFb0080116

Template Parameters:

ValueType – precision of matrix elements

Public Functions

virtual std::unique_ptr<LinOp> transpose() const override#

Returns a LinOp representing the transpose of the Transposable object.

Returns:

a pointer to the new transposed object

virtual std::unique_ptr<LinOp> conj_transpose() const override#

Returns a LinOp representing the conjugate transpose of the Transposable object.

Returns:

a pointer to the new conjugate transposed object

inline bool apply_uses_initial_guess() const override#

Return true as iterative solvers use the data in x as an initial guess.

Returns:

true as iterative solvers use the data in x as an initial guess.

Public Static Functions

static parameters_type parse(
const config::pnode &config,
const config::registry &context,
const config::type_descriptor &td_for_child = config::make_type_descriptor<ValueType>(),
)#

Create the parameters from the property_tree. Because this is directly tied to the specific type, the value/index type settings within config are ignored and type_descriptor is only used for children configs.

Parameters:
  • config – the property tree for setting

  • context – the registry

  • td_for_child – the type descriptor for children configs. The default uses the value type of this class.

Returns:

parameters

struct parameters_type #

Inherits from

  • public gko::solver::enable_preconditioned_iterative_solver_factory_parameters<parameters_type, Factory>