src/include/smart_graph.h
changeset 400 cb377609cf1d
parent 353 eeae2f4a0d74
child 402 f90f65ba21d5
equal deleted inserted replaced
2:deaf9fea3436 3:b04c68b58f06
   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;