All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Classes | Functions
Graph Maps
Maps

Detailed Description

This group contains maps that are specifically designed to assign values to the nodes and arcs/edges of graphs.

If you are looking for the standard graph maps (NodeMap, ArcMap, EdgeMap), see the Graph Structure Concepts.

Classes

class  IdMap< GR, K >
 Provides an immutable and unique id for each item in a graph. More...
 
class  CrossRefMap< GR, K, V >
 General cross reference graph map type. More...
 
class  RangeIdMap< GR, K >
 Provides continuous and unique id for the items of a graph. More...
 
class  IterableBoolMap< GR, K >
 Dynamic iterable bool map. More...
 
class  IterableIntMap< GR, K >
 Dynamic iterable integer map. More...
 
class  IterableValueMap< GR, K, V >
 Dynamic iterable map for comparable values. More...
 
class  SourceMap< GR >
 Map of the source nodes of arcs in a digraph. More...
 
class  TargetMap< GR >
 Map of the target nodes of arcs in a digraph. More...
 
class  ForwardMap< GR >
 Map of the "forward" directed arc view of edges in a graph. More...
 
class  BackwardMap< GR >
 Map of the "backward" directed arc view of edges in a graph. More...
 
class  InDegMap< GR >
 Map of the in-degrees of nodes in a digraph. More...
 
class  OutDegMap< GR >
 Map of the out-degrees of nodes in a digraph. More...
 
class  PotentialDifferenceMap< GR, POT >
 Potential difference map. More...
 
class  IdMap< GR, K >::InverseMap
 The inverse map type of IdMap. More...
 
class  CrossRefMap< GR, K, V >::InverseMap
 The inverse map type of CrossRefMap. More...
 
class  CrossRefMap< GR, K, V >::ValueIt
 Forward iterator for values. More...
 
class  RangeIdMap< GR, K >::InverseMap
 The inverse map type of RangeIdMap. More...
 
class  IterableBoolMap< GR, K >::FalseIt
 Iterator for the keys mapped to false. More...
 
class  IterableBoolMap< GR, K >::ItemIt
 Iterator for the keys mapped to a given value. More...
 
class  IterableBoolMap< GR, K >::Reference
 Reference to the value of the map. More...
 
class  IterableBoolMap< GR, K >::TrueIt
 Iterator for the keys mapped to true. More...
 
class  IterableIntMap< GR, K >::ItemIt
 Iterator for the keys with the same value. More...
 
class  IterableIntMap< GR, K >::Reference
 Reference to the value of the map. More...
 
class  IterableValueMap< GR, K, V >::ItemIt
 Iterator for the keys with the same value. More...
 
class  IterableValueMap< GR, K, V >::ValueIt
 Forward iterator for values. More...
 

Functions

template<typename GR , typename From , typename To >
void mapCopy (const GR &gr, const From &from, To &to)
 Copy the values of a graph map to another map.
 
template<typename GR , typename Map1 , typename Map2 >
bool mapCompare (const GR &gr, const Map1 &map1, const Map2 &map2)
 Compare two graph maps.
 
template<typename GR , typename Map >
Map::Key mapMin (const GR &gr, const Map &map)
 Return an item having minimum value of a graph map.
 
template<typename GR , typename Map , typename Comp >
Map::Key mapMin (const GR &gr, const Map &map, const Comp &comp)
 Return an item having minimum value of a graph map.
 
template<typename GR , typename Map >
Map::Key mapMax (const GR &gr, const Map &map)
 Return an item having maximum value of a graph map.
 
template<typename GR , typename Map , typename Comp >
Map::Key mapMax (const GR &gr, const Map &map, const Comp &comp)
 Return an item having maximum value of a graph map.
 
template<typename GR , typename Map >
Map::Value mapMinValue (const GR &gr, const Map &map)
 Return the minimum value of a graph map.
 
template<typename GR , typename Map , typename Comp >
Map::Value mapMinValue (const GR &gr, const Map &map, const Comp &comp)
 Return the minimum value of a graph map.
 
