Ginkgo  Generated from pipelines/130473384 branch based on develop. Ginkgo version 1.1.1
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::Dense< ValueType > Class Template Reference

Dense is a matrix format which explicitly stores all values of the matrix. More...

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

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

Public Types

using value_type = ValueType
 
using index_type = int64
 
using mat_data = gko::matrix_data< ValueType, int64 >
 
using mat_data32 = gko::matrix_data< ValueType, int32 >
 
using row_major_range = gko::range< gko::accessor::row_major< ValueType, 2 > >
 
- Public Types inherited from gko::EnablePolymorphicAssignment< Dense< ValueType > >
using result_type = Dense< ValueType >
 
- Public Types inherited from gko::ConvertibleTo< Dense< ValueType > >
using result_type = Dense< ValueType >
 
- Public Types inherited from gko::ConvertibleTo< Coo< ValueType, int32 > >
using result_type = Coo< ValueType, int32 >
 
- Public Types inherited from gko::ConvertibleTo< Coo< ValueType, int64 > >
using result_type = Coo< ValueType, int64 >
 
- Public Types inherited from gko::ConvertibleTo< Csr< ValueType, int32 > >
using result_type = Csr< ValueType, int32 >
 
- Public Types inherited from gko::ConvertibleTo< Csr< ValueType, int64 > >
using result_type = Csr< ValueType, int64 >
 
- Public Types inherited from gko::ConvertibleTo< Ell< ValueType, int32 > >
using result_type = Ell< ValueType, int32 >
 
- Public Types inherited from gko::ConvertibleTo< Ell< ValueType, int64 > >
using result_type = Ell< ValueType, int64 >
 
- Public Types inherited from gko::ConvertibleTo< Hybrid< ValueType, int32 > >
using result_type = Hybrid< ValueType, int32 >
 
- Public Types inherited from gko::ConvertibleTo< Hybrid< ValueType, int64 > >
using result_type = Hybrid< ValueType, int64 >
 
- Public Types inherited from gko::ConvertibleTo< Sellp< ValueType, int32 > >
using result_type = Sellp< ValueType, int32 >
 
- Public Types inherited from gko::ConvertibleTo< Sellp< ValueType, int64 > >
using result_type = Sellp< ValueType, int64 >
 
- Public Types inherited from gko::ConvertibleTo< SparsityCsr< ValueType, int32 > >
using result_type = SparsityCsr< ValueType, int32 >
 
- Public Types inherited from gko::ConvertibleTo< SparsityCsr< ValueType, int64 > >
using result_type = SparsityCsr< ValueType, int64 >
 

Public Member Functions

void convert_to (Coo< ValueType, int32 > *result) const override
 
void move_to (Coo< ValueType, int32 > *result) override
 
void convert_to (Coo< ValueType, int64 > *result) const override
 
void move_to (Coo< ValueType, int64 > *result) override
 
void convert_to (Csr< ValueType, int32 > *result) const override
 
void move_to (Csr< ValueType, int32 > *result) override
 
void convert_to (Csr< ValueType, int64 > *result) const override
 
void move_to (Csr< ValueType, int64 > *result) override
 
void convert_to (Ell< ValueType, int32 > *result) const override
 
void move_to (Ell< ValueType, int32 > *result) override
 
void convert_to (Ell< ValueType, int64 > *result) const override
 
void move_to (Ell< ValueType, int64 > *result) override
 
void convert_to (Hybrid< ValueType, int32 > *result) const override
 
void move_to (Hybrid< ValueType, int32 > *result) override
 
void convert_to (Hybrid< ValueType, int64 > *result) const override
 
void move_to (Hybrid< ValueType, int64 > *result) override
 
void convert_to (Sellp< ValueType, int32 > *result) const override
 
void move_to (Sellp< ValueType, int32 > *result) override
 
void convert_to (Sellp< ValueType, int64 > *result) const override
 
void move_to (Sellp< ValueType, int64 > *result) override
 
void convert_to (SparsityCsr< ValueType, int32 > *result) const override
 
