Ginkgo  Generated from tags/v1.0.0^0 branch based on master. Ginkgo version 1.0.0
A numerical linear algebra library targeting many-core architectures
Public Member Functions | List of all members
gko::matrix::Hybrid< ValueType, IndexType >::imbalance_limit Class Reference

imbalance_limit is a strategy_type which decides the number of stored elements per row of the ell part according to the percent. More...

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

Collaboration diagram for gko::matrix::Hybrid< ValueType, IndexType >::imbalance_limit:
[legend]

Public Member Functions

 imbalance_limit (float percent=0.8)
 Creates a imbalance_limit strategy. More...
 
size_type compute_ell_num_stored_elements_per_row (Array< size_type > *row_nnz) const override
 Computes the number of stored elements per row of the ell part. More...
 
- Public Member Functions inherited from gko::matrix::Hybrid< ValueType, IndexType >::strategy_type
 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). More...
 
const size_type get_ell_num_stored_elements_per_row () const noexcept
 Returns the number of stored elements per row of the ell part. More...
 
const size_type get_coo_nnz () const noexcept
 Returns the number of nonzeros of the coo part. More...
 

Detailed Description

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

imbalance_limit is a strategy_type which decides the number of stored elements per row of the ell part according to the percent.

It sorts the number of nonzeros of each row and takes the value at the position floor(percent * num_row) as the number of stored elements per row of the ell part. Thus, at least percent rows of all are in the ell part.

Constructor & Destructor Documentation

◆ imbalance_limit()

template<typename ValueType = default_precision, typename IndexType = int32>
gko::matrix::Hybrid< ValueType, IndexType >::imbalance_limit::imbalance_limit ( float  percent = 0.8)
inlineexplicit

Creates a imbalance_limit strategy.

Parameters
percentthe row_nnz[floor(num_rows*percent)] is the number of stored elements per row of the ell part

Member Function Documentation

◆ compute_ell_num_stored_elements_per_row()

template<typename ValueType = default_precision, typename IndexType = int32>
size_type gko::matrix::Hybrid< ValueType, IndexType >::imbalance_limit::compute_ell_num_stored_elements_per_row ( Array< size_type > *  row_nnz) const
inlineoverridevirtual

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

Parameters
row_nnzthe number of nonzeros of each row
Returns
the number of stored elements per row of the ell part

Implements gko::matrix::Hybrid< ValueType, IndexType >::strategy_type.

References gko::Array< ValueType >::get_data(), and gko::Array< ValueType >::get_num_elems().


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