Fork me on GitHub
 All Classes Files Functions Variables Groups Pages
Classes | Typedefs | Functions | Variables

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 >
 

Typedefs

typedef cusp::norm_type
< ValueType >::type 
cusp::monitor< ValueType >::Real
 
typedef Parent::Real cusp::convergence_monitor< ValueType >::Real
 
typedef Parent::Real cusp::default_monitor< ValueType >::Real
 
typedef Parent::Real cusp::verbose_monitor< ValueType >::Real
 

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
 

Function Documentation

template<typename ValueType>
Real cusp::monitor< ValueType >::absolute_tolerance ( void  ) const

Returns the absolute tolerance.

Returns
absolute_tolerance set for monitor
template<typename ValueType>
Real cusp::monitor< ValueType >::average_rate ( void  )

Returns the average convergence rate.

Returns
average convergence rate.
template<typename ValueType>
bool cusp::monitor< ValueType >::converged ( void  ) const

Indicates whether the last tested residual satisfies the convergence tolerance.

Returns
Boolean convergence indicator
template<typename ValueType >
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 
)
inline

Constructs a convergence_monitor for a given right-hand-side b.

Template Parameters
VectorTypeType of initial vector
Parameters
bright-hand-side of the linear system A x = b
iteration_limitmaximum number of solver iterations to allow
relative_tolerancedetermines convergence criteria
absolute_tolerancedetermines convergence criteria
verboseControls printing status updates during execution
Deprecated:
As of v0.4.0 monitors have been unified. Use monitor instead.

Definition at line 283 of file monitor.h.

template<typename ValueType >
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 
)
inline

Constructs a default_monitor for a given right-hand-side b.

Template Parameters
VectorTypeType of initial vector
Parameters
bright-hand-side of the linear system A x = b
iteration_limitmaximum number of solver iterations to allow
relative_tolerancedetermines convergence criteria
absolute_tolerancedetermines convergence criteria
verboseControls printing status updates during execution
Deprecated:
As of v0.4.0 monitors have been unified. Use monitor instead.

Definition at line 317 of file monitor.h.

template<typename ValueType>
template<typename Vector >
bool cusp::monitor< ValueType >::finished ( const Vector &  r)

Applies convergence criteria to determine whether iteration is finished.

Template Parameters
Vectorvector
Parameters
rresidual vector of the linear system (r = b - A x)
template<typename ValueType>
Real cusp::monitor< ValueType >::geometric_rate ( void  )

Returns the geometric convergence rate.

Returns
geometric convergence rate.
template<typename ValueType>
Real cusp::monitor< ValueType >::immediate_rate ( void  )

Returns the immedidate convergence rate.

Returns
immediate convergence rate.
template<typename ValueType>
bool cusp::monitor< ValueType >::is_verbose ( void  )

Gets the verbosity level of the monitor.

Returns
verbosity of this monitor.
template<typename ValueType>
size_t cusp::monitor< ValueType >::iteration_count ( void  ) const

Returns the number of iterations that the monitor has executed.

Returns
Number of iterations
template<typename ValueType>
size_t cusp::monitor< ValueType >::iteration_limit ( void  ) const

Returns the maximum number of iterations.

Returns
Maximum number of allowed iterations
template<typename ValueType>
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.

Template Parameters
VectorTypeType of initial vector
Parameters
bright-hand-side of the linear system A x = b
iteration_limitmaximum number of solver iterations to allow
relative_tolerancedetermines convergence criteria
absolute_tolerancedetermines convergence criteria
verboseControls printing status updates during execution
template<typename ValueType>
Real cusp::monitor< ValueType >::relative_tolerance ( void  ) const

Returns the relative tolerance.

Returns
absolute_tolerance set for monitor
template<typename ValueType>
template<typename Vector >
void cusp::monitor< ValueType >::reset ( const Vector &  b)

Resets the monitor using same convergence criteria.

Template Parameters
Vectorvector
Parameters
binitial right hand side
template<typename ValueType>
Real cusp::monitor< ValueType >::residual_norm ( void  ) const

Euclidean norm of last residual.

Returns
The residual norm
template<typename ValueType>
void cusp::monitor< ValueType >::set_verbose ( bool  verbose_ = true)

Sets the verbosity level of the monitor.

Parameters
verbose_If true print convergence messages during iterations.
template<typename ValueType>
Real cusp::monitor< ValueType >::tolerance ( void  ) const

Return the tolerance equal to absolute_tolerance() + relative_tolerance() * ||b||.

Returns
tolerance set for monitor
template<typename ValueType >
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 
)
inline

Constructs a verbose_monitor for a given right-hand-side b.

Template Parameters
VectorTypeType of initial vector
Parameters
bright-hand-side of the linear system A x = b
iteration_limitmaximum number of solver iterations to allow
relative_tolerancedetermines convergence criteria
absolute_tolerancedetermines convergence criteria
verboseControls printing status updates during execution
Deprecated:
As of v0.4.0 monitors have been unified. Use monitor instead.

Definition at line 351 of file monitor.h.