Element of sparse vector. More...
#include <sparse_vector.hh>
Public Member Functions | |
element (SparseVector< T > *m, key_t k) | |
Construct as proxy for specified element in given sparse vector. | |
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 vector.
Proxy for sparse vector entries. This is required for non-const access to vector elements in order to provide a very similar syntax for the sparse data structure and the corresponding non-sparse vector.
LocARNA::SparseVector< T >::element::element | ( | SparseVector< T > * | m, |
key_t | k | ||
) | [inline] |
Construct as proxy for specified element in given sparse vector.
m | pointer to sparse vector |
k | key/index of entry in given sparse vector |
LocARNA::SparseVector< 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::SparseVector< T >::element::operator+= | ( | const value_t & | x | ) | [inline] |
Operator for in place addition.
x | value |
element& LocARNA::SparseVector< T >::element::operator= | ( | const value_t & | x | ) | [inline] |
Assignment operator.
x | value |