RowGatherer< IndexType > Class Template Reference

RowGatherer&lt; IndexType &gt; Class Template Reference#

Reference API: gko::matrix::RowGatherer< IndexType > Class Template Reference
Reference API

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

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

Public Types

using index_type = IndexType
 
- Public Types inherited from gko::EnablePolymorphicAssignment< ConcreteLinOp >
using result_type = ConcreteLinOp
 
- Public Types inherited from gko::ConvertibleTo< ResultType >
using result_type = ResultType
 

Public Member Functions

index_type * get_row_idxs () noexcept
 
const index_type * get_const_row_idxs () const noexcept
 
- Public Member Functions inherited from gko::EnableLinOp< ConcreteLinOp, PolymorphicBase >
const ConcreteLinOp * apply (ptr_param< const LinOp > b, ptr_param< LinOp > x) const
 
ConcreteLinOp * apply (ptr_param< const LinOp > b, ptr_param< LinOp > x)
 
const ConcreteLinOp * apply (ptr_param< const LinOp > alpha, ptr_param< const LinOp > b, ptr_param< const LinOp > beta, ptr_param< LinOp > x) const
 
ConcreteLinOp * 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< AbstractObject, PolymorphicBase >
std::unique_ptr< AbstractObject > create_default (std::shared_ptr< const Executor > exec) const
 
std::unique_ptr< AbstractObject > create_default () const
 
std::unique_ptr< AbstractObject > clone (std::shared_ptr< const Executor > exec) const
 
std::unique_ptr< AbstractObject > clone () const
 
AbstractObject * copy_from (const PolymorphicObject *other)
 
template<typename Derived >
std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, AbstractObject > * copy_from (std::unique_ptr< Derived > &&other)
 
template<typename Derived >
std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, AbstractObject > * copy_from (const std::unique_ptr< Derived > &other)
 
AbstractObject * copy_from (const std::shared_ptr< const PolymorphicObject > &other)
 
AbstractObject * move_from (ptr_param< PolymorphicObject > other)
 
AbstractObject * clear ()
 
- Public Member Functions inherited from gko::PolymorphicObject
PolymorphicObjectoperator= (const PolymorphicObject &)
 
std::unique_ptr< PolymorphicObjectcreate_default (std::shared_ptr< const Executor > exec) const
 
std::unique_ptr< PolymorphicObjectcreate_default () const
 
std::unique_ptr< PolymorphicObjectclone (std::shared_ptr< const Executor > exec) const
 
std::unique_ptr< PolymorphicObjectclone () const
 
PolymorphicObjectcopy_from (const PolymorphicObject *other)
 
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)
 
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)
 
PolymorphicObjectcopy_from (const std::shared_ptr< const PolymorphicObject > &other)
 
PolymorphicObjectmove_from (ptr_param< PolymorphicObject > other)
 
PolymorphicObjectclear ()
 
std::shared_ptr< const Executorget_executor () const noexcept
 
- 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< ConcreteLinOp >
void convert_to (result_type *result) const override
 
void move_to (result_type *result) override
 
- Public Member Functions inherited from gko::ConvertibleTo< ResultType >
virtual void convert_to (result_type *result) const =0
 
void convert_to (ptr_param< result_type > result) const
 
virtual void move_to (result_type *result)=0
 
void move_to (ptr_param< result_type > result)
 

Static Public Member Functions

static std::unique_ptr< RowGatherercreate (std::shared_ptr< const Executor > exec, const dim< 2 > &size={})
 
static std::unique_ptr< RowGatherercreate (std::shared_ptr< const Executor > exec, const dim< 2 > &size, array< index_type > row_idxs)
 
static std::unique_ptr< const RowGatherercreate_const (std::shared_ptr< const Executor > exec, const dim< 2 > &size, gko::detail::const_array_view< IndexType > &&row_idxs)
 

Protected Member Functions

 RowGatherer (std::shared_ptr< const Executor > exec, const dim< 2 > &size={})
 
 RowGatherer (std::shared_ptr< const Executor > exec, const dim< 2 > &size, array< index_type > row_idxs)
 
void apply_impl (const LinOp *in, LinOp *out) const override
 
void apply_impl (const LinOp *alpha, const LinOp *in, const LinOp *beta, LinOp *out) const override
 
- Protected Member Functions inherited from gko::EnableLinOp< ConcreteLinOp, PolymorphicBase >
ConcreteLinOp * self () noexcept
 
const ConcreteLinOp * self () const noexcept
 
- Protected Member Functions inherited from gko::EnablePolymorphicObject< ConcreteObject, PolymorphicBase >
std::unique_ptr< PolymorphicObjectcreate_default_impl (std::shared_ptr< const Executor > exec) const override
 
PolymorphicObjectcopy_from_impl (const PolymorphicObject *other) override
 
PolymorphicObjectcopy_from_impl (std::unique_ptr< PolymorphicObject > other) override
 
PolymorphicObjectmove_from_impl (PolymorphicObject *other) override
 
PolymorphicObjectmove_from_impl (std::unique_ptr< PolymorphicObject > other) override
 
PolymorphicObjectclear_impl () override
 
- Protected Member Functions inherited from gko::PolymorphicObject
 PolymorphicObject (std::shared_ptr< const Executor > exec)
 
 PolymorphicObject (const PolymorphicObject &other)
 
- Protected Member Functions inherited from gko::log::EnableLogging< PolymorphicObject >
void log (Params &&... params) const
 

Friends

class EnablePolymorphicObject< RowGatherer, LinOp >
 

Additional Inherited Members

- Protected Attributes inherited from gko::log::EnableLogging< PolymorphicObject >
std::vector< std::shared_ptr< const Logger > > loggers_
 

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

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

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

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


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