void move_to (SparsityCsr< ValueType, int32 > *result) override
 
void convert_to (SparsityCsr< ValueType, int64 > *result) const override
 
void move_to (SparsityCsr< ValueType, int64 > *result) override
 
void read (const mat_data &data) override
 
void read (const mat_data32 &data) override
 
void write (mat_data &data) const override
 
void write (mat_data32 &data) const override
 
std::unique_ptr< LinOptranspose () const override
 Returns a LinOp representing the transpose of the Transposable object. More...
 
std::unique_ptr< LinOpconj_transpose () const override
 Returns a LinOp representing the conjugate transpose of the Transposable object. More...
 
std::unique_ptr< LinOprow_permute (const Array< int32 > *permutation_indices) const override
 Returns a LinOp representing the row permutation of the Permutable object. More...
 
std::unique_ptr< LinOprow_permute (const Array< int64 > *permutation_indices) const override
 Returns a LinOp representing the row permutation of the Permutable object. More...
 
std::unique_ptr< LinOpcolumn_permute (const Array< int32 > *permutation_indices) const override
 Returns a LinOp representing the column permutation of the Permutable object. More...
 
std::unique_ptr< LinOpcolumn_permute (const Array< int64 > *permutation_indices) const override
 Returns a LinOp representing the column permutation of the Permutable object. More...
 
std::unique_ptr< LinOpinverse_row_permute (const Array< int32 > *inverse_permutation_indices) const override
 Returns a LinOp representing the row permutation of the inverse permuted object. More...
 
std::unique_ptr< LinOpinverse_row_permute (const Array< int64 > *inverse_permutation_indices) const override
 Returns a LinOp representing the row permutation of the inverse permuted object. More...
 
std::unique_ptr< LinOpinverse_column_permute (const Array< int32 > *inverse_permutation_indices) const override
 Returns a LinOp representing the row permutation of the inverse permuted object. More...
 
std::unique_ptr< LinOpinverse_column_permute (const Array< int64 > *inverse_permutation_indices) const override
 Returns a LinOp representing the row permutation of the inverse permuted object. More...
 
value_type * get_values () noexcept
 Returns a pointer to the array of values of the matrix. More...
 
const value_type * get_const_values () const noexcept
 Returns a pointer to the array of values of the matrix. More...
 
size_type get_stride () const noexcept
 Returns the stride of the matrix. More...
 
size_type get_num_stored_elements () const noexcept
 Returns the number of elements explicitly stored in the matrix. More...
 
value_type & at (size_type row, size_type col) noexcept
 Returns a single element of the matrix. More...
 
value_type at (size_type row, size_type col) const noexcept
 Returns a single element of the matrix. More...
 
ValueType & at (size_type idx) noexcept
 Returns a single element of the matrix. More...
 
ValueType at (size_type idx) const noexcept
 Returns a single element of the matrix. More...
 
void scale (const LinOp *alpha)
 Scales the matrix with a scalar (aka: BLAS scal). More...
 
void add_scaled (const LinOp *alpha, const LinOp *b)
 Adds b scaled by alpha to the matrix (aka: BLAS axpy). More...
 
void compute_dot (const LinOp *b, LinOp *result) const
 Computes the column-wise dot product of this matrix and b. More...
 
void compute_norm2 (LinOp *result) const
 Computes the Euclidian (L^2) norm of this matrix. More...
 
std::unique_ptr< Densecreate_submatrix (const span &rows, const span &columns, const size_type stride)
 Create a submatrix from the original matrix. More...
 
std::unique_ptr< Densecreate_submatrix (const span &rows, const span &columns)
 
- Public Member Functions inherited from gko::EnableLinOp< Dense< ValueType > >
const Dense< ValueType > * apply (const LinOp *b, LinOp *x) const
 
Dense< ValueType > * apply (const LinOp *b, LinOp *x)
 
const Dense< ValueType > * apply (const LinOp *alpha, const LinOp *b, const LinOp *beta, LinOp *x) const
 
Dense< ValueType > * apply (const LinOp *alpha, const LinOp *b, const LinOp *beta, LinOp *x)
 
