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>
Inherits Type< GR, K >.
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. More... | |
IterableIntMap (const Graph &graph, int value) | |
Constructor of the map with a given value. More... | |
int | size () const |
Gives back the maximal value plus one. More... | |
void | set (const Key &key, const Value &value) |
Set operation of the map. More... | |
const Value & | operator[] (const Key &key) const |
Const subscript operator of the map. More... | |
Reference | operator[] (const Key &key) |
Subscript operator of the map. More... | |
|
inlineexplicit |
Constructor of the map. It sets all values to -1.
|
inlineexplicit |
Constructor of the map with a given value.
|
inline |
Gives back the maximal value plus one.