lemon/core.h
changeset 232 e39056157d24
parent 229 aebc0161f6e5
child 233 28239207a8a3
equal deleted inserted replaced
1:a8d38ddf3153 2:eab500975184
  1382           }
  1382           }
  1383           splay(s);
  1383           splay(s);
  1384         } else {
  1384         } else {
  1385           _right.set(e, _right[arc]);
  1385           _right.set(e, _right[arc]);
  1386           _parent.set(_right[arc], e);
  1386           _parent.set(_right[arc], e);
       
  1387           _parent.set(e, _parent[arc]);
  1387 
  1388 
  1388           if (_parent[arc] != INVALID) {
  1389           if (_parent[arc] != INVALID) {
  1389             if (_left[_parent[arc]] == arc) {
  1390             if (_left[_parent[arc]] == arc) {
  1390               _left.set(_parent[arc], e);
  1391               _left.set(_parent[arc], e);
  1391             } else {
  1392             } else {
  1512     ///\return An arc from \c s to \c t if there exists,
  1513     ///\return An arc from \c s to \c t if there exists,
  1513     ///\ref INVALID otherwise.
  1514     ///\ref INVALID otherwise.
  1514     Arc operator()(Node s, Node t) const
  1515     Arc operator()(Node s, Node t) const
  1515     {
  1516     {
  1516       Arc a = _head[s];
  1517       Arc a = _head[s];
       
  1518       if (a == INVALID) return INVALID;
  1517       while (true) {
  1519       while (true) {
  1518         if (_g.target(a) == t) {
  1520         if (_g.target(a) == t) {
  1519           const_cast<DynArcLookUp&>(*this).splay(a);
  1521           const_cast<DynArcLookUp&>(*this).splay(a);
  1520           return a;
  1522           return a;
  1521         } else if (t < _g.target(a)) {
  1523         } else if (t < _g.target(a)) {
  1546     ///\return An arc from \c s to \c t if there exists, \ref INVALID
  1548     ///\return An arc from \c s to \c t if there exists, \ref INVALID
  1547     /// otherwise.
  1549     /// otherwise.
  1548     Arc findFirst(Node s, Node t) const
  1550     Arc findFirst(Node s, Node t) const
  1549     {
  1551     {
  1550       Arc a = _head[s];
  1552       Arc a = _head[s];
       
  1553       if (a == INVALID) return INVALID;
  1551       Arc r = INVALID;
  1554       Arc r = INVALID;
  1552       while (true) {
  1555       while (true) {
  1553         if (_g.target(a) < t) {
  1556         if (_g.target(a) < t) {
  1554           if (_right[a] == INVALID) {
  1557           if (_right[a] == INVALID) {
  1555             const_cast<DynArcLookUp&>(*this).splay(a);
  1558             const_cast<DynArcLookUp&>(*this).splay(a);