Most of them are ReadMaps. They can make arithmetic operations between one or two maps (negation, scaling, addition, multiplication etc.) or e.g. convert a map to another one of different Value type.
The typical usage of this classes is passing implicit maps to algorithms. If a function type algorithm is called then the function type map adaptors can be used comfortable. For example let's see the usage of map adaptors with the graphToEps()
function:
Color nodeColor(int deg) { if (deg >= 2) { return Color(0.5, 0.0, 0.5); } else if (deg == 1) { return Color(1.0, 0.5, 1.0); } else { return Color(0.0, 0.0, 0.0); } } Graph::NodeMap<int> degree_map(graph); graphToEps(graph, "graph.eps") .coords(coords).scaleToA4().undirected() .nodeColors(composeMap(functorMap(nodeColor), degree_map)) .run();
functorMap()
function makes an int
to Color
map from the nodeColor() function. The composeMap()
compose the degree_map and the previous created map. The composed map is proper function to get color of each node.The usage with class type algorithms is little bit harder. In this case the function type map adaptors can not be used, because the function map adaptors give back temporary objects.
Graph graph; typedef Graph::EdgeMap<double> DoubleEdgeMap; DoubleEdgeMap length(graph); DoubleEdgeMap speed(graph); typedef DivMap<DoubleEdgeMap, DoubleEdgeMap> TimeMap; TimeMap time(length, speed); Dijkstra<Graph, TimeMap> dijkstra(graph, time); dijkstra.run(source, target);
We have a length map and a maximum speed map on a graph. The minimum time to pass the edge can be calculated as the division of the two maps which can be done implicitly with the DivMap
template class. We use the implicit minimum time map as the length map of the Dijkstra
algorithm.
Classes | |
class | IdentityMap< T > |
Identity map. More... | |
class | ConvertMap< M, T > |
Convert the Value of a map to another type using the default conversion. More... | |
class | SimpleMap< M > |
Simple wrapping of a map. More... | |
class | SimpleWriteMap< M > |
Simple writable wrapping of a map. More... | |
class | AddMap< M1, M2 > |
Sum of two maps. More... | |
class | ShiftMap< M, C > |
Shift a map with a constant. More... | |
class | ShiftWriteMap< M, C > |
Shift a map with a constant (ReadWrite version). More... | |
class | SubMap< M1, M2 > |
Difference of two maps. More... | |
class | MulMap< M1, M2 > |
Product of two maps. More... | |
class | ScaleMap< M, C > |
Scales a map with a constant. More... | |
class | ScaleWriteMap< M, C > |
Scales a map with a constant (ReadWrite version). More... | |
class | DivMap< M1, M2 > |
Quotient of two maps. More... | |
class | ComposeMap< M1, M2 > |
Composition of two maps. More... | |
class | CombineMap< M1, M2, F, V > |
Combine of two maps using an STL (binary) functor. More... | |
class | NegMap< M > |
Negative value of a map. More... | |
class | NegWriteMap< M > |
Negative value of a map (ReadWrite version). More... | |
class | AbsMap< M > |
Absolute value of a map. More... | |
class | FunctorMap< F, K, V > |
Converts an STL style functor to a map. More... | |
class | MapFunctor< M > |
Converts a map to an STL style (unary) functor. More... | |
class | ForkMap< M1, M2 > |
Just readable version of ForkWriteMap. More... | |
class | ForkWriteMap< M1, M2 > |
Applies all map setting operations to two maps. More... | |
class | NotMap< M > |
Logical 'not' of a map. More... | |
class | NotWriteMap< M > |
Logical 'not' of a map (ReadWrie version). More... | |
class | StoreBoolMap< _Iterator, _Functor > |
Writable bool map for logging each true assigned element. More... | |
class | BackInserterBoolMap< Container, Functor > |
Writable bool map for logging each true assigned element in a back insertable container. More... | |
class | FrontInserterBoolMap< Container, Functor > |
Writable bool map for logging each true assigned element in a front insertable container. More... | |
class | InserterBoolMap< Container, Functor > |
Writable bool map for storing each true assigned element in an insertable container. More... | |
class | FillBoolMap< Map > |
Writable bool map for filling each true assigned element with a given value. More... | |
class | SettingOrderBoolMap< Map > |
Writable bool map for storing the sequence number of true assignments. More... | |
Functions | |
template<typename T > | |
IdentityMap< T > | identityMap () |
Returns an IdentityMap class. | |
template<typename T , typename M > | |
ConvertMap< M, T > | convertMap (const M &m) |
Returns a ConvertMap class. | |
template<typename M > | |
SimpleMap< M > | simpleMap (const M &m) |
Returns a SimpleMap class. | |
template<typename M > | |
SimpleWriteMap< M > | simpleWriteMap (M &m) |
Returns a SimpleWriteMap class. | |
template<typename M1 , typename M2 > | |
AddMap< M1, M2 > | addMap (const M1 &m1, const M2 &m2) |
Returns an AddMap class. | |
template<typename M , typename C > | |
ShiftMap< M, C > | shiftMap (const M &m, const C &v) |
Returns a ShiftMap class. | |
template<typename M , typename C > | |
ShiftWriteMap< M, C > | shiftMap (M &m, const C &v) |
Returns a ShiftWriteMap class. | |
template<typename M1 , typename M2 > | |
SubMap< M1, M2 > | subMap (const M1 &m1, const M2 &m2) |
Returns a SubMap class. | |
template<typename M1 , typename M2 > | |
MulMap< M1, M2 > | mulMap (const M1 &m1, const M2 &m2) |
Returns a MulMap class. | |
template<typename M , typename C > | |
ScaleMap< M, C > | scaleMap (const M &m, const C &v) |
Returns a ScaleMap class. | |
template<typename M , typename C > | |
ScaleWriteMap< M, C > | scaleMap (M &m, const C &v) |
Returns a ScaleWriteMap class. | |
template<typename M1 , typename M2 > | |
DivMap< M1, M2 > | divMap (const M1 &m1, const M2 &m2) |
Returns a DivMap class. | |
template<typename M1 , typename M2 > | |
ComposeMap< M1, M2 > | composeMap (const M1 &m1, const M2 &m2) |
Returns a ComposeMap class. | |
template<typename M1 , typename M2 , typename F , typename V > | |
CombineMap< M1, M2, F, V > | combineMap (const M1 &m1, const M2 &m2, const F &f) |
Returns a CombineMap class. | |
template<typename M > | |
NegMap< M > | negMap (const M &m) |
Returns a NegMap class. | |
template<typename M > | |
NegWriteMap< M > | negMap (M &m) |
Returns a NegWriteMap class. | |
template<typename M > | |
AbsMap< M > | absMap (const M &m) |
Returns an AbsMap class. | |
template<typename K , typename V , typename F > | |
FunctorMap< F, K, V > | functorMap (const F &f) |
Returns a FunctorMap class. | |
template<typename M > | |
MapFunctor< M > | mapFunctor (const M &m) |
Returns a MapFunctor class. | |
template<typename M1 , typename M2 > | |
ForkMap< M1, M2 > | forkMap (const M1 &m1, const M2 &m2) |
Returns a ForkMap class. | |
template<typename M1 , typename M2 > | |
ForkWriteMap< M1, M2 > | forkMap (M1 &m1, M2 &m2) |
Returns a ForkWriteMap class. | |
template<typename M > | |
NotMap< M > | notMap (const M &m) |
Returns a NotMap class. | |
template<typename M > | |
NotWriteMap< M > | notMap (M &m) |
Returns a NotWriteMap class. |
IdentityMap< T > identityMap | ( | ) | [related, inherited] |
This function just returns an IdentityMap
class.
ConvertMap< M, T > convertMap | ( | const M & | m | ) | [related, inherited] |
This function just returns a ConvertMap
class.
SimpleMap< M > simpleMap | ( | const M & | m | ) | [related, inherited] |
This function just returns a SimpleMap
class.
SimpleWriteMap< M > simpleWriteMap | ( | M & | m | ) | [related, inherited] |
This function just returns a SimpleWriteMap
class.
AddMap< M1, M2 > addMap | ( | const M1 & | m1, | |
const M2 & | m2 | |||
) | [related, inherited] |
ShiftMap< M, C > shiftMap | ( | const M & | m, | |
const C & | v | |||
) | [related, inherited] |
This function just returns an ShiftMap
class.
ShiftWriteMap< M, C > shiftMap | ( | M & | m, | |
const C & | v | |||
) | [related, inherited] |
This function just returns a ShiftWriteMap
class.
SubMap< M1, M2 > subMap | ( | const M1 & | m1, | |
const M2 & | m2 | |||
) | [related, inherited] |
This function just returns a SubMap
class.
MulMap< M1, M2 > mulMap | ( | const M1 & | m1, | |
const M2 & | m2 | |||
) | [related, inherited] |
This function just returns a MulMap
class.
ScaleMap< M, C > scaleMap | ( | const M & | m, | |
const C & | v | |||
) | [related, inherited] |
This function just returns a ScaleMap
class.
ScaleWriteMap< M, C > scaleMap | ( | M & | m, | |
const C & | v | |||
) | [related, inherited] |
This function just returns a ScaleWriteMap
class.
DivMap< M1, M2 > divMap | ( | const M1 & | m1, | |
const M2 & | m2 | |||
) | [related, inherited] |
This function just returns a DivMap
class.
ComposeMap< M1, M2 > composeMap | ( | const M1 & | m1, | |
const M2 & | m2 | |||
) | [related, inherited] |
This function just returns a ComposeMap
class.
CombineMap< M1, M2, F, V > combineMap | ( | const M1 & | m1, | |
const M2 & | m2, | |||
const F & | f | |||
) | [related, inherited] |
This function just returns a CombineMap
class.
For example if m1
and m2
are both double
valued maps, then
combineMap(m1,m2,std::plus<double>())
addMap(m1,m2)
This function is specialized for adaptable binary function classes and C++ functions.
NegMap< M > negMap | ( | const M & | m | ) | [related, inherited] |
This function just returns a NegMap
class.
NegWriteMap< M > negMap | ( | M & | m | ) | [related, inherited] |
This function just returns a NegWriteMap
class.
AbsMap< M > absMap | ( | const M & | m | ) | [related, inherited] |
This function just returns an AbsMap
class.
FunctorMap< F, K, V > functorMap | ( | const F & | f | ) | [related, inherited] |
This function just returns a FunctorMap
class.
This function is specialized for adaptable binary function classes and C++ functions.
MapFunctor< M > mapFunctor | ( | const M & | m | ) | [related, inherited] |
This function just returns a MapFunctor
class.
ForkMap< M1, M2 > forkMap | ( | const M1 & | m1, | |
const M2 & | m2 | |||
) | [related, inherited] |
This function just returns a ForkMap
class.
ForkWriteMap< M1, M2 > forkMap | ( | M1 & | m1, | |
M2 & | m2 | |||
) | [related, inherited] |
This function just returns a ForkWriteMap
class.
NotMap< M > notMap | ( | const M & | m | ) | [related, inherited] |
This function just returns a NotMap
class.
NotWriteMap< M > notMap | ( | M & | m | ) | [related, inherited] |
This function just returns a NotWriteMap
class.