|
LocARNA-2.0.0
|
Represents a sparse 2D matrix. More...
#include <sparse_matrix.hh>


Public Types | |
| using | parent_t = SparseVectorBase< SparseMatrix< T >, T, std::pair< size_t, size_t > > |
| using | size_type = typename parent_t::size_type |
| usual definition of size_type | |
| using | value_type = T |
| type of matrix entries | |
| using | key_type = std::pair< size_type, size_type > |
| type of matrix index pair | |
| using | map_type = std::unordered_map< key_type, value_type > |
| map type | |
Public Types inherited from LocARNA::SparseVectorBase< SparseMatrix< T >, T, std::pair< size_t, size_t > > | |
| using | derived_type = SparseMatrix< T > |
| using | value_type = T |
| type of vector entries | |
| using | key_type = std::pair< size_t, size_t > |
| type of vector index | |
| using | map_type = std::unordered_map< std::pair< size_t, size_t >, T > |
| using | size_type = size_t |
| usual definition of size_type | |
| using | const_iterator = typename map_type::const_iterator |
| Stl-compatible constant iterator over vector elements. More... | |
| using | iterator = typename map_type::iterator |
Public Member Functions | |
| SparseMatrix (const value_type &def) | |
| Construct with default value. More... | |
| parent_t::element_proxy | operator() (size_type i, size_type j) |
| Access to matrix element. More... | |
| const value_type & | operator() (size_type i, size_type j) const |
| value_type & | ref (size_type i, size_type j) |
| void | set (size_type i, size_type j, const value_type &val) |
| void | reset (size_type i, size_type j) |
Public Member Functions inherited from LocARNA::SparseVectorBase< SparseMatrix< T >, T, std::pair< size_t, size_t > > | |
| SparseVectorBase (const value_type def) | |
| element_proxy | operator[] (const key_type &i) |
| Access to vector element. More... | |
| const value_type & | operator[] (const key_type &i) const |
| Read-only access to vector element of const vector. More... | |
| void | set (const key_type &i, const value_type &val) |
| Write access to vector entry. More... | |
| value_type & | ref (const key_type &i) |
| Write access to element. More... | |
| void | reset (const key_type &i) |
| Set vector entry to default value. More... | |
| size_type | size () const |
| Size of sparse vector. More... | |
| bool | empty () const |
| Check for emptiness. More... | |
| void | clear () |
| Clear the vector. | |
| const_iterator | begin () const |
| Begin const iterator over vector entries. More... | |
| const_iterator | end () const |
| End const iterator over vector entries. More... | |
| const value_type & | def () const |
| Default value. More... | |
Public Attributes | |
| friend | parent_t |
Additional Inherited Members | |
Protected Attributes inherited from LocARNA::SparseVectorBase< SparseMatrix< T >, T, std::pair< size_t, size_t > > | |
| value_type | def_ |
| default value of vector entries | |
| map_type | the_map_ |
| internal representation of sparse vector | |
Represents a sparse 2D matrix.
Sparse matrix of entries val_t implements the matrix by a hash map. The class is designed to be largely exchangable with the non-sparse Matrix class. (A proxy class is used to provide the same syntax for the interface.)
|
inlineexplicit |
Construct with default value.
| def | default value of entries |
|
inline |
Access to matrix element.
| i | index first dimension |
| j | index second dimension |