Ginkgo: gko::matrix::Hybrid< ValueType, IndexType >::strategy_type Class Reference

| 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::Hybrid< ValueType, IndexType >::strategy_type Class Referenceabstract

strategy_type is to decide how to set the hybrid config. More...

`#include <ginkgo/core/matrix/hybrid.hpp>`

Inheritance diagram for gko::matrix::Hybrid< ValueType, IndexType >::strategy_type:
[legend]

## Public Member Functions
| strategy_type ()
| Creates a strategy_type.
void | compute_hybrid_config (const array< size_type > &row_nnz, size_type *ell_num_stored_elements_per_row, size_type *coo_nnz)
| Computes the config of the Hybrid matrix (ell_num_stored_elements_per_row and coo_nnz).
size_type | get_ell_num_stored_elements_per_row () const noexcept
| Returns the number of stored elements per row of the ell part.
size_type | get_coo_nnz () const noexcept
| Returns the number of nonzeros of the coo part.
virtual size_type | compute_ell_num_stored_elements_per_row (array< size_type > *row_nnz) const =0
| Computes the number of stored elements per row of the ell part.

## Detailed Description

template<typename ValueType = default_precision, typename IndexType = int32>
class gko::matrix::Hybrid< ValueType, IndexType >::strategy_type

strategy_type is to decide how to set the hybrid config.

It computes the number of stored elements per row of the ell part and then set the number of residual nonzeros as the number of nonzeros of the coo part.

The practical strategy method should inherit strategy_type and implement its compute_ell_num_stored_elements_per_row function.

## Member Function Documentation

## ◆ compute_ell_num_stored_elements_per_row()

template<typename ValueType = default_precision, typename IndexType = int32>

virtual size_type gko::matrix::Hybrid< ValueType, IndexType >::strategy_type::compute_ell_num_stored_elements_per_row | ( | array< size_type > * | row_nnz | ) | const
| pure virtual

Computes the number of stored elements per row of the ell part.

Parameters

  row_nnz | the number of nonzeros of each row

Returns
  the number of stored elements per row of the ell part

Implemented in gko::matrix::Hybrid< ValueType, IndexType >::automatic, gko::matrix::Hybrid< ValueType, IndexType >::column_limit, gko::matrix::Hybrid< ValueType, IndexType >::imbalance_bounded_limit, gko::matrix::Hybrid< ValueType, IndexType >::imbalance_limit, and gko::matrix::Hybrid< ValueType, IndexType >::minimal_storage_limit.

References gko::array< ValueType >::get_const_data(), and gko::array< ValueType >::get_size().

Referenced by compute_hybrid_config().

## ◆ compute_hybrid_config()

template<typename ValueType = default_precision, typename IndexType = int32>

void gko::matrix::Hybrid< ValueType, IndexType >::strategy_type::compute_hybrid_config | ( | const array< size_type > & | row_nnz,
|  | size_type * | ell_num_stored_elements_per_row,
|  | size_type * | coo_nnz )
| inline

Computes the config of the Hybrid matrix (ell_num_stored_elements_per_row and coo_nnz).

For now, it copies row_nnz to the reference executor and performs all operations on the reference executor.

Parameters

  row_nnz | the number of nonzeros of each row
  ell_num_stored_elements_per_row | the output number of stored elements per row of the ell part
  coo_nnz | the output number of nonzeros of the coo part

References compute_ell_num_stored_elements_per_row(), gko::array< ValueType >::get_executor(), and gko::array< ValueType >::get_size().

## ◆ get_coo_nnz()

template<typename ValueType = default_precision, typename IndexType = int32>

size_type gko::matrix::Hybrid< ValueType, IndexType >::strategy_type::get_coo_nnz | ( |  | ) | const
| inlinenoexcept

Returns the number of nonzeros of the coo part.

Returns
  the number of nonzeros of the coo part

## ◆ get_ell_num_stored_elements_per_row()

template<typename ValueType = default_precision, typename IndexType = int32>

size_type gko::matrix::Hybrid< ValueType, IndexType >::strategy_type::get_ell_num_stored_elements_per_row | ( |  | ) | const
| inlinenoexcept

Returns the number of stored elements per row of the ell part.

Returns
  the number of stored elements per row of the ell part

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

- ginkgo/core/matrix/hybrid.hpp