template<typename GR , typename Map >
Map::Value mapMaxValue (const GR &gr, const Map &map)
 Return the maximum value of a graph map.
 
template<typename GR , typename Map , typename Comp >
Map::Value mapMaxValue (const GR &gr, const Map &map, const Comp &comp)
 Return the maximum value of a graph map.
 
template<typename GR , typename Map >
Map::Key mapFind (const GR &gr, const Map &map, const typename Map::Value &val)
 Return an item having a specified value in a graph map.
 
template<typename GR , typename Map , typename Pred >
Map::Key mapFindIf (const GR &gr, const Map &map, const Pred &pred)
 Return an item having value for which a certain predicate is true in a graph map.
 
template<typename GR , typename Map >
int mapCount (const GR &gr, const Map &map, const typename Map::Value &val)
 Return the number of items having a specified value in a graph map.
 
template<typename GR , typename Map , typename Pred >
int mapCountIf (const GR &gr, const Map &map, const Pred &pred)
 Return the number of items having values for which a certain predicate is true in a graph map.
 
template<typename GR , typename Map >
void mapFill (const GR &gr, Map &map, const typename Map::Value &val)
 Fill a graph map with a certain value.
 
template<typename K , typename GR >
IdMap< GR, K > idMap (const GR &graph)
 Returns an IdMap class.
 
template<typename K , typename GR >
RangeIdMap< GR, K > rangeIdMap (const GR &graph)
 Returns a RangeIdMap class.
 
template<typename GR >
SourceMap< GR > sourceMap (const GR &graph)
 Returns a SourceMap class.
 
template<typename GR >
TargetMap< GR > targetMap (const GR &graph)
 Returns a TargetMap class.
 
template<typename GR >
ForwardMap< GR > forwardMap (const GR &graph)
 Returns a ForwardMap class.
 
template<typename GR >
BackwardMap< GR > backwardMap (const GR &graph)
 Returns a BackwardMap class.
 
template<typename GR , typename POT >
PotentialDifferenceMap< GR, POT > potentialDifferenceMap (const GR &gr, const POT &potential)
 Returns a PotentialDifferenceMap.
 

Function Documentation

void lemon::mapCopy ( const GR &  gr,
const From &  from,
To &  to 
)

This function copies the values of a graph map to another graph map. To::Key must be equal or convertible to From::Key and From::Value must be equal or convertible to To::Value.

For example, an edge map of int value type can be copied to an arc map of double value type in an undirected graph, but an arc map cannot be copied to an edge map. Note that even a ConstMap can be copied to a standard graph map, but mapFill() can also be used for this purpose.

Parameters
grThe graph for which the maps are defined.
fromThe map from which the values have to be copied. It must conform to the ReadMap concept.
toThe map to which the values have to be copied. It must conform to the WriteMap concept.
bool lemon::mapCompare ( const GR &  gr,
const Map1 &  map1,
const Map2 &  map2 
)

This function compares the values of two graph maps. It returns true if the maps assign the same value for all items in the graph. The Key type of the maps (Node, Arc or Edge) must be equal and their Value types must be comparable using operator==().

Parameters
grThe graph for which the maps are defined.
map1The first map.
map2The second map.
Map::Key lemon::mapMin ( const GR &  gr,
const Map &  map 
)

This function returns an item (Node, Arc or Edge) having minimum value of the given graph map. If the item set is empty, it returns INVALID.

Parameters
grThe graph for which the map is defined.
mapThe graph map.
Map::Key lemon::mapMin ( const GR &  gr,
const Map &  map,
const Comp &  comp 
)

This function returns an item (Node, Arc or Edge) having minimum value of the given graph map. If the item set is empty, it returns INVALID.

Parameters
grThe graph for which the map is defined.
mapThe graph map.
compComparison function object.
Map::Key lemon::mapMax ( const GR &  gr,
const Map &  map 
)

