MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
mtl::mat::ell_matrix< Value, Parameters > Class Template Reference

ELLPACK sparse matrix: each row stores up to max_width non-zeros. More...

#include <ell_matrix.hpp>

Public Types

using param_type = Parameters
using value_type = Value
using size_type = typename Parameters::size_type
using const_reference = const Value&
using reference = Value&

Public Member Functions

 ell_matrix ()
 Default: empty.
 ell_matrix (size_type nrows, size_type ncols, size_type max_width)
 Empty nrows x ncols with given max row width.
 ell_matrix (const compressed2D< Value, Parameters > &csr)
 Construct from compressed2D (auto-detect max row width).
value_type operator() (size_type r, size_type c) const
size_type num_rows () const
size_type num_cols () const
size_type size () const
size_type max_width () const
const std::vector< size_type > & ref_indices () const
const std::vector< Value > & ref_data () const

Static Public Attributes

static constexpr size_type invalid = size_type(-1)

Detailed Description

template<typename Value, typename Parameters = parameters<>>
class mtl::mat::ell_matrix< Value, Parameters >

ELLPACK sparse matrix: each row stores up to max_width non-zeros.

Two flat arrays of size nrows * max_width: indices and values. Unused slots have index == size_type(-1).

Member Typedef Documentation

◆ const_reference

template<typename Value, typename Parameters = parameters<>>
using mtl::mat::ell_matrix< Value, Parameters >::const_reference = const Value&

◆ param_type

template<typename Value, typename Parameters = parameters<>>
using mtl::mat::ell_matrix< Value, Parameters >::param_type = Parameters

◆ reference

template<typename Value, typename Parameters = parameters<>>
using mtl::mat::ell_matrix< Value, Parameters >::reference = Value&

◆ size_type

template<typename Value, typename Parameters = parameters<>>
using mtl::mat::ell_matrix< Value, Parameters >::size_type = typename Parameters::size_type

◆ value_type

template<typename Value, typename Parameters = parameters<>>
using mtl::mat::ell_matrix< Value, Parameters >::value_type = Value

Constructor & Destructor Documentation

◆ ell_matrix() [1/3]

template<typename Value, typename Parameters = parameters<>>
mtl::mat::ell_matrix< Value, Parameters >::ell_matrix ( )
inline

Default: empty.

◆ ell_matrix() [2/3]

template<typename Value, typename Parameters = parameters<>>
mtl::mat::ell_matrix< Value, Parameters >::ell_matrix ( size_type nrows,
size_type ncols,
size_type max_width )
inline

Empty nrows x ncols with given max row width.

◆ ell_matrix() [3/3]

template<typename Value, typename Parameters = parameters<>>
mtl::mat::ell_matrix< Value, Parameters >::ell_matrix ( const compressed2D< Value, Parameters > & csr)
inlineexplicit

Construct from compressed2D (auto-detect max row width).

Member Function Documentation

◆ max_width()

template<typename Value, typename Parameters = parameters<>>
size_type mtl::mat::ell_matrix< Value, Parameters >::max_width ( ) const
inline

◆ num_cols()

template<typename Value, typename Parameters = parameters<>>
size_type mtl::mat::ell_matrix< Value, Parameters >::num_cols ( ) const
inline

◆ num_rows()

template<typename Value, typename Parameters = parameters<>>
size_type mtl::mat::ell_matrix< Value, Parameters >::num_rows ( ) const
inline

◆ operator()()

template<typename Value, typename Parameters = parameters<>>
value_type mtl::mat::ell_matrix< Value, Parameters >::operator() ( size_type r,
size_type c ) const
inline

◆ ref_data()

template<typename Value, typename Parameters = parameters<>>
const std::vector< Value > & mtl::mat::ell_matrix< Value, Parameters >::ref_data ( ) const
inline

◆ ref_indices()

template<typename Value, typename Parameters = parameters<>>
const std::vector< size_type > & mtl::mat::ell_matrix< Value, Parameters >::ref_indices ( ) const
inline

◆ size()

template<typename Value, typename Parameters = parameters<>>
size_type mtl::mat::ell_matrix< Value, Parameters >::size ( ) const
inline

Member Data Documentation

◆ invalid

template<typename Value, typename Parameters = parameters<>>
size_type mtl::mat::ell_matrix< Value, Parameters >::invalid = size_type(-1)
staticconstexpr

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