lemon/list_graph.h
changeset 1753 98d83dd56c1d
parent 1718 6a958ab38386
child 1770 657de7e5043c
equal deleted inserted replaced
8:135ad5f3bf91 9:8d084b52f5d5
   336     ///
   336     ///
   337     ///\note The <tt>Edge</tt>'s and <tt>OutEdge</tt>'s
   337     ///\note The <tt>Edge</tt>'s and <tt>OutEdge</tt>'s
   338     ///referencing the changed edge remain
   338     ///referencing the changed edge remain
   339     ///valid. However <tt>InEdge</tt>'s are invalidated.
   339     ///valid. However <tt>InEdge</tt>'s are invalidated.
   340     void changeTarget(Edge e, Node n) { 
   340     void changeTarget(Edge e, Node n) { 
   341       getNotifier(Edge()).signalChange(e); 
       
   342       _changeTarget(e,n); 
   341       _changeTarget(e,n); 
   343       getNotifier(Edge()).commitChange(e); 
       
   344     }
   342     }
   345     /// Changes the source of \c e to \c n
   343     /// Changes the source of \c e to \c n
   346 
   344 
   347     /// Changes the source of \c e to \c n
   345     /// Changes the source of \c e to \c n
   348     ///
   346     ///
   349     ///\note The <tt>Edge</tt>'s and <tt>InEdge</tt>'s
   347     ///\note The <tt>Edge</tt>'s and <tt>InEdge</tt>'s
   350     ///referencing the changed edge remain
   348     ///referencing the changed edge remain
   351     ///valid. However <tt>OutEdge</tt>'s are invalidated.
   349     ///valid. However <tt>OutEdge</tt>'s are invalidated.
   352     void changeSource(Edge e, Node n) { 
   350     void changeSource(Edge e, Node n) { 
   353       getNotifier(Edge()).signalChange(e); 
       
   354       _changeSource(e,n);
   351       _changeSource(e,n);
   355       getNotifier(Edge()).commitChange(e); 
       
   356     }
   352     }
   357 
   353 
   358     /// Invert the direction of an edge.
   354     /// Invert the direction of an edge.
   359 
   355 
   360     ///\note The <tt>Edge</tt>'s
   356     ///\note The <tt>Edge</tt>'s
   361     ///referencing the changed edge remain
   357     ///referencing the changed edge remain
   362     ///valid. However <tt>OutEdge</tt>'s  and <tt>InEdge</tt>'s are invalidated.
   358     ///valid. However <tt>OutEdge</tt>'s  and <tt>InEdge</tt>'s are invalidated.
   363     void reverseEdge(Edge e) {
   359     void reverseEdge(Edge e) {
   364       Node t=target(e);
   360       Node t=target(e);
   365       getNotifier(Edge()).signalChange(e); 
       
   366       _changeTarget(e,source(e));
   361       _changeTarget(e,source(e));
   367       _changeSource(e,t);
   362       _changeSource(e,t);
   368       getNotifier(Edge()).commitChange(e); 
       
   369     }
   363     }
   370 
   364 
   371     ///Using this it possible to avoid the superfluous memory allocation.
   365     ///Using this it possible to avoid the superfluous memory allocation.
   372 
   366 
   373     ///Using this it possible to avoid the superfluous memory allocation.
   367     ///Using this it possible to avoid the superfluous memory allocation.
   591     ///
   585     ///
   592     /// \note The <tt>Edge</tt>'s and <tt>OutEdge</tt>'s
   586     /// \note The <tt>Edge</tt>'s and <tt>OutEdge</tt>'s
   593     /// referencing the changed edge remain
   587     /// referencing the changed edge remain
   594     /// valid. However <tt>InEdge</tt>'s are invalidated.
   588     /// valid. However <tt>InEdge</tt>'s are invalidated.
   595     void changeTarget(UndirEdge e, Node n) { 
   589     void changeTarget(UndirEdge e, Node n) { 
   596       getNotifier(UndirEdge()).signalChange(e); 
       
   597       getNotifier(Edge()).signalChange(direct(e, true)); 
       
   598       getNotifier(Edge()).signalChange(direct(e, false)); 
       
   599       _changeTarget(e,n); 
   590       _changeTarget(e,n); 
   600       getNotifier(UndirEdge()).commitChange(e);
       
   601       getNotifier(Edge()).commitChange(direct(e, true)); 
       
   602       getNotifier(Edge()).commitChange(direct(e, false)); 
       
   603     }
   591     }
   604     /// Changes the source of \c e to \c n
   592     /// Changes the source of \c e to \c n
   605     ///
   593     ///
   606     /// Changes the source of \c e to \c n
   594     /// Changes the source of \c e to \c n
   607     ///
   595     ///
   608     ///\note The <tt>Edge</tt>'s and <tt>InEdge</tt>'s
   596     ///\note The <tt>Edge</tt>'s and <tt>InEdge</tt>'s
   609     ///referencing the changed edge remain
   597     ///referencing the changed edge remain
   610     ///valid. However <tt>OutEdge</tt>'s are invalidated.
   598     ///valid. However <tt>OutEdge</tt>'s are invalidated.
   611     void changeSource(UndirEdge e, Node n) { 
   599     void changeSource(UndirEdge e, Node n) { 
   612       getNotifier(UndirEdge()).signalChange(e); 
       
   613       getNotifier(Edge()).signalChange(direct(e, true)); 
       
   614       getNotifier(Edge()).signalChange(direct(e, false)); 
       
   615       _changeSource(e,n); 
   600       _changeSource(e,n); 
   616       getNotifier(UndirEdge()).commitChange(e);
       
   617       getNotifier(Edge()).commitChange(direct(e, true)); 
       
   618       getNotifier(Edge()).commitChange(direct(e, false)); 
       
   619     }
   601     }
   620     /// \brief Contract two nodes.
   602     /// \brief Contract two nodes.
   621     ///
   603     ///
   622     /// This function contracts two nodes.
   604     /// This function contracts two nodes.
   623     ///
   605     ///