Template Numerical Library: TNL::Solvers::Linear::BICGStabL< Matrix > Class Template Reference

Template Numerical Library version\ main:16b9213d5

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
TNL::Solvers::Linear::BICGStabL< Matrix > Class Template Reference

Iterative solver of linear systems based on the BICGStab(l) method. More...

`#include <TNL/Solvers/Linear/BICGStabL.h>`

Inheritance diagram for TNL::Solvers::Linear::BICGStabL< Matrix >:
[legend]
Collaboration diagram for TNL::Solvers::Linear::BICGStabL< Matrix >:
[legend]

## Public Types
using | ConstVectorViewType = typename Base::ConstVectorViewType
| Type for constant vector view.
using | DeviceType = typename Base::DeviceType
| Device where the solver will run on and auxiliary data will alloacted on.
using | IndexType = typename Base::IndexType
| Type for indexing.
using | RealType = typename Base::RealType
| Floating point type used for computations.
using | VectorViewType = typename Base::VectorViewType
| Type for vector view.
Public Types inherited from TNL::Solvers::Linear::LinearSolver< Matrix >
using | ConstVectorViewType = typename Traits< Matrix >::ConstVectorViewType
| Type for constant vector view.
using | DeviceType = typename Matrix::DeviceType
| Device where the solver will run on and auxiliary data will alloacted on.
using | IndexType = typename Matrix::IndexType
| Type for indexing.
using | MatrixPointer = std::shared_ptr< std::add_const_t< MatrixType > >
| Type of shared pointer to the matrix.
using | MatrixType = Matrix
| Type of the matrix representing the linear system.
using | PreconditionerPointer = std::shared_ptr< std::add_const_t< PreconditionerType > >
| Type of shared pointer to the preconditioner.
using | PreconditionerType = Preconditioners::Preconditioner< MatrixType >
| Type of preconditioner.
using | RealType = typename Matrix::RealType
| Floating point type used for computations.
using | VectorViewType = typename Traits< Matrix >::VectorViewType
| Type for vector view.
Public Types inherited from TNL::Solvers::IterativeSolver< Matrix::RealType, Matrix::IndexType >
using | SolverMonitorType
| Type of an object used for monitoring of the convergence.

## Public Member Functions
bool | setup (const Config::ParameterContainer &parameters, const String &prefix="") override
| Method for setup of the linear iterative solver based on configuration parameters.
bool | solve (ConstVectorViewType b, VectorViewType x) override
| Method for solving of a linear system.
Public Member Functions inherited from TNL::Solvers::Linear::LinearSolver< Matrix >
virtual | ~LinearSolver ()=default
| Default destructor.
virtual void | setMatrix (const MatrixPointer &matrix)
| Set the matrix of the linear system.
void | setPreconditioner (const PreconditionerPointer &preconditioner)
| Set the preconditioner.
Public Member Functions inherited from TNL::Solvers::IterativeSolver< Matrix::RealType, Matrix::IndexType >
| IterativeSolver ()=default
| Default constructor.
virtual bool | checkConvergence () const
| Checks whether the convergence occurred already.
virtual bool | checkNextIteration () const
| Checks if the solver is allowed to do the next iteration.
const Matrix::RealType & | getConvergenceResidue () const
| Gets the threshold for convergence based on residue.
const Matrix::RealType & | getDivergenceResidue () const
| Gets the threshold for divergence based on residue.
const Matrix::IndexType & | getIterations () const
| Gets the number of iterations performed by the solver so far.
const Matrix::IndexType & | getMaxIterations () const
| Gets the maximal number of iterations the solver is allowed to perform.
const Matrix::IndexType & | getMinIterations () const
| Gets the minimal number of iterations the solver is supposed to do.
const Matrix::RealType & | getResidue () const
| Gets the residue reached at the current iteration.
virtual bool | nextIteration ()
| Proceeds to the next iteration.
void | resetIterations ()
| Sets the the number of the current iterations to zero.
void | setConvergenceResidue (const Matrix::RealType &convergenceResidue)
| Sets the threshold for convergence based on residue.
void | setDivergenceResidue (const Matrix::RealType &divergenceResidue)
| Sets the threshold for divergence based on residue.
void | setMaxIterations (const Matrix::IndexType &maxIterations)
| Sets the maximal number of iterations the solver is allowed to perform.
void | setMinIterations (const Matrix::IndexType &minIterations)
| Sets the minimal number of iterations the solver is supposed to do.
void | setRefreshRate (const Matrix::IndexType &refreshRate)
| Sets the refresh rate (in milliseconds) for the solver monitor.
void | setResidue (const Matrix::RealType &residue)
| Sets the residue reached at the current iteration.
void | setSolverMonitor (SolverMonitorType &solverMonitor)
| Sets the solver monitor object.
bool | setup (const Config::ParameterContainer &parameters, const std::string &prefix="")
| Method for setup of the iterative solver based on configuration parameters.

## Static Public Member Functions
static void | configSetup (Config::ConfigDescription &config, const String &prefix="")
| This is method defines configuration entries for setup of the linear iterative solver.
Static Public Member Functions inherited from TNL::Solvers::Linear::LinearSolver< Matrix >
static void | configSetup (Config::ConfigDescription &config, const String &prefix="")
| This method defines configuration entries for setup of the linear iterative solver.
Static Public Member Functions inherited from TNL::Solvers::IterativeSolver< Matrix::RealType, Matrix::IndexType >
static void | configSetup (Config::ConfigDescription &config, const std::string &prefix="")
| This method defines configuration entries for setup of the iterative solver.

