Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
cusp::default_block_monitor< ValueType > Class Template Reference

#include <block_monitor.h>

Public Types

typedef norm_type< ValueType >
::type 
Real
 

Public Member Functions

template<typename MV >
 default_block_monitor (const MV &b, size_t iteration_limit=500, Real absolute_tolerance=1e-6, Real relative_tolerance=1e-6, bool verbose=true)
 
void operator++ (void)
 
template<typename MV >
bool finished (const MV &r)
 
template<typename MV >
bool converged (MV &r) const
 
size_t iteration_count () const
 
size_t iteration_limit () const
 
Real relative_tolerance () const
 
Real absolute_tolerance () const
 
Real tolerance (int i) const
 

Protected Attributes

Real relative_tolerance_
 
Real absolute_tolerance_
 
bool verbose_
 
size_t numRHS
 
size_t iteration_limit_
 
size_t iteration_count_
 
cusp::array1d< ValueType,
cusp::host_memory > 
b_norm
 

Detailed Description

template<typename ValueType>
class cusp::default_block_monitor< ValueType >

default_monitor : Implements standard convergence criteria and reporting for iterative solvers.

Template Parameters
ValueTypescalar type used in the solver (e.g. float or cusp::complex<double>).
See Also
verbose_monitor

Definition at line 63 of file block_monitor.h.

Member Typedef Documentation

template<typename ValueType>
typedef norm_type<ValueType>::type cusp::default_block_monitor< ValueType >::Real

Definition at line 66 of file block_monitor.h.

Constructor & Destructor Documentation

template<typename ValueType>
template<typename MV >
cusp::default_block_monitor< ValueType >::default_block_monitor ( const MV &  b,
size_t  iteration_limit = 500,
Real  absolute_tolerance = 1e-6,
Real  relative_tolerance = 1e-6,
bool  verbose = true 
)
inline

Construct a default_monitor for a given right-hand-side b

The default_monitor terminates iteration when the residual norm satisfies the condition ||b - A x|| <= absolute_tolerance + relative_tolerance * ||b|| or when the iteration limit is reached.

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
Template Parameters
VectorTypevector

Definition at line 83 of file block_monitor.h.

Member Function Documentation

template<typename ValueType>
void cusp::default_block_monitor< ValueType >::operator++ ( void  )
inline

increment the iteration count

Definition at line 102 of file block_monitor.h.

template<typename ValueType>
template<typename MV >
bool cusp::default_block_monitor< ValueType >::finished ( const MV &  r)
inline

applies convergence criteria to determine whether iteration is finished

Parameters
rresidual vector of the linear system (r = b - A x)
Template Parameters
Vectorvector

Definition at line 110 of file block_monitor.h.

template<typename ValueType>
template<typename MV >
bool cusp::default_block_monitor< ValueType >::converged ( MV &  r) const
inline

whether the last tested residual satifies the convergence tolerance

Definition at line 160 of file block_monitor.h.

template<typename ValueType>
size_t cusp::default_block_monitor< ValueType >::iteration_count ( ) const
inline

number of iterations

Definition at line 174 of file block_monitor.h.

template<typename ValueType>
size_t cusp::default_block_monitor< ValueType >::iteration_limit ( ) const
inline

maximum number of iterations

Definition at line 178 of file block_monitor.h.

template<typename ValueType>
Real cusp::default_block_monitor< ValueType >::relative_tolerance ( ) const
inline

relative tolerance

Definition at line 182 of file block_monitor.h.

template<typename ValueType>
Real cusp::default_block_monitor< ValueType >::absolute_tolerance ( ) const
inline

absolute tolerance

Definition at line 186 of file block_monitor.h.

template<typename ValueType>
Real cusp::default_block_monitor< ValueType >::tolerance ( int  i) const
inline

tolerance

Equal to absolute_tolerance() + relative_tolerance() * ||b||

Definition at line 193 of file block_monitor.h.

Member Data Documentation

template<typename ValueType>
Real cusp::default_block_monitor< ValueType >::relative_tolerance_
protected

Definition at line 197 of file block_monitor.h.

template<typename ValueType>
Real cusp::default_block_monitor< ValueType >::absolute_tolerance_
protected

Definition at line 198 of file block_monitor.h.

template<typename ValueType>
bool cusp::default_block_monitor< ValueType >::verbose_
protected

Definition at line 199 of file block_monitor.h.

template<typename ValueType>
size_t cusp::default_block_monitor< ValueType >::numRHS
protected

Definition at line 200 of file block_monitor.h.

template<typename ValueType>
size_t cusp::default_block_monitor< ValueType >::iteration_limit_
protected

Definition at line 201 of file block_monitor.h.

template<typename ValueType>
size_t cusp::default_block_monitor< ValueType >::iteration_count_
protected

Definition at line 202 of file block_monitor.h.

template<typename ValueType>
cusp::array1d<ValueType, cusp::host_memory> cusp::default_block_monitor< ValueType >::b_norm
protected

Definition at line 203 of file block_monitor.h.


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