maps_summary.cc File Reference
Detailed Description
#include <iostream>
#include <lemon/list_graph.h>
using namespace lemon;
template < typename GRAPH, typename MAP >
typename MAP::Value summary( GRAPH& gr, MAP& m )
{
typename MAP::Value summ = typename MAP::Value();
for( typename GRAPH::NodeIt n(gr); n != lemon::INVALID; ++n )
summ += m[n];
return summ;
}
int main()
{
ListGraph gr;
ListGraph::NodeMap<double> value(gr, 0.0);
std::cout << "The summary of assigned values is " << summary(gr,value) << std::endl;
return 0;
}
#include <iostream>
#include <lemon/list_graph.h>