Namespaces | Classes | Enumerations | Functions
LinearSolver Namespace Reference

Functionality for solving linear systems of equations. More...

Namespaces

 InnerProductImpls
 Implementations of LinearSolver::inner_product.
 
 Tags
 The DataBox tags associated with the linear solver.
 

Classes

struct  ConjugateGradient
 A conjugate gradient solver for linear systems of equations \(Ax=b\) where the operator \(A\) is symmetric. More...
 
struct  ConvergenceCriteria
 Criteria that determine the linear solve has converged. More...
 
struct  Gmres
 A GMRES solver for nonsymmetric linear systems of equations \(Ax=b\). More...
 
struct  HasConverged
 Signals convergence of the linear solver. More...
 
struct  IterationId
 Identifies a step in the linear solver algorithm. More...
 

Enumerations

enum  ConvergenceReason { MaxIterations, AbsoluteResidual, RelativeResidual }
 The reason the linear solver has converged. More...
 

Functions

bool operator== (const ConvergenceCriteria &lhs, const ConvergenceCriteria &rhs) noexcept
 
bool operator!= (const ConvergenceCriteria &lhs, const ConvergenceCriteria &rhs) noexcept
 
std::ostreamoperator<< (std::ostream &os, const ConvergenceReason &convergence_reason) noexcept
 
boost::optional< ConvergenceReasonconvergence_criteria_match (const ConvergenceCriteria &convergence_criteria, const IterationId &iteration_id, double residual_magnitude, double initial_residual_magnitude) noexcept
 Determine whether the convergence_criteria are met. More...
 
std::ostreamoperator<< (std::ostream &os, const HasConverged &has_converged) noexcept
 
bool operator== (const HasConverged &lhs, const HasConverged &rhs) noexcept
 
bool operator!= (const HasConverged &lhs, const HasConverged &rhs) noexcept
 
template<typename Lhs , typename Rhs >
double inner_product (const Lhs &lhs, const Rhs &rhs) noexcept
 The local part of the Euclidean inner product on the vector space w.r.t. which the addition and scalar multiplication of both Lhs and Rhs is defined. More...
 
bool operator== (const IterationId &a, const IterationId &b) noexcept
 
bool operator!= (const IterationId &a, const IterationId &b) noexcept
 
bool operator< (const IterationId &a, const IterationId &b) noexcept
 
bool operator<= (const IterationId &a, const IterationId &b) noexcept
 
bool operator> (const IterationId &a, const IterationId &b) noexcept
 
bool operator>= (const IterationId &a, const IterationId &b) noexcept
 
std::ostreamoperator<< (std::ostream &s, const IterationId &id) noexcept
 
size_t hash_value (const IterationId &id) noexcept
 

Detailed Description

Functionality for solving linear systems of equations.

Enumeration Type Documentation

◆ ConvergenceReason

The reason the linear solver has converged.

See also
LinearSolver::ConvergenceCriteria

Function Documentation

◆ convergence_criteria_match()

boost::optional< ConvergenceReason > LinearSolver::convergence_criteria_match ( const ConvergenceCriteria convergence_criteria,
const IterationId iteration_id,
double  residual_magnitude,
double  initial_residual_magnitude 
)
noexcept

Determine whether the convergence_criteria are met.

Note
This function assumes the iteration_id is that of the next, but not yet performed step. For instance, a MaxIteration criterion of 1 will match if the iteration_id is 1 or higher, since the first iteration (with id 0) has been completed. At this point, also the residual_magnitude reflects the state of the algorithm after completion of the first iteration. The initial_residual_magnitude always refers to the state before the first iteration has begun.

Returns: a LinearSolver::ConvergenceReason if the criteria are met, or boost::none otherwise.