LocARNA-1.9.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions
LocARNA::SparseMatrix< T >::element Class Reference

Element of sparse matrix. More...

#include <sparse_matrix.hh>

List of all members.

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.
elementoperator= (const value_t &x)
 Assignment operator.

Detailed Description

template<typename T>
class LocARNA::SparseMatrix< T >::element

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.


Constructor & Destructor Documentation

template<typename T>
LocARNA::SparseMatrix< T >::element::element ( SparseMatrix< T > *  m,
const key_t k 
) [inline]

Construct as proxy for specified element in given sparse matrix.

Parameters:
mpointer to sparse matrix
kkey/index of entry in given sparse matrix

Member Function Documentation

template<typename T>
LocARNA::SparseMatrix< T >::element::operator value_t ( ) [inline]

Access entry for which the class acts as proxy.

Returns:
value of matrix entry.

If entry does not exist, return the default value

template<typename T>
element LocARNA::SparseMatrix< T >::element::operator+= ( const value_t x) [inline]

Operator for in place addition.

Parameters:
xvalue
Postcondition:
x is added to matrix entry for that the class is proxy
Returns:
*this after adding x
Note:
If entry does not exist, x is added to the default value
template<typename T>
element& LocARNA::SparseMatrix< T >::element::operator= ( const value_t x) [inline]

Assignment operator.

Parameters:
xvalue
Postcondition:
x is assigned to matrix entry for that the class is proxy
Returns:
*this after assigning x
Note:
If x equals the default value and the entry exists, it is erased

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends