Nehany folyamalgoritmus futasi ideje, azzal a kozponti kerdessel, hogy a sok dereferalas
hasznalata/kerulese
optimalizalassal/optimalizalas nelkul
kulonbozo gepeken Celeron 600/karp
milyen futasi idoket eredmenyez.
1 #ifndef EDGE_MAP_REGISTER_H
2 #define EDGE_MAP_REGISTER_H
6 template <typename G, typename E>
7 class EdgeMapRegister {
12 typedef EdgeMapBase<Graph, Edge> EdgeMapBase;
15 typedef std::vector<EdgeMapBase*> Container;
19 void add(EdgeMapBase& map_base) {
21 map_base.graph->edge_maps.erase(map_base);
23 container.push_back(&map_base);
24 map_base.graph_index = container.size()-1;
27 void erase(EdgeMapBase& map_base) {
28 if (map_base.graph != this) return;
29 container.back()->graph_index = map_base.graph_index;
30 container[map_base.graph_index] = container.back();
35 void addEdge(Edge& edge) {
36 typename Container::iterator it;
37 for (it = container.begin(); it != container.end(); ++it) {
42 void eraseEdge(Edge& edge) {
43 typename Container::iterator it;
44 for (it = container.begin(); it != container.end(); ++it) {
49 friend class EdgeMapBase;