![]() |
Ginkgo
Generated from pipelines/2969282958 branch based on develop. Ginkgo version 2.0.0
A numerical linear algebra library targeting many-core architectures
|
This mixin provides a default implementation of a concrete factory. More...
#include <ginkgo/core/base/abstract_factory.hpp>
Inherits PolymorphicBase.
Inherited by gko::EnableDefaultReusableLinOpFactory< Factory, Multigrid, parameters_type, reuse_data_type >, gko::EnableDefaultReusableLinOpFactory< Factory, Pgm, parameters_type, reuse_data_type >, gko::batch::preconditioner::Jacobi< ValueType, IndexType >::Factory, gko::batch::solver::Bicgstab< ValueType >::Factory, gko::batch::solver::Cg< ValueType >::Factory, gko::EnableDefaultReusableLinOpFactory< ConcreteFactory, ConcreteLinOp, ParametersType, ReuseDataType, PolymorphicBase >, gko::experimental::distributed::preconditioner::Schwarz< ValueType, LocalIndexType, GlobalIndexType >::Factory, gko::experimental::reorder::ScaledReordered< ValueType, IndexType >::Factory, gko::experimental::solver::Direct< ValueType, IndexType >::Factory, gko::ext::cuda::solver::Cudss< ValueType, IndexType >::Factory, gko::factorization::Ic< ValueType, IndexType >::Factory, gko::factorization::Ilu< ValueType, IndexType >::Factory, gko::factorization::ParIc< ValueType, IndexType >::Factory, gko::factorization::ParIct< ValueType, IndexType >::Factory, gko::factorization::ParIlu< ValueType, IndexType >::Factory, gko::factorization::ParIlut< ValueType, IndexType >::Factory, gko::multigrid::FixedCoarsening< ValueType, IndexType >::Factory, gko::multigrid::Pmis< ValueType, IndexType >::Factory, gko::multigrid::Rs< ValueType, IndexType >::Factory, gko::multigrid::UniformCoarsening< ValueType, IndexType >::Factory, gko::preconditioner::Ic< ValueType, IndexType >::Factory, gko::preconditioner::Ilu< ValueType, ReverseApply, IndexType >::Factory, gko::preconditioner::Isai< IsaiType, ValueType, IndexType >::Factory, gko::preconditioner::Jacobi< ValueType, IndexType >::Factory, gko::preconditioner::NullspaceProjection< ValueType >::Factory, gko::reorder::Rcm< ValueType, IndexType >::Factory, gko::solver::Bicg< ValueType >::Factory, gko::solver::Bicgstab< ValueType >::Factory, gko::solver::CbGmres< ValueType >::Factory, gko::solver::Cg< ValueType >::Factory, gko::solver::Cgs< ValueType >::Factory, gko::solver::Chebyshev< ValueType >::Factory, gko::solver::Fcg< ValueType >::Factory, gko::solver::Gcr< ValueType >::Factory, gko::solver::Gmres< ValueType >::Factory, gko::solver::Idr< ValueType >::Factory, gko::solver::Ir< ValueType >::Factory, gko::solver::LowerTrs< ValueType, IndexType >::Factory, gko::solver::Minres< ValueType >::Factory, gko::solver::PipeCg< ValueType >::Factory, gko::solver::UpperTrs< ValueType, IndexType >::Factory, gko::stop::AbsoluteResidualNorm< ValueType >::Factory, gko::stop::Combined::Factory, gko::stop::ImplicitResidualNorm< ValueType >::Factory, gko::stop::Iteration::Factory, gko::stop::RelativeResidualNorm< ValueType >::Factory, gko::stop::ResidualNorm< ValueType >::Factory, gko::stop::ResidualNormReduction< ValueType >::Factory, and gko::stop::Time::Factory.
Public Member Functions | |
| template<typename... Args> | |
| std::unique_ptr< product_type > | generate (Args &&... args) const |
| const parameters_type & | get_parameters () const noexcept |
| Returns the parameters of the factory. More... | |
Static Public Member Functions | |
| static parameters_type | create () |
| Creates a new ParametersType object which can be used to instantiate a new ConcreteFactory. More... | |
This mixin provides a default implementation of a concrete factory.
It implements all the methods of AbstractFactory and PolymorphicObject. Its implementation of the generate_impl() method delegates the creation of the product by calling the ProductType::ProductType(const ConcreteFactory *, const components_type &) constructor. The factory also supports parameters by using the ParametersType structure, which is defined by the user.
For a simple example, see IntFactory in core/test/base/abstract_factory.cpp.
| ConcreteFactory | the concrete factory which is being implemented [CRTP parameter] |
| ProductType | the concrete type of products which this factory produces, has to be a subclass of PolymorphicBase::abstract_product_type |
| ParametersType | a type representing the parameters of the factory, has to inherit from the enable_parameters_type mixin |
| PolymorphicBase | parent of ConcreteFactory in the polymorphic hierarchy, has to be a subclass of AbstractFactory |
|
inlinestatic |
Creates a new ParametersType object which can be used to instantiate a new ConcreteFactory.
This method does not construct the factory directly, but returns a new parameters_type object, which can be used to set the parameters of the factory. Once the parameters have been set, the parameters_type::on() method can be used to obtain an instance of the factory with those parameters.
|
inlinenoexcept |
Returns the parameters of the factory.
1.8.16