This map makes possible to give back a linear combination for each node. It works like the std::accumulate
function, so it accumulates the bf
binary function with the fv
first value. The map accumulates only on that positions (dimensions) where the index of the node is one. The values that have to be accumulated should be given by the begin
and end
iterators and the length of this range should be equal to the dimension number of the graph.
const int DIM = 3; HypercubeGraph graph(DIM); dim2::Point<double> base[DIM]; for (int k = 0; k < DIM; ++k) { base[k].x = rnd(); base[k].y = rnd(); } HypercubeGraph::HyperMap<dim2::Point<double> > pos(graph, base, base + DIM, dim2::Point<double>(0.0, 0.0));
#include <lemon/hypercube_graph.h>
Public Types | |
typedef Node | Key |
The key type of the map. | |
typedef T | Value |
The value type of the map. | |
Public Member Functions | |
template<typename It > | |
HyperMap (const Graph &graph, It begin, It end, T fv=0, const BF &bf=BF()) | |
Constructor for HyperMap. | |
Value | operator[] (const Key &k) const |
The partial accumulated value. |
HyperMap | ( | const Graph & | graph, |
It | begin, | ||
It | end, | ||
T | fv = 0 , |
||
const BF & | bf = BF() |
||
) | [inline] |
Construct a HyperMap for the given graph. The values that have to be accumulated should be given by the begin
and end
iterators and the length of this range should be equal to the dimension number of the graph.
This map accumulates the bf
binary function with the fv
first value on that positions (dimensions) where the index of the node is one.