- Public Member Functions inherited from gko::EnableAbstractPolymorphicObject< Dense< ValueType >, LinOp >
std::unique_ptr< Dense< ValueType > > create_default (std::shared_ptr< const Executor > exec) const
 
std::unique_ptr< Dense< ValueType > > create_default () const
 
std::unique_ptr< Dense< ValueType > > clone (std::shared_ptr< const Executor > exec) const
 
std::unique_ptr< Dense< ValueType > > clone () const
 
Dense< ValueType > * copy_from (const PolymorphicObject *other)
 
Dense< ValueType > * copy_from (std::unique_ptr< PolymorphicObject > other)
 
Dense< ValueType > * clear ()
 
- Public Member Functions inherited from gko::LinOp
LinOpapply (const LinOp *b, LinOp *x)
 Applies a linear operator to a vector (or a sequence of vectors). More...
 
const LinOpapply (const LinOp *b, LinOp *x) const
 Applies a linear operator to a vector (or a sequence of vectors). More...
 
LinOpapply (const LinOp *alpha, const LinOp *b, const LinOp *beta, LinOp *x)
 Performs the operation x = alpha * op(b) + beta * x. More...
 
const LinOpapply (const LinOp *alpha, const LinOp *b, const LinOp *beta, LinOp *x) const
 Performs the operation x = alpha * op(b) + beta * x. More...
 
const dim< 2 > & get_size () const noexcept
 Returns the size of the operator. More...
 
- Public Member Functions inherited from gko::EnableAbstractPolymorphicObject< LinOp >
std::unique_ptr< LinOpcreate_default (std::shared_ptr< const Executor > exec) const
 
std::unique_ptr< LinOpcreate_default () const
 
std::unique_ptr< LinOpclone (std::shared_ptr< const Executor > exec) const
 
std::unique_ptr< LinOpclone () const
 
LinOpcopy_from (const PolymorphicObject *other)
 
LinOpcopy_from (std::unique_ptr< PolymorphicObject > other)
 
LinOpclear ()
 
- Public Member Functions inherited from gko::PolymorphicObject
PolymorphicObjectoperator= (const PolymorphicObject &)
 
std::unique_ptr< PolymorphicObjectcreate_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< PolymorphicObjectcreate_default () const
 Creates a new "default" object of the same dynamic type as this object. More...
 
std::unique_ptr< PolymorphicObjectclone (std::shared_ptr< const Executor > exec) const
 Creates a clone of the object. More...
 
std::unique_ptr< PolymorphicObjectclone () const
 Creates a clone of the object. More...
 
PolymorphicObjectcopy_from (const PolymorphicObject *other)
 Copies another object into this object. More...
 
PolymorphicObjectcopy_from (std::unique_ptr< PolymorphicObject > other)
 Moves another object into this object. More...
 
PolymorphicObjectclear ()
 Transforms the object into its default state. More...
 
std::shared_ptr< const Executorget_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
 Adds a new logger to the list of subscribed loggers. More...
 
void remove_logger (const Logger *logger) override
 Removes a logger from the list of subscribed loggers. More...
 
- Public Member Functions inherited from gko::EnablePolymorphicAssignment< Dense< 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< Coo< ValueType, int32 > >
virtual void convert_to (result_type *result) const=0
 Converts the implementer to an object of type result_type. More...
 
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...
 
- Public Member Functions inherited from gko::ConvertibleTo< Coo< ValueType, int64 > >
virtual void convert_to (result_type *result) const=0
 Converts the implementer to an object of type result_type. More...
 
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...
 
- Public Member Functions inherited from gko::ConvertibleTo< Csr< ValueType, int32 > >
virtual void convert_to (result_type *result) const=0
 Converts the implementer to an object of type result_type. More...
 
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...
 
- Public Member Functions inherited from gko::ConvertibleTo< Csr< ValueType, int64 > >
virtual void convert_to (result_type *result) const=0
 Converts the implementer to an object of type result_type. More...
 
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...
 
