equal
deleted
inserted
replaced
1 #include <mapstorage.h> |
1 #include <mapstorage.h> |
2 |
2 |
3 MapStorage::MapStorage(Graph & graph):g(graph) |
3 MapStorage::MapStorage(Graph & graph):g(graph) |
4 { |
4 { |
5 for(int i=0;i<EDGE_PROPERTY_NUM;i++) |
|
6 { |
|
7 Graph::EdgeMap<double> emd(g,edge_property_defaults[i]); |
|
8 default_edgemaps.push_back(emd); |
|
9 } |
|
10 |
|
11 for(int i=0;i<NODE_PROPERTY_NUM;i++) |
|
12 { |
|
13 Graph::NodeMap<double> nmd(g,node_property_defaults[i]); |
|
14 default_nodemaps.push_back(nmd); |
|
15 } |
|
16 |
|
17 for(int i=0;i<EDGE_PROPERTY_NUM;i++) |
|
18 { |
|
19 for (EdgeIt j(g); j!=INVALID; ++j) |
|
20 { |
|
21 (default_edgemaps[i])[j]=edge_property_defaults[i]; |
|
22 } |
|
23 addEdgeMap(edge_property_strings[i],&(default_edgemaps[i])); |
|
24 } |
|
25 |
|
26 for(int i=0;i<NODE_PROPERTY_NUM;i++) |
|
27 { |
|
28 for (NodeIt j(g); j!=INVALID; ++j) |
|
29 { |
|
30 (default_nodemaps[i])[j]=node_property_defaults[i]; |
|
31 } |
|
32 addNodeMap(node_property_strings[i],&(default_nodemaps[i])); |
|
33 } |
|
34 |
|
35 }; |
5 }; |
36 |
6 |
37 int MapStorage::addNodeMap(const std::string & name, Graph::NodeMap<double> *nodemap) |
7 int MapStorage::addNodeMap(const std::string & name, Graph::NodeMap<double> *nodemap) |
38 { |
8 { |
39 nodemap_storage[name]=nodemap; |
9 nodemap_storage[name]=nodemap; |
100 return min; |
70 return min; |
101 } |
71 } |
102 |
72 |
103 void MapStorage::initMapsForEdge(Graph::Edge e) |
73 void MapStorage::initMapsForEdge(Graph::Edge e) |
104 { |
74 { |
105 e=e; |
75 std::map< std::string,Graph::EdgeMap<double> * >::iterator ems_it; |
106 // beragad, aztan csovez |
76 for(ems_it=edgemap_storage.begin();ems_it!=edgemap_storage.end();ems_it++) |
107 // std::map< std::string,Graph::EdgeMap<double> * >::iterator ems_it; |
77 { |
108 // for(ems_it=edgemap_storage.begin();ems_it!=edgemap_storage.end();ems_it++) |
78 (*((*ems_it).second))[e]=5; |
109 // { |
79 } |
110 // std::cout << "szevasz\n"; |
|
111 // (*((*ems_it).second))[e]=0; |
|
112 // } |
|
113 // std::cout << std::endl; |
|
114 |
|
115 // g_closure_invoke... |
|
116 // for(int i=0;i<EDGE_PROPERTY_NUM;i++) |
|
117 // { |
|
118 // (default_edgemaps[i])[e]=property_defaults[i]; |
|
119 // } |
|
120 } |
80 } |