This class provides a special graph map type which can store a bool
value for graph items (Node
, Arc
or Edge
). For both true
and false
values it is possible to iterate on the keys mapped to the value.
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 | FalseIt |
Iterator for the keys mapped to false . More... | |
class | ItemIt |
Iterator for the keys mapped to a given value. More... | |
class | Reference |
Reference to the value of the map. More... | |
class | TrueIt |
Iterator for the keys mapped to true . More... | |
Public Types | |
typedef True | ReferenceMapTag |
Indicates that the map is reference map. | |
typedef K | Key |
The key type. | |
typedef bool | Value |
The value type. | |
typedef const Value & | ConstReference |
The const reference type. | |
Public Member Functions | |
IterableBoolMap (const Graph &graph, bool def=false) | |
bool | operator[] (const Key &key) const |
Reference | operator[] (const Key &key) |
void | set (const Key &key, bool value) |
void | setAll (bool value) |
Set all items. | |
int | trueNum () const |
int | falseNum () const |
|
inlineexplicit |
Constructor of the map with a default value.
|
inline |
Const subscript operator of the map.
|
inline |
Set operation of the map.
|
inline |
Set all items in the map.
|
inline |
Returns the number of the keys mapped to true
.
|
inline |
Returns the number of the keys mapped to false
.