Ginkgo  Generated from pipelines/3133041809 branch based on develop. Ginkgo version 2.0.0
A numerical linear algebra library targeting many-core architectures
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
gko::matrix::MultiVector< ValueType > Class Template Reference

MultiVector is a multivector format which explicitly stores all values of the vector. More...

#include <ginkgo/core/matrix/multivector.hpp>

Inheritance diagram for gko::matrix::MultiVector< ValueType >:
[legend]
Collaboration diagram for gko::matrix::MultiVector< ValueType >:
[legend]

Public Types

using value_type = typename EnableMultiVector< MultiVector >::value_type
 
using index_type = int64
 
using transposed_type = MultiVector< value_type >
 
using mat_data64 = matrix_data< value_type, int64 >
 
using mat_data32 = matrix_data< value_type, int32 >
 
using device_mat_data64 = device_matrix_data< value_type, int64 >
 
using device_mat_data32 = device_matrix_data< value_type, int32 >
 
using absolute_type = typename EnableMultiVector< MultiVector >::absolute_type
 
using real_type = typename EnableMultiVector< MultiVector >::real_type
 
using complex_type = typename EnableMultiVector< MultiVector >::complex_type
 
using norm_type = typename EnableMultiVector< MultiVector >::norm_type
 
using device_view = typename EnableMultiVector< MultiVector >::device_view
 
using const_device_view = typename EnableMultiVector< MultiVector >::const_device_view
 
using row_major_range = gko::range< gko::accessor::row_major< ValueType, 2 > >
 
- Public Types inherited from gko::EnableMultiVector< MultiVector< ValueType > >
using traits = vector_traits< MultiVector< ValueType > >
 The traits providing the types related to ConcreteType.
 
using value_type = typename traits::value_type
 The value type of the stored elements.
 
using absolute_value_type = typename traits::absolute_value_type
 The real counterpart of value_type.
 
using absolute_type = typename traits::absolute_type
 The vector type holding absolute values of this vector.
 
using real_type = typename traits::real_type
 The vector type holding real or imaginary parts of this vector.
 
using complex_type = typename traits::complex_type
 The vector type holding a complex version of this vector.
 
using result_type = MultiVector< ValueType >
 The target type of the conversions provided by this mixin.
 
using norm_type = matrix::MultiVector< absolute_value_type >
 The vector type used to store the results of reductions to norms.
 
using device_view = AbstractMultiVector::device_view< value_type >
 The mutable device view type of the local data.
 
using const_device_view = AbstractMultiVector::device_view< const value_type >
 The immutable device view type of the local data.
 
- Public Types inherited from gko::AbstractMultiVector
template<typename ValueType >
using device_view = matrix::view::dense< ValueType >
 
- Public Types inherited from gko::ConvertibleTo< MultiVector< ValueType > >
using result_type = MultiVector< ValueType >
 
- Public Types inherited from gko::ConvertibleTo< MultiVector< next_precision< ValueType > > >
using result_type = MultiVector< next_precision< ValueType > >
 
- Public Types inherited from gko::ConvertibleTo< Dense< ValueType > >
using result_type = Dense< ValueType >
 
- Public Types inherited from gko::ReadableFromMatrixData< ValueType, int32 >
using value_type = ValueType
 
using index_type = int32
 
- Public Types inherited from gko::ReadableFromMatrixData< ValueType, int64 >
using value_type = ValueType
 
using index_type = int64
 
- Public Types inherited from gko::WritableToMatrixData< ValueType, int32 >
using value_type = ValueType
 
using index_type = int32
 
- Public Types inherited from gko::WritableToMatrixData< ValueType, int64 >
using value_type = ValueType
 
using index_type = int64
 

Public Member Functions

void convert_to (MultiVector< next_precision< ValueType >> *result) const override
 
void move_to (MultiVector< next_precision< ValueType >> *result) override
 
void convert_to (Dense< ValueType > *result) const override
 
void move_to (Dense< ValueType > *result) override
 
void read (const mat_data64 &data) override
 
void read (const mat_data32 &data) override
 
void read (const device_mat_data64 &data) override
 
void read (const device_mat_data32 &data) override
 
void read (device_mat_data64 &&data) override
 
void read (device_mat_data32 &&data) override
 
void write (mat_data64 &data) const override
 
void write (mat_data32 &data) const override
 
std::unique_ptr< MultiVector > transpose () const
 
std::unique_ptr< MultiVector > conj_transpose () const
 
void transpose (ptr_param< MultiVector > output) const
 Writes the transposed multivector into the given output multivector. More...
 
void conj_transpose (ptr_param< MultiVector > output) const
 Writes the conjugate-transposed multivector into the given output multivector. More...
 
