|
BitMagic-C++
|
Const iterator to traverse the sparse vector. More...
#include <bmsparsevec.h>
Public Types | |
| typedef std::input_iterator_tag | iterator_category |
| typedef sparse_vector< Val, BV > | sparse_vector_type |
| typedef sparse_vector_type * | sparse_vector_type_ptr |
| typedef sparse_vector_type::value_type | value_type |
| typedef sparse_vector_type::size_type | size_type |
| typedef sparse_vector_type::bvector_type | bvector_type |
| typedef bvector_type::allocator_type | allocator_type |
| typedef bvector_type::allocator_type::allocator_pool_type | allocator_pool_type |
| typedef bm::byte_buffer< allocator_type > | buffer_type |
| typedef unsigned | difference_type |
| typedef unsigned * | pointer |
| typedef value_type & | reference |
Public Member Functions | |
| const_iterator () BMNOEXCEPT | |
| const_iterator (const sparse_vector_type *sv) BMNOEXCEPT | |
| const_iterator (const sparse_vector_type *sv, size_type pos) BMNOEXCEPT | |
| const_iterator (const const_iterator &it) BMNOEXCEPT | |
| bool | operator== (const const_iterator &it) const BMNOEXCEPT |
| bool | operator!= (const const_iterator &it) const BMNOEXCEPT |
| bool | operator< (const const_iterator &it) const BMNOEXCEPT |
| bool | operator<= (const const_iterator &it) const BMNOEXCEPT |
| bool | operator> (const const_iterator &it) const BMNOEXCEPT |
| bool | operator>= (const const_iterator &it) const BMNOEXCEPT |
| value_type | operator* () const |
| Get current position (value). | |
| const_iterator & | operator++ () BMNOEXCEPT |
| Advance to the next available value. | |
| const_iterator | operator++ (int) |
| Advance to the next available value. | |
| value_type | value () const |
| Get current position (value). | |
| bool | is_null () const BMNOEXCEPT |
| Get NULL status. | |
| bool | valid () const BMNOEXCEPT |
| Returns true if iterator is at a valid position. | |
| void | invalidate () BMNOEXCEPT |
| Invalidate current iterator. | |
| size_type | pos () const BMNOEXCEPT |
| Current position (index) in the vector. | |
| void | go_to (size_type pos) BMNOEXCEPT |
| re-position to a specified position | |
| bool | advance () BMNOEXCEPT |
| advance iterator forward by one | |
| void | skip_zero_values () BMNOEXCEPT |
Friends | |
| class | sparse_vector |
Const iterator to traverse the sparse vector.
Implementation uses buffer for decoding so, competing changes to the original vector may not match the iterator returned values.
This iterator keeps an operational buffer for 8K elements, so memory footprint is not negligable (about 64K for unsigned int)
Definition at line 157 of file bmsparsevec.h.
| typedef bvector_type::allocator_type::allocator_pool_type bm::sparse_vector< Val, BV >::const_iterator::allocator_pool_type |
Definition at line 171 of file bmsparsevec.h.
| typedef bvector_type::allocator_type bm::sparse_vector< Val, BV >::const_iterator::allocator_type |
Definition at line 170 of file bmsparsevec.h.
| typedef bm::byte_buffer<allocator_type> bm::sparse_vector< Val, BV >::const_iterator::buffer_type |
Definition at line 172 of file bmsparsevec.h.
| typedef sparse_vector_type::bvector_type bm::sparse_vector< Val, BV >::const_iterator::bvector_type |
Definition at line 169 of file bmsparsevec.h.
| typedef unsigned bm::sparse_vector< Val, BV >::const_iterator::difference_type |
Definition at line 174 of file bmsparsevec.h.
| typedef std::input_iterator_tag bm::sparse_vector< Val, BV >::const_iterator::iterator_category |
Definition at line 163 of file bmsparsevec.h.
| typedef unsigned* bm::sparse_vector< Val, BV >::const_iterator::pointer |
Definition at line 175 of file bmsparsevec.h.
| typedef value_type& bm::sparse_vector< Val, BV >::const_iterator::reference |
Definition at line 176 of file bmsparsevec.h.
| typedef sparse_vector_type::size_type bm::sparse_vector< Val, BV >::const_iterator::size_type |
Definition at line 168 of file bmsparsevec.h.
| typedef sparse_vector<Val, BV> bm::sparse_vector< Val, BV >::const_iterator::sparse_vector_type |
Definition at line 165 of file bmsparsevec.h.
| typedef sparse_vector_type* bm::sparse_vector< Val, BV >::const_iterator::sparse_vector_type_ptr |
Definition at line 166 of file bmsparsevec.h.
| typedef sparse_vector_type::value_type bm::sparse_vector< Val, BV >::const_iterator::value_type |
Definition at line 167 of file bmsparsevec.h.
| bm::sparse_vector< Val, BV >::const_iterator::const_iterator | ( | ) |
Definition at line 2332 of file bmsparsevec.h.
References BMNOEXCEPT, and bm::id_max.
Referenced by const_iterator(), const_iterator(), const_iterator(), bm::sparse_vector< unsigned, bm::bvector<> >::end(), bm::sparse_vector< unsigned, bm::bvector<> >::get_const_iterator(), operator!=(), operator++(), operator++(), operator<(), operator<=(), operator==(), operator>(), and operator>=().
| bm::sparse_vector< Val, BV >::const_iterator::const_iterator | ( | const sparse_vector_type * | sv | ) |
References BMNOEXCEPT, and const_iterator().
| bm::sparse_vector< Val, BV >::const_iterator::const_iterator | ( | const sparse_vector_type * | sv, |
| size_type | pos ) |
References BMNOEXCEPT, const_iterator(), and pos().
| bm::sparse_vector< Val, BV >::const_iterator::const_iterator | ( | const const_iterator & | it | ) |
References BMNOEXCEPT, and const_iterator().
| bool bm::sparse_vector< Val, BV >::const_iterator::advance | ( | ) |
advance iterator forward by one
Definition at line 2380 of file bmsparsevec.h.
References BMNOEXCEPT, bm::id_max, invalidate(), and bm::sparse_vector< Val, BV >::n_buf_size.
Referenced by operator++(), and operator++().
| void bm::sparse_vector< Val, BV >::const_iterator::go_to | ( | size_type | pos | ) |
re-position to a specified position
Definition at line 2371 of file bmsparsevec.h.
References BMNOEXCEPT, bm::id_max, and pos().
|
inline |
Invalidate current iterator.
Definition at line 221 of file bmsparsevec.h.
References BMNOEXCEPT, and bm::id_max.
Referenced by advance().
| bool bm::sparse_vector< Val, BV >::const_iterator::is_null | ( | ) | const |
|
inline |
Definition at line 187 of file bmsparsevec.h.
References BMNOEXCEPT, const_iterator(), and operator==().
|
inline |
|
inline |
Advance to the next available value.
Definition at line 203 of file bmsparsevec.h.
References advance(), BMNOEXCEPT, and const_iterator().
|
inline |
Advance to the next available value.
Definition at line 207 of file bmsparsevec.h.
References advance(), and const_iterator().
|
inline |
Definition at line 189 of file bmsparsevec.h.
References BMNOEXCEPT, and const_iterator().
|
inline |
Definition at line 191 of file bmsparsevec.h.
References BMNOEXCEPT, and const_iterator().
|
inline |
Definition at line 185 of file bmsparsevec.h.
References BMNOEXCEPT, and const_iterator().
Referenced by operator!=().
|
inline |
Definition at line 193 of file bmsparsevec.h.
References BMNOEXCEPT, and const_iterator().
|
inline |
Definition at line 195 of file bmsparsevec.h.
References BMNOEXCEPT, and const_iterator().
|
inline |
Current position (index) in the vector.
Definition at line 224 of file bmsparsevec.h.
References BMNOEXCEPT.
Referenced by const_iterator(), and go_to().
| void bm::sparse_vector< Val, BV >::const_iterator::skip_zero_values | ( | ) |
Definition at line 2421 of file bmsparsevec.h.
References BMNOEXCEPT, bm::id_max, bm::sparse_vector< Val, BV >::n_buf_size, and value().
|
inline |
Returns true if iterator is at a valid position.
Definition at line 218 of file bmsparsevec.h.
References BMNOEXCEPT, bm::id_max, and valid().
| sparse_vector< Val, BV >::const_iterator::value_type bm::sparse_vector< Val, BV >::const_iterator::value | ( | ) | const |
Get current position (value).
Definition at line 2403 of file bmsparsevec.h.
References BM_ASSERT, bm::sparse_vector< Val, BV >::n_buf_size, and valid().
Referenced by operator*(), and skip_zero_values().
|
friend |
Definition at line 160 of file bmsparsevec.h.
References sparse_vector.
Referenced by sparse_vector.