[Cgc-tickets] [Coin Graph Classes] #4: bug in DynNetArcIterator::compareHack

Coin Graph Classes coin-trac at coin-or.org
Fri May 25 14:52:34 EDT 2007


#4: bug in DynNetArcIterator::compareHack
------------------------+---------------------------------------------------
 Reporter:  stefan      |       Owner:  somebody
     Type:  defect      |      Status:  new     
 Priority:  major       |   Milestone:          
Component:  component1  |     Version:          
 Keywords:              |  
------------------------+---------------------------------------------------
 Hi,

 I just started to use your Cgc.

 In the method DynNetArcIterator::compareHack special care has to be taken
 in case that nodeIter and otherIter.nodeIter are both net->end().
 In this case, arcIter will likely be not set.
 I added the line
 {{{ if (nodeIter == net->end()) return true; }}}
 before the test on arcIter to get it working.

 As a suggestion for an extension: I wanted to find an arc in a !DynNet
 given two node iterators.
 First I used getNodeIdHack(), and used the appropriate arc_find method.
 Then I saw that this method will search for the node iterators again. So
 maybe you could add a method to find an arc given two iterators:
 {{{
         arc_iterator arc_find(const_iterator& tail, const_iterator& head)
         {
             DynNet<NodeInfo,ArcInfo> *netpnt=
                 const_cast< DynNet<NodeInfo,ArcInfo> * >(this);
             Arc anArc(tail,ArcInfo(),head);
             typename Node::iterator arcFound=(*tail).findArc(&anArc);
             if(arcFound==(*tail).end())
                 return arc_end();
             else
                 return arc_iterator(*netpnt,tail,arcFound);
         }
 }}}

 Finally, since !ConnComp finds bi-connected components, why not call it
 !BiConnComp? :-)

 Best,
 Stefan

-- 
Ticket URL: <https://projects.coin-or.org/Cgc/ticket/4>
Coin Graph Classes <http://projects.coin-or.org/Cgc>
Coin Graph Classes



More information about the Cgc-tickets mailing list