IterableValueMap
Declared in lemon/maps.h, in the group Graph Maps; the same class on the Doxygen site.
-
template< typename GR , typename K , typename V >
class IterableValueMap : protected Type< GR , K > Dynamic iterable map for comparable values.
This class provides a special graph map type which can store a comparable value for graph items (
Node,ArcorEdge). For each value it is possible to iterate on the keys mapped to the value (ItemIt), and the values of the map can be accessed with an STL compatible forward iterator (ValueIt). The map stores a linked list for each value, which contains the items mapped to the value, and the used values are stored in balanced binary tree (std::map).IterableBoolMap and IterableIntMap are similar classes specialized for
boolandintvalues, respectively.This type is not reference map, so it cannot 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).V – The value type of the map. It can be any comparable value type.
Public Types
Public Functions
-
inline explicit IterableValueMap( const Graph & graph , const Value & value = Value() )
Constructor of the map with a given value.
-
inline ValueIt beginValue() const
Returns an iterator to the first value.
Returns an STL compatible iterator to the first value of the map. The values of the map can be accessed in the
[beginValue, endValue)range.
-
inline ValueIt endValue() const
Returns an iterator after the last value.
Returns an STL compatible iterator after the last value of the map. The values of the map can be accessed in the
[beginValue, endValue)range.
-
class ValueIt
Forward iterator for values.
This iterator is an STL compatible forward iterator on the values of the map. The values can be accessed in the
[beginValue, endValue)range.
-
class ItemIt : public Key
Iterator for the keys with the same value. It works like a graph item iterator, it can be converted to the item type of the map, incremented with
++operator, and if the iterator leaves the last valid item, it will be equal toINVALID.Public Functions
-
inline ItemIt(Invalid)
Invalid constructor & conversion.
This constructor initializes the iterator to be invalid.
See also
Invalid for more details.
-
inline ItemIt( const IterableValueMap & map , const Value & value )
Creates an iterator with a value. It iterates on the keys which have the given value.
- Parameters:
map – The IterableValueMap
value – The value
-
inline ItemIt(Invalid)