Maps
[Data Structures]


Detailed Description

This group describes the map structures implemented in LEMON.

LEMON provides several special purpose maps and map adaptors that e.g. combine new maps from existing ones.

See also: Map Concepts.


Classes

class  MapBase
 Base class of maps. More...
class  NullMap
 Null map. (a.k.a. DoNothingMap). More...
class  ConstMap
 Constant map. More...
class  ConstMap< K, Const< V, v > >
 Constant map with inlined constant value. More...
class  IdentityMap
 Identity map. More...
class  RangeMap
 Map for storing values for integer keys from the range [0..size-1]. More...
class  SparseMap
 Map type based on std::map. More...
class  TrueMap
 Constant true map. More...
class  FalseMap
 Constant false map. More...
class  LoggerBoolMap
 Writable bool map for logging each true assigned element. More...

Modules

 Graph Maps
 Special graph-related maps.
 Map Adaptors
 Tools to create new maps from existing ones.

Files

file  maps.h
 Miscellaneous property maps.

Functions

template<typename K , typename V >
NullMap< K, V > nullMap ()
 Returns a NullMap class.
template<typename K , typename V >
ConstMap< K, V > constMap (const V &v)
 Returns a ConstMap class.
template<typename K , typename V , V v>
ConstMap< K, Const< V, v > > constMap ()
 Returns a ConstMap class with inlined constant value.
template<typename T >
IdentityMap< T > identityMap ()
 Returns an IdentityMap class.
template<typename V >
RangeMap< V > rangeMap (int size=0, const V &value=V())
 Returns a RangeMap class.
template<typename V >
RangeMap< V > rangeMap (const std::vector< V > &vector)
 Returns a RangeMap class created from an appropriate std::vector.
template<typename K , typename V , typename Compare >
SparseMap< K, V, Compare > sparseMap (const V &value=V())
 Returns a SparseMap class.
template<typename K , typename V , typename Compare >
SparseMap< K, V, Compare > sparseMap (const std::map< K, V, Compare > &map, const V &value=V())
 Returns a SparseMap class created from an appropriate std::map.
template<typename K >
TrueMap< K > trueMap ()
 Returns a TrueMap class.
template<typename K >
FalseMap< K > falseMap ()
 Returns a FalseMap class.
template<typename Iterator >
LoggerBoolMap< Iterator > loggerBoolMap (Iterator it)
 Returns a LoggerBoolMap class.


Function Documentation

NullMap< K, V > nullMap (  )  [related, inherited]

This function just returns a NullMap class.

ConstMap< K, V > constMap ( const V &  v  )  [related, inherited]

This function just returns a ConstMap class.

ConstMap< K, Const< V, v > > constMap (  )  [related, inherited]

This function just returns a ConstMap class with inlined constant value.

IdentityMap< T > identityMap (  )  [related, inherited]

This function just returns an IdentityMap class.

RangeMap< V > rangeMap ( int  size = 0,
const V &  value = V() 
) [related, inherited]

This function just returns a RangeMap class.

RangeMap< V > rangeMap ( const std::vector< V > &  vector  )  [related, inherited]

This function just returns a RangeMap class created from an appropriate std::vector.

SparseMap< K, V, Compare > sparseMap ( const V &  value = V()  )  [related, inherited]

This function just returns a SparseMap class with specified default value.

SparseMap< K, V, Compare > sparseMap ( const std::map< K, V, Compare > &  map,
const V &  value = V() 
) [related, inherited]

This function just returns a SparseMap class created from an appropriate std::map.

TrueMap< K > trueMap (  )  [related, inherited]

This function just returns a TrueMap class.

FalseMap< K > falseMap (  )  [related, inherited]

This function just returns a FalseMap class.

LoggerBoolMap< Iterator > loggerBoolMap ( Iterator  it  )  [related, inherited]

This function just returns a LoggerBoolMap class.

The most important usage of it is storing certain nodes or arcs that were marked true by an algorithm. For example it makes easier to store the nodes in the processing order of Dfs algorithm, as the following examples show.

   std::vector<Node> v;
   dfs(g,s).processedMap(loggerBoolMap(std::back_inserter(v))).run();
   std::vector<Node> v(countNodes(g));
   dfs(g,s).processedMap(loggerBoolMap(v.begin())).run();

Note:
The container of the iterator must contain enough space for the elements or the iterator should be an inserter iterator.

LoggerBoolMap is just writable, so it cannot be used when a readable map is needed, for example as ReachedMap for Bfs, Dfs and Dijkstra algorithms.


Generated on Sun Dec 7 10:49:37 2008 for LEMON by  doxygen 1.5.7.1