src/work/alpar/smart_graph.h
changeset 491 4804c967543d
parent 395 b619f369a9ef
equal deleted inserted replaced
18:b16120cfb7b7 19:f9b862f580e4
   154     Node addNode() {
   154     Node addNode() {
   155       Node n; n.n=nodes.size();
   155       Node n; n.n=nodes.size();
   156       nodes.push_back(NodeT()); //FIXME: Hmmm...
   156       nodes.push_back(NodeT()); //FIXME: Hmmm...
   157 
   157 
   158       for(std::vector<DynMapBase<Node> * >::iterator i=dyn_node_maps.begin();
   158       for(std::vector<DynMapBase<Node> * >::iterator i=dyn_node_maps.begin();
   159 	  i!=dyn_node_maps.end(); ++i) (**i).add(n.n);
   159 	  i!=dyn_node_maps.end(); ++i) (**i).add(n);
   160 
   160 
   161       return n;
   161       return n;
   162     }
   162     }
   163     
   163     
   164     Edge addEdge(Node u, Node v) {
   164     Edge addEdge(Node u, Node v) {
   466     template<typename T> class SymEdgeMap;
   466     template<typename T> class SymEdgeMap;
   467     template<typename T> friend class SymEdgeMap;
   467     template<typename T> friend class SymEdgeMap;
   468 
   468 
   469     SymSmartGraph() : SmartGraph() { }
   469     SymSmartGraph() : SmartGraph() { }
   470     SymSmartGraph(const SmartGraph &_g) : SmartGraph(_g) { }
   470     SymSmartGraph(const SmartGraph &_g) : SmartGraph(_g) { }
       
   471     ///Adds a pair of oppositely directed edges to the graph.
   471     Edge addEdge(Node u, Node v)
   472     Edge addEdge(Node u, Node v)
   472     {
   473     {
   473       Edge e = SmartGraph::addEdge(u,v);
   474       Edge e = SmartGraph::addEdge(u,v);
   474       SmartGraph::addEdge(v,u);
   475       SmartGraph::addEdge(v,u);
   475       return e;
   476       return e;