This function returns an item (Node, Arc or Edge) having maximum value of the given graph map. If the item set is empty, it returns INVALID.

Parameters
grThe graph for which the map is defined.
mapThe graph map.
Map::Key lemon::mapMax ( const GR &  gr,
const Map &  map,
const Comp &  comp 
)

This function returns an item (Node, Arc or Edge) having maximum value of the given graph map. If the item set is empty, it returns INVALID.

Parameters
grThe graph for which the map is defined.
mapThe graph map.
compComparison function object.
Map::Value lemon::mapMinValue ( const GR &  gr,
const Map &  map 
)

This function returns the minimum value of the given graph map. The corresponding item set of the graph must not be empty.

Parameters
grThe graph for which the map is defined.
mapThe graph map.
Map::Value lemon::mapMinValue ( const GR &  gr,
const Map &  map,
const Comp &  comp 
)

This function returns the minimum value of the given graph map. The corresponding item set of the graph must not be empty.

Parameters
grThe graph for which the map is defined.
mapThe graph map.
compComparison function object.
Map::Value lemon::mapMaxValue ( const GR &  gr,
const Map &  map 
)

This function returns the maximum value of the given graph map. The corresponding item set of the graph must not be empty.

Parameters
grThe graph for which the map is defined.
mapThe graph map.
Map::Value lemon::mapMaxValue ( const GR &  gr,
const Map &  map,
const Comp &  comp 
)

This function returns the maximum value of the given graph map. The corresponding item set of the graph must not be empty.

Parameters
grThe graph for which the map is defined.
mapThe graph map.
compComparison function object.
Map::Key lemon::mapFind ( const GR &  gr,
const Map &  map,
const typename Map::Value &  val 
)

This function returns an item (Node, Arc or Edge) having the specified assigned value in the given graph map. If no such item exists, it returns INVALID.

Parameters
grThe graph for which the map is defined.
mapThe graph map.
valThe value that have to be found.
Map::Key lemon::mapFindIf ( const GR &  gr,
const Map &  map,
const Pred &  pred 
)

This function returns an item (Node, Arc or Edge) having such assigned value for which the specified predicate is true in the given graph map. If no such item exists, it returns INVALID.

Parameters
grThe graph for which the map is defined.
mapThe graph map.
predThe predicate function object.
int lemon::mapCount ( const GR &  gr,
const Map &  map,
const typename Map::Value &  val 
)

This function returns the number of items (Node, Arc or Edge) having the specified assigned value in the given graph map.

Parameters
grThe graph for which the map is defined.
mapThe graph map.
valThe value that have to be counted.
int lemon::mapCountIf ( const GR &  gr,
const Map &  map,
const Pred &  pred 
)

This function returns the number of items (Node, Arc or Edge) having such assigned values for which the specified predicate is true in the given graph map.

Parameters
grThe graph for which the map is defined.
mapThe graph map.
predThe predicate function object.
void lemon::mapFill ( const GR &  gr,
Map &  map,
const typename Map::Value &  val 
)

This function sets the specified value for all items (Node, Arc or Edge) in the given graph map.

Parameters
grThe graph for which the map is defined.
mapThe graph map. It must conform to the WriteMap concept.
valThe value.
IdMap< GR, K > idMap ( const GR &  graph)
related

This function just returns an IdMap class.

RangeIdMap< GR, K > rangeIdMap ( const GR &  graph)
related

This function just returns an RangeIdMap class.

SourceMap< GR > sourceMap ( const GR &  graph)
related

This function just returns an SourceMap class.

TargetMap< GR > targetMap ( const GR &  graph)
related

This function just returns a TargetMap class.

ForwardMap< GR > forwardMap ( const GR &  graph)
related

This function just returns an ForwardMap class.

BackwardMap< GR > backwardMap ( const GR &  graph)
related

This function just returns a BackwardMap class.

PotentialDifferenceMap< GR, POT > potentialDifferenceMap ( const GR &  gr,
const POT &  potential 
)
related

This function just returns a PotentialDifferenceMap.