33#ifndef GKO_PUBLIC_CORE_STOP_COMBINED_HPP_
34#define GKO_PUBLIC_CORE_STOP_COMBINED_HPP_
40#include <ginkgo/core/stop/criterion.hpp>
72 std::vector<std::shared_ptr<const CriterionFactory>>
73 GKO_DEFERRED_FACTORY_VECTOR_PARAMETER(
criteria);
79 friend class ::gko::EnablePolymorphicObject<
81 friend class ::gko::enable_parameters_type<parameters_type, Factory>;
88 explicit Factory(std::shared_ptr<const ::gko::Executor> exec);
89 explicit Factory(std::shared_ptr<const ::gko::Executor> exec,
100 const parameters_type& get_parameters()
const {
return parameters_; }
105 const Updater&)
override;
107 explicit Combined(std::shared_ptr<const gko::Executor> exec);
109 explicit Combined(
const Factory* factory,
const CriterionArgs&
args);
112 friend ::gko::stop::EnableDefaultCriterionFactory<Factory, Combined,
115 parameters_type parameters_;
117 std::vector<std::unique_ptr<Criterion>> criteria_{};
137template <
typename FactoryContainer>
142 GKO_NOT_SUPPORTED(
nullptr);
145 GKO_NOT_SUPPORTED(
nullptr);
151 GKO_NOT_SUPPORTED(
nullptr);
153 auto exec =
factories[0]->get_executor();
154 return Combined::build()
155 .with_criteria(std::forward<FactoryContainer>(
factories))
The AbstractFactory is a generic interface template that enables easy implementation of the abstract ...
Definition abstract_factory.hpp:75
This mixin provides a default implementation of a concrete factory.
Definition abstract_factory.hpp:154
This mixin inherits from (a subclass of) PolymorphicObject and provides a base implementation of a ne...
Definition polymorphic_object.hpp:691
The enable_parameters_type mixin is used to create a base implementation of the factory parameters st...
Definition abstract_factory.hpp:239
Definition combined.hpp:78
The Combined class is used to combine multiple criterions together through an OR operation.
Definition combined.hpp:55
The Criterion class is a base class for all stopping criteria.
Definition criterion.hpp:64
std::shared_ptr< const CriterionFactory > combine(FactoryContainer &&factories)
Combines multiple criterion factories into a single combined criterion factory.
Definition combined.hpp:138
The Ginkgo namespace.
Definition abstract_factory.hpp:48
constexpr T one()
Returns the multiplicative identity for T.
Definition math.hpp:803
std::uint8_t uint8
8-bit unsigned integral type.
Definition types.hpp:149
Definition combined.hpp:62
std::vector< std::shared_ptr< const CriterionFactory > > criteria
Criterion factories to combine.
Definition combined.hpp:73