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 | List of all members
gko::AbstractMultiVector Class Referenceabstract

Abstract interface class for (multi-)vector types. More...

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

Inheritance diagram for gko::AbstractMultiVector:
[legend]
Collaboration diagram for gko::AbstractMultiVector:
[legend]

Public Types

template<typename ValueType >
using device_view = matrix::view::dense< ValueType >
 

Public Member Functions

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
virtual void validate_data () const
 Throws gko::InvalidData exception if we found the data inside the object does not fulfill certain property up to our knowledge.
 
PolymorphicObject & operator= (const PolymorphicObject &)
 
std::shared_ptr< const Executor > get_executor () const noexcept
 Returns the Executor of the object. More...
 
- 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
 

Static Public Member Functions

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...
 

Detailed Description

Abstract interface class for (multi-)vector types.

This interface defines the required functions on a vector. LinOps are applied to this type. It has functions in the following categories:

The public interface functions are not virtual. Instead they call virtual implementation functions and check for matching dimensions appropriately. For example the function add_sub(scale, other), then an exception is thrown if either:

To simplify the creation of derived classes, the mixin

See also
EnableMultiVector can be used.

Member Function Documentation

◆ add_scaled()

void gko::AbstractMultiVector::add_scaled ( ptr_param< const AbstractMultiVector >  alpha,
ptr_param< const AbstractMultiVector >  b 
)

Adds b scaled by alpha to this (aka: BLAS axpy).

Parameters
alphaA matrix::MultiVector. If its size is 1x1 then b is scaled by alpha. If its size is 1xc then i-th column of b is scaled with the i-th element of alpha (the number of columns of alpha has to match the number of columns of the multi-vector).
ba multi-vector of the same dimension as this
Exceptions
NotSupportedIf alpha isn't a matrix::MultiVector
DimensionMismatchIf alpha or b have incompatible dimensions

◆ as_precision() [1/4]

temporary_conversion<AbstractMultiVector> gko::AbstractMultiVector::as_precision ( precision  p)

Creates a temporary conversion of this vector with another precision.

Allowed conversions:

  • bf16 <-> fp16 <-> fp32 <-> fp64
  • complex_bf16 <-> complex_fp16 <-> complex_fp32 <-> complex_fp64 No conversions from complex to real or vice versa are supported.
Note
This non-const overload may cause a copy when the return value is destroyed.
Parameters
pThe requested precision
Returns
A vector with the requested precision

◆ as_precision() [2/4]

temporary_conversion<const AbstractMultiVector> gko::AbstractMultiVector::as_precision ( precision  p) const

Creates a temporary conversion of this vector with another precision.

Allowed conversions:

  • bf16 <-> fp16 <-> fp32 <-> fp64
  • complex_bf16 <-> complex_fp16 <-> complex_fp32 <-> complex_fp64 No conversions from complex to real or vice versa are supported.
Note
This non-const overload may cause a copy when the return value is destroyed.
Parameters
pThe requested precision
Returns
A vector with the requested precision
Note
The const overload will not cause a copy when the return value is destroyed.

◆ as_precision() [3/4]

temporary_conversion<AbstractMultiVector> gko::AbstractMultiVector::as_precision ( ptr_param< const AbstractMultiVector >  p)

Creates a temporary conversion of this vector with another precision.

See also
as_precision(precision) for more details
Parameters
pmulti-vector with the target precision
Returns
A vector with the same precision as p

◆ as_precision() [4/4]

temporary_conversion<const AbstractMultiVector> gko::AbstractMultiVector::as_precision ( ptr_param< const AbstractMultiVector >  p) const

Creates a temporary conversion of this vector with another precision.

See also
as_precision(precision) for more details
Parameters
pmulti-vector with the target precision
Returns
A vector with the same precision as p

◆ clone() [1/2]

std::unique_ptr<AbstractMultiVector> gko::AbstractMultiVector::clone ( ) const

