COIN-OR::LEMON - Graph Library

Changeset 239:7b7e3f20bcec in lemon


Ignore:
Timestamp:
07/29/08 14:54:08 (16 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Parents:
238:79643f6e8c52 (diff), 235:b46d2787e9c2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Message:

Merge

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lemon/list_graph.h

    r235 r239  
    843843
    844844    public:
    845       operator Edge() const { return edgeFromId(id / 2); }
     845      operator Edge() const {
     846        return id != -1 ? edgeFromId(id / 2) : INVALID;
     847      }
    846848
    847849      Arc() {}
  • lemon/list_graph.h

    r238 r239  
    396396    bool valid(Arc a) const { return Parent::valid(a); }
    397397
    398     /// Change the target of \c e to \c n
    399 
    400     /// Change the target of \c e to \c n
     398    /// Change the target of \c a to \c n
     399
     400    /// Change the target of \c a to \c n
    401401    ///
    402402    ///\note The <tt>ArcIt</tt>s and <tt>OutArcIt</tt>s referencing
     
    406406    ///\warning This functionality cannot be used together with the Snapshot
    407407    ///feature.
    408     void changeTarget(Arc e, Node n) {
    409       Parent::changeTarget(e,n);
    410     }
    411     /// Change the source of \c e to \c n
    412 
    413     /// Change the source of \c e to \c n
    414     ///
    415     ///\note The <tt>ArcIt</tt>s and <tt>InArcIt</tt>s referencing
    416     ///the changed arc remain valid. However <tt>OutArcIt</tt>s are
     408    void changeTarget(Arc a, Node n) {
     409      Parent::changeTarget(a,n);
     410    }
     411    /// Change the source of \c a to \c n
     412
     413    /// Change the source of \c a to \c n
     414    ///
     415    ///\note The <tt>InArcIt</tt>s referencing the changed arc remain
     416    ///valid. However the <tt>ArcIt<tt>s and <tt>OutArcIt</tt>s are
    417417    ///invalidated.
    418418    ///
    419419    ///\warning This functionality cannot be used together with the Snapshot
    420420    ///feature.
    421     void changeSource(Arc e, Node n) {
    422       Parent::changeSource(e,n);
     421    void changeSource(Arc a, Node n) {
     422      Parent::changeSource(a,n);
    423423    }
    424424
     
    11171117  protected:
    11181118
    1119     void changeTarget(Edge e, Node n) {
     1119    void changeV(Edge e, Node n) {
    11201120      if(arcs[2 * e.id].next_out != -1) {
    11211121        arcs[arcs[2 * e.id].next_out].prev_out = arcs[2 * e.id].prev_out;
     
    11381138    }
    11391139
    1140     void changeSource(Edge e, Node n) {
     1140    void changeU(Edge e, Node n) {
    11411141      if(arcs[(2 * e.id) | 1].next_out != -1) {
    11421142        arcs[arcs[(2 * e.id) | 1].next_out].prev_out =
     
    12611261    /// added to the graph.
    12621262    bool valid(Edge e) const { return Parent::valid(e); }
    1263     /// \brief Change the source of \c e to \c n
    1264     ///
    1265     /// This function changes the source of \c e to \c n.
    1266     ///
    1267     ///\note The <tt>ArcIt</tt>s and <tt>InArcIt</tt>s
    1268     ///referencing the changed arc remain
    1269     ///valid. However <tt>OutArcIt</tt>s are invalidated.
     1263    /// \brief Change the end \c u of \c e to \c n
     1264    ///
     1265    /// This function changes the end \c u of \c e to node \c n.
     1266    ///
     1267    ///\note The <tt>EdgeIt</tt>s and <tt>ArcIt</tt>s referencing the
     1268    ///changed edge are invalidated and if the changed node is the
     1269    ///base node of an iterator then this iterator is also
     1270    ///invalidated.
    12701271    ///
    12711272    ///\warning This functionality cannot be used together with the
    12721273    ///Snapshot feature.
    1273     void changeSource(Edge e, Node n) {
    1274       Parent::changeSource(e,n);
    1275     }
    1276     /// \brief Change the target of \c e to \c n
    1277     ///
    1278     /// This function changes the target of \c e to \c n.
    1279     ///
    1280     /// \note The <tt>ArcIt</tt>s referencing the changed arc remain
    1281     /// valid. However the other iterators may be invalidated.
     1274    void changeU(Edge e, Node n) {
     1275      Parent::changeU(e,n);
     1276    }
     1277    /// \brief Change the end \c v of \c e to \c n
     1278    ///
     1279    /// This function changes the end \c v of \c e to \c n.
     1280    ///
     1281    ///\note The <tt>EdgeIt</tt>s referencing the changed edge remain
     1282    ///valid, however <tt>ArcIt</tt>s and if the changed node is the
     1283    ///base node of an iterator then this iterator is invalidated.
    12821284    ///
    12831285    ///\warning This functionality cannot be used together with the
    12841286    ///Snapshot feature.
    1285     void changeTarget(Edge e, Node n) {
    1286       Parent::changeTarget(e,n);
    1287     }
    1288     /// \brief Change the source of \c e to \c n
    1289     ///
    1290     /// This function changes the source of \c e to \c n.
    1291     /// It also changes the proper node of the represented edge.
    1292     ///
    1293     ///\note The <tt>ArcIt</tt>s and <tt>InArcIt</tt>s
    1294     ///referencing the changed arc remain
    1295     ///valid. However <tt>OutArcIt</tt>s are invalidated.
    1296     ///
    1297     ///\warning This functionality cannot be used together with the
    1298     ///Snapshot feature.
    1299     void changeSource(Arc e, Node n) {
    1300       if (Parent::direction(e)) {
    1301         Parent::changeSource(e,n);
    1302       } else {
    1303         Parent::changeTarget(e,n);
    1304       }
    1305     }
    1306     /// \brief Change the target of \c e to \c n
    1307     ///
    1308     /// This function changes the target of \c e to \c n.
    1309     /// It also changes the proper node of the represented edge.
    1310     ///
    1311     ///\note The <tt>ArcIt</tt>s and <tt>OutArcIt</tt>s
    1312     ///referencing the changed arc remain
    1313     ///valid. However <tt>InArcIt</tt>s are invalidated.
    1314     ///
    1315     ///\warning This functionality cannot be used together with the
    1316     ///Snapshot feature.
    1317     void changeTarget(Arc e, Node n) {
    1318       if (Parent::direction(e)) {
    1319         Parent::changeTarget(e,n);
    1320       } else {
    1321         Parent::changeSource(e,n);
    1322       }
     1287    void changeV(Edge e, Node n) {
     1288      Parent::changeV(e,n);
    13231289    }
    13241290    /// \brief Contract two nodes.
     
    13401306        if (r && runningNode(e) == a) {
    13411307          erase(e);
    1342         } else if (source(e) == b) {
    1343           changeSource(e, a);
     1308        } else if (u(e) == b) {
     1309          changeU(e, a);
    13441310        } else {
    1345           changeTarget(e, a);
     1311          changeV(e, a);
    13461312        }
    13471313        e = f;
Note: See TracChangeset for help on using the changeset viewer.