Element of sparse matrix. More...
#include <sparse_matrix.hh>
Public Member Functions | |
element (SparseMatrix< T > *m, const key_t &k) | |
Construct as proxy for specified element in given sparse matrix. | |
operator value_t () | |
Access entry for which the class acts as proxy. | |
element | operator+= (const value_t &x) |
Operator for in place addition. | |
element & | operator= (const value_t &x) |
Assignment operator. |
Element of sparse matrix.
Proxy for sparse matrix entries. This is required for non-const access to matrix elements in order to provide a very similar syntax for the sparse data structure and the corresponding non-sparse matrix.
LocARNA::SparseMatrix< T >::element::element | ( | SparseMatrix< T > * | m, |
const key_t & | k | ||
) | [inline] |
Construct as proxy for specified element in given sparse matrix.
m | pointer to sparse matrix |
k | key/index of entry in given sparse matrix |
LocARNA::SparseMatrix< T >::element::operator value_t | ( | ) | [inline] |
Access entry for which the class acts as proxy.
If entry does not exist, return the default value
element LocARNA::SparseMatrix< T >::element::operator+= | ( | const value_t & | x | ) | [inline] |
Operator for in place addition.
x | value |
element& LocARNA::SparseMatrix< T >::element::operator= | ( | const value_t & | x | ) | [inline] |
Assignment operator.
x | value |