Ginkgo Generated from branch based on main. Ginkgo version 1.11.0
A numerical linear algebra library targeting many-core architectures
Loading...
Searching...
No Matches
gko::matrix::RowGatherer< IndexType > Class Template Reference

RowGatherer is a matrix "format" which stores the gather indices arrays which can be used to gather rows to another matrix. More...

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

Inheritance diagram for gko::matrix::RowGatherer< IndexType >:
[legend]
Collaboration diagram for gko::matrix::RowGatherer< IndexType >:
[legend]

Public Types

using index_type = IndexType
Public Types inherited from gko::EnablePolymorphicAssignment< RowGatherer< int32 > >
using result_type

Public Member Functions

index_type * get_row_idxs () noexcept
 Returns a pointer to the row index array for gathering.
const index_type * get_const_row_idxs () const noexcept
 Returns a pointer to the row index array for gathering.
Public Member Functions inherited from gko::EnableLinOp< RowGatherer< int32 > >
const RowGatherer< int32 > * apply (ptr_param< const LinOp > b, ptr_param< LinOp > x) const
Public Member Functions inherited from gko::EnablePolymorphicAssignment< RowGatherer< int32 > >
void convert_to (result_type *result) const override
void move_to (result_type *result) override

Static Public Member Functions

static std::unique_ptr< RowGatherer > create (std::shared_ptr< const Executor > exec, const dim< 2 > &size={})
 Creates uninitialized RowGatherer arrays of the specified size.
static std::unique_ptr< RowGatherer > create (std::shared_ptr< const Executor > exec, const dim< 2 > &size, array< index_type > row_idxs)
 Creates a RowGatherer matrix from an already allocated (and initialized) row gathering array.
static std::unique_ptr< const RowGatherer > create_const (std::shared_ptr< const Executor > exec, const dim< 2 > &size, gko::detail::const_array_view< IndexType > &&row_idxs)
 Creates a constant (immutable) RowGatherer matrix from a constant array.

Friends

class EnablePolymorphicObject< RowGatherer, LinOp >

Detailed Description

template<typename IndexType = int32>
class gko::matrix::RowGatherer< IndexType >

RowGatherer is a matrix "format" which stores the gather indices arrays which can be used to gather rows to another matrix.

Template Parameters
IndexTypeprecision of rowgatherer array indices.
Note
This format is used mainly to allow for an abstraction of the rowgatherer and provides the user with an apply method which calls the respective Dense rowgatherer operation. As such it only stores an array of the rowgatherer indices.

Member Function Documentation

◆ create() [1/2]

template<typename IndexType = int32>
std::unique_ptr< RowGatherer > gko::matrix::RowGatherer< IndexType >::create ( std::shared_ptr< const Executor > exec,
const dim< 2 > & size,
array< index_type > row_idxs )
static

Creates a RowGatherer matrix from an already allocated (and initialized) row gathering array.

Parameters
execExecutor associated to the matrix
sizesize of the rowgatherer array.
row_idxsarray of rowgatherer array
Note
If row_idxs is not an rvalue, not an array of IndexType, or is on the wrong executor, an internal copy will be created, and the original array data will not be used in the matrix.
Returns
A smart pointer to the newly created matrix.

◆ create() [2/2]

template<typename IndexType = int32>
std::unique_ptr< RowGatherer > gko::matrix::RowGatherer< IndexType >::create ( std::shared_ptr< const Executor > exec,
const dim< 2 > & size = {} )
static

Creates uninitialized RowGatherer arrays of the specified size.

Parameters
execExecutor associated to the matrix
sizesize of the RowGatherable matrix
Returns
A smart pointer to the newly created matrix.

◆ create_const()

template<typename IndexType = int32>
std::unique_ptr< const RowGatherer > gko::matrix::RowGatherer< IndexType >::create_const ( std::shared_ptr< const Executor > exec,
const dim< 2 > & size,
gko::detail::const_array_view< IndexType > && row_idxs )
static

Creates a constant (immutable) RowGatherer matrix from a constant array.

Parameters
execthe executor to create the matrix on
sizethe dimensions of the matrix
row_idxsthe gathered row indices of the matrix
Returns
A smart pointer to the constant matrix wrapping the input arrays (if they reside on the same executor as the matrix) or a copy of the arrays on the correct executor.

◆ get_const_row_idxs()

template<typename IndexType = int32>
const index_type * gko::matrix::RowGatherer< IndexType >::get_const_row_idxs ( ) const
inlinenoexcept

Returns a pointer to the row index array for gathering.

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

◆ get_row_idxs()

template<typename IndexType = int32>
index_type * gko::matrix::RowGatherer< IndexType >::get_row_idxs ( )
inlinenoexcept

Returns a pointer to the row index array for gathering.

Returns
the pointer to the row index array for gathering.

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