|
MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
|
CSR sparse matrix: three arrays – data (values), indices (column indices), starts (row pointers of length nrows+1). More...
#include <compressed2D.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& |
| using | memory_space = ::mtl::detail::memory_space_of_t<Parameters> |
| Where the three arrays live: Parameters::memory_space, or host memory for a parameter bundle that names none (#223). | |
| template<typename T> | |
| using | array_type = ::mtl::detail::space_vector<T, memory_space> |
| The array type of ref_major() / ref_minor() (size_type) and ref_data() (Value): std::vector<T> in host memory, so host code is unchanged. | |
Public Member Functions | |
| compressed2D () | |
| Default: empty 0x0 matrix. | |
| compressed2D (size_type nrows, size_type ncols) | |
| Construct empty nrows x ncols matrix. | |
| compressed2D (size_type nrows, size_type ncols, size_type nnz_count, const size_type *starts, const size_type *indices, const Value *data) | |
| Construct from raw CSR arrays (copies data). | |
| value_type | operator() (size_type r, size_type c) const |
| Read-only access: binary search within row r for column c. | |
| size_type | num_rows () const |
| size_type | num_cols () const |
| size_type | size () const |
| size_type | nnz () const |
| const array_type< size_type > & | ref_major () const |
| array_type< size_type > & | ref_major () |
| const array_type< size_type > & | ref_minor () const |
| array_type< size_type > & | ref_minor () |
| const array_type< Value > & | ref_data () const |
| array_type< Value > & | ref_data () |
| void | change_dim (size_type r, size_type c) |
| void | make_empty () |
CSR sparse matrix: three arrays – data (values), indices (column indices), starts (row pointers of length nrows+1).
| using mtl::mat::compressed2D< Value, Parameters >::array_type = ::mtl::detail::space_vector<T, memory_space> |
The array type of ref_major() / ref_minor() (size_type) and ref_data() (Value): std::vector<T> in host memory, so host code is unchanged.
| using mtl::mat::compressed2D< Value, Parameters >::const_reference = const Value& |
| using mtl::mat::compressed2D< Value, Parameters >::memory_space = ::mtl::detail::memory_space_of_t<Parameters> |
Where the three arrays live: Parameters::memory_space, or host memory for a parameter bundle that names none (#223).
| using mtl::mat::compressed2D< Value, Parameters >::param_type = Parameters |
| using mtl::mat::compressed2D< Value, Parameters >::reference = Value& |
| using mtl::mat::compressed2D< Value, Parameters >::size_type = typename Parameters::size_type |
| using mtl::mat::compressed2D< Value, Parameters >::value_type = Value |
|
inline |
Default: empty 0x0 matrix.
|
inline |
Construct empty nrows x ncols matrix.
|
inline |
Construct from raw CSR arrays (copies data).
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Read-only access: binary search within row r for column c.
Returns zero if element is absent.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |