33 #ifndef GKO_CORE_STOP_COMBINED_HPP_ 34 #define GKO_CORE_STOP_COMBINED_HPP_ 37 #include <ginkgo/core/stop/criterion.hpp> 70 std::vector<std::shared_ptr<const CriterionFactory>>
77 bool check_impl(
uint8 stoppingId,
bool setFinalized,
79 const Updater &)
override;
81 explicit Combined(std::shared_ptr<const gko::Executor> exec)
89 for (
const auto &f : parameters_.
criteria) {
90 criteria_.push_back(f->generate(args));
95 std::vector<std::unique_ptr<Criterion>> criteria_{};
115 template <
typename FactoryContainer>
116 std::shared_ptr<const CriterionFactory>
combine(FactoryContainer &&factories)
118 switch (factories.size()) {
120 GKO_NOT_SUPPORTED(
nullptr);
125 auto exec = factories[0]->get_executor();
126 return Combined::build()
127 .with_criteria(std::forward<FactoryContainer>(factories))
137 #endif // GKO_CORE_STOP_COMBINED_HPP_ std::vector< std::shared_ptr< const CriterionFactory > > criteria
Criterion factories to combine.
Definition: combined.hpp:71
const parameters_type & get_parameters() const noexcept
Returns the parameters of the factory.
Definition: abstract_factory.hpp:175
The Combined class is used to combine multiple criterions together through an OR operation.
Definition: combined.hpp:55
This mixin inherits from (a subclass of) PolymorphicObject and provides a base implementation of a ne...
Definition: polymorphic_object.hpp:505
#define GKO_FACTORY_PARAMETER(_name,...)
Creates a factory parameter in the factory parameters structure.
Definition: lin_op.hpp:751
The Ginkgo namespace.
Definition: abstract_factory.hpp:45
#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...
Definition: criterion.hpp:280
std::uint8_t uint8
8-bit unsigned integral type.
Definition: types.hpp:123
An Array is a container which encapsulates fixed-sized arrays, stored on the Executor tied to the Arr...
Definition: array.hpp:63
#define GKO_CREATE_FACTORY_PARAMETERS(_parameters_name, _factory_name)
This Macro will generate a new type containing the parameters for the factory _factory_name.
Definition: lin_op.hpp:611
Definition: combined.hpp:73
std::shared_ptr< const CriterionFactory > combine(FactoryContainer &&factories)
Combines multiple criterion factories into a single combined criterion factory.
Definition: combined.hpp:116
#define GKO_ENABLE_BUILD_METHOD(_factory_name)
Defines a build method for the factory, simplifying its construction by removing the repetitive typin...
Definition: lin_op.hpp:730
This struct is used to pass parameters to the EnableDefaultCriterionFactoryCriterionFactory::generate...
Definition: criterion.hpp:216