EnablePolymorphicAssignment< ConcreteType, ResultType > Class Template Reference#
|
Reference API
|
#include <ginkgo/core/base/polymorphic_object.hpp>
Inherits gko::ConvertibleTo< ResultType >.
Inherited by gko::EnableLinOp< StencilMatrix< ValueType > >, gko::EnableLinOp< BlockOperator >, gko::EnableLinOp< Combination< default_precision > >, gko::EnableLinOp< Composition< default_precision > >, gko::EnableLinOp< Perturbation< default_precision > >, gko::EnableLinOp< Matrix< default_precision, int32, int64 > >, gko::EnableLinOp< Vector< double > >, gko::EnableLinOp< Schwarz< default_precision, int32, int64 > >, gko::EnableLinOp< Factorization< ValueType, IndexType > >, gko::EnableLinOp< ScaledReordered< default_precision, int32 > >, gko::EnableLinOp< Direct< ValueType, IndexType > >, gko::EnableLinOp< Composition< gko::default_precision > >, gko::EnableLinOp< Coo< default_precision, int32 > >, gko::EnableLinOp< Csr< default_precision, int32 > >, gko::EnableLinOp< Dense< default_precision > >, gko::EnableLinOp< Diagonal< default_precision > >, gko::EnableLinOp< Ell< default_precision, int32 > >, gko::EnableLinOp< Fbcsr< default_precision, int32 > >, gko::EnableLinOp< Fft >, gko::EnableLinOp< Fft2 >, gko::EnableLinOp< Fft3 >, gko::EnableLinOp< Hybrid< default_precision, int32 > >, gko::EnableLinOp< Identity< default_precision > >, gko::EnableLinOp< Permutation< int32 > >, gko::EnableLinOp< RowGatherer< int32 > >, gko::EnableLinOp< ScaledPermutation< default_precision, int32 > >, gko::EnableLinOp< Sellp< default_precision, int32 > >, gko::EnableLinOp< SparsityCsr< default_precision, int32 > >, gko::EnableLinOp< FixedCoarsening< default_precision, int32 > >, gko::EnableLinOp< Pgm< default_precision, int32 > >, gko::EnableLinOp< Ic< solver::LowerTrs<>, int32 > >, gko::EnableLinOp< Ilu< solver::LowerTrs<>, solver::UpperTrs<>, false, int32 > >, gko::EnableLinOp< Isai< IsaiType, ValueType, IndexType > >, gko::EnableLinOp< Jacobi< default_precision, int32 > >, gko::EnableLinOp< Bicg< default_precision > >, gko::EnableLinOp< Bicgstab< default_precision > >, gko::EnableLinOp< CbGmres< default_precision > >, gko::EnableLinOp< Cg< default_precision > >, gko::EnableLinOp< Cgs< default_precision > >, gko::EnableLinOp< Fcg< default_precision > >, gko::EnableLinOp< Gcr< default_precision > >, gko::EnableLinOp< Gmres< default_precision > >, gko::EnableLinOp< Idr< default_precision > >, gko::EnableLinOp< Ir< default_precision > >, gko::EnableLinOp< LowerTrs< default_precision, int32 > >, gko::EnableLinOp< Minres< default_precision > >, gko::EnableLinOp< Multigrid >, gko::EnableLinOp< UpperTrs< default_precision, int32 > >, gko::EnableLinOp< Dense< value_type > >, gko::EnableLinOp< Dense< ValueType > >, gko::batch::EnableBatchLinOp< Csr< default_precision, int32 > >, gko::batch::EnableBatchLinOp< Dense< default_precision > >, gko::batch::EnableBatchLinOp< Ell< default_precision, int32 > >, gko::batch::EnableBatchLinOp< Identity< default_precision > >, gko::batch::EnableBatchLinOp< Jacobi< default_precision, int32 > >, gko::batch::EnableBatchLinOp< Bicgstab< default_precision >, BatchLinOp >, gko::batch::EnableBatchLinOp< Cg< default_precision >, BatchLinOp >, gko::batch::EnableBatchLinOp< ConcreteSolver, BatchLinOp >, gko::batch::MultiVector< ValueType >, gko::experimental::distributed::Partition< LocalIndexType, GlobalIndexType >, gko::experimental::reorder::Amd< IndexType >, gko::experimental::reorder::Mc64< ValueType, IndexType >, gko::preconditioner::GaussSeidel< ValueType, IndexType >, gko::preconditioner::Sor< ValueType, IndexType >, and gko::reorder::Rcm< ValueType, IndexType >.
Public Types | |
| using | result_type = ResultType |
Public Types inherited from gko::ConvertibleTo< ResultType > | |
| using | result_type = ResultType |
Public Member Functions | |
| void | convert_to (result_type *result) const override |
| void | move_to (result_type *result) override |
Public Member Functions inherited from gko::ConvertibleTo< ResultType > | |
| void | convert_to (ptr_param< result_type > result) const |
| void | move_to (ptr_param< result_type > result) |
Detailed Description
class gko::EnablePolymorphicAssignment< ConcreteType, ResultType >
This mixin is used to enable a default PolymorphicObject::copy_from() implementation for objects that have implemented conversions between them.
The requirement is that there is either a conversion constructor from ConcreteType in ResultType, or a conversion operator to ResultType in ConcreteType.
- Template Parameters
-
ConcreteType the concrete type from which the copy_from is being enabled [CRTP parameter] ResultType the type to which copy_from is being enabled
Member Function Documentation
◆ convert_to()
|
inlineoverridevirtual |
Converts the implementer to an object of type result_type.
- Parameters
-
result the object used to store the result of the conversion
Implements gko::ConvertibleTo< ResultType >.
◆ move_to()
|
inlineoverridevirtual |
Converts the implementer to an object of type result_type by moving data from this object.
This method is used when the implementer is a temporary object, and move semantics can be used.
- Parameters
-
result the object used to emplace the result of the conversion
- Note
- ConvertibleTo::move_to can be implemented by simply calling ConvertibleTo::convert_to. However, this operation can often be optimized by exploiting the fact that implementer's data can be moved to the result.
Implements gko::ConvertibleTo< ResultType >.
The documentation for this class was generated from the following file:
- ginkgo/core/base/polymorphic_object.hpp
Generated by
Public Types inherited from