Creates a copy of this vector on this vector's executor.

Returns
A copy of this vector

◆ clone() [2/2]

std::unique_ptr<AbstractMultiVector> gko::AbstractMultiVector::clone ( std::shared_ptr< const Executor >  exec) const

Creates a copy of this vector on the given executor.

Parameters
execThe executor of the new vector
Returns
A copy of this vector, stored on exec

◆ compute_absolute() [1/2]

std::unique_ptr<AbstractMultiVector> gko::AbstractMultiVector::compute_absolute ( ) const

Creates a new vector with the element-wise absolute values of this vector.

The result has the real precision matching this vector's precision, e.g. a complex_fp32 vector results in a fp32 vector.

Returns
A real vector with the absolute values of this vector

◆ compute_absolute() [2/2]

void gko::AbstractMultiVector::compute_absolute ( ptr_param< AbstractMultiVector >  output) const

Writes the element-wise absolute values of this vector into output.

See also
compute_absolute()
Parameters
outputThe vector to write the absolute values into. It must have the same size as this vector.
Exceptions
DimensionMismatchif output doesn't have the same size as this vector
PrecisionErrorif the output doesn't have the real precision of this

◆ compute_absolute_inplace()

void gko::AbstractMultiVector::compute_absolute_inplace ( )

Replaces each element of this vector with its absolute value.

The precision of this vector is not changed, i.e. a complex vector stays complex, with zero imaginary parts.

◆ compute_conj_dot() [1/2]

void gko::AbstractMultiVector::compute_conj_dot ( ptr_param< const AbstractMultiVector >  b,
ptr_param< AbstractMultiVector >  result 
) const

Computes the column-wise dot product of conj(this) and b.

Parameters
ba multi-vector of same dimension as this
resulta single row vector, used to store the dot product (the number of column in the vector must match the number of columns of this)
Exceptions
DimensionMismatchIf result or b have incompatible dimensions

◆ compute_conj_dot() [2/2]

void gko::AbstractMultiVector::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.