std::unique_ptr< MultiVector > permute (ptr_param< const Permutation< int32 >> permutation, permute_mode mode=permute_mode::symmetric) const
 Creates a permuted copy \(A'\) of this multivector \(A\) with the given permutation \(P\). More...
 
std::unique_ptr< MultiVector > permute (ptr_param< const Permutation< int64 >> permutation, permute_mode mode=permute_mode::symmetric) const
 
void permute (ptr_param< const Permutation< int32 >> permutation, ptr_param< MultiVector > output, permute_mode mode) const
 Overload of permute(ptr_param<const Permutation<int32>>, permute_mode) that writes the permuted copy into an existing MultiVector. More...
 
void permute (ptr_param< const Permutation< int64 >> permutation, ptr_param< MultiVector > output, permute_mode mode) const
 
std::unique_ptr< MultiVector > permute (ptr_param< const Permutation< int32 >> row_permutation, ptr_param< const Permutation< int32 >> column_permutation, bool invert=false) const
 Creates a non-symmetrically permuted copy \(A'\) of this multivector \(A\) with the given row and column permutations \(P\) and \(Q\). More...
 
std::unique_ptr< MultiVector > permute (ptr_param< const Permutation< int64 >> row_permutation, ptr_param< const Permutation< int64 >> column_permutation, bool invert=false) const
 
void permute (ptr_param< const Permutation< int32 >> row_permutation, ptr_param< const Permutation< int32 >> column_permutation, ptr_param< MultiVector > output, bool invert=false) const
 Overload of permute(ptr_param<const Permutation<int32>>, ptr_param<const Permutation<int32>>, permute_mode) that writes the permuted copy into an existing MultiVector. More...
 
void permute (ptr_param< const Permutation< int64 >> row_permutation, ptr_param< const Permutation< int64 >> column_permutation, ptr_param< MultiVector > output, bool invert=false) const
 
std::unique_ptr< MultiVector > scale_permute (ptr_param< const ScaledPermutation< value_type, int32 >> permutation, permute_mode mode=permute_mode::symmetric) const
 Creates a scaled and permuted copy of this multivector. More...
 
std::unique_ptr< MultiVector > scale_permute (ptr_param< const ScaledPermutation< value_type, int64 >> permutation, permute_mode mode=permute_mode::symmetric) const
 
void scale_permute (ptr_param< const ScaledPermutation< value_type, int32 >> permutation, ptr_param< MultiVector > output, permute_mode mode) const
 Overload of scale_permute(ptr_param<const ScaledPermutation<value_type, int32>>, permute_mode) that writes the permuted copy into an existing MultiVector. More...
 
void scale_permute (ptr_param< const ScaledPermutation< value_type, int64 >> permutation, ptr_param< MultiVector > output, permute_mode mode) const
 
std::unique_ptr< MultiVector > scale_permute (ptr_param< const ScaledPermutation< value_type, int32 >> row_permutation, ptr_param< const ScaledPermutation< value_type, int32 >> column_permutation, bool invert=false) const
 Creates a scaled and permuted copy of this multivector. More...
 
std::unique_ptr< MultiVector > scale_permute (ptr_param< const ScaledPermutation< value_type, int64 >> row_permutation, ptr_param< const ScaledPermutation< value_type, int64 >> column_permutation, bool invert=false) const
 
void scale_permute (ptr_param< const ScaledPermutation< value_type, int32 >> row_permutation, ptr_param< const ScaledPermutation< value_type, int32 >> column_permutation, ptr_param< MultiVector > output, bool invert=false) const
 Overload of scale_permute(ptr_param<const ScaledPermutation<value_type, int32>>, ptr_param<const ScaledPermutation<value_type, int32>>, bool) that writes the permuted copy into an existing MultiVector. More...
 
void scale_permute (ptr_param< const ScaledPermutation< value_type, int64 >> row_permutation, ptr_param< const ScaledPermutation< value_type, int64 >> column_permutation, ptr_param< MultiVector > output, bool invert=false) const
 
std::unique_ptr< MultiVector > permute (const array< int32 > *permutation_indices) const
 
std::unique_ptr< MultiVector > permute (const array< int64 > *permutation_indices) const
 
void permute (const array< int32 > *permutation_indices, ptr_param< MultiVector > output) const
 Writes the symmetrically permuted multivector into the given output multivector. More...
 
void permute (const array< int64 > *permutation_indices, ptr_param< MultiVector > output) const
 
std::unique_ptr< MultiVector > inverse_permute (const array< int32 > *permutation_indices) const
 
std::unique_ptr< MultiVector > inverse_permute (const array< int64 > *permutation_indices) const
 
void inverse_permute (const array< int32 > *permutation_indices, ptr_param< MultiVector > output) const
 Writes the inverse symmetrically permuted multivector into the given output multivector. More...
 
void inverse_permute (const array< int64 > *permutation_indices, ptr_param< MultiVector > output) const
 
std::unique_ptr< MultiVector > row_permute (const array< int32 > *permutation_indices) const
 
std::unique_ptr< MultiVector > row_permute (const array< int64 > *permutation_indices) const
 
void row_permute (const array< int32 > *permutation_indices, ptr_param< MultiVector > output) const
 Writes the row-permuted multivector into the given output multivector. More...
 
void row_permute (const array< int64 > *permutation_indices, ptr_param< MultiVector > output) const
 
std::unique_ptr< MultiVector > row_gather (const array< int32 > *gather_indices) const
 Create a MultiVector consisting of the given rows from this multivector. More...
 
std::unique_ptr< MultiVector > row_gather (const array< int64 > *gather_indices) const
 Create a MultiVector consisting of the given rows from this multivector. More...
 
void row_gather (const array< int32 > *gather_indices, ptr_param< AbstractMultiVector > row_collection) const
 Copies the given rows from this multivector into row_collection More...
 
void row_gather (const array< int64 > *gather_indices, ptr_param< AbstractMultiVector > row_collection) const
 
void row_gather (ptr_param< const AbstractMultiVector > alpha, const array< int32 > *gather_indices, ptr_param< const AbstractMultiVector > beta, ptr_param< AbstractMultiVector > row_collection) const
 Copies the given rows from this multivector into row_collection with scaling. More...
 
void row_gather (ptr_param< const AbstractMultiVector > alpha, const array< int64 > *gather_indices, ptr_param< const AbstractMultiVector > beta, ptr_param< AbstractMultiVector > row_collection) const
 
void scatter_add (const array< int32 > *scatter_indices, ptr_param< const AbstractMultiVector > source)
 Accumulates rows from source into this multivector at scattered positions: this(scatter_indices(i), j) += source(i, j) More...
 
void scatter_add (const array< int64 > *scatter_indices, ptr_param< const AbstractMultiVector > source)
 
std::unique_ptr< MultiVector > column_permute (const array< int32 > *permutation_indices) const
 
std::unique_ptr< MultiVector > column_permute (const array< int64 > *permutation_indices) const
 
void column_permute (const array< int32 > *permutation_indices, ptr_param< MultiVector > output) const
 Writes the column-permuted multivector into the given output multivector. More...
 
void column_permute (const array< int64 > *permutation_indices, ptr_param< MultiVector > output) const
 
std::unique_ptr< MultiVector > inverse_row_permute (const array< int32 > *permutation_indices) const
 
std::unique_ptr< MultiVector > inverse_row_permute (const array< int64 > *permutation_indices) const
 
void inverse_row_permute (const array< int32 > *permutation_indices, ptr_param< MultiVector > output) const
 Writes the inverse row-permuted multivector into the given output multivector. More...
 
void inverse_row_permute (const array< int64 > *permutation_indices, ptr_param< MultiVector > output) const
 
std::unique_ptr< MultiVector > inverse_column_permute (const array< int32 > *permutation_indices) const
 
std::unique_ptr< MultiVector > inverse_column_permute (const array< int64 > *permutation_indices) const
 
void inverse_column_permute (const array< int32 > *permutation_indices, ptr_param< MultiVector > output) const
 Writes the inverse column-permuted multivector into the given output multivector. More...
 
void inverse_column_permute (const array< int64 > *permutation_indices, ptr_param< MultiVector > output) const
 
value_type * get_values () noexcept
 Returns a pointer to the array of values of the multivector. More...
 
const value_type * get_const_values () const noexcept
 Returns a pointer to the array of values of the multivector. More...
 
size_type get_stride () const noexcept
 Returns the stride of the multivector. More...
 
size_type get_num_stored_elements () const noexcept
 Returns the number of elements explicitly stored in the multivector. More...
 
device_view get_device_view ()
 
const_device_view get_const_device_view () const
 
value_type & at (size_type row, size_type col) noexcept
 Returns a single element of the multivector. More...
 
value_type at (size_type row, size_type col) const noexcept
 Returns a single element of the multivector. More...
 
ValueType & at (size_type idx) noexcept
 Returns a single element of the multivector. More...
 
ValueType at (size_type idx) const noexcept
 Returns a single element of the multivector. More...
 
void compute_mean (ptr_param< AbstractMultiVector > result) const
 Computes the column-wise arithmetic mean of this multivector. More...
 
void compute_mean (ptr_param< AbstractMultiVector > result, array< char > &tmp) const
 Computes the column-wise arithmetic mean of this multivector. More...
 
void validate_data () const override
 Throws gko::InvalidData exception if we found the data inside the object does not fulfill certain property up to our knowledge.
 
std::unique_ptr< const Dense< ValueType > > as_const_dense_view () const
 
std::unique_ptr< Dense< ValueType > > as_dense_view ()
 
template<typename OtherValueType , typename = std::enable_if_t<is_complex<ValueType>() == is_complex<OtherValueType>()>>
temporary_conversion< MultiVector< OtherValueType > > as_precision ()
 Converts the vector to the target precision type. More...
 
template<typename OtherValueType , typename = std::enable_if_t<is_complex<ValueType>() == is_complex<OtherValueType>()>>
temporary_conversion< const MultiVector< OtherValueType > > as_precision () const
 Converts the vector to the target precision type. More...
 
MultiVector & operator= (const MultiVector &)
 Copy-assigns a MultiVector. More...
 
MultiVector & operator= (MultiVector &&)
 Move-assigns a MultiVector. More...
 
 MultiVector (const MultiVector &)
 Copy-constructs a MultiVector. More...
 
 MultiVector (MultiVector &&)
 Move-constructs a MultiVector. More...
 
- Public Member Functions inherited from gko::EnableMultiVector< MultiVector< ValueType > >
std::unique_ptr< MultiVector< ValueType > > clone (std::shared_ptr< const Executor > exec) const
 
std::unique_ptr< MultiVector< ValueType > > clone () const
 
MultiVector< ValueType > * copy_from (ptr_param< const MultiVector< ValueType > > other)
 
MultiVector< ValueType > * move_from (ptr_param< MultiVector< ValueType > > other)
 
std::unique_ptr< MultiVector< ValueType > > create_default () const
 
std::unique_ptr< MultiVector< ValueType > > create_default (std::shared_ptr< const Executor > exec) const
 
std::unique_ptr< MultiVector< ValueType > > create_subview (local_span rows, local_span columns)
 
std::unique_ptr< const MultiVector< ValueType > > create_subview (local_span rows, local_span columns) const
 
std::unique_ptr< MultiVector< ValueType > > create_subview (local_span rows, local_span columns, dim< 2 > global_size)
 
std::unique_ptr< const MultiVector< ValueType > > create_subview (local_span rows, local_span columns, dim< 2 > global_size) const
 
std::unique_ptr< const real_type > create_real_view () const
 
std::unique_ptr< real_type > create_real_view ()
 
std::unique_ptr< absolute_type > compute_absolute () const
 
void compute_absolute (ptr_param< absolute_type > output) const
 
std::unique_ptr< complex_type > make_complex () const
 
void make_complex (ptr_param< complex_type > output) const
 
std::unique_ptr< real_type > get_real () const
 
void get_real (ptr_param< real_type > output) const
 
std::unique_ptr< real_type > get_imag () const
 
void get_imag (ptr_param< real_type > output) const
 
void convert_to (result_type *result) const override
 
void move_to (result_type *result) override
 
device_view get_local_device_view ()
 Gets a local device view of this vector. More...
 
device_view< ValueType > get_local_device_view ()
 Gets a local device view of this vector for the specified value type. More...
 
const_device_view get_const_local_device_view () const
 Gets a local device view of this vector. More...
 
device_view< const ValueType > get_const_local_device_view () const
 Gets a local device view of this vector. More...
 
- Public Member Functions inherited from gko::AbstractMultiVector
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...
 
- Public Member Functions inherited from gko::PolymorphicObject
PolymorphicObject & operator= (const PolymorphicObject &)
 
std::shared_ptr< const Executor > get_executor () const noexcept
 Returns the Executor of the object. More...
 
- Public Member Functions inherited from gko::log::EnableLogging< PolymorphicObject >
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
 
- Public Member Functions inherited from gko::log::Loggable
void remove_logger (ptr_param< const Logger > logger)
 
- Public Member Functions inherited from gko::Cloneable
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
 
- Public Member Functions inherited from gko::ConvertibleTo< MultiVector< ValueType > >
void convert_to (ptr_param< result_type > result) const
 
void move_to (ptr_param< result_type > result)
 
- Public Member Functions inherited from gko::ConvertibleTo< MultiVector< next_precision< ValueType > > >
virtual void convert_to (result_type *result) const=0
 Converts the implementer to an object of type result_type. More...
 
void convert_to (ptr_param< result_type > result) const
 
virtual void move_to (result_type *result)=0
 Converts the implementer to an object of type result_type by moving data from this object. More...
 
void move_to (ptr_param< result_type > result)
 
- Public Member Functions inherited from gko::ConvertibleTo< Dense< ValueType > >
virtual void convert_to (result_type *result) const=0
 Converts the implementer to an object of type result_type. More...
 
void convert_to (ptr_param< result_type > result) const
 
virtual void move_to (result_type *result)=0
 Converts the implementer to an object of type result_type by moving data from this object. More...
 
void move_to (ptr_param< result_type > result)
 
- Public Member Functions inherited from gko::ReadableFromMatrixData< ValueType, int32 >
virtual void read (const matrix_data< ValueType, int32 > &data)=0
 Reads a matrix from a matrix_data structure. More...
 
void read (const matrix_assembly_data< ValueType, int32 > &data)
 Reads a matrix from a matrix_assembly_data structure. More...
 
virtual void read (const device_matrix_data< ValueType, int32 > &data)
 Reads a matrix from a device_matrix_data structure. More...
 
virtual void read (device_matrix_data< ValueType, int32 > &&data)
 Reads a matrix from a device_matrix_data structure. More...
 
- Public Member Functions inherited from gko::ReadableFromMatrixData< ValueType, int64 >
virtual void read (const matrix_data< ValueType, int64 > &data)=0
 Reads a matrix from a matrix_data structure. More...
 
void read (const matrix_assembly_data< ValueType, int64 > &data)
 Reads a matrix from a matrix_assembly_data structure. More...
 
virtual void read (const device_matrix_data< ValueType, int64 > &data)
 Reads a matrix from a device_matrix_data structure. More...
 
virtual void read (device_matrix_data< ValueType, int64 > &&data)
 Reads a matrix from a device_matrix_data structure. More...
 
- Public Member Functions inherited from gko::WritableToMatrixData< ValueType, int32 >
virtual void write (matrix_data< ValueType, int32 > &data) const=0
 Writes a matrix to a matrix_data structure. More...
 
virtual void write (device_matrix_data< ValueType, int32 > &data) const
 Writes a matrix to a device_matrix_data structure. More...
 
- Public Member Functions inherited from gko::WritableToMatrixData< ValueType, int64 >
virtual void write (matrix_data< ValueType, int64 > &data) const=0
 Writes a matrix to a matrix_data structure. More...
 
virtual void write (device_matrix_data< ValueType, int64 > &data) const
 Writes a matrix to a device_matrix_data structure. More...
 

Static Public Member Functions

static std::unique_ptr< MultiVector > create_with_type_of (ptr_param< const MultiVector > other, std::shared_ptr< const Executor > exec, const dim< 2 > &size, size_type stride)
 
static std::unique_ptr< MultiVector > create (std::shared_ptr< const Executor > exec, const dim< 2 > &size={}, size_type stride=0)
 Creates an uninitialized MultiVector of the specified size. More...
 
static std::unique_ptr< MultiVector > create (std::shared_ptr< const Executor > exec, const dim< 2 > &size, array< value_type > values, size_type stride)
 Creates a MultiVector from an already allocated (and initialized) array. More...
 
template<typename InputValueType >
static std::unique_ptr< MultiVector > create (std::shared_ptr< const Executor > exec, const dim< 2 > &size, std::initializer_list< InputValueType > values, size_type stride)
 create(std::shared_ptr<const More...
 
static std::unique_ptr< const MultiVector > create_const (std::shared_ptr< const Executor > exec, const dim< 2 > &size, gko::detail::const_array_view< ValueType > &&values, size_type stride)
 Creates a constant (immutable) MultiVector from a constant array. More...
 
- Static Public Member Functions inherited from gko::EnableMultiVector< MultiVector< ValueType > >
static std::unique_ptr< MultiVector< ValueType > > create_with_config_of (ptr_param< const MultiVector< ValueType > > other)
 
static std::unique_ptr< MultiVector< ValueType > > create_with_type_of (ptr_param< const MultiVector< ValueType > > other, std::shared_ptr< const Executor > exec)
 
static std::unique_ptr< MultiVector< ValueType > > create_with_type_of (ptr_param< const MultiVector< ValueType > > other, std::shared_ptr< const Executor > exec, const dim< 2 > &global_size, const dim< 2 > &local_size)
 
static std::unique_ptr< MultiVector< ValueType > > create_with_type_of (ptr_param< const MultiVector< ValueType > > other, std::shared_ptr< const Executor > exec, const dim< 2 > &global_size, const dim< 2 > &local_size, size_type stride)
 
- Static Public Member Functions inherited from gko::AbstractMultiVector
static std::unique_ptr< AbstractMultiVector > create_with_config_of (ptr_param< const AbstractMultiVector > other)
 Creates an empty multi-vector with the same type, executor, size, stride and precision as other. More...
 
static std::unique_ptr< AbstractMultiVector > create_with_type_of (ptr_param< const AbstractMultiVector > other, std::shared_ptr< const Executor > exec)
 Creates an empty multi-vector with the same type as other on exec. More...
 
static std::unique_ptr< AbstractMultiVector > create_with_type_of (ptr_param< const AbstractMultiVector > other, std::shared_ptr< const Executor > exec, const dim< 2 > &global_size, const dim< 2 > &local_size)
 Creates an empty multi-vector with the same type as other and the given size. More...
 
static std::unique_ptr< AbstractMultiVector > create_with_type_of (ptr_param< const AbstractMultiVector > other, std::shared_ptr< const Executor > exec, const dim< 2 > &global_size, const dim< 2 > &local_size, size_type stride)
 Creates an empty multi-vector with the same type as other and the given size and stride. More...
 

Friends

class Dense< ValueType >
 
class MultiVector< to_complex< ValueType > >
 
class EnableMultiVector< MultiVector >
 
class experimental::distributed::Vector< ValueType >
 
class MultiVector< previous_precision< ValueType > >
 

Detailed Description

template<typename ValueType = default_precision>
class gko::matrix::MultiVector< ValueType >

MultiVector is a multivector format which explicitly stores all values of the vector.

The values are stored in row-major format (values belonging to the same row appear consecutive in the memory). Optionally, rows can be padded for better memory access.

Note
A multi-vector can be viewed as a matrix::Dense with no overhead. This allows to use matrix exclusive operations on vectors, e.g. apply, etc.
Template Parameters
ValueTypeprecision of multivector elements

Constructor & Destructor Documentation

◆ MultiVector() [1/2]

template<typename ValueType = default_precision>
gko::matrix::MultiVector< ValueType >::MultiVector ( const MultiVector< ValueType > &  )

Copy-constructs a MultiVector.

Inherits executor and dimensions, but copies data without padding.

◆ MultiVector() [2/2]

template<typename ValueType = default_precision>
gko::matrix::MultiVector< ValueType >::MultiVector ( MultiVector< ValueType > &&  )

Move-constructs a MultiVector.

Inherits executor, dimensions and data with padding. The moved-from object is empty (0x0 with empty Array).

Member Function Documentation

◆ as_precision() [1/2]

template<typename ValueType = default_precision>
template<typename OtherValueType , typename = std::enable_if_t<is_complex<ValueType>() == is_complex<OtherValueType>()>>
temporary_conversion<MultiVector<OtherValueType> > gko::matrix::MultiVector< ValueType >::as_precision ( )

Converts the vector to the target precision type.

Note
This overload will include a copy-back operation when the temporary conversion is destroyed, if OtherValueType != ValueType.
Template Parameters
OtherValueTypeThe target precision type. If ValueType is real, OtherValueType must be real. If ValueType is complex, OtherValueType must be complex.
Returns
Temporary conversion to the target precision type.

◆ as_precision() [2/2]

template<typename ValueType = default_precision>
template<typename OtherValueType , typename = std::enable_if_t<is_complex<ValueType>() == is_complex<OtherValueType>()>>
temporary_conversion<const MultiVector<OtherValueType> > gko::matrix::MultiVector< ValueType >::as_precision ( ) const

Converts the vector to the target precision type.

Template Parameters
OtherValueTypeThe target precision type. If ValueType is real, OtherValueType must be real. If ValueType is complex, OtherValueType must be complex.
Returns
Temporary conversion to the target precision type.

◆ at() [1/4]

template<typename ValueType = default_precision>
ValueType gko::matrix::MultiVector< ValueType >::at ( size_type  idx) const
inlinenoexcept

Returns a single element of the multivector.

Useful for iterating across all elements of the multivector. However, it is less efficient than the two-parameter variant of this method.

Parameters
idxa linear index of the requested element (ignoring the stride)
Note
the method has to be called on the same Executor the multivector is stored at (e.g. trying to call this method on a GPU multivector from the OMP results in a runtime error)

◆ at() [2/4]

template<typename ValueType = default_precision>
ValueType& gko::matrix::MultiVector< ValueType >::at ( size_type  idx)
inlinenoexcept

Returns a single element of the multivector.

Useful for iterating across all elements of the multivector. However, it is less efficient than the two-parameter variant of this method.

Parameters
idxa linear index of the requested element (ignoring the stride)
Note
the method has to be called on the same Executor the multivector is stored at (e.g. trying to call this method on a GPU multivector from the OMP results in a runtime error)

◆ at() [3/4]

template<typename ValueType = default_precision>
value_type gko::matrix::MultiVector< ValueType >::at ( size_type  row,
size_type  col 
) const
inlinenoexcept

Returns a single element of the multivector.

Parameters
rowthe row of the requested element
colthe column of the requested element
Note
the method has to be called on the same Executor the multivector is stored at (e.g. trying to call this method on a GPU multivector from the OMP results in a runtime error)

◆ at() [4/4]

template<typename ValueType = default_precision>
value_type& gko::matrix::MultiVector< ValueType >::at ( size_type  row,
size_type  col 
)
inlinenoexcept

Returns a single element of the multivector.

Parameters
rowthe row of the requested element
colthe column of the requested element
Note
the method has to be called on the same Executor the multivector is stored at (e.g. trying to call this method on a GPU multivector from the OMP results in a runtime error)

◆ column_permute() [1/2]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::column_permute ( const array< int32 > *  permutation_indices,
ptr_param< MultiVector< ValueType > >  output 
) const

Writes the column-permuted multivector into the given output multivector.

Parameters
permutation_indicesThe array containing permutation indices. It must have this->get_size()[1] elements.
outputThe output multivector. It must have the dimensions this->get_size()
See also
MultiVector::column_permute(const array<int32>*)

◆ column_permute() [2/2]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::column_permute ( const array< int64 > *  permutation_indices,
ptr_param< MultiVector< ValueType > >  output 
) const

◆ compute_mean() [1/2]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::compute_mean ( ptr_param< AbstractMultiVector< ValueType > >  result) const

Computes the column-wise arithmetic mean of this multivector.

Parameters
resulta MultiVector row vector, used to store the mean (the number of columns in the vector must match the number of columns of this)

◆ compute_mean() [2/2]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::compute_mean ( ptr_param< AbstractMultiVector< ValueType > >  result,
array< char > &  tmp 
) const

Computes the column-wise arithmetic mean of this multivector.

Parameters
resulta MultiVector row vector, used to store the mean (the number of columns in the vector must match the number of columns of this)
tmpthe temporary storage to use for partial sums during the reduction computation. It may be resized and/or reset to the correct executor.

◆ conj_transpose()

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::conj_transpose ( ptr_param< MultiVector< ValueType > >  output) const

Writes the conjugate-transposed multivector into the given output multivector.

Parameters
outputThe output multivector. It must have the dimensions gko::transpose(this->get_size())

◆ create() [1/3]

template<typename ValueType = default_precision>
static std::unique_ptr<MultiVector> gko::matrix::MultiVector< ValueType >::create ( std::shared_ptr< const Executor >  exec,
const dim< 2 > &  size,
array< value_type >  values,
size_type  stride 
)
static

Creates a MultiVector from an already allocated (and initialized) array.

Parameters
execExecutor associated to the multivector
sizesize of the multivector
valuesarray of multivector values
stridestride of the rows (i.e. offset between the first elements of two consecutive rows, expressed as the number of multivector elements)
Note
If values is not an rvalue, not an array of ValueType, or is on the wrong executor, an internal copy will be created, and the original array data will not be used in the multivector.
Returns
A smart pointer to the newly created multivector.

◆ create() [2/3]

template<typename ValueType = default_precision>
template<typename InputValueType >
static std::unique_ptr<MultiVector> gko::matrix::MultiVector< ValueType >::create ( std::shared_ptr< const Executor >  exec,
const dim< 2 > &  size,
std::initializer_list< InputValueType >  values,
size_type  stride 
)
inlinestatic

create(std::shared_ptr<const

create(std::shared_ptr<const executor>="">, const dim<2>&, array<value_type>, size_type)

◆ create() [3/3]

template<typename ValueType = default_precision>
static std::unique_ptr<MultiVector> gko::matrix::MultiVector< ValueType >::create ( std::shared_ptr< const Executor >  exec,
const dim< 2 > &  size = {},
size_type  stride = 0 
)
static

Creates an uninitialized MultiVector of the specified size.

Parameters
execExecutor associated to the multivector
sizesize of the multivector
stridestride of the rows (i.e. offset between the first elements of two consecutive rows, expressed as the number of multivector elements). If it is set to 0, size[1] will be used instead.
Returns
A smart pointer to the newly created multivector.

Referenced by gko::matrix::MultiVector< value_type >::create().

◆ create_const()

template<typename ValueType = default_precision>
static std::unique_ptr<const MultiVector> gko::matrix::MultiVector< ValueType >::create_const ( std::shared_ptr< const Executor >  exec,
const dim< 2 > &  size,
gko::detail::const_array_view< ValueType > &&  values,
size_type  stride 
)
static

Creates a constant (immutable) MultiVector from a constant array.

Parameters
execthe executor to create the multivector on
sizethe dimensions of the multivector
valuesthe value array of the multivector
stridethe row-stride of the multivector
Returns
A smart pointer to the constant multivector wrapping the input array (if it resides on the same executor as the multivector) or a copy of the array on the correct executor.

◆ get_const_values()

template<typename ValueType = default_precision>
const value_type* gko::matrix::MultiVector< ValueType >::get_const_values ( ) const
inlinenoexcept

Returns a pointer to the array of values of the multivector.

Returns
the pointer to the array of values
Note
This is the constant version of the function, which can be significantly more memory efficient than the non-constant version, so always prefer this version.

◆ get_num_stored_elements()

template<typename ValueType = default_precision>
size_type gko::matrix::MultiVector< ValueType >::get_num_stored_elements ( ) const
inlinenoexcept

Returns the number of elements explicitly stored in the multivector.

Returns
the number of elements explicitly stored in the multivector

◆ get_stride()

template<typename ValueType = default_precision>
size_type gko::matrix::MultiVector< ValueType >::get_stride ( ) const
inlinenoexcept

Returns the stride of the multivector.

Returns
the stride of the multivector.

◆ get_values()

template<typename ValueType = default_precision>
value_type* gko::matrix::MultiVector< ValueType >::get_values ( )
inlinenoexcept

Returns a pointer to the array of values of the multivector.

Returns
the pointer to the array of values

◆ inverse_column_permute() [1/2]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::inverse_column_permute ( const array< int32 > *  permutation_indices,
ptr_param< MultiVector< ValueType > >  output 
) const

Writes the inverse column-permuted multivector into the given output multivector.

Parameters
permutation_indicesThe array containing permutation indices. It must have this->get_size()[1] elements.
outputThe output multivector. It must have the dimensions this->get_size()
See also
MultiVector::inverse_column_permute(const array<int32>*)

◆ inverse_column_permute() [2/2]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::inverse_column_permute ( const array< int64 > *  permutation_indices,
ptr_param< MultiVector< ValueType > >  output 
) const

◆ inverse_permute() [1/2]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::inverse_permute ( const array< int32 > *  permutation_indices,
ptr_param< MultiVector< ValueType > >  output 
) const

Writes the inverse symmetrically permuted multivector into the given output multivector.

Parameters
permutation_indicesThe array containing permutation indices. It must have this->get_size()[0] elements.
outputThe output multivector. It must have the dimensions this->get_size()
See also
MultiVector::inverse_permute(const array<int32>*)

◆ inverse_permute() [2/2]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::inverse_permute ( const array< int64 > *  permutation_indices,
ptr_param< MultiVector< ValueType > >  output 
) const

◆ inverse_row_permute() [1/2]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::inverse_row_permute ( const array< int32 > *  permutation_indices,
ptr_param< MultiVector< ValueType > >  output 
) const

Writes the inverse row-permuted multivector into the given output multivector.

Parameters
permutation_indicesThe array containing permutation indices. It must have this->get_size()[0] elements.
outputThe output multivector. It must have the dimensions this->get_size()
See also
MultiVector::inverse_row_permute(const array<int32>*)

◆ inverse_row_permute() [2/2]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::inverse_row_permute ( const array< int64 > *  permutation_indices,
ptr_param< MultiVector< ValueType > >  output 
) const

◆ operator=() [1/2]

template<typename ValueType = default_precision>
MultiVector& gko::matrix::MultiVector< ValueType >::operator= ( const MultiVector< ValueType > &  )

Copy-assigns a MultiVector.

Preserves the executor, reallocates the multivector with minimal stride if the dimensions don't match, then copies the data over, ignoring padding.

◆ operator=() [2/2]

template<typename ValueType = default_precision>
MultiVector& gko::matrix::MultiVector< ValueType >::operator= ( MultiVector< ValueType > &&  )

Move-assigns a MultiVector.

Preserves the executor, moves the data over preserving size and stride. Leaves the moved-from object in an empty state (0x0 with empty Array).

◆ permute() [1/10]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::permute ( const array< int32 > *  permutation_indices,
ptr_param< MultiVector< ValueType > >  output 
) const

Writes the symmetrically permuted multivector into the given output multivector.

Parameters
permutation_indicesThe array containing permutation indices. It must have this->get_size()[0] elements.
outputThe output multivector. It must have the dimensions this->get_size()
See also
MultiVector::permute(const array<int32>*)

◆ permute() [2/10]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::permute ( const array< int64 > *  permutation_indices,
ptr_param< MultiVector< ValueType > >  output 
) const

◆ permute() [3/10]

template<typename ValueType = default_precision>
std::unique_ptr<MultiVector> gko::matrix::MultiVector< ValueType >::permute ( ptr_param< const Permutation< int32 >>  permutation,
permute_mode  mode = permute_mode::symmetric 
) const

Creates a permuted copy \(A'\) of this multivector \(A\) with the given permutation \(P\).

By default, this computes a symmetric permutation (permute_mode::symmetric). For the effect of the different permutation modes, see permute_mode.

Parameters
permutationThe input permutation.
modeThe permutation mode, see permute_mode.
Returns
The permuted multivector.

◆ permute() [4/10]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::permute ( ptr_param< const Permutation< int32 >>  permutation,
ptr_param< MultiVector< ValueType > >  output,
permute_mode  mode 
) const

Overload of permute(ptr_param<const Permutation<int32>>, permute_mode) that writes the permuted copy into an existing MultiVector.

Parameters
permutationthe input permutation.
outputthe output multivector.
modethe permutation mode, see permute_mode.

◆ permute() [5/10]

template<typename ValueType = default_precision>
std::unique_ptr<MultiVector> gko::matrix::MultiVector< ValueType >::permute ( ptr_param< const Permutation< int32 >>  row_permutation,
ptr_param< const Permutation< int32 >>  column_permutation,
bool  invert = false 
) const

Creates a non-symmetrically permuted copy \(A'\) of this multivector \(A\) with the given row and column permutations \(P\) and \(Q\).

The operation will compute \(A'(i, j) = A(p[i], q[j])\), or \(A' = P A Q^T\) if invert is false, and \(A'(p[i], q[j]) = A(i,j)\), or \(A' = P^{-1} A Q^{-T}\) if invert is true.

Parameters
row_permutationThe permutation \(P\) to apply to the rows
column_permutationThe permutation \(Q\) to apply to the columns
invertIf set to false, uses the input permutations, otherwise uses their inverses \(P^{-1}, Q^{-1}\)
Returns
The permuted multivector.

◆ permute() [6/10]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::permute ( ptr_param< const Permutation< int32 >>  row_permutation,
ptr_param< const Permutation< int32 >>  column_permutation,
ptr_param< MultiVector< ValueType > >  output,
bool  invert = false 
) const

Overload of permute(ptr_param<const Permutation<int32>>, ptr_param<const Permutation<int32>>, permute_mode) that writes the permuted copy into an existing MultiVector.

Parameters
row_permutationthe row permutation.
column_permutationthe column permutation.
outputthe output multivector.
invertif true, the inverse permutations are used.

◆ permute() [7/10]

template<typename ValueType = default_precision>
std::unique_ptr<MultiVector> gko::matrix::MultiVector< ValueType >::permute ( ptr_param< const Permutation< int64 >>  permutation,
permute_mode  mode = permute_mode::symmetric 
) const

◆ permute() [8/10]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::permute ( ptr_param< const Permutation< int64 >>  permutation,
ptr_param< MultiVector< ValueType > >  output,
permute_mode  mode 
) const

◆ permute() [9/10]

template<typename ValueType = default_precision>
std::unique_ptr<MultiVector> gko::matrix::MultiVector< ValueType >::permute ( ptr_param< const Permutation< int64 >>  row_permutation,
ptr_param< const Permutation< int64 >>  column_permutation,
bool  invert = false 
) const

◆ permute() [10/10]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::permute ( ptr_param< const Permutation< int64 >>  row_permutation,
ptr_param< const Permutation< int64 >>  column_permutation,
ptr_param< MultiVector< ValueType > >  output,
bool  invert = false 
) const

◆ row_gather() [1/6]

template<typename ValueType = default_precision>
std::unique_ptr<MultiVector> gko::matrix::MultiVector< ValueType >::row_gather ( const array< int32 > *  gather_indices) const

Create a MultiVector consisting of the given rows from this multivector.

Parameters
gather_indicespointer to an array containing row indices from this multivector. It may contain duplicates.
Returns
MultiVector on the same executor with the same number of columns and gather_indices->get_size() rows containing the gathered rows from this multivector: output(i,j) = input(gather_indices(i), j)

◆ row_gather() [2/6]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::row_gather ( const array< int32 > *  gather_indices,
ptr_param< AbstractMultiVector< ValueType > >  row_collection 
) const

Copies the given rows from this multivector into row_collection

Parameters
gather_indicespointer to an array containing row indices from this multivector. It may contain duplicates.
row_collectionpointer to a AbstractMultiVector that will store the gathered rows: row_collection(i,j) = input(gather_indices(i), j) It must have the same number of columns as this multivector and gather_indices->get_size() rows.

◆ row_gather() [3/6]

template<typename ValueType = default_precision>
std::unique_ptr<MultiVector> gko::matrix::MultiVector< ValueType >::row_gather ( const array< int64 > *  gather_indices) const

Create a MultiVector consisting of the given rows from this multivector.

Parameters
gather_indicespointer to an array containing row indices from this multivector. It may contain duplicates.
Returns
MultiVector on the same executor with the same number of columns and gather_indices->get_size() rows containing the gathered rows from this multivector: output(i,j) = input(gather_indices(i), j)

◆ row_gather() [4/6]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::row_gather ( const array< int64 > *  gather_indices,
ptr_param< AbstractMultiVector< ValueType > >  row_collection 
) const

const

◆ row_gather() [5/6]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::row_gather ( ptr_param< const AbstractMultiVector< ValueType > >  alpha,
const array< int32 > *  gather_indices,
ptr_param< const AbstractMultiVector< ValueType > >  beta,
ptr_param< AbstractMultiVector< ValueType > >  row_collection 
) const

Copies the given rows from this multivector into row_collection with scaling.

Parameters
alphascaling the result of row gathering
gather_indicespointer to an array containing row indices from this multivector. It may contain duplicates.
betascaling the input row_collection
row_collectionpointer to a AbstractMultiVector that will store the gathered rows: row_collection(i,j) = input(gather_indices(i), j) It must have the same number of columns as this multivector and gather_indices->get_size() rows.

◆ row_gather() [6/6]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::row_gather ( ptr_param< const AbstractMultiVector< ValueType > >  alpha,
const array< int64 > *  gather_indices,
ptr_param< const AbstractMultiVector< ValueType > >  beta,
ptr_param< AbstractMultiVector< ValueType > >  row_collection 
) const

Parameters
alphascaling the result of row gathering
gather_indicespointer to an array containing row indices from this multivector. It may contain duplicates.
betascaling the input row_collection
row_collectionpointer to a AbstractMultiVector that will store the gathered rows: row_collection(i,j) = input(gather_indices(i), j) It must have the same number of columns as this multivector and gather_indices->get_size() rows.

◆ row_permute() [1/2]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::row_permute ( const array< int32 > *  permutation_indices,
ptr_param< MultiVector< ValueType > >  output 
) const

Writes the row-permuted multivector into the given output multivector.

Parameters
permutation_indicesThe array containing permutation indices. It must have this->get_size()[0] elements.
outputThe output multivector. It must have the dimensions this->get_size()
See also
MultiVector::row_permute(const array<int32>*)

◆ row_permute() [2/2]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::row_permute ( const array< int64 > *  permutation_indices,
ptr_param< MultiVector< ValueType > >  output 
) const

◆ scale_permute() [1/8]

template<typename ValueType = default_precision>
std::unique_ptr<MultiVector> gko::matrix::MultiVector< ValueType >::scale_permute ( ptr_param< const ScaledPermutation< value_type, int32 >>  permutation,
permute_mode  mode = permute_mode::symmetric 
) const

Creates a scaled and permuted copy of this multivector.

For an explanation of the permutation modes, see permute(ptr_param<const Permutation<index_type>>, permute_mode)

Parameters
permutationThe scaled permutation.
modeThe permutation mode.
Returns
The permuted multivector.

◆ scale_permute() [2/8]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::scale_permute ( ptr_param< const ScaledPermutation< value_type, int32 >>  permutation,
ptr_param< MultiVector< ValueType > >  output,
permute_mode  mode 
) const

Overload of scale_permute(ptr_param<const ScaledPermutation<value_type, int32>>, permute_mode) that writes the permuted copy into an existing MultiVector.

Parameters
permutationthe input scaled permutation.
outputthe output multivector.
modethe permutation mode, see permute_mode.

◆ scale_permute() [3/8]

template<typename ValueType = default_precision>
std::unique_ptr<MultiVector> gko::matrix::MultiVector< ValueType >::scale_permute ( ptr_param< const ScaledPermutation< value_type, int32 >>  row_permutation,
ptr_param< const ScaledPermutation< value_type, int32 >>  column_permutation,
bool  invert = false 
) const

Creates a scaled and permuted copy of this multivector.

For an explanation of the parameters, see permute(ptr_param<const Permutation<index_type>>, ptr_param<const Permutation<index_type>>, permute_mode)

Parameters
row_permutationThe scaled row permutation.
column_permutationThe scaled column permutation.
invertIf set to false, uses the input permutations, otherwise uses their inverses \(P^{-1}, Q^{-1}\)
Returns
The permuted multivector.

◆ scale_permute() [4/8]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::scale_permute ( ptr_param< const ScaledPermutation< value_type, int32 >>  row_permutation,
ptr_param< const ScaledPermutation< value_type, int32 >>  column_permutation,
ptr_param< MultiVector< ValueType > >  output,
bool  invert = false 
) const

Overload of scale_permute(ptr_param<const ScaledPermutation<value_type, int32>>, ptr_param<const ScaledPermutation<value_type, int32>>, bool) that writes the permuted copy into an existing MultiVector.

Parameters
row_permutationthe row scaled permutation.
column_permutationthe column scaled permutation.
outputthe output multivector.
invertif true, the inverse permutations are used.

◆ scale_permute() [5/8]

template<typename ValueType = default_precision>
std::unique_ptr<MultiVector> gko::matrix::MultiVector< ValueType >::scale_permute ( ptr_param< const ScaledPermutation< value_type, int64 >>  permutation,
permute_mode  mode = permute_mode::symmetric 
) const

◆ scale_permute() [6/8]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::scale_permute ( ptr_param< const ScaledPermutation< value_type, int64 >>  permutation,
ptr_param< MultiVector< ValueType > >  output,
permute_mode  mode 
) const

◆ scale_permute() [7/8]

template<typename ValueType = default_precision>
std::unique_ptr<MultiVector> gko::matrix::MultiVector< ValueType >::scale_permute ( ptr_param< const ScaledPermutation< value_type, int64 >>  row_permutation,
ptr_param< const ScaledPermutation< value_type, int64 >>  column_permutation,
bool  invert = false 
) const

◆ scale_permute() [8/8]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::scale_permute ( ptr_param< const ScaledPermutation< value_type, int64 >>  row_permutation,
ptr_param< const ScaledPermutation< value_type, int64 >>  column_permutation,
ptr_param< MultiVector< ValueType > >  output,
bool  invert = false 
) const

◆ scatter_add() [1/2]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::scatter_add ( const array< int32 > *  scatter_indices,
ptr_param< const AbstractMultiVector< ValueType > >  source 
)

Accumulates rows from source into this multivector at scattered positions: this(scatter_indices(i), j) += source(i, j)

Parameters
scatter_indicespointer to an array containing target row indices in this multivector. May contain duplicates (contributions are summed).
sourcethe source multivector whose rows are scattered into this. Must have the same number of columns as this multivector and scatter_indices->get_size() rows. If its value type differs from this multivector, it is converted first.

◆ scatter_add() [2/2]

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::scatter_add ( const array< int64 > *  scatter_indices,
ptr_param< const AbstractMultiVector< ValueType > >  source 
)

Parameters
scatter_indicespointer to an array containing target row indices in this multivector. May contain duplicates (contributions are summed).
sourcethe source multivector whose rows are scattered into this. Must have the same number of columns as this multivector and scatter_indices->get_size() rows. If its value type differs from this multivector, it is converted first.

◆ transpose()

template<typename ValueType = default_precision>
void gko::matrix::MultiVector< ValueType >::transpose ( ptr_param< MultiVector< ValueType > >  output) const

Writes the transposed multivector into the given output multivector.

Parameters
outputThe output multivector. It must have the dimensions gko::transpose(this->get_size())

The documentation for this class was generated from the following files: