ug4
|
#include <unsorted_sparse_vector.h>
Public Types | |
typedef AlgebraicConnection< TValue > | connection |
typedef std::vector< connection >::const_iterator | const_iterator |
typedef std::vector< connection >::iterator | iterator |
typedef TValue | value_type |
Public Member Functions | |
iterator | begin () |
const_iterator | begin () const |
void | clear () |
iterator | end () |
const_iterator | end () const |
bool | has_connection (size_t c) const |
size_t | num_connections () const |
value_type & | operator() (size_t c) |
const value_type & | operator() (size_t c) const |
size_t | size () const |
connection * | unsorted_raw_ptr () |
UnsortedSparseVector (size_t s) | |
Private Attributes | |
std::vector< connection > | con |
size_t | m_size |
std::vector< int > | posInConnections |
This is in most cases faster than the std::map-based SparseVector in sparse_vector.h because it uses and "posInConnection" array which reduces all operations to O(1), instead of O(log n) for std::map when number of non-zeroes in the vector. The additional array is as long as the (non-sparse) size of the vector, so this makes only sense if you REUSE the UnsortedSparseVector, like
typedef AlgebraicConnection<TValue> ug::UnsortedSparseVector< TValue >::connection |
typedef std::vector<connection>::const_iterator ug::UnsortedSparseVector< TValue >::const_iterator |
typedef std::vector<connection>::iterator ug::UnsortedSparseVector< TValue >::iterator |
typedef TValue ug::UnsortedSparseVector< TValue >::value_type |
|
inline |
References ug::UnsortedSparseVector< TValue >::con, and s.
|
inline |
References ug::UnsortedSparseVector< TValue >::con.
|
inline |
References ug::UnsortedSparseVector< TValue >::con.
|
inline |
|
inline |
References ug::UnsortedSparseVector< TValue >::con.
|
inline |
References ug::UnsortedSparseVector< TValue >::con.
|
inline |
|
inline |
References ug::UnsortedSparseVector< TValue >::con.
|
inline |
|
inline |
|
inline |
References ug::UnsortedSparseVector< TValue >::m_size.
|
inline |
References ug::UnsortedSparseVector< TValue >::con.
|
private |
Referenced by ug::UnsortedSparseVector< TValue >::begin(), ug::UnsortedSparseVector< TValue >::clear(), ug::UnsortedSparseVector< TValue >::end(), ug::UnsortedSparseVector< TValue >::num_connections(), ug::UnsortedSparseVector< TValue >::operator()(), ug::UnsortedSparseVector< TValue >::unsorted_raw_ptr(), and ug::UnsortedSparseVector< TValue >::UnsortedSparseVector().
|
private |
|
private |