Ginkgo  Generated from tags/v1.0.0^0 branch based on master. Ginkgo version 1.0.0
A numerical linear algebra library targeting many-core architectures
Namespaces | Classes | Macros | Functions
Stopping criteria

A module dedicated to the implementation and usage of the Stopping Criteria in Ginkgo. More...

Namespaces

 gko::stop
 The Stopping criterion namespace.
 

Classes

class  gko::stop::Combined
 The Combined class is used to combine multiple criterions together through an OR operation. More...
 
class  gko::stop::Iteration
 The Iteration class is a stopping criterion which stops the iteration process after a preset number of iterations. More...
 
class  gko::stop::ResidualNormReduction< ValueType >
 The ResidualNormReduction class is a stopping criterion which stops the iteration process when the relative residual norm is below a certain threshold. More...
 
class  gko::stopping_status
 This class is used to keep track of the stopping status of one vector. More...
 
class  gko::stop::Time
 The Time class is a stopping criterion which stops the iteration process after a certain amout of time has passed. More...
 

Macros

#define GKO_ENABLE_CRITERION_FACTORY(_criterion, _parameters_name, _factory_name)
 This macro will generate a default implementation of a CriterionFactory for the Criterion subclass it is defined in. More...
 

Functions

template<typename FactoryContainer >
std::shared_ptr< const CriterionFactorygko::stop::combine (FactoryContainer &&factories)
 Combines multiple criterion factories into a single combined criterion factory. More...
 

Detailed Description

A module dedicated to the implementation and usage of the Stopping Criteria in Ginkgo.

Macro Definition Documentation

◆ GKO_ENABLE_CRITERION_FACTORY

#define GKO_ENABLE_CRITERION_FACTORY (   _criterion,
  _parameters_name,
  _factory_name 
)
Value:
public: \
const _parameters_name##_type &get_##_parameters_name() const \
{ \
return _parameters_name##_; \
} \
\
class _factory_name \
: public ::gko::stop::EnableDefaultCriterionFactory< \
_factory_name, _criterion, _parameters_name##_type> { \
friend class ::gko::EnablePolymorphicObject< \
_factory_name, ::gko::stop::CriterionFactory>; \
friend class ::gko::enable_parameters_type<_parameters_name##_type, \
_factory_name>; \
using ::gko::stop::EnableDefaultCriterionFactory< \
_factory_name, _criterion, \
_parameters_name##_type>::EnableDefaultCriterionFactory; \
}; \
friend ::gko::stop::EnableDefaultCriterionFactory< \
_factory_name, _criterion, _parameters_name##_type>; \
\
private: \
_parameters_name##_type _parameters_name##_; \
\
public: \
static_assert(true, \
"This assert is used to counter the false positive extra " \
"semi-colon warnings")
The AbstractFactory is a generic interface template that enables easy implementation of the abstract ...
Definition: abstract_factory.hpp:70

This macro will generate a default implementation of a CriterionFactory for the Criterion subclass it is defined in.

This macro is very similar to the macro #ENABLE_LIN_OP_FACTORY(). A more detailed description of the use of these type of macros can be found there.

Parameters
_criterionconcrete operator for which the factory is to be created [CRTP parameter]
_parameters_namename of the parameters member in the class (its type is <_parameters_name>_type, the protected member's name is <_parameters_name>_, and the public getter's name is get_<_parameters_name>())
_factory_namename of the generated factory type

Function Documentation

◆ combine()

template<typename FactoryContainer >
std::shared_ptr<const CriterionFactory> gko::stop::combine ( FactoryContainer &&  factories)

Combines multiple criterion factories into a single combined criterion factory.

This function treats a singleton container as a special case and avoids creating an additional object and just returns the input factory.

Template Parameters
FactoryContainera random access container type
Parameters
factoriesa list of factories to combined
Returns
a combined criterion factory if the input contains multiple factories or the input factory if the input contains only one factory