Ginkgo
Generated from pipelines/1554403166 branch based on develop. Ginkgo version 1.9.0
A numerical linear algebra library targeting many-core architectures
|
Vector is a format which explicitly stores (multiple) distributed column vectors in a dense storage format. More...
#include <ginkgo/core/distributed/vector.hpp>
Public Types | |
using | value_type = ValueType |
using | absolute_type = remove_complex< Vector > |
using | real_type = absolute_type |
using | complex_type = Vector< to_complex< value_type > > |
using | local_vector_type = gko::matrix::Dense< value_type > |
Public Types inherited from gko::EnablePolymorphicAssignment< Vector< ValueType > > | |
using | result_type = Vector< ValueType > |
Public Types inherited from gko::ConvertibleTo< Vector< ValueType > > | |
using | result_type = Vector< ValueType > |
Public Types inherited from gko::ConvertibleTo< Vector< next_precision< ValueType > > > | |
using | result_type = Vector< next_precision< ValueType > > |
Public Types inherited from gko::EnableAbsoluteComputation< remove_complex< Vector< ValueType > > > | |
using | absolute_type = remove_complex< Vector< ValueType > > |
Public Member Functions | |
void | read_distributed (const device_matrix_data< ValueType, int64 > &data, ptr_param< const Partition< int64, int64 >> partition) |
Reads a vector from the device_matrix_data structure and a global row partition. More... | |
void | read_distributed (const device_matrix_data< ValueType, int64 > &data, ptr_param< const Partition< int32, int64 >> partition) |
void | read_distributed (const device_matrix_data< ValueType, int32 > &data, ptr_param< const Partition< int32, int32 >> partition) |
void | read_distributed (const matrix_data< ValueType, int64 > &data, ptr_param< const Partition< int64, int64 >> partition) |
Reads a vector from the matrix_data structure and a global row partition. More... | |
void | read_distributed (const matrix_data< ValueType, int64 > &data, ptr_param< const Partition< int32, int64 >> partition) |
void | read_distributed (const matrix_data< ValueType, int32 > &data, ptr_param< const Partition< int32, int32 >> partition) |
void | convert_to (Vector< next_precision< ValueType >> *result) const override |
void | move_to (Vector< next_precision< ValueType >> *result) override |
std::unique_ptr< absolute_type > | compute_absolute () const override |
Gets the AbsoluteLinOp. More... | |
void | compute_absolute_inplace () override |
Compute absolute inplace on each element. | |
std::unique_ptr< complex_type > | make_complex () const |
Creates a complex copy of the original vectors. More... | |
void | make_complex (ptr_param< complex_type > result) const |
Writes a complex copy of the original vectors to given complex vectors. More... | |
std::unique_ptr< real_type > | get_real () const |
Creates new real vectors and extracts the real part of the original vectors into that. | |
void | get_real (ptr_param< real_type > result) const |
Extracts the real part of the original vectors into given real vectors. | |
std::unique_ptr< real_type > | get_imag () const |
Creates new real vectors and extracts the imaginary part of the original vectors into that. | |
void | get_imag (ptr_param< real_type > result) const |
Extracts the imaginary part of the original vectors into given real vectors. | |
void | fill (ValueType value) |
Fill the distributed vectors with a given value. More... | |
void | scale (ptr_param< const LinOp > alpha) |
Scales the vectors with a scalar (aka: BLAS scal). More... | |
void | inv_scale (ptr_param< const LinOp > alpha) |
Scales the vectors with the inverse of a scalar. More... | |
void | add_scaled (ptr_param< const LinOp > alpha, ptr_param< const LinOp > b) |
Adds b scaled by alpha to the vectors (aka: BLAS axpy). More... | |
void | sub_scaled (ptr_param< const LinOp > alpha, ptr_param< const LinOp > b) |
Subtracts b scaled by alpha from the vectors (aka: BLAS axpy). More... | |
void | compute_dot (ptr_param< const LinOp > b, ptr_param< LinOp > result) const |
Computes the column-wise dot product of this (multi-)vector and b using a global reduction. More... | |
void | compute_dot (ptr_param< const LinOp > b, ptr_param< LinOp > result, array< char > &tmp) const |
Computes the column-wise dot product of this (multi-)vector and b using a global reduction. More... | |
void | compute_conj_dot (ptr_param< const LinOp > b, ptr_param< LinOp > result) const |
Computes the column-wise dot product of this (multi-)vector and conj(b) using a global reduction. More... | |
void | compute_conj_dot (ptr_param< const LinOp > b, ptr_param< LinOp > result, array< char > &tmp) const |
Computes the column-wise dot product of this (multi-)vector and conj(b) using a global reduction. More... | |
void | compute_squared_norm2 (ptr_param< LinOp > result) const |
Computes the square of the column-wise Euclidean ( ) norm of this (multi-)vector using a global reduction. More... | |
void | compute_squared_norm2 (ptr_param< LinOp > result, array< char > &tmp) const |
Computes the square of the column-wise Euclidean ( ) norm of this (multi-)vector using a global reduction. More... | |
void | compute_norm2 (ptr_param< LinOp > result) const |
Computes the Euclidean (L^2) norm of this (multi-)vector using a global reduction. More... | |
void | compute_norm2 (ptr_param< LinOp > result, array< char > &tmp) const |
Computes the Euclidean (L^2) norm of this (multi-)vector using a global reduction. More... | |
void | compute_norm1 (ptr_param< LinOp > result) const |
Computes the column-wise (L^1) norm of this (multi-)vector. More... | |
void | compute_norm1 (ptr_param< LinOp > result, array< char > &tmp) const |
Computes the column-wise (L^1) norm of this (multi-)vector using a global reduction. More... | |
void | compute_mean (ptr_param< LinOp > result) const |
Computes the column-wise mean of this (multi-)vector using a global reduction. More... | |
void | compute_mean (ptr_param< LinOp > result, array< char > &tmp) const |
Computes the column-wise arithmetic mean of this (multi-)vector using a global reduction. More... | |
value_type & | at_local (size_type row, size_type col) noexcept |
Returns a single element of the multi-vector. More... | |
value_type | at_local (size_type row, size_type col) const noexcept |
ValueType & | at_local (size_type idx) noexcept |
Returns a single element of the multi-vector. More... | |
ValueType | at_local (size_type idx) const noexcept |
value_type * | get_local_values () |
Returns a pointer to the array of local values of the multi-vector. More... | |
const value_type * | get_const_local_values () const |
Returns a pointer to the array of local values of the multi-vector. More... | |
const local_vector_type * | get_local_vector () const |
Direct (read) access to the underlying local local_vector_type vectors. 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... | |
size_type | get_stride () const noexcept |
Public Member Functions inherited from gko::experimental::EnableDistributedLinOp< Vector< ValueType > > | |
const Vector< ValueType > * | apply (ptr_param< const LinOp > b, ptr_param< LinOp > x) const |
Vector< ValueType > * | apply (ptr_param< const LinOp > b, ptr_param< LinOp > x) |
const Vector< ValueType > * | apply (ptr_param< const LinOp > alpha, ptr_param< const LinOp > b, ptr_param< const LinOp > beta, ptr_param< LinOp > x) const |
Vector< ValueType > * | apply (ptr_param< const LinOp > alpha, ptr_param< const LinOp > b, ptr_param< const LinOp > beta, ptr_param< LinOp > x) |
Public Member Functions inherited from gko::EnableAbstractPolymorphicObject< Vector< ValueType >, LinOp > | |
std::unique_ptr< Vector< ValueType > > | create_default (std::shared_ptr< const Executor > exec) const |
std::unique_ptr< Vector< ValueType > > | create_default () const |
std::unique_ptr< Vector< ValueType > > | clone (std::shared_ptr< const Executor > exec) const |
std::unique_ptr< Vector< ValueType > > | clone () const |
Vector< ValueType > * | copy_from (const PolymorphicObject *other) |
std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, Vector< ValueType > > * | copy_from (std::unique_ptr< Derived > &&other) |
std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, Vector< ValueType > > * | copy_from (const std::unique_ptr< Derived > &other) |
Vector< ValueType > * | copy_from (const std::shared_ptr< const PolymorphicObject > &other) |
Vector< ValueType > * | move_from (ptr_param< PolymorphicObject > other) |
Vector< ValueType > * | clear () |
Public Member Functions inherited from gko::LinOp | |
LinOp * | apply (ptr_param< const LinOp > b, ptr_param< LinOp > x) |
Applies a linear operator to a vector (or a sequence of vectors). More... | |
const LinOp * | apply (ptr_param< const LinOp > b, ptr_param< LinOp > x) const |
LinOp * | apply (ptr_param< const LinOp > alpha, ptr_param< const LinOp > b, ptr_param< const LinOp > beta, ptr_param< LinOp > x) |
Performs the operation x = alpha * op(b) + beta * x. More... | |
const LinOp * | apply (ptr_param< const LinOp > alpha, ptr_param< const LinOp > b, ptr_param< const LinOp > beta, ptr_param< LinOp > x) const |
const dim< 2 > & | get_size () const noexcept |
Returns the size of the operator. More... | |
virtual bool | apply_uses_initial_guess () const |
Returns true if the linear operator uses the data given in x as an initial guess. More... | |
LinOp & | operator= (const LinOp &)=default |
Copy-assigns a LinOp. More... | |
LinOp & | operator= (LinOp &&other) |
Move-assigns a LinOp. More... | |
LinOp (const LinOp &)=default | |
Copy-constructs a LinOp. More... | |
LinOp (LinOp &&other) | |
Move-constructs a LinOp. More... | |
Public Member Functions inherited from gko::EnableAbstractPolymorphicObject< LinOp > | |
std::unique_ptr< LinOp > | create_default (std::shared_ptr< const Executor > exec) const |
std::unique_ptr< LinOp > | create_default () const |
std::unique_ptr< LinOp > | clone (std::shared_ptr< const Executor > exec) const |
std::unique_ptr< LinOp > | clone () const |
LinOp * | copy_from (const PolymorphicObject *other) |
std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, LinOp > * | copy_from (std::unique_ptr< Derived > &&other) |
std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, LinOp > * | copy_from (const std::unique_ptr< Derived > &other) |
LinOp * | copy_from (const std::shared_ptr< const PolymorphicObject > &other) |
LinOp * | move_from (ptr_param< PolymorphicObject > other) |
LinOp * | clear () |
Public Member Functions inherited from gko::PolymorphicObject | |
PolymorphicObject & | operator= (const PolymorphicObject &) |
std::unique_ptr< PolymorphicObject > | create_default (std::shared_ptr< const Executor > exec) const |
Creates a new "default" object of the same dynamic type as this object. More... | |
std::unique_ptr< PolymorphicObject > | create_default () const |
Creates a new "default" object of the same dynamic type as this object. More... | |
std::unique_ptr< PolymorphicObject > | clone (std::shared_ptr< const Executor > exec) const |
Creates a clone of the object. More... | |
std::unique_ptr< PolymorphicObject > | clone () const |
Creates a clone of the object. More... | |
PolymorphicObject * | copy_from (const PolymorphicObject *other) |
Copies another object into this object. More... | |
template<typename Derived , typename Deleter > | |
std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, PolymorphicObject > * | copy_from (std::unique_ptr< Derived, Deleter > &&other) |
Moves another object into this object. More... | |
template<typename Derived , typename Deleter > | |
std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, PolymorphicObject > * | copy_from (const std::unique_ptr< Derived, Deleter > &other) |
Copies another object into this object. More... | |
PolymorphicObject * | copy_from (const std::shared_ptr< const PolymorphicObject > &other) |
Copies another object into this object. More... | |
PolymorphicObject * | move_from (ptr_param< PolymorphicObject > other) |
Moves another object into this object. More... | |
PolymorphicObject * | clear () |
Transforms the object into its default state. More... | |
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::EnablePolymorphicAssignment< Vector< ValueType > > | |
void | convert_to (result_type *result) const override |
Converts the implementer to an object of type result_type. More... | |
void | move_to (result_type *result) override |
Converts the implementer to an object of type result_type by moving data from this object. More... | |
Public Member Functions inherited from gko::ConvertibleTo< Vector< 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< Vector< 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::EnableAbsoluteComputation< remove_complex< Vector< ValueType > > > | |
std::unique_ptr< LinOp > | compute_absolute_linop () const override |
Gets the absolute LinOp. More... | |
Public Member Functions inherited from gko::experimental::distributed::DistributedBase | |
DistributedBase (const DistributedBase &other)=default | |
DistributedBase (DistributedBase &&other)=default | |
DistributedBase & | operator= (const DistributedBase &) |
Copy assignment that doesn't change the used mpi::communicator. More... | |
DistributedBase & | operator= (DistributedBase &&) noexcept |
Move assignment that doesn't change the used mpi::communicator. More... | |
mpi::communicator | get_communicator () const |
Access the used mpi::communicator. More... | |
Static Public Member Functions | |
static std::unique_ptr< Vector > | create_with_config_of (ptr_param< const Vector > other) |
Creates a distributed Vector with the same size and stride as another Vector. More... | |
static std::unique_ptr< Vector > | create_with_type_of (ptr_param< const Vector > other, std::shared_ptr< const Executor > exec) |
Creates an empty Vector with the same type as another Vector, but on a different executor. More... | |
static std::unique_ptr< Vector > | create_with_type_of (ptr_param< const Vector > other, std::shared_ptr< const Executor > exec, const dim< 2 > &global_size, const dim< 2 > &local_size, size_type stride) |
Creates an Vector with the same type as another Vector, but on a different executor and with a different size. More... | |
static std::unique_ptr< Vector > | create (std::shared_ptr< const Executor > exec, mpi::communicator comm, dim< 2 > global_size, dim< 2 > local_size, size_type stride) |
Creates an empty distributed vector with a specified size. More... | |
static std::unique_ptr< Vector > | create (std::shared_ptr< const Executor > exec, mpi::communicator comm, dim< 2 > global_size={}, dim< 2 > local_size={}) |
Creates an empty distributed vector with a specified size. More... | |
static std::unique_ptr< Vector > | create (std::shared_ptr< const Executor > exec, mpi::communicator comm, dim< 2 > global_size, std::unique_ptr< local_vector_type > local_vector) |
Creates a distributed vector from local vectors with a specified size. More... | |
static std::unique_ptr< Vector > | create (std::shared_ptr< const Executor > exec, mpi::communicator comm, std::unique_ptr< local_vector_type > local_vector) |
Creates a distributed vector from local vectors. More... | |
static std::unique_ptr< const Vector > | create_const (std::shared_ptr< const Executor > exec, mpi::communicator comm, dim< 2 > global_size, std::unique_ptr< const local_vector_type > local_vector) |
Creates a constant (immutable) distributed Vector from a constant local vector. More... | |
static std::unique_ptr< const Vector > | create_const (std::shared_ptr< const Executor > exec, mpi::communicator comm, std::unique_ptr< const local_vector_type > local_vector) |
Creates a constant (immutable) distributed Vector from a constant local vector. More... | |
Friends | |
class | EnableDistributedPolymorphicObject< Vector, LinOp > |
class | Vector< to_complex< ValueType > > |
class | Vector< remove_complex< ValueType > > |
class | Vector< next_precision< ValueType > > |
Vector is a format which explicitly stores (multiple) distributed column vectors in a dense storage format.
The (multi-)vector is distributed by row, which is described by a
ValueType | The precision of vector elements. |
void gko::experimental::distributed::Vector< ValueType >::add_scaled | ( | ptr_param< const LinOp > | alpha, |
ptr_param< const LinOp > | b | ||
) |
Adds b
scaled by alpha
to the vectors (aka: BLAS axpy).
alpha | If alpha is 1x1 Dense matrix, the all vectors of b are scaled by alpha. If it is a Dense row vector of values, then i-th column vector of b is scaled with the i-th element of alpha (the number of columns of alpha has to match the number of vectors). |
b | a (multi-)vector of the same dimension as this |
|
noexcept |
|
noexcept |
Returns a single element of the multi-vector.
Useful for iterating across all elements of the multi-vector. However, it is less efficient than the two-parameter variant of this method.
idx | a linear index of the requested element (ignoring the stride) |
|
noexcept |
|
noexcept |
Returns a single element of the multi-vector.
row | the local row of the requested element |
col | the local column of the requested element |
|
overridevirtual |
Gets the AbsoluteLinOp.
Implements gko::EnableAbsoluteComputation< remove_complex< Vector< ValueType > > >.
void gko::experimental::distributed::Vector< ValueType >::compute_conj_dot | ( | ptr_param< const LinOp > | b, |
ptr_param< LinOp > | result | ||
) | const |
Computes the column-wise dot product of this (multi-)vector and conj(b)
using a global reduction.
b | a (multi-)vector of same dimension as this |
result | a Dense row matrix, used to store the dot product (the number of column in result must match the number of columns of this) |
void gko::experimental::distributed::Vector< ValueType >::compute_conj_dot | ( | ptr_param< const LinOp > | b, |
ptr_param< LinOp > | result, | ||
array< char > & | tmp | ||
) | const |
Computes the column-wise dot product of this (multi-)vector and conj(b)
using a global reduction.
b | a (multi-)vector of same dimension as this |
result | a Dense row matrix, used to store the dot product (the number of column in result must match the number of columns of this) |
tmp | the temporary storage to use for partial sums during the reduction computation. It may be resized and/or reset to the correct executor. |
void gko::experimental::distributed::Vector< ValueType >::compute_dot | ( | ptr_param< const LinOp > | b, |
ptr_param< LinOp > | result | ||
) | const |
Computes the column-wise dot product of this (multi-)vector and b
using a global reduction.
b | a (multi-)vector of same dimension as this |
result | a Dense row matrix, used to store the dot product (the number of column in result must match the number of columns of this) |
void gko::experimental::distributed::Vector< ValueType >::compute_dot | ( | ptr_param< const LinOp > | b, |
ptr_param< LinOp > | result, | ||
array< char > & | tmp | ||
) | const |
Computes the column-wise dot product of this (multi-)vector and b
using a global reduction.
b | a (multi-)vector of same dimension as this |
result | a Dense row matrix, used to store the dot product (the number of column in result must match the number of columns of this) |
tmp | the temporary storage to use for partial sums during the reduction computation. It may be resized and/or reset to the correct executor. |
void gko::experimental::distributed::Vector< ValueType >::compute_mean | ( | ptr_param< LinOp > | result | ) | const |
Computes the column-wise mean of this (multi-)vector using a global reduction.
result | a Dense row matrix, used to store the mean (the number of columns in result must match the number of columns of this) |
void gko::experimental::distributed::Vector< ValueType >::compute_mean | ( | ptr_param< LinOp > | result, |
array< char > & | tmp | ||
) | const |
Computes the column-wise arithmetic mean of this (multi-)vector using a global reduction.
result | a Dense row matrix, used to store the mean (the number of columns in result must match the number of columns of this) |
tmp | the temporary storage to use for partial sums during the reduction computation. It may be resized and/or reset to the correct executor. |
void gko::experimental::distributed::Vector< ValueType >::compute_norm1 | ( | ptr_param< LinOp > | result | ) | const |
Computes the column-wise (L^1) norm of this (multi-)vector.
result | a Dense row matrix, used to store the norm (the number of columns in result must match the number of columns of this) |
void gko::experimental::distributed::Vector< ValueType >::compute_norm1 | ( | ptr_param< LinOp > | result, |
array< char > & | tmp | ||
) | const |
Computes the column-wise (L^1) norm of this (multi-)vector using a global reduction.
result | a Dense row matrix, used to store the norm (the number of columns in result must match the number of columns of this) |
tmp | the temporary storage to use for partial sums during the reduction computation. It may be resized and/or reset to the correct executor. |
void gko::experimental::distributed::Vector< ValueType >::compute_norm2 | ( | ptr_param< LinOp > | result | ) | const |
Computes the Euclidean (L^2) norm of this (multi-)vector using a global reduction.
result | a Dense row matrix, used to store the norm (the number of columns in result must match the number of columns of this) |
void gko::experimental::distributed::Vector< ValueType >::compute_norm2 | ( | ptr_param< LinOp > | result, |
array< char > & | tmp | ||
) | const |
Computes the Euclidean (L^2) norm of this (multi-)vector using a global reduction.
result | a Dense row matrix, used to store the norm (the number of columns in result must match the number of columns of this) |
tmp | the temporary storage to use for partial sums during the reduction computation. It may be resized and/or reset to the correct executor. |
void gko::experimental::distributed::Vector< ValueType >::compute_squared_norm2 | ( | ptr_param< LinOp > | result | ) | const |
Computes the square of the column-wise Euclidean ( ) norm of this (multi-)vector using a global reduction.
result | a Dense row vector, used to store the norm (the number of columns in the vector must match the number of columns of this) |
void gko::experimental::distributed::Vector< ValueType >::compute_squared_norm2 | ( | ptr_param< LinOp > | result, |
array< char > & | tmp | ||
) | const |
Computes the square of the column-wise Euclidean ( ) norm of this (multi-)vector using a global reduction.
result | a Dense row vector, used to store the norm (the number of columns in the vector must match the number of columns of this) |
tmp | the temporary storage to use for partial sums during the reduction computation. It may be resized and/or reset to the correct executor. |
|
static |
Creates an empty distributed vector with a specified size.
exec | Executor associated with vector |
comm | Communicator associated with vector |
global_size | Global size of the vector |
local_size | Processor-local size of the vector |
stride | Stride of the local vector. |
|
static |
Creates a distributed vector from local vectors with a specified size.
exec | Executor associated with this vector |
comm | Communicator associated with this vector |
global_size | The global size of the vector |
local_vector | The underlying local vector, the data will be moved into this |
|
static |
Creates an empty distributed vector with a specified size.
exec | Executor associated with vector |
comm | Communicator associated with vector |
global_size | Global size of the vector |
local_size | Processor-local size of the vector, uses local_size[1] as the stride |
|
static |
Creates a distributed vector from local vectors.
The global size will be deduced from the local sizes, which will incur a collective communication.
exec | Executor associated with this vector |
comm | Communicator associated with this vector |
local_vector | The underlying local vector, the data will be moved into this. |
|
static |
Creates a constant (immutable) distributed Vector from a constant local vector.
exec | Executor associated with this vector |
comm | Communicator associated with this vector |
global_size | The global size of the vector |
local_vector | The underlying local vector, of which a view is created |
|
static |
Creates a constant (immutable) distributed Vector from a constant local vector.
The global size will be deduced from the local sizes, which will incur a collective communication.
exec | Executor associated with this vector |
comm | Communicator associated with this vector |
local_vector | The underlying local vector, of which a view is created |
std::unique_ptr<real_type> gko::experimental::distributed::Vector< ValueType >::create_real_view | ( | ) |
Create a real view of the (potentially) complex original multi-vector.
If the original vector is real, nothing changes. If the original vector is complex, the result is created by viewing the complex vector with as real with a reinterpret_cast with twice the number of columns and double the stride.
std::unique_ptr<const real_type> gko::experimental::distributed::Vector< ValueType >::create_real_view | ( | ) | const |
Create a real view of the (potentially) complex original multi-vector.
If the original vector is real, nothing changes. If the original vector is complex, the result is created by viewing the complex vector with as real with a reinterpret_cast with twice the number of columns and double the stride.
|
static |
|
static |
Creates an empty Vector with the same type as another Vector, but on a different executor.
other | The other multi-vector whose type we target. |
exec | The executor of the new multi-vector. |
|
static |
Creates an Vector with the same type as another Vector, but on a different executor and with a different size.
other | The other multi-vector whose type we target. |
exec | The executor of the new multi-vector. |
global_size | The global size of the multi-vector. |
local_size | The local size of the multi-vector. |
stride | The stride of the new multi-vector. |
void gko::experimental::distributed::Vector< ValueType >::fill | ( | ValueType | value | ) |
Fill the distributed vectors with a given value.
value | the value to be filled |
const value_type* gko::experimental::distributed::Vector< ValueType >::get_const_local_values | ( | ) | const |
Returns a pointer to the array of local values of the multi-vector.
value_type* gko::experimental::distributed::Vector< ValueType >::get_local_values | ( | ) |
Returns a pointer to the array of local values of the multi-vector.
const local_vector_type* gko::experimental::distributed::Vector< ValueType >::get_local_vector | ( | ) | const |
Direct (read) access to the underlying local local_vector_type vectors.
void gko::experimental::distributed::Vector< ValueType >::inv_scale | ( | ptr_param< const LinOp > | alpha | ) |
Scales the vectors with the inverse of a scalar.
alpha | If alpha is 1x1 Dense matrix, the all vectors are scaled by 1 / alpha. If it is a Dense row vector of values, then i-th column vector is scaled with the inverse of the i-th element of alpha (the number of columns of alpha has to match the number of vectors). |
std::unique_ptr<complex_type> gko::experimental::distributed::Vector< ValueType >::make_complex | ( | ) | const |
Creates a complex copy of the original vectors.
If the original vectors were real, the imaginary part of the result will be zero.
void gko::experimental::distributed::Vector< ValueType >::make_complex | ( | ptr_param< complex_type > | result | ) | const |
Writes a complex copy of the original vectors to given complex vectors.
If the original vectors were real, the imaginary part of the result will be zero.
void gko::experimental::distributed::Vector< ValueType >::read_distributed | ( | const device_matrix_data< ValueType, int64 > & | data, |
ptr_param< const Partition< int64, int64 >> | partition | ||
) |
Reads a vector from the device_matrix_data structure and a global row partition.
The number of rows of the matrix data is ignored, only its number of columns is relevant. Both the number of local and global rows are inferred from the row partition.
data | The device_matrix_data structure |
partition | The global row partition |
void gko::experimental::distributed::Vector< ValueType >::read_distributed | ( | const matrix_data< ValueType, int64 > & | data, |
ptr_param< const Partition< int64, int64 >> | partition | ||
) |
Reads a vector from the matrix_data structure and a global row partition.
See @read_distributed
void gko::experimental::distributed::Vector< ValueType >::scale | ( | ptr_param< const LinOp > | alpha | ) |
Scales the vectors with a scalar (aka: BLAS scal).
alpha | If alpha is 1x1 Dense matrx, the all vectors are scaled by alpha. If it is a Dense row vector of values, then i-th column vector is scaled with the i-th element of alpha (the number of columns of alpha has to match the number of vectors). |
void gko::experimental::distributed::Vector< ValueType >::sub_scaled | ( | ptr_param< const LinOp > | alpha, |
ptr_param< const LinOp > | b | ||
) |
Subtracts b
scaled by alpha
from the vectors (aka: BLAS axpy).
alpha | If alpha is 1x1 Dense matrix, the all vectors of b are scaled by alpha. If it is a Dense row vector of values, then i-th column vector of b is scaled with the i-th element of alpha (the number of c |
b | a (multi-)vector of the same dimension as this |