Ginkgo
Generated from pipelines/1068515030 branch based on master. Ginkgo version 1.7.0
A numerical linear algebra library targeting many-core architectures
|
Dense is a batch matrix format which explicitly stores all values of the matrix in each of the batches. More...
#include <ginkgo/core/matrix/batch_dense.hpp>
Public Types | |
using | value_type = ValueType |
using | index_type = int32 |
using | transposed_type = Dense< ValueType > |
using | unbatch_type = gko::matrix::Dense< ValueType > |
using | absolute_type = remove_complex< Dense > |
using | complex_type = to_complex< Dense > |
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< Dense< next_precision< ValueType > > > | |
using | result_type = Dense< next_precision< ValueType > > |
Public Member Functions | |
void | convert_to (Dense< next_precision< ValueType >> *result) const override |
void | move_to (Dense< next_precision< ValueType >> *result) override |
std::unique_ptr< unbatch_type > | create_view_for_item (size_type item_id) |
Creates a mutable view (of gko::matrix::Dense type) of one item of the batch::matrix::Dense<value_type> object. More... | |
std::unique_ptr< const unbatch_type > | create_const_view_for_item (size_type item_id) const |
Creates a mutable view (of gko::matrix::Dense type) of one item of the batch::matrix::Dense<value_type> object. More... | |
size_type | get_cumulative_offset (size_type batch_id) const |
Get the cumulative storage size offset. More... | |
value_type * | get_values () noexcept |
Returns a pointer to the array of values of the multi-vector. More... | |
const value_type * | get_const_values () const noexcept |
Returns a pointer to the array of values of the multi-vector. More... | |
value_type & | at (size_type batch_id, size_type row, size_type col) |
Returns a single element for a particular batch item. More... | |
value_type | at (size_type batch_id, size_type row, size_type col) const |
Returns a single element for a particular batch item. More... | |
ValueType & | at (size_type batch_id, size_type idx) noexcept |
Returns a single element for a particular batch item. More... | |
ValueType | at (size_type batch_id, size_type idx) const noexcept |
Returns a single element for a particular batch item. More... | |
value_type * | get_values_for_item (size_type batch_id) noexcept |
Returns a pointer to the array of values of the matrix for a specific batch item. More... | |
const value_type * | get_const_values_for_item (size_type batch_id) const noexcept |
Returns a pointer to the array of values of the matrix for a specific batch item. More... | |
size_type | get_num_stored_elements () const noexcept |
Returns the number of elements explicitly stored in the batch matrix, cumulative across all the batch items. More... | |
Dense * | apply (ptr_param< const MultiVector< value_type >> b, ptr_param< MultiVector< value_type >> x) |
Apply the matrix to a multi-vector. More... | |
Dense * | apply (ptr_param< const MultiVector< value_type >> alpha, ptr_param< const MultiVector< value_type >> b, ptr_param< const MultiVector< value_type >> beta, ptr_param< MultiVector< value_type >> x) |
Apply the matrix to a multi-vector with a linear combination of the given input vector. More... | |
const Dense * | apply (ptr_param< const MultiVector< value_type >> b, ptr_param< MultiVector< value_type >> x) const |
const Dense * | apply (ptr_param< const MultiVector< value_type >> alpha, ptr_param< const MultiVector< value_type >> b, ptr_param< const MultiVector< value_type >> beta, ptr_param< MultiVector< value_type >> x) const |
Public Member Functions inherited from gko::EnableAbstractPolymorphicObject< Dense< ValueType >, BatchLinOp > | |
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) |
std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, Dense< ValueType > > * | copy_from (std::unique_ptr< Derived > &&other) |
std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, Dense< ValueType > > * | copy_from (const std::unique_ptr< Derived > &other) |
Dense< ValueType > * | copy_from (const std::shared_ptr< const PolymorphicObject > &other) |
Dense< ValueType > * | move_from (ptr_param< PolymorphicObject > other) |
Dense< ValueType > * | clear () |
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< Dense< 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< Dense< 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) |
Static Public Member Functions | |
static std::unique_ptr< const Dense< value_type > > | create_const (std::shared_ptr< const Executor > exec, const batch_dim< 2 > &sizes, gko::detail::const_array_view< ValueType > &&values) |
Creates a constant (immutable) batch dense matrix from a constant array. 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, BatchLinOp > |
class | Dense< to_complex< ValueType > > |
class | Dense< next_precision< ValueType > > |
Dense is a batch matrix format which explicitly stores all values of the matrix in each of the batches.
The values in each of the batches are stored in row-major format (values belonging to the same row appear consecutive in the memory and the values of each batch item are also stored consecutively in memory).
ValueType | precision of matrix elements |
Dense* gko::batch::matrix::Dense< ValueType >::apply | ( | ptr_param< const MultiVector< value_type >> | alpha, |
ptr_param< const MultiVector< value_type >> | b, | ||
ptr_param< const MultiVector< value_type >> | beta, | ||
ptr_param< MultiVector< value_type >> | x | ||
) |
Apply the matrix to a multi-vector with a linear combination of the given input vector.
Represents the matrix vector multiplication, x = alpha * A
alpha | the scalar to scale the matrix-vector product with |
b | the multi-vector to be applied to |
beta | the scalar to scale the x vector with |
x | the output multi-vector |
const Dense* gko::batch::matrix::Dense< ValueType >::apply | ( | ptr_param< const MultiVector< value_type >> | alpha, |
ptr_param< const MultiVector< value_type >> | b, | ||
ptr_param< const MultiVector< value_type >> | beta, | ||
ptr_param< MultiVector< value_type >> | x | ||
) | const |
Dense* gko::batch::matrix::Dense< ValueType >::apply | ( | ptr_param< const MultiVector< value_type >> | b, |
ptr_param< MultiVector< value_type >> | x | ||
) |
Apply the matrix to a multi-vector.
Represents the matrix vector multiplication, x = A * b, where x and b are both multi-vectors.
b | the multi-vector to be applied to |
x | the output multi-vector |
const Dense* gko::batch::matrix::Dense< ValueType >::apply | ( | ptr_param< const MultiVector< value_type >> | b, |
ptr_param< MultiVector< value_type >> | x | ||
) | const |
|
inlinenoexcept |
Returns a single element for a particular batch item.
batch_id | the batch item index to be queried |
row | the row of the requested element |
col | the column of the requested element |
References gko::array< ValueType >::get_const_data().
|
inlinenoexcept |
Returns a single element for a particular batch item.
Useful for iterating across all elements of the matrix. However, it is less efficient than the two-parameter variant of this method.
batch_id | the batch item index to be queried |
idx | a linear index of the requested element |
References gko::array< ValueType >::get_data().
|
inline |
Returns a single element for a particular batch item.
batch_id | the batch item index to be queried |
row | the row of the requested element |
col | the column of the requested element |
References gko::array< ValueType >::get_data().
|
inline |
Returns a single element for a particular batch item.
batch_id | the batch item index to be queried |
row | the row of the requested element |
col | the column of the requested element |
References gko::array< ValueType >::get_const_data().
|
static |
Creates a constant (immutable) batch dense matrix from a constant array.
exec | the executor to create the matrix on |
size | the dimensions of the matrix |
values | the value array of the matrix |
std::unique_ptr<const unbatch_type> gko::batch::matrix::Dense< ValueType >::create_const_view_for_item | ( | size_type | item_id | ) | const |
Creates a mutable view (of gko::matrix::Dense type) of one item of the batch::matrix::Dense<value_type> object.
Does not perform any deep copies, but only returns a view of the data.
item_id | The index of the batch item |
std::unique_ptr<unbatch_type> gko::batch::matrix::Dense< ValueType >::create_view_for_item | ( | size_type | item_id | ) |
Creates a mutable view (of gko::matrix::Dense type) of one item of the batch::matrix::Dense<value_type> object.
Does not perform any deep copies, but only returns a view of the data.
item_id | The index of the batch item |
|
inlinenoexcept |
Returns a pointer to the array of values of the multi-vector.
References gko::array< ValueType >::get_const_data().
|
inlinenoexcept |
Returns a pointer to the array of values of the matrix for a specific batch item.
batch_id | the id of the batch item. |
References gko::array< ValueType >::get_const_data(), and gko::batch::matrix::Dense< ValueType >::get_cumulative_offset().
|
inline |
Get the cumulative storage size offset.
batch_id | the batch id |
Referenced by gko::batch::matrix::Dense< ValueType >::get_const_values_for_item(), and gko::batch::matrix::Dense< ValueType >::get_values_for_item().
|
inlinenoexcept |
Returns the number of elements explicitly stored in the batch matrix, cumulative across all the batch items.
References gko::array< ValueType >::get_num_elems().
|
inlinenoexcept |
Returns a pointer to the array of values of the multi-vector.
References gko::array< ValueType >::get_data().
|
inlinenoexcept |
Returns a pointer to the array of values of the matrix for a specific batch item.
batch_id | the id of the batch item. |
References gko::batch::matrix::Dense< ValueType >::get_cumulative_offset(), and gko::array< ValueType >::get_data().