Generated on: Thu Mar 29 07:46:58 PDT 2012 for custom file set | ||
|
||
#include <vector_map.h>
Public Types | |
typedef T | value_type |
Standard STL container boilerplate. | |
typedef const T * | pointer |
typedef const T & | reference |
typedef const T & | const_reference |
typedef size_t | size_type |
typedef ptrdiff_t | difference_type |
typedef const T * | const_iterator |
typedef std::reverse_iterator < const_iterator > | const_reverse_iterator |
Public Member Functions | |
int | Add (const T &element) |
Adds an element if not already present, and returns its index in the vector-map. | |
void | Add (const std::vector< T > &elements) |
int | Index (const T &element) const |
Returns -1 if the element is not in the vector, or its unique index if it is. | |
bool | Contains (const T &element) const |
const T & | Element (int index) const |
Returns the element at position index. | |
int | size () const |
Returns the number of distinct elements added to the vector-map. | |
void | clear () |
Clears all the elements added to the vector-map. | |
const std::vector< T > & | list () const |
Returns a read-only access to the vector of elements. | |
const_iterator | begin () const |
const_iterator | end () const |
const_reverse_iterator | rbegin () const |
const_reverse_iterator | rend () const |
Static Public Attributes | |
static const size_type | npos |
This is useful to store mapping between objects and indices.
Definition at line 28 of file vector_map.h.
typedef T operations_research::VectorMap< T >::value_type |
typedef const T* operations_research::VectorMap< T >::pointer |
Definition at line 85 of file vector_map.h.
typedef const T& operations_research::VectorMap< T >::reference |
Definition at line 86 of file vector_map.h.
typedef const T& operations_research::VectorMap< T >::const_reference |
Definition at line 87 of file vector_map.h.
typedef size_t operations_research::VectorMap< T >::size_type |
Definition at line 88 of file vector_map.h.
typedef ptrdiff_t operations_research::VectorMap< T >::difference_type |
Definition at line 89 of file vector_map.h.
typedef const T* operations_research::VectorMap< T >::const_iterator |
Definition at line 91 of file vector_map.h.
typedef std::reverse_iterator<const_iterator> operations_research::VectorMap< T >::const_reverse_iterator |
Definition at line 92 of file vector_map.h.
int operations_research::VectorMap< T >::Add | ( | const T & | element | ) | [inline] |
Adds an element if not already present, and returns its index in the vector-map.
Definition at line 32 of file vector_map.h.
void operations_research::VectorMap< T >::Add | ( | const std::vector< T > & | elements | ) | [inline] |
Adds all elements of the vector.
Definition at line 46 of file vector_map.h.
int operations_research::VectorMap< T >::Index | ( | const T & | element | ) | const [inline] |
Returns -1 if the element is not in the vector, or its unique index if it is.
Definition at line 54 of file vector_map.h.
bool operations_research::VectorMap< T >::Contains | ( | const T & | element | ) | const [inline] |
Returns wether the element has already been added to the vector-map.
Definition at line 60 of file vector_map.h.
const T& operations_research::VectorMap< T >::Element | ( | int | index | ) | const [inline] |
int operations_research::VectorMap< T >::size | ( | ) | const [inline] |
Returns the number of distinct elements added to the vector-map.
Definition at line 72 of file vector_map.h.
void operations_research::VectorMap< T >::clear | ( | ) | [inline] |
const std::vector<T>& operations_research::VectorMap< T >::list | ( | ) | const [inline] |
const_iterator operations_research::VectorMap< T >::begin | ( | ) | const [inline] |
Definition at line 93 of file vector_map.h.
const_iterator operations_research::VectorMap< T >::end | ( | ) | const [inline] |
Definition at line 94 of file vector_map.h.
const_reverse_iterator operations_research::VectorMap< T >::rbegin | ( | ) | const [inline] |
Definition at line 95 of file vector_map.h.
const_reverse_iterator operations_research::VectorMap< T >::rend | ( | ) | const [inline] |
Definition at line 98 of file vector_map.h.
const size_type operations_research::VectorMap< T >::npos [static] |
Definition at line 90 of file vector_map.h.