IterableBoolMap
Declared in lemon/maps.h, in the group Graph Maps; the same class on the Doxygen site.
-
template< typename GR , typename K >
class IterableBoolMap : protected Type< GR , K > Dynamic iterable
boolmap.This class provides a special graph map type which can store a
boolvalue for graph items (Node,ArcorEdge). For bothtrueandfalsevalues 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.
See also
See also
- Template Parameters:
GR – The graph type.
K – The key type of the map (
GR::Node,GR::ArcorGR::Edge).
Public Types
-
typedef True ReferenceMapTag
Indicates that the map is reference map.
-
typedef bool Value
The value type.
Public Functions
-
inline explicit IterableBoolMap( const Graph & graph , bool def = false )
Constructor of the map with a default value.
-
inline void setAll( bool value )
Set all items.
Set all items in the map.
Note
Constant time operation.
-
inline int trueNum() const
Returns the number of the keys mapped to
true.
-
inline int falseNum() const
Returns the number of the keys mapped to
false.
-
inline LemonRangeWrapper1< TrueIt , IterableBoolMap > trueKeys()
STL style iterator for the keys mapped to
true.This is an STL style wrapper for TrueIt. It can be used in range-based for loops, STL algorithms, etc.
-
inline LemonRangeWrapper1< FalseIt , IterableBoolMap > falseKeys()
STL style iterator for the keys mapped to
false.This is an STL style wrapper for FalseIt. It can be used in range-based for loops, STL algorithms, etc.
-
inline LemonRangeWrapper2< ItemIt , IterableBoolMap , bool > items( bool value )
STL style iterator for the keys mapped to a given value.
This is an STL style wrapper for ItemIt. It can be used in range-based for loops, STL algorithms, etc.
-
class Reference
Reference to the value of the map.
This class is similar to the
booltype. It can be converted tobooland it provides the same operators.Public Functions
-
inline operator bool() const
-
inline operator bool() const
-
class TrueIt : public Key
Iterator for the keys mapped to
true. It works like a graph item iterator, it can be converted to the key type of the map, incremented with++operator, and if the iterator leaves the last valid key, it will be equal toINVALID.Public Functions
-
inline explicit TrueIt( const IterableBoolMap & map )
Creates an iterator. It iterates on the keys mapped to
true.- Parameters:
map – The IterableBoolMap.
-
inline explicit TrueIt( const IterableBoolMap & map )
-
class FalseIt : public Key
Iterator for the keys mapped to
false. It works like a graph item iterator, it can be converted to the key type of the map, incremented with++operator, and if the iterator leaves the last valid key, it will be equal toINVALID.Public Functions
-
inline explicit FalseIt( const IterableBoolMap & map )
Creates an iterator. It iterates on the keys mapped to
false.- Parameters:
map – The IterableBoolMap.
-
inline explicit FalseIt( const IterableBoolMap & map )
-
class ItemIt : public Key
Iterator for the keys mapped to a given value. It works like a graph item iterator, it can be converted to the key type of the map, incremented with
++operator, and if the iterator leaves the last valid key, it will be equal toINVALID.Public Functions
-
inline ItemIt( const IterableBoolMap & map , bool value )
Creates an iterator with a value. It iterates on the keys mapped to the given value.
- Parameters:
map – The IterableBoolMap.
value – The value.
-
inline ItemIt( const IterableBoolMap & map , bool value )