## Protected Types
using | DeviceVector = Containers::Vector< RealType, DeviceType, IndexType >
using | HostVector = Containers::Vector< RealType, Devices::Host, IndexType >
using | VectorType = typename Traits::VectorType

## Protected Member Functions
void | compute_residue (VectorViewType r, ConstVectorViewType x, ConstVectorViewType b)
void | preconditioned_matvec (ConstVectorViewType src, VectorViewType dst)
void | setSize (const VectorViewType &x)

## Protected Attributes
int | ell = 1
bool | exact_residue = false
HostVector | g_0
HostVector | g_1
HostVector | g_2
IndexType | ldSize = 0
VectorType | M_tmp
DeviceVector | R
VectorType | r_ast
VectorType | res_tmp
HostVector | sigma
IndexType | size = 0
HostVector | T
DeviceVector | U
Protected Attributes inherited from TNL::Solvers::Linear::LinearSolver< Matrix >
MatrixPointer | matrix = nullptr
PreconditionerPointer | preconditioner = nullptr
Protected Attributes inherited from TNL::Solvers::IterativeSolver< Matrix::RealType, Matrix::IndexType >
Matrix::RealType | convergenceResidue
Matrix::IndexType | currentIteration
Matrix::RealType | currentResidue
Matrix::RealType | divergenceResidue
Matrix::IndexType | maxIterations
Matrix::IndexType | minIterations
Matrix::IndexType | refreshRate
std::ofstream | residualHistoryFile
std::string | residualHistoryFileName
IterativeSolverMonitor< double > * | solverMonitor

## Detailed Description

template<typename Matrix>
class TNL::Solvers::Linear::BICGStabL< Matrix >

Iterative solver of linear systems based on the BICGStab(l) method.

BICGStabL implements an iterative solver for non-symmetric linear systems, using the BiCGstab(l) algorithm described in [1] and [2]. It is a generalization of the stabilized biconjugate-gradient (BiCGstab) algorithm proposed by van der Vorst [3]. BiCGstab(1) is equivalent to BiCGstab, and BiCGstab(2) is a slightly more efficient version of the BiCGstab2 algorithm by Gutknecht [4], while BiCGstab(l>2) is a further generalization.

[1] Gerard L. G. Sleijpen and Diederik R. Fokkema, "BiCGstab(l) for linear equations involving unsymmetric matrices with complex spectrum", Electronic Trans. on Numerical Analysis 1, 11-32 (1993).

[2] Gerard L. G. Sleijpen, Henk A. van der Vorst, and Diederik R. Fokkema, "BiCGstab(l) and other Hybrid Bi-CG Methods", Numerical Algorithms 7, 75-109 (1994).

[3] Henk A. van der Vorst, "Bi-CGSTAB: A fast and smoothly converging variant of Bi-CG for the solution of nonsymmetric linear systems, SIAM Journal on scientific and Statistical Computing 13.2, 631-644 (1992). [4] Martin H. Gutknecht, "Variants of BiCGStab for matrices with complex spectrum", IPS Research Report No. 91-14 (1991).

See TNL::Solvers::Linear::LinearSolver for example of showing how to use the linear solvers.

Template Parameters

  Matrix | is type of matrix describing the linear system.

## Member Function Documentation

## ◆ configSetup()

template<typename Matrix>

void TNL::Solvers::Linear::BICGStabL< Matrix >::configSetup | ( | Config::ConfigDescription & | config,
|  | const String & | prefix = "" )
| static

This is method defines configuration entries for setup of the linear iterative solver.

In addition to config entries defined by IterativeSolver::configSetup, this method defines the following:

bicgstab-ell - number of Bi-CG iterations before the MR part starts.

bicgstab-exact-residue - says whether the BiCGstab should compute the exact residue in each step (true) or to use a cheap approximation (false).

Parameters

  config | contains description of configuration parameters.
  prefix | is a prefix of particular configuration entries.

## ◆ setup()

template<typename Matrix>

bool TNL::Solvers::Linear::BICGStabL< Matrix >::setup | ( | const Config::ParameterContainer & | parameters,
|  | const String & | prefix = "" )
| overridevirtual

Method for setup of the linear iterative solver based on configuration parameters.

Parameters

  parameters | contains values of the define configuration entries.
  prefix | is a prefix of particular configuration entries.

Reimplemented from TNL::Solvers::Linear::LinearSolver< Matrix >.

## ◆ solve()

template<typename Matrix>

bool TNL::Solvers::Linear::BICGStabL< Matrix >::solve | ( | ConstVectorViewType | b,
|  | VectorViewType | x )
| overridevirtual

Method for solving of a linear system.

See LinearSolver::solve for more details.

Parameters

  b | vector with the right-hand side of the linear system.
  x | vector for the solution of the linear system.

Returns
  true if the solver converged.
  false if the solver did not converge.

Implements TNL::Solvers::Linear::LinearSolver< Matrix >.

The documentation for this class was generated from the following file:

- src/TNL/Solvers/Linear/BICGStabL.h