A writable bool map for logging each true
assigned element, i.e it copies subsequently each keys set to true
to the given iterator. The most important usage of it is storing certain nodes or arcs that were marked true
by an algorithm.
There are several algorithms that provide solutions through bool maps and most of them assign true
at most once for each key. In these cases it is a natural request to store each true
assigned elements (in order of the assignment), which can be easily done with LoggerBoolMap.
The simplest way of using this map is through the loggerBoolMap() function.
IT | The type of the iterator. |
KEY | The key type of the map. The default value set according to the iterator type should work in most cases. |
#include <lemon/maps.h>
Public Types | |
typedef KEY | Key |
| |
typedef bool | Value |
| |
typedef IT | Iterator |
| |
Public Types inherited from MapBase< KEY, bool > | |
typedef KEY | Key |
The key type of the map. | |
typedef bool | Value |
The value type of the map. (The type of objects associated with the keys). | |
Public Member Functions | |
LoggerBoolMap (Iterator it) | |
Constructor. | |
Iterator | begin () const |
Gives back the given iterator set for the first key. | |
Iterator | end () const |
Gives back the the 'after the last' iterator. | |
void | set (const Key &key, Value value) |
The set function of the map. | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename Iterator > | |
LoggerBoolMap< Iterator > | loggerBoolMap (Iterator it) |
Returns a LoggerBoolMap class. | |