COIN-OR::LEMON - Graph Library

Changes in / [236:da953e387d31:240:bea328c5a8d3] in lemon-main


Ignore:
Location:
lemon
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • lemon/lgf_writer.h

    r236 r240  
    935935    bool local_os;
    936936
    937     Graph& _graph;
     937    const Graph& _graph;
    938938
    939939    std::string _nodes_caption;
  • lemon/list_graph.h

    r234 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
     
    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() {}
     
    11151117  protected:
    11161118
    1117     void changeTarget(Edge e, Node n) {
     1119    void changeV(Edge e, Node n) {
    11181120      if(arcs[2 * e.id].next_out != -1) {
    11191121        arcs[arcs[2 * e.id].next_out].prev_out = arcs[2 * e.id].prev_out;
     
    11361138    }
    11371139
    1138     void changeSource(Edge e, Node n) {
     1140    void changeU(Edge e, Node n) {
    11391141      if(arcs[(2 * e.id) | 1].next_out != -1) {
    11401142        arcs[arcs[(2 * e.id) | 1].next_out].prev_out =
     
    12591261    /// added to the graph.
    12601262    bool valid(Edge e) const { return Parent::valid(e); }
    1261     /// \brief Change the source of \c e to \c n
    1262     ///
    1263     /// This function changes the source of \c e to \c n.
    1264     ///
    1265     ///\note The <tt>ArcIt</tt>s and <tt>InArcIt</tt>s
    1266     ///referencing the changed arc remain
    1267     ///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.
    12681271    ///
    12691272    ///\warning This functionality cannot be used together with the
    12701273    ///Snapshot feature.
    1271     void changeSource(Edge e, Node n) {
    1272       Parent::changeSource(e,n);
    1273     }
    1274     /// \brief Change the target of \c e to \c n
    1275     ///
    1276     /// This function changes the target of \c e to \c n.
    1277     ///
    1278     /// \note The <tt>ArcIt</tt>s referencing the changed arc remain
    1279     /// 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.
    12801284    ///
    12811285    ///\warning This functionality cannot be used together with the
    12821286    ///Snapshot feature.
    1283     void changeTarget(Edge e, Node n) {
    1284       Parent::changeTarget(e,n);
    1285     }
    1286     /// \brief Change the source of \c e to \c n
    1287     ///
    1288     /// This function changes the source of \c e to \c n.
    1289     /// It also changes the proper node of the represented edge.
    1290     ///
    1291     ///\note The <tt>ArcIt</tt>s and <tt>InArcIt</tt>s
    1292     ///referencing the changed arc remain
    1293     ///valid. However <tt>OutArcIt</tt>s are invalidated.
    1294     ///
    1295     ///\warning This functionality cannot be used together with the
    1296     ///Snapshot feature.
    1297     void changeSource(Arc e, Node n) {
    1298       if (Parent::direction(e)) {
    1299         Parent::changeSource(e,n);
    1300       } else {
    1301         Parent::changeTarget(e,n);
    1302       }
    1303     }
    1304     /// \brief Change the target of \c e to \c n
    1305     ///
    1306     /// This function changes the target of \c e to \c n.
    1307     /// It also changes the proper node of the represented edge.
    1308     ///
    1309     ///\note The <tt>ArcIt</tt>s and <tt>OutArcIt</tt>s
    1310     ///referencing the changed arc remain
    1311     ///valid. However <tt>InArcIt</tt>s are invalidated.
    1312     ///
    1313     ///\warning This functionality cannot be used together with the
    1314     ///Snapshot feature.
    1315     void changeTarget(Arc e, Node n) {
    1316       if (Parent::direction(e)) {
    1317         Parent::changeTarget(e,n);
    1318       } else {
    1319         Parent::changeSource(e,n);
    1320       }
     1287    void changeV(Edge e, Node n) {
     1288      Parent::changeV(e,n);
    13211289    }
    13221290    /// \brief Contract two nodes.
     
    13381306        if (r && runningNode(e) == a) {
    13391307          erase(e);
    1340         } else if (source(e) == b) {
    1341           changeSource(e, a);
     1308        } else if (u(e) == b) {
     1309          changeU(e, a);
    13421310        } else {
    1343           changeTarget(e, a);
     1311          changeV(e, a);
    13441312        }
    13451313        e = f;
  • lemon/smart_graph.h

    r220 r238  
    466466
    467467    public:
    468       operator Edge() const { return edgeFromId(_id / 2); }
     468      operator Edge() const {
     469        return _id != -1 ? edgeFromId(_id / 2) : INVALID;
     470      }
    469471
    470472      Arc() {}
Note: See TracChangeset for help on using the changeset viewer.