HyperMap< T, BF > Class Template Reference


Detailed Description

template<typename T, typename BF = std::plus<T>>
class lemon::HyperCubeGraph::HyperMap< T, BF >

It makes possible to give back a linear combination for each node. This function works like the std::accumulate so it accumulates the bf binary function with the fv first value. The map accumulates only on that dimensions where the node's index is one. The accumulated values should be given by the begin and end iterators and this range's length should be 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));

See also:
HyperCubeGraph
#include <lemon/hypercube_graph.h>

List of all members.

Public Member Functions

template<typename It >
 HyperMap (const Graph &graph, It begin, It end, T fv=0.0, const BF &bf=BF())
 Constructor for HyperMap.
Value operator[] (Key k) const


Constructor & Destructor Documentation

HyperMap ( const Graph &  graph,
It  begin,
It  end,
fv = 0.0,
const BF &  bf = BF() 
) [inline]

Construct a HyperMap for the given graph. The accumulated values should be given by the begin and end iterators and this range's length should be the dimension number of the graph.

This function accumulates the bf binary function with the fv first value. The map accumulates only on that dimensions where the node's index is one.


Member Function Documentation

Value operator[] ( Key  k  )  const [inline]

Gives back the partial accumulated value.


Generated on Thu Jun 4 04:04:53 2009 for LEMON by  doxygen 1.5.9