Parameters
ba multi-vector of same dimension as this
resulta single row vector, used to store the dot product (the number of column 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.
Exceptions
DimensionMismatchIf result or b have incompatible dimensions

◆ compute_dot() [1/2]

void gko::AbstractMultiVector::compute_dot ( ptr_param< const AbstractMultiVector >  b,
ptr_param< AbstractMultiVector >  result 
) const

Computes the column-wise dot product of this and b.

Parameters
ba multi-vector of same dimension as this
resulta single row vector, used to store the dot product (the number of column in the vector must match the number of columns of this)
Exceptions
DimensionMismatchIf result or b have incompatible dimensions

◆ compute_dot() [2/2]

void gko::AbstractMultiVector::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.

Parameters
ba multi-vector of same dimension as this
resulta single row vector, used to store the dot product (the number of column 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.
Exceptions
DimensionMismatchIf result or b have incompatible dimensions

◆ compute_norm1() [1/2]

void gko::AbstractMultiVector::compute_norm1 ( ptr_param< AbstractMultiVector >  result) const

Computes the column-wise (L^1) norm of this.

Parameters
resulta single row vector, used to store the norm (the number of columns in the vector must match the number of columns of this)
Exceptions
DimensionMismatchIf result has incompatible dimensions

◆ compute_norm1() [2/2]

void gko::AbstractMultiVector::compute_norm1 ( ptr_param< AbstractMultiVector >  result,
array< char > &  tmp 
) const

Computes the column-wise (L^1) norm of this.

Parameters
resulta single row vector, used to store the norm (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.
Exceptions
DimensionMismatchIf result has incompatible dimensions

◆ compute_norm2() [1/2]

void gko::AbstractMultiVector::compute_norm2 ( ptr_param< AbstractMultiVector >  result) const

Computes the column-wise Euclidean (L^2) norm of this.

Parameters
resulta single row vector, used to store the norm (the number of columns in the vector must match the number of columns of this)
Exceptions
DimensionMismatchIf result has incompatible dimensions

◆ compute_norm2() [2/2]

void gko::AbstractMultiVector::compute_norm2 ( ptr_param< AbstractMultiVector >  result,
array< char > &  tmp 
) const

Computes the column-wise Euclidean (L^2) norm of this.

Parameters
resulta single row vector, used to store the norm (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.
Exceptions
DimensionMismatchIf result has incompatible dimensions

◆ compute_squared_norm2() [1/2]

void gko::AbstractMultiVector::compute_squared_norm2 ( ptr_param< AbstractMultiVector >  result) const

Computes the square of the column-wise Euclidean (L^2) norm of this.

Parameters
resulta single row vector, used to store the norm (the number of columns in the vector must match the number of columns of this)
Exceptions
DimensionMismatchIf result has incompatible dimensions

◆ compute_squared_norm2() [2/2]

void gko::AbstractMultiVector::compute_squared_norm2 ( ptr_param< AbstractMultiVector >  result,
array< char > &  tmp 
) const

Computes the square of the column-wise Euclidean (L^2) norm of this.

Parameters
resulta single row vector, used to store the norm (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.
Exceptions
DimensionMismatchIf result has incompatible dimensions

◆ copy_from()

AbstractMultiVector* gko::AbstractMultiVector::copy_from ( ptr_param< const AbstractMultiVector >  other)

Copies the data of other into this vector.

The executor and the precision of this vector are preserved, i.e. the data of other is converted if the precisions don't match.

Parameters
otherThe vector to copy from
Returns
This vector

◆ create_default() [1/2]

std::unique_ptr<AbstractMultiVector> gko::AbstractMultiVector::create_default ( ) const

Creates an empty vector with the same type as this vector on this vector's executor.

Returns
An empty vector with the type of this vector

◆ create_default() [2/2]

std::unique_ptr<AbstractMultiVector> gko::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.

Parameters
execThe executor of the new vector
Returns
An empty vector with the type of this vector

◆ create_real_view() [1/2]

std::unique_ptr<AbstractMultiVector> gko::AbstractMultiVector::create_real_view ( )

Create a real view of the (potentially) complex original multi-vector.

If the original multi-vector is real, nothing changes. If the original multi-vector is complex, the result is created by viewing the complex multi-vector with as real with a reinterpret_cast with twice the number of columns and double the stride.

◆ create_real_view() [2/2]

std::unique_ptr<const AbstractMultiVector> gko::AbstractMultiVector::create_real_view ( ) const

Create a real view of the (potentially) complex original multi-vector.

If the original multi-vector is real, nothing changes. If the original multi-vector is complex, the result is created by viewing the complex multi-vector with as real with a reinterpret_cast with twice the number of columns and double the stride.

◆ create_subview() [1/2]

std::unique_ptr<AbstractMultiVector> gko::AbstractMultiVector::create_subview ( local_span  rows,
local_span  columns 
)

Creates a view containing the selected local rows and columns.

Note
May incur a communication overhead. Use the overload create_subview(local_span, local_span, dim<2>) to prevent this

◆ create_subview() [2/2]

std::unique_ptr<const AbstractMultiVector> gko::AbstractMultiVector::create_subview ( local_span  rows,
local_span  columns 
) const

Creates a const view containing the selected local rows and columns.

Note
May incur a communication overhead. Use the overload create_subview(local_span, local_span, dim<2>) to prevent this

◆ create_with_config_of()

static std::unique_ptr<AbstractMultiVector> gko::AbstractMultiVector::create_with_config_of ( ptr_param< const AbstractMultiVector >  other)
static

Creates an empty multi-vector with the same type, executor, size, stride and precision as other.

Parameters
otherThe vector whose configuration is used
Returns
An uninitialized vector with the configuration of other

◆ create_with_type_of() [1/3]

static std::unique_ptr<AbstractMultiVector> gko::AbstractMultiVector::create_with_type_of ( ptr_param< const AbstractMultiVector >  other,
std::shared_ptr< const Executor >  exec 
)
static

Creates an empty multi-vector with the same type as other on exec.

Only the type and precision of other are used, the size and stride of the new vector are both zero.

Parameters
otherThe multi-vector whose type is used.
execThe executor of the new multi-vector.
Returns
An empty vector with the type of other

◆ create_with_type_of() [2/3]

static std::unique_ptr<AbstractMultiVector> gko::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 
)
static

Creates an empty multi-vector with the same type as other and the given size.

The stride of the new vector is set to the number of global columns. For non-distributed types, global_size and local_size have to be equal.

Parameters
otherThe multi-vector whose type is used.
execThe executor of the new multi-vector.
global_sizeThe global size of the new multi-vector.
local_sizeThe local size of the new multi-vector.
Exceptions
DimensionMismatchif global_size and local_size don't have the same number of columns
Returns
An empty vector with the type of other

◆ create_with_type_of() [3/3]

static std::unique_ptr<AbstractMultiVector> gko::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 
)
static

Creates an empty multi-vector with the same type as other and the given size and stride.

See also
create_with_type_of(ptr_param<const AbstractMultiVector>, std::shared_ptr<const Executor>, const dim<2>&, const dim<2>&)
Parameters
otherThe multi-vector whose type is used.
execThe executor of the new multi-vector.
global_sizeThe global size of the new multi-vector.
local_sizeThe local size of the new multi-vector.
strideThe stride of the new multi-vector.
Returns
An empty vector with the type of other

◆ fill()

void gko::AbstractMultiVector::fill ( any_scalar  value)

Fills this vector with a single value.

Parameters
valueThe value to fill this vector with.

◆ get_const_local_device_view()

template<typename ValueType >
device_view<const ValueType> gko::AbstractMultiVector::get_const_local_device_view ( ) const

Gets a local device view of this vector for the specified value type.

The size of the view is equal to the local size of the vector.

Exceptions
InvalidStateErrorif the vector isn't stored in the requested value type
Template Parameters
ValueTypeThe value type of the view
Returns
A device view of the vector

◆ get_imag() [1/2]

std::unique_ptr<AbstractMultiVector> gko::AbstractMultiVector::get_imag ( ) const

Creates a new real vector with the imaginary parts of this vector.

If this vector is real, the result is zero.

Returns
A real vector with the imaginary parts of this vector

◆ get_imag() [2/2]

void gko::AbstractMultiVector::get_imag ( ptr_param< AbstractMultiVector >  result) const

Writes the imaginary parts of this vector into result.

See also
get_imag()
Parameters
resultThe real vector to write into. It must have the same size as this vector.
Exceptions
DimensionMismatchif result doesn't have the same size as this vector
PrecisionErrorif the output doesn't have the real precision of this

◆ get_local_device_view()

template<typename ValueType >
device_view<ValueType> gko::AbstractMultiVector::get_local_device_view ( )

Gets a local device view of this vector for the specified value type.

The size of the view is equal to the local size of the vector.

Exceptions
InvalidStateErrorif the vector isn't stored in the requested value type
Template Parameters
ValueTypeThe value type of the view
Returns
A device view of the vector

◆ get_local_size()

dim<2> gko::AbstractMultiVector::get_local_size ( ) const
noexcept

Gets the size (number of rows and columns) locally owned by this vector.

Returns
The size as a dim<2> object

◆ get_precision()

precision gko::AbstractMultiVector::get_precision ( ) const
noexcept

Gets the precision of this vector.

Returns
The precision enum value

◆ get_real() [1/2]

std::unique_ptr<AbstractMultiVector> gko::AbstractMultiVector::get_real ( ) const

Creates a new real vector with the real parts of this vector.

Returns
A real vector with the real parts of this vector

◆ get_real() [2/2]

void gko::AbstractMultiVector::get_real ( ptr_param< AbstractMultiVector >  result) const

Writes the real parts of this vector into result.

Parameters
resultThe real vector to write into. It must have the same size as this vector.
Exceptions
DimensionMismatchif result doesn't have the same size as this vector
PrecisionErrorif the output doesn't have the real precision of this

◆ get_size()

dim<2> gko::AbstractMultiVector::get_size ( ) const
noexcept

Gets the size (number of rows and columns) of this vector.

Returns
The size as a dim<2> object

◆ inv_scale()

void gko::AbstractMultiVector::inv_scale ( ptr_param< const AbstractMultiVector >  alpha)

Divides this multi-vector element-wise by alpha.

Parameters
alphaA matrix::MultiVector. If its size is 1x1 then this is scaled by 1 / alpha. If its size is 1xc then i-th column of this multi-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 columns of the multi-vector).
Exceptions
NotSupportedIf alpha isn't a matrix::MultiVector
DimensionMismatchIf alpha has incompatible dimensions

◆ make_complex() [1/2]

std::unique_ptr<AbstractMultiVector> gko::AbstractMultiVector::make_complex ( ) const

Creates a complex copy of this vector.

If this vector is real, the imaginary part of the result is zero.

Returns
A complex copy of this vector

◆ make_complex() [2/2]

void gko::AbstractMultiVector::make_complex ( ptr_param< AbstractMultiVector >  result) const

Writes a complex copy of this vector into result.

See also
make_complex()
Parameters
resultThe complex vector to write into. It must have the same size as this vector.
Exceptions
DimensionMismatchif result doesn't have the same size as this vector
PrecisionErrorif the output doesn't have the complex precision of this

◆ move_from()

AbstractMultiVector* gko::AbstractMultiVector::move_from ( ptr_param< AbstractMultiVector >  other)

Moves the data of other into this vector.

The executor and the precision of this vector are preserved, i.e. the data of other is copied and converted if the precisions or executors don't match. other is left in an unspecified, but valid, state.

Parameters
otherThe vector to move from
Returns
This vector

◆ operator=() [1/2]

AbstractMultiVector& gko::AbstractMultiVector::operator= ( AbstractMultiVector &&  other)
noexcept

Moves the contents of another multi-vector.

Preserves the executor and precision on both objects.

◆ operator=() [2/2]

AbstractMultiVector& gko::AbstractMultiVector::operator= ( const AbstractMultiVector &  other)

Copies the contents of another multi-vector.

Preserves the executor and precision on both objects.

◆ scale()

void gko::AbstractMultiVector::scale ( ptr_param< const AbstractMultiVector >  alpha)

Scales this multi-vector element-wise by alpha.

Parameters
alphaA matrix::MultiVector. If its size is 1x1 then this is scaled by alpha. If its size is 1xc then i-th column of this multi-vector is scaled with the i-th element of alpha (the number of columns of alpha has to match the number of columns of the multi-vector).
Exceptions
NotSupportedIf alpha isn't a matrix::MultiVector
DimensionMismatchIf alpha has incompatible dimensions

◆ sub_scaled()

void gko::AbstractMultiVector::sub_scaled ( ptr_param< const AbstractMultiVector >  alpha,
ptr_param< const AbstractMultiVector >  b 
)

Subtracts b scaled by alpha from this (aka: BLAS axpy).

Parameters
alphaA matrix::MultiVector. If its size is 1x1 then b is scaled by alpha. If its size is 1xc then i-th column of b is scaled with the i-th element of alpha (the number of columns of alpha has to match the number of columns of the multi-vector).
ba multi-vector of the same dimension as this
Exceptions
NotSupportedIf alpha isn't a matrix::MultiVector
DimensionMismatchIf alpha or b have incompatible dimensions

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