- Public Member Functions inherited from gko::ConvertibleTo< Ell< ValueType, int32 > >
virtual void convert_to (result_type *result) const=0
 Converts the implementer to an object of type result_type. More...
 
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...
 
- Public Member Functions inherited from gko::ConvertibleTo< Ell< ValueType, int64 > >
virtual void convert_to (result_type *result) const=0
 Converts the implementer to an object of type result_type. More...
 
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...
 
- Public Member Functions inherited from gko::ConvertibleTo< Hybrid< ValueType, int32 > >
virtual void convert_to (result_type *result) const=0
 Converts the implementer to an object of type result_type. More...
 
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...
 
- Public Member Functions inherited from gko::ConvertibleTo< Hybrid< ValueType, int64 > >
virtual void convert_to (result_type *result) const=0
 Converts the implementer to an object of type result_type. More...
 
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...
 
- Public Member Functions inherited from gko::ConvertibleTo< Sellp< ValueType, int32 > >
virtual void convert_to (result_type *result) const=0
 Converts the implementer to an object of type result_type. More...
 
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...
 
- Public Member Functions inherited from gko::ConvertibleTo< Sellp< ValueType, int64 > >
virtual void convert_to (result_type *result) const=0
 Converts the implementer to an object of type result_type. More...
 
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...
 
- Public Member Functions inherited from gko::ConvertibleTo< SparsityCsr< ValueType, int32 > >
virtual void convert_to (result_type *result) const=0
 Converts the implementer to an object of type result_type. More...
 
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...
 
- Public Member Functions inherited from gko::ConvertibleTo< SparsityCsr< ValueType, int64 > >
virtual void convert_to (result_type *result) const=0
 Converts the implementer to an object of type result_type. More...
 
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...
 
- 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...
 
- 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...
 
- 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...
 
- 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...
 

Static Public Member Functions

static std::unique_ptr< Densecreate_with_config_of (const Dense *other)
 Creates a Dense matrix with the configuration of another Dense matrix. More...
 
- Static Public Member Functions inherited from gko::EnableCreateMethod< Dense< ValueType > >
static std::unique_ptr< Dense< ValueType > > create (Args &&... args)
 

Friends

class EnableCreateMethod< Dense >
 
class EnablePolymorphicObject< Dense, LinOp >
 
class Coo< ValueType, int32 >
 
class Coo< ValueType, int64 >
 
class Csr< ValueType, int32 >
 
class Csr< ValueType, int64 >
 
class Ell< ValueType, int32 >
 
class Ell< ValueType, int64 >
 
class Hybrid< ValueType, int32 >
 
class Hybrid< ValueType, int64 >
 
class Sellp< ValueType, int32 >
 
class Sellp< ValueType, int64 >
 
class SparsityCsr< ValueType, int32 >
 
class SparsityCsr< ValueType, int64 >
 

Detailed Description

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

Dense is a matrix format which explicitly stores all values of the matrix.

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.

Template Parameters
ValueTypeprecision of matrix elements
Note
While this format is not very useful for storing sparse matrices, it is often suitable to store vectors, and sets of vectors.

Member Function Documentation

◆ add_scaled()

template<typename ValueType = default_precision>
void gko::matrix::Dense< ValueType >::add_scaled ( const LinOp alpha,
const LinOp b 
)
inline

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

Parameters
alphaIf alpha is 1x1 Dense matrix, the entire matrix is scaled by alpha. If it is a Dense row vector of values, then i-th column of the matrix is scaled with the i-th element of alpha (the number of columns of alpha has to match the number of columns of the matrix).
ba matrix of the same dimension as this

References gko::PolymorphicObject::get_executor(), and gko::make_temporary_clone().

◆ at() [1/4]

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

Returns a single element of the matrix.

Useful for iterating across all elements of the matrix. 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 matrix is stored at (e.g. trying to call this method on a GPU matrix from the OMP results in a runtime error)

References gko::Array< ValueType >::get_const_data().

◆ at() [2/4]

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

Returns a single element of the matrix.

Useful for iterating across all elements of the matrix. 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 matrix is stored at (e.g. trying to call this method on a GPU matrix from the OMP results in a runtime error)

References gko::Array< ValueType >::get_data().

◆ at() [3/4]

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

Returns a single element of the matrix.

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 matrix is stored at (e.g. trying to call this method on a GPU matrix from the OMP results in a runtime error)

References gko::Array< ValueType >::get_const_data().

◆ at() [4/4]

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

Returns a single element of the matrix.

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 matrix is stored at (e.g. trying to call this method on a GPU matrix from the OMP results in a runtime error)

References gko::Array< ValueType >::get_data().

Referenced by gko::initialize().

◆ column_permute() [1/2]

template<typename ValueType = default_precision>
std::unique_ptr<LinOp> gko::matrix::Dense< ValueType >::column_permute ( const Array< int32 > *  permutation_indices) const
overridevirtual

Returns a LinOp representing the column permutation of the Permutable object.

Parameters
permutation_indicesthe array of indices contaning the permutation order.
Returns
a pointer to the new column permuted object

Implements gko::Permutable< int32 >.

◆ column_permute() [2/2]

template<typename ValueType = default_precision>
std::unique_ptr<LinOp> gko::matrix::Dense< ValueType >::column_permute ( const Array< int64 > *  permutation_indices) const
overridevirtual

Returns a LinOp representing the column permutation of the Permutable object.

Parameters
permutation_indicesthe array of indices contaning the permutation order.
Returns
a pointer to the new column permuted object

Implements gko::Permutable< int64 >.

◆ compute_dot()

template<typename ValueType = default_precision>
void gko::matrix::Dense< ValueType >::compute_dot ( const LinOp b,
LinOp result 
) const
inline

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

The conjugate of this is taken.

Parameters
ba Dense matrix of same dimension as this
resulta Dense row vector, used to store the dot product (the number of column in the vector must match the number of columns of this)

References gko::PolymorphicObject::get_executor(), and gko::make_temporary_clone().

◆ compute_norm2()

template<typename ValueType = default_precision>
void gko::matrix::Dense< ValueType >::compute_norm2 ( LinOp result) const
inline

Computes the Euclidian (L^2) norm of this matrix.

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

References gko::PolymorphicObject::get_executor(), and gko::make_temporary_clone().

◆ conj_transpose()

template<typename ValueType = default_precision>
std::unique_ptr<LinOp> gko::matrix::Dense< ValueType >::conj_transpose ( ) const
overridevirtual

Returns a LinOp representing the conjugate transpose of the Transposable object.

Returns
a pointer to the new conjugate transposed object

Implements gko::Transposable.

◆ create_submatrix()

template<typename ValueType = default_precision>
std::unique_ptr<Dense> gko::matrix::Dense< ValueType >::create_submatrix ( const span rows,
const span columns,
const size_type  stride 
)
inline

Create a submatrix from the original matrix.

Warning: defining stride for this create_submatrix method might cause wrong memory access. Better use the create_submatrix(rows, columns) method instead.

Parameters
rowsrow span
columnscolumn span
stridestride of the new submatrix.

References gko::span::begin, gko::PolymorphicObject::get_executor(), gko::LinOp::get_size(), gko::matrix::Dense< ValueType >::get_stride(), gko::matrix::Dense< ValueType >::get_values(), and gko::Array< ValueType >::view().

◆ create_with_config_of()

template<typename ValueType = default_precision>
static std::unique_ptr<Dense> gko::matrix::Dense< ValueType >::create_with_config_of ( const Dense< ValueType > *  other)
inlinestatic

Creates a Dense matrix with the configuration of another Dense matrix.

Parameters
otherThe other matrix whose configuration needs to copied.

◆ get_const_values()

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

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

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.

References gko::Array< ValueType >::get_const_data().

◆ get_num_stored_elements()

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

Returns the number of elements explicitly stored in the matrix.

Returns
the number of elements explicitly stored in the matrix

References gko::Array< ValueType >::get_num_elems().

◆ get_stride()

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

Returns the stride of the matrix.

Returns
the stride of the matrix.

Referenced by gko::matrix::Dense< ValueType >::create_submatrix().

◆ get_values()

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

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

Returns
the pointer to the array of values

References gko::Array< ValueType >::get_data().

Referenced by gko::matrix::Dense< ValueType >::create_submatrix().

◆ inverse_column_permute() [1/2]

template<typename ValueType = default_precision>
std::unique_ptr<LinOp> gko::matrix::Dense< ValueType >::inverse_column_permute ( const Array< int32 > *  inverse_permutation_indices) const
overridevirtual

Returns a LinOp representing the row permutation of the inverse permuted object.

Parameters
inverse_permutation_indicesthe array of indices contaning the inverse permutation order.
Returns
a pointer to the new inverse permuted object

Implements gko::Permutable< int32 >.

◆ inverse_column_permute() [2/2]

template<typename ValueType = default_precision>
std::unique_ptr<LinOp> gko::matrix::Dense< ValueType >::inverse_column_permute ( const Array< int64 > *  inverse_permutation_indices) const
overridevirtual

Returns a LinOp representing the row permutation of the inverse permuted object.

Parameters
inverse_permutation_indicesthe array of indices contaning the inverse permutation order.
Returns
a pointer to the new inverse permuted object

Implements gko::Permutable< int64 >.

◆ inverse_row_permute() [1/2]

template<typename ValueType = default_precision>
std::unique_ptr<LinOp> gko::matrix::Dense< ValueType >::inverse_row_permute ( const Array< int32 > *  inverse_permutation_indices) const
overridevirtual

Returns a LinOp representing the row permutation of the inverse permuted object.

Parameters
inverse_permutation_indicesthe array of indices contaning the inverse permutation order.
Returns
a pointer to the new inverse permuted object

Implements gko::Permutable< int32 >.

◆ inverse_row_permute() [2/2]

template<typename ValueType = default_precision>
std::unique_ptr<LinOp> gko::matrix::Dense< ValueType >::inverse_row_permute ( const Array< int64 > *  inverse_permutation_indices) const
overridevirtual

Returns a LinOp representing the row permutation of the inverse permuted object.

Parameters
inverse_permutation_indicesthe array of indices contaning the inverse permutation order.
Returns
a pointer to the new inverse permuted object

Implements gko::Permutable< int64 >.

◆ row_permute() [1/2]

template<typename ValueType = default_precision>
std::unique_ptr<LinOp> gko::matrix::Dense< ValueType >::row_permute ( const Array< int32 > *  permutation_indices) const
overridevirtual

Returns a LinOp representing the row permutation of the Permutable object.

Parameters
permutation_indicesthe array of indices contaning the permutation order.
Returns
a pointer to the new permuted object

Implements gko::Permutable< int32 >.

◆ row_permute() [2/2]

template<typename ValueType = default_precision>
std::unique_ptr<LinOp> gko::matrix::Dense< ValueType >::row_permute ( const Array< int64 > *  permutation_indices) const
overridevirtual

Returns a LinOp representing the row permutation of the Permutable object.

Parameters
permutation_indicesthe array of indices contaning the permutation order.
Returns
a pointer to the new permuted object

Implements gko::Permutable< int64 >.

◆ scale()

template<typename ValueType = default_precision>
void gko::matrix::Dense< ValueType >::scale ( const LinOp alpha)
inline

Scales the matrix with a scalar (aka: BLAS scal).

Parameters
alphaIf alpha is 1x1 Dense matrix, the entire matrix is scaled by alpha. If it is a Dense row vector of values, then i-th column of the matrix is scaled with the i-th element of alpha (the number of columns of alpha has to match the number of columns of the matrix).

References gko::PolymorphicObject::get_executor(), and gko::make_temporary_clone().

◆ transpose()

template<typename ValueType = default_precision>
std::unique_ptr<LinOp> gko::matrix::Dense< ValueType >::transpose ( ) const
overridevirtual

Returns a LinOp representing the transpose of the Transposable object.

Returns
a pointer to the new transposed object

Implements gko::Transposable.


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