1 #include <mapstorage.h>
3 MapStorage::MapStorage(Graph & graph):g(graph)
5 for(int i=0;i<PROPERTY_NUM;i++)
7 Graph::EdgeMap<double> emd(g);
8 default_edgemaps.push_back(emd);
9 Graph::NodeMap<double> nmd(g);
10 default_nodemaps.push_back(nmd);
13 //std::string defaultstr="Default ";
14 for(int i=0;i<PROPERTY_NUM;i++)
16 for (EdgeIt j(g); j!=INVALID; ++j)
18 (default_edgemaps[i])[j]=property_defaults[i];
20 addEdgeMap(property_strings[i],&(default_edgemaps[i]));
25 int MapStorage::addNodeMap(const std::string & name, Graph::NodeMap<double> *nodemap)
27 nodemap_storage[name]=nodemap;
30 int MapStorage::addEdgeMap(const std::string & name, Graph::EdgeMap<double> *edgemap)
32 edgemap_storage[name]=edgemap;
36 double MapStorage::maxOfNodeMap(const std::string & name)
39 for (NodeIt j(g); j!=INVALID; ++j)
41 if( (*nodemap_storage[name])[j]>max )
43 max=(*nodemap_storage[name])[j];
49 double MapStorage::maxOfEdgeMap(const std::string & name)
52 for (EdgeIt j(g); j!=INVALID; ++j)
54 if( (*edgemap_storage[name])[j]>max )
56 max=(*edgemap_storage[name])[j];
62 double MapStorage::minOfNodeMap(const std::string & name)
65 double min=(*nodemap_storage[name])[j];
66 for (; j!=INVALID; ++j)
68 if( (*nodemap_storage[name])[j]<min )
70 min=(*nodemap_storage[name])[j];
76 double MapStorage::minOfEdgeMap(const std::string & name)
79 double min=(*edgemap_storage[name])[j];
80 for (EdgeIt j(g); j!=INVALID; ++j)
82 if( (*edgemap_storage[name])[j]<min )
84 min=(*edgemap_storage[name])[j];