Configurable convergence monitors for iterative solvers. More...
Classes | |
class | cusp::monitor< ValueType > |
Implements standard convergence criteria and reporting for iterative solvers. More... | |
class | cusp::convergence_monitor< ValueType > |
class | cusp::default_monitor< ValueType > |
class | cusp::verbose_monitor< ValueType > |
Functions | |
template<typename VectorType > | |
cusp::monitor< ValueType >::monitor (const VectorType &b, const size_t iteration_limit=500, const Real relative_tolerance=1e-5, const Real absolute_tolerance=0, const bool verbose=false) | |
Constructs a monitor for a given right-hand-side b . More... | |
void | cusp::monitor< ValueType >::operator++ (void) |
Increments the iteration count. | |
bool | cusp::monitor< ValueType >::converged (void) const |
Indicates whether the last tested residual satisfies the convergence tolerance. More... | |
Real | cusp::monitor< ValueType >::residual_norm (void) const |
Euclidean norm of last residual. More... | |
size_t | cusp::monitor< ValueType >::iteration_count (void) const |
Returns the number of iterations that the monitor has executed. More... | |
size_t | cusp::monitor< ValueType >::iteration_limit (void) const |
Returns the maximum number of iterations. More... | |
Real | cusp::monitor< ValueType >::relative_tolerance (void) const |
Returns the relative tolerance. More... | |
Real | cusp::monitor< ValueType >::absolute_tolerance (void) const |
Returns the absolute tolerance. More... | |
Real | cusp::monitor< ValueType >::tolerance (void) const |
Return the tolerance equal to absolute_tolerance() + relative_tolerance() * ||b||. More... | |
template<typename Vector > | |
bool | cusp::monitor< ValueType >::finished (const Vector &r) |
Applies convergence criteria to determine whether iteration is finished. More... | |
void | cusp::monitor< ValueType >::set_verbose (bool verbose_=true) |
Sets the verbosity level of the monitor. More... | |
bool | cusp::monitor< ValueType >::is_verbose (void) |
Gets the verbosity level of the monitor. More... | |
template<typename Vector > | |
void | cusp::monitor< ValueType >::reset (const Vector &b) |
Resets the monitor using same convergence criteria. More... | |
void | cusp::monitor< ValueType >::print (void) |
Prints the number of iterations and convergence history information. | |
Real | cusp::monitor< ValueType >::immediate_rate (void) |
Returns the immedidate convergence rate. More... | |
Real | cusp::monitor< ValueType >::geometric_rate (void) |
Returns the geometric convergence rate. More... | |
Real | cusp::monitor< ValueType >::average_rate (void) |
Returns the average convergence rate. More... | |
template<typename VectorType > | |
CUSP_DEPRECATED | cusp::convergence_monitor< ValueType >::convergence_monitor (const VectorType &b, const size_t iteration_limit=500, const Real relative_tolerance=1e-5, const Real absolute_tolerance=0) |
Constructs a convergence_monitor for a given right-hand-side b . More... | |
template<typename VectorType > | |
CUSP_DEPRECATED | cusp::default_monitor< ValueType >::default_monitor (const VectorType &b, const size_t iteration_limit=500, const Real relative_tolerance=1e-5, const Real absolute_tolerance=0) |
Constructs a default_monitor for a given right-hand-side b . More... | |
template<typename VectorType > | |
CUSP_DEPRECATED | cusp::verbose_monitor< ValueType >::verbose_monitor (const VectorType &b, const size_t iteration_limit=500, const Real relative_tolerance=1e-5, const Real absolute_tolerance=0) |
Constructs a verbose_monitor for a given right-hand-side b . More... | |
Variables | |
cusp::array1d< Real, cusp::host_memory > | cusp::monitor< ValueType >::residuals |
Real cusp::monitor< ValueType >::absolute_tolerance | ( | void | ) | const |
Returns the absolute tolerance.
Real cusp::monitor< ValueType >::average_rate | ( | void | ) |
Returns the average convergence rate.
bool cusp::monitor< ValueType >::converged | ( | void | ) | const |
Indicates whether the last tested residual satisfies the convergence tolerance.
|
inline |
Constructs a convergence_monitor
for a given right-hand-side b
.
VectorType | Type of initial vector |
b | right-hand-side of the linear system A x = b |
iteration_limit | maximum number of solver iterations to allow |
relative_tolerance | determines convergence criteria |
absolute_tolerance | determines convergence criteria |
verbose | Controls printing status updates during execution |
|
inline |
Constructs a default_monitor
for a given right-hand-side b
.
VectorType | Type of initial vector |
b | right-hand-side of the linear system A x = b |
iteration_limit | maximum number of solver iterations to allow |
relative_tolerance | determines convergence criteria |
absolute_tolerance | determines convergence criteria |
verbose | Controls printing status updates during execution |
bool cusp::monitor< ValueType >::finished | ( | const Vector & | r | ) |
Applies convergence criteria to determine whether iteration is finished.
Vector | vector |
r | residual vector of the linear system (r = b - A x) |
Real cusp::monitor< ValueType >::geometric_rate | ( | void | ) |
Returns the geometric convergence rate.
Real cusp::monitor< ValueType >::immediate_rate | ( | void | ) |
Returns the immedidate convergence rate.
bool cusp::monitor< ValueType >::is_verbose | ( | void | ) |
Gets the verbosity level of the monitor.
size_t cusp::monitor< ValueType >::iteration_count | ( | void | ) | const |
Returns the number of iterations that the monitor has executed.
size_t cusp::monitor< ValueType >::iteration_limit | ( | void | ) | const |
Returns the maximum number of iterations.
cusp::monitor< ValueType >::monitor | ( | const VectorType & | b, |
const size_t | iteration_limit = 500 , |
||
const Real | relative_tolerance = 1e-5 , |
||
const Real | absolute_tolerance = 0 , |
||
const bool | verbose = false |
||
) |
Constructs a monitor
for a given right-hand-side b
.
VectorType | Type of initial vector |
b | right-hand-side of the linear system A x = b |
iteration_limit | maximum number of solver iterations to allow |
relative_tolerance | determines convergence criteria |
absolute_tolerance | determines convergence criteria |
verbose | Controls printing status updates during execution |
Real cusp::monitor< ValueType >::relative_tolerance | ( | void | ) | const |
Returns the relative tolerance.
void cusp::monitor< ValueType >::reset | ( | const Vector & | b | ) |
Resets the monitor using same convergence criteria.
Vector | vector |
b | initial right hand side |
Real cusp::monitor< ValueType >::residual_norm | ( | void | ) | const |
Euclidean norm of last residual.
void cusp::monitor< ValueType >::set_verbose | ( | bool | verbose_ = true | ) |
Sets the verbosity level of the monitor.
verbose_ | If true print convergence messages during iterations. |
Real cusp::monitor< ValueType >::tolerance | ( | void | ) | const |
Return the tolerance equal to absolute_tolerance() + relative_tolerance() * ||b||.
|
inline |
Constructs a verbose_monitor
for a given right-hand-side b
.
VectorType | Type of initial vector |
b | right-hand-side of the linear system A x = b |
iteration_limit | maximum number of solver iterations to allow |
relative_tolerance | determines convergence criteria |
absolute_tolerance | determines convergence criteria |
verbose | Controls printing status updates during execution |