|
| std::unique_ptr< ConcreteType > | clone (std::shared_ptr< const Executor > exec) const |
| |
| std::unique_ptr< ConcreteType > | clone () const |
| | Creates a copy of this vector on the given executor. More...
|
| |
| ConcreteType * | copy_from (ptr_param< const ConcreteType > other) |
| |
| ConcreteType * | move_from (ptr_param< ConcreteType > other) |
| | Moves the data of other into this vector. More...
|
| |
| std::unique_ptr< ConcreteType > | create_default () const |
| | Creates an empty vector with the same type as this vector on the given executor. More...
|
| |
| std::unique_ptr< ConcreteType > | create_default (std::shared_ptr< const Executor > exec) const |
| |
| std::unique_ptr< ConcreteType > | create_subview (local_span rows, local_span columns) |
| | Creates a view containing the selected local rows and columns. More...
|
| |
| std::unique_ptr< const ConcreteType > | create_subview (local_span rows, local_span columns) const |
| | Creates a view containing the selected local rows and columns. More...
|
| |
| std::unique_ptr< ConcreteType > | create_subview (local_span rows, local_span columns, dim< 2 > global_size) |
| | Creates a view containing the selected local rows and columns. More...
|
| |
| std::unique_ptr< const ConcreteType > | create_subview (local_span rows, local_span columns, dim< 2 > global_size) const |
| | Creates a view containing the selected local rows and columns. More...
|
| |
| std::unique_ptr< const real_type > | create_real_view () const |
| | Create a real view of the (potentially) complex original multi-vector. More...
|
| |
| std::unique_ptr< real_type > | create_real_view () |
| | Create a real view of the (potentially) complex original multi-vector. More...
|
| |
| std::unique_ptr< absolute_type > | compute_absolute () const |
| | Creates a new vector with the element-wise absolute values of this vector. More...
|
| |
| void | compute_absolute (ptr_param< absolute_type > output) const |
| |
| std::unique_ptr< complex_type > | make_complex () const |
| | Creates a complex copy of this vector. More...
|
| |
| void | make_complex (ptr_param< complex_type > output) const |
| |
| std::unique_ptr< real_type > | get_real () const |
| | Creates a new real vector with the real parts of this vector. More...
|
| |
| void | get_real (ptr_param< real_type > output) const |
| |
| std::unique_ptr< real_type > | get_imag () const |
| | Creates a new real vector with the imaginary parts of this vector. More...
|
| |
| void | get_imag (ptr_param< real_type > output) const |
| |
| void | convert_to (result_type *result) const override |
| |
| void | move_to (result_type *result) override |
| | Converts the implementer to an object of type result_type by moving data from this object. More...
|
| |
| device_view | get_local_device_view () |
| | Gets a local device view of this vector. More...
|
| |
| const_device_view | get_const_local_device_view () const |
| | Gets a local device view of this vector. More...
|
| |
| template<typename ValueType > |
| device_view< const ValueType > | get_const_local_device_view () const |
| | Gets a local device view of this vector. More...
|
| |
| template<typename ValueType > |
| device_view< ValueType > | get_local_device_view () |
| | Gets a local device view of this vector for the specified value type. More...
|
| |
| std::unique_ptr< AbstractMultiVector > | clone (std::shared_ptr< const Executor > exec) const |
| | Creates a copy of this vector on the given executor. More...
|
| |
| std::unique_ptr< AbstractMultiVector > | clone () const |
| | Creates a copy of this vector on this vector's executor. More...
|
| |
| AbstractMultiVector * | copy_from (ptr_param< const AbstractMultiVector > other) |
| | Copies the data of other into this vector. More...
|
| |
| AbstractMultiVector * | move_from (ptr_param< AbstractMultiVector > other) |
| | Moves the data of other into this vector. More...
|
| |
| std::unique_ptr< AbstractMultiVector > | create_default (std::shared_ptr< const Executor > exec) const |
| | Creates an empty vector with the same type as this vector on the given executor. More...
|
| |
| std::unique_ptr< AbstractMultiVector > | create_default () const |
| | Creates an empty vector with the same type as this vector on this vector's executor. More...
|
| |
| std::unique_ptr< AbstractMultiVector > | compute_absolute () const |
| | Creates a new vector with the element-wise absolute values of this vector. More...
|
| |
| void | compute_absolute (ptr_param< AbstractMultiVector > output) const |
| | Writes the element-wise absolute values of this vector into output. More...
|
| |
| void | compute_absolute_inplace () |
| | Replaces each element of this vector with its absolute value. More...
|
| |
| std::unique_ptr< AbstractMultiVector > | make_complex () const |
| | Creates a complex copy of this vector. More...
|
| |
| void | make_complex (ptr_param< AbstractMultiVector > result) const |
| | Writes a complex copy of this vector into result. More...
|
| |
| std::unique_ptr< AbstractMultiVector > | get_real () const |
| | Creates a new real vector with the real parts of this vector. More...
|
| |
| void | get_real (ptr_param< AbstractMultiVector > result) const |
| | Writes the real parts of this vector into result. More...
|
| |
| std::unique_ptr< AbstractMultiVector > | get_imag () const |
| | Creates a new real vector with the imaginary parts of this vector. More...
|
| |
| void | get_imag (ptr_param< AbstractMultiVector > result) const |
| | Writes the imaginary parts of this vector into result. More...
|
| |
| void | fill (any_scalar value) |
| | Fills this vector with a single value. More...
|
| |
| void | scale (ptr_param< const AbstractMultiVector > alpha) |
| | Scales this multi-vector element-wise by alpha. More...
|
| |
| void | inv_scale (ptr_param< const AbstractMultiVector > alpha) |
| | Divides this multi-vector element-wise by alpha. More...
|
| |
| void | add_scaled (ptr_param< const AbstractMultiVector > alpha, ptr_param< const AbstractMultiVector > b) |
| | Adds b scaled by alpha to this (aka: BLAS axpy). More...
|
| |
| void | sub_scaled (ptr_param< const AbstractMultiVector > alpha, ptr_param< const AbstractMultiVector > b) |
| | Subtracts b scaled by alpha from this (aka: BLAS axpy). More...
|
| |
| void | compute_dot (ptr_param< const AbstractMultiVector > b, ptr_param< AbstractMultiVector > result) const |
| | Computes the column-wise dot product of this and b. More...
|
| |
| void | compute_dot (ptr_param< const AbstractMultiVector > b, ptr_param< AbstractMultiVector > result, array< char > &tmp) const |
| | Computes the column-wise dot product of this and b. More...
|
| |
| void | compute_conj_dot (ptr_param< const AbstractMultiVector > b, ptr_param< AbstractMultiVector > result) const |
| | Computes the column-wise dot product of conj(this) and b. More...
|
| |
| void | compute_conj_dot (ptr_param< const AbstractMultiVector > b, ptr_param< AbstractMultiVector > result, array< char > &tmp) const |
| | Computes the column-wise dot product of conj(this) and b. More...
|
| |
| void | compute_norm2 (ptr_param< AbstractMultiVector > result) const |
| | Computes the column-wise Euclidean (L^2) norm of this. More...
|
| |
| void | compute_norm2 (ptr_param< AbstractMultiVector > result, array< char > &tmp) const |
| | Computes the column-wise Euclidean (L^2) norm of this. More...
|
| |
| void | compute_squared_norm2 (ptr_param< AbstractMultiVector > result) const |
| | Computes the square of the column-wise Euclidean (L^2) norm of this. More...
|
| |
| void | compute_squared_norm2 (ptr_param< AbstractMultiVector > result, array< char > &tmp) const |
| | Computes the square of the column-wise Euclidean (L^2) norm of this. More...
|
| |
| void | compute_norm1 (ptr_param< AbstractMultiVector > result) const |
| | Computes the column-wise (L^1) norm of this. More...
|
| |
| void | compute_norm1 (ptr_param< AbstractMultiVector > result, array< char > &tmp) const |
| | Computes the column-wise (L^1) norm of this. More...
|
| |
| std::unique_ptr< const AbstractMultiVector > | create_real_view () const |
| | Create a real view of the (potentially) complex original multi-vector. More...
|
| |
| std::unique_ptr< AbstractMultiVector > | create_real_view () |
| | Create a real view of the (potentially) complex original multi-vector. More...
|
| |
| std::unique_ptr< AbstractMultiVector > | create_subview (local_span rows, local_span columns) |
| | Creates a view containing the selected local rows and columns. More...
|
| |
| std::unique_ptr< const AbstractMultiVector > | create_subview (local_span rows, local_span columns) const |
| | Creates a const view containing the selected local rows and columns. More...
|
| |
|
std::unique_ptr< AbstractMultiVector > | create_subview (local_span rows, local_span columns, dim< 2 > global_size) |
| | Creates a view with the selected rows, columns, and global size.
|
| |
|
std::unique_ptr< const AbstractMultiVector > | create_subview (local_span rows, local_span columns, dim< 2 > global_size) const |
| | Creates a const view with the selected rows, columns, and global size.
|
| |
| template<typename ValueType > |
| device_view< ValueType > | get_local_device_view () |
| | Gets a local device view of this vector for the specified value type. More...
|
| |
| template<typename ValueType > |
| device_view< const ValueType > | get_const_local_device_view () const |
| | Gets a local device view of this vector for the specified value type. More...
|
| |
| temporary_conversion< AbstractMultiVector > | as_precision (precision p) |
| | Creates a temporary conversion of this vector with another precision. More...
|
| |
| temporary_conversion< AbstractMultiVector > | as_precision (ptr_param< const AbstractMultiVector > p) |
| | Creates a temporary conversion of this vector with another precision. More...
|
| |
| temporary_conversion< const AbstractMultiVector > | as_precision (precision p) const |
| | Creates a temporary conversion of this vector with another precision. More...
|
| |
| temporary_conversion< const AbstractMultiVector > | as_precision (ptr_param< const AbstractMultiVector > p) const |
| | Creates a temporary conversion of this vector with another precision. More...
|
| |
| precision | get_precision () const noexcept |
| | Gets the precision of this vector. More...
|
| |
| dim< 2 > | get_size () const noexcept |
| | Gets the size (number of rows and columns) of this vector. More...
|
| |
| dim< 2 > | get_local_size () const noexcept |
| | Gets the size (number of rows and columns) locally owned by this vector. More...
|
| |
|
| AbstractMultiVector (const AbstractMultiVector &other) |
| |
|
| AbstractMultiVector (AbstractMultiVector &&other) noexcept |
| |
| AbstractMultiVector & | operator= (const AbstractMultiVector &other) |
| | Copies the contents of another multi-vector. More...
|
| |
| AbstractMultiVector & | operator= (AbstractMultiVector &&other) noexcept |
| | Moves the contents of another multi-vector. More...
|
| |
|
virtual void | validate_data () const |
| | Throws gko::InvalidData exception if we found the data inside the object does not fulfill certain property up to our knowledge.
|
| |
|
PolymorphicObject & | operator= (const PolymorphicObject &) |
| |
| std::shared_ptr< const Executor > | get_executor () const noexcept |
| | Returns the Executor of the object. More...
|
| |
|
void | add_logger (std::shared_ptr< const Logger > logger) override |
| |
|
void | remove_logger (const Logger *logger) override |
| |
|
void | remove_logger (ptr_param< const Logger > logger) |
| |
|
const std::vector< std::shared_ptr< const Logger > > & | get_loggers () const override |
| |
|
void | clear_loggers () override |
| |
|
void | remove_logger (ptr_param< const Logger > logger) |
| |
|
std::unique_ptr< Cloneable > | clone (std::shared_ptr< const Executor > exec) const |
| |
|
std::unique_ptr< Cloneable > | clone () const |
| |
|
Cloneable * | copy_from (ptr_param< const Cloneable > other) |
| |
|
Cloneable * | move_from (ptr_param< Cloneable > other) |
| |
|
std::unique_ptr< Cloneable > | create_default (std::shared_ptr< const Executor > exec) const |
| |
|
std::unique_ptr< Cloneable > | create_default () const |
| |
|
void | convert_to (ptr_param< result_type > result) const |
| |
|
void | move_to (ptr_param< result_type > result) |
| |
template<typename ConcreteType>
class gko::EnableMultiVector< ConcreteType >
Mixin class to simplify the implementation of the AbstractMultiVector interface.
The mixin is used for the following reasons:
- hide functions that return AbstractMultiVector and instead return ConcreteType
- handle the precision dispatch such that implementors are only required to implement virtual functions with concrete types
For example the clone function returns now ConcreteType, instead of an AbstractMultiVector. This means that if the concrete type is available, it is carried through. Here is an example:
{c++}
auto vec = ConcreteType::create(...);
auto clone = vec->clone();
The mixin handles the dispatch from the abstract interface functions to the concrete overridden functions. Two dispatches happen:
- To the same precision as this,
- To the same derived type as this.
Classes using this mixin need to only implement functions with concretized arguments. Especially any precision conversion is guaranteed to be unnecessary.
For example, the interface defines abstract virtual functions, such as AbstractMultiVector::add_scaled_impl(const AbstractMultiVector* alpha, const AbstractMultiVector* b). This function is overridden (with final) here. Classes using this mixin, instead override functions with concretized arguments, such as add_scaled_impl(scaling_param<value_type> alpha, const ConcreteType* b).
If a requested combination of precisions is not supported, for example scaling a real vector by a complex factor, then the dispatch throws NotImplemented instead of forwarding to the concretized function.
Besides the concretized virtual functions, ConcreteType has to provide:
- a specialization of vector_traits unless it's a templated class with the first template parameter as value type,
- a member function template
as_precision<ValueType>() returning a temporary_conversion of a vector with the requested value type, which is used to implement AbstractMultiVector::as_precision, and
- copy and move assignment, which are used to implement the conversion to and from ConcreteType.
- Template Parameters
-
| ConcreteType | Multi vector type to enable the mixin for. |