This class provides a special graph map type which can store an integer value for graph items (Node
, Arc
or Edge
). For each non-negative value it is possible to iterate on the keys mapped to the value.
This map is intended to be used with small integer values, for which it is efficient, and supports iteration only for non-negative values. If you need large values and/or iteration for negative integers, consider to use IterableValueMap instead.
This type is a reference map, so it can be modified with the subscript operator.
GR | The graph type. |
K | The key type of the map (GR::Node , GR::Arc or GR::Edge ). |
#include <lemon/maps.h>
Classes | |
class | ItemIt |
Iterator for the keys with the same value. More... | |
class | Reference |
Reference to the value of the map. More... | |
Public Types | |
typedef K | Key |
The key type. | |
typedef int | Value |
The value type. | |
typedef GR | Graph |
The graph type. | |
typedef True | ReferenceMapTag |
Indicates that the map is reference map. | |
typedef const Value & | ConstReference |
The const reference type. | |
Public Member Functions | |
IterableIntMap (const Graph &graph) | |
Constructor of the map. | |
IterableIntMap (const Graph &graph, int value) | |
int | size () const |
void | set (const Key &key, const Value &value) |
const Value & | operator[] (const Key &key) const |
Reference | operator[] (const Key &key) |
IterableIntMap | ( | const Graph & | graph | ) | [inline, explicit] |
Constructor of the map. It sets all values to -1.
IterableIntMap | ( | const Graph & | graph, |
int | value | ||
) | [inline, explicit] |
Constructor of the map with a given value.
int size | ( | ) | const [inline] |
Gives back the maximal value plus one.