COIN-OR::LEMON - Graph Library

Changeset 877:66dd225ca128 in lemon-0.x


Ignore:
Timestamp:
09/17/04 09:02:16 (16 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1183
Message:

Fix maps in the GraphWrappers?.

Location:
src/hugo
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/graph_wrapper.h

    r876 r877  
    225225    Edge opposite(const Edge& e) const { return Edge(graph->opposite(e)); }
    226226
    227     template<typename T> class NodeMap : public Graph::template NodeMap<T> {
    228       typedef typename Graph::template NodeMap<T> Parent;
    229     public:
    230       NodeMap(const GraphWrapper<Graph>& gw) :  Parent(*(gw.graph)) { }
    231       NodeMap(const GraphWrapper<Graph>& gw, T a) : Parent(*(gw.graph), a) { }
    232 //       NodeMap(const NodeMap<T>& map) : Parent(map) { }
    233 //       template<typename Map>
    234 //       NodeMap(const Map& map) :  Parent(map) { }
    235     };
    236 
    237     template<typename T> class EdgeMap : public Graph::template EdgeMap<T> {
    238       typedef typename Graph::template EdgeMap<T> Parent;
    239     public:
    240       EdgeMap(const GraphWrapper<Graph>& gw) : Parent(*(gw.graph)) { }
    241       EdgeMap(const GraphWrapper<Graph>& gw, T a) : Parent(*(gw.graph), a) { }
    242 //       EdgeMap(const EdgeMap<T>& map) : Parent(map) { }
    243 //       template<typename Map>
    244 //       EdgeMap(const Map& map) :  Parent(map) { }
    245     };
     227
     228    IMPORT_NODE_MAP(Graph, *(gw.graph), GraphWrapper, gw);   
     229    IMPORT_EDGE_MAP(Graph, *(gw.graph), GraphWrapper, gw);
     230   
     231
    246232  };
    247233
     
    331317      return GraphWrapper<Graph>::tail(e); }
    332318
     319    KEEP_MAPS(Parent, RevGraphWrapper);
     320
    333321  };
    334322
     
    570558    }
    571559
     560    KEEP_MAPS(Parent, SubGraphWrapper);
    572561  };
    573562
     
    660649      if (e.out_or_in) return this->graph->head(e); else
    661650        return this->graph->tail(e); }
     651
     652    KEEP_MAPS(Parent, UndirGraphWrapper);
     653
    662654  };
    663655 
     
    677669      Parent::setGraph(gr);
    678670    }
     671
     672    KEEP_MAPS(Parent, UndirGraph);
    679673  };
    680674
     
    11091103//       }
    11101104    };
     1105
     1106
     1107    KEEP_NODE_MAP(Parent, SubBidirGraphWrapper);
     1108
    11111109  };
    11121110
     
    11461144      return 2*this->graph->edgeNum();
    11471145    }
     1146    KEEP_MAPS(Parent, BidirGraphWrapper);
    11481147  };
    11491148
     
    11681167      Parent::setGraph(gr);
    11691168    }
     1169    KEEP_MAPS(Parent, BidirGraph);
    11701170  };
    11711171
     
    13081308    };
    13091309
     1310    KEEP_MAPS(Parent, ResGraphWrapper);
    13101311  };
    13111312
     
    14191420      first_out_edges->set(n, f);
    14201421    }
     1422
     1423    KEEP_MAPS(Parent, ErasingFirstGraphWrapper);
    14211424  };
    14221425
  • src/hugo/list_graph.h

    r844 r877  
    883883
    884884
    885     /// Creating edge map registry.
     885    /// Creates edge map registry.
    886886    CREATE_EDGE_MAP_REGISTRY;
    887     /// Creating edge maps.
     887    /// Creates edge maps.
    888888    CREATE_EDGE_MAP(DefaultMap);
    889889
    890     /// Importing node maps from the NodeGraphType.
     890    /// Imports node maps from the NodeGraphType.
    891891    IMPORT_NODE_MAP(NodeGraphType, graph.G, EdgeSet, graph);
    892892   
  • src/hugo/map_defines.h

    r844 r877  
    206206};
    207207
     208#define KEEP_EDGE_MAP(From, To) \
     209IMPORT_EDGE_MAP(From, graph, To, graph)
     210
     211
     212#define KEEP_NODE_MAP(From, To) \
     213IMPORT_NODE_MAP(From, graph, To, graph)
    208214
    209215/** This is a macro to keep the node and edge maps for a graph class.
    210216 */
    211217#define KEEP_MAPS(From, To) \
    212 IMPORT_EDGE_MAP(From, graph, To, graph) \
    213 IMPORT_NODE_MAP(From, graph, To, graph)
     218KEEP_EDGE_MAP(From, To) \
     219KEEP_NODE_MAP(From, To)
     220
    214221 
    215222/// @}
Note: See TracChangeset for help on using the changeset viewer.