COIN-OR::LEMON - Graph Library

Changeset 813:65144c52969c in lemon-0.x


Ignore:
Timestamp:
09/07/04 12:35:31 (15 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1109
Message:
  • maxEdgeId() and maxNodeId() now works as their names suggest.
  • maxEdgeId(), maxNodeId(), nodeNum() and edgeNum() are documented.
Location:
src/hugo
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/full_graph.h

    r798 r813  
    5959      : NodeNum(_g.nodeNum()), EdgeNum(NodeNum*NodeNum) { }
    6060   
    61     int nodeNum() const { return NodeNum; }  //FIXME: What is this?
    62     int edgeNum() const { return EdgeNum; }  //FIXME: What is this?
    63 
    64     int maxNodeId() const { return NodeNum; }  //FIXME: What is this?
    65     int maxEdgeId() const { return EdgeNum; }  //FIXME: What is this?
     61    ///Number of nodes.
     62    int nodeNum() const { return NodeNum; }
     63    ///Number of edges.
     64    int edgeNum() const { return EdgeNum; }
     65
     66    /// Maximum node ID.
     67   
     68    /// Maximum node ID.
     69    ///\sa id(Node)
     70    int maxNodeId() const { return NodeNum-1; }
     71    /// Maximum edge ID.
     72   
     73    /// Maximum edge ID.
     74    ///\sa id(Edge)
     75    int maxEdgeId() const { return EdgeNum-1; }
    6676
    6777    Node tail(Edge e) const { return e.n%NodeNum; }
     
    7787      e=InEdgeIt(*this,v); return e; }
    7888
     89    /// Node ID.
     90   
     91    /// The ID of a valid Node is a nonnegative integer not greater than
     92    /// \ref maxNodeId(). The range of the ID's is not surely continuous
     93    /// and the greatest node ID can be actually less then \ref maxNodeId().
     94    ///
     95    /// The ID of the \ref INVALID node is -1.
     96    ///\return The ID of the node \c v.
    7997    static int id(Node v) { return v.n; }
     98    /// Edge ID.
     99   
     100    /// The ID of a valid Edge is a nonnegative integer not greater than
     101    /// \ref maxEdgeId(). The range of the ID's is not surely continuous
     102    /// and the greatest edge ID can be actually less then \ref maxEdgeId().
     103    ///
     104    /// The ID of the \ref INVALID edge is -1.
     105    ///\return The ID of the edge \c e.
    80106    static int id(Edge e) { return e.n; }
    81107
  • src/hugo/list_graph.h

    r798 r813  
    9494        first_free_edge(_g.first_free_edge) {}
    9595   
    96     int nodeNum() const { return nodes.size(); }  //FIXME: What is this?
    97     int edgeNum() const { return edges.size(); }  //FIXME: What is this?
    98 
    99     ///Set the expected number of edges
     96    ///Number of nodes.
     97    int nodeNum() const { return nodes.size(); }
     98    ///Number of edges.
     99    int edgeNum() const { return edges.size(); }
     100
     101    ///Set the expected maximum number of edges.
    100102
    101103    ///With this function, it is possible to set the expected number of edges.
     
    104106    void reserveEdge(int n) { edges.reserve(n); };
    105107   
    106     ///\bug This function does something different than
    107     ///its name would suggests...
    108     int maxNodeId() const { return nodes.size(); }  //FIXME: What is this?
    109     ///\bug This function does something different than
    110     ///its name would suggests...
    111     int maxEdgeId() const { return edges.size(); }  //FIXME: What is this?
     108    /// Maximum node ID.
     109   
     110    /// Maximum node ID.
     111    ///\sa id(Node)
     112    int maxNodeId() const { return nodes.size()-1; }
     113    /// Maximum edge ID.
     114   
     115    /// Maximum edge ID.
     116    ///\sa id(Edge)
     117    int maxEdgeId() const { return edges.size()-1; }
    112118
    113119    Node tail(Edge e) const { return edges[e.n].tail; }
     
    123129      e=InEdgeIt(*this,v); return e; }
    124130
     131    /// Node ID.
     132   
     133    /// The ID of a valid Node is a nonnegative integer not greater than
     134    /// \ref maxNodeId(). The range of the ID's is not surely continuous
     135    /// and the greatest node ID can be actually less then \ref maxNodeId().
     136    ///
     137    /// The ID of the \ref INVALID node is -1.
     138    ///\return The ID of the node \c v.
    125139    static int id(Node v) { return v.n; }
     140    /// Edge ID.
     141   
     142    /// The ID of a valid Edge is a nonnegative integer not greater than
     143    /// \ref maxEdgeId(). The range of the ID's is not surely continuous
     144    /// and the greatest edge ID can be actually less then \ref maxEdgeId().
     145    ///
     146    /// The ID of the \ref INVALID edge is -1.
     147    ///\return The ID of the edge \c e.
    126148    static int id(Edge e) { return e.n; }
    127149
    128150    /// Adds a new node to the graph.
    129151
    130     /// \todo It adds the nodes in a reversed order.
     152    /// \warning It adds the new node to the front of the list.
    131153    /// (i.e. the lastly added node becomes the first.)
    132154    Node addNode() {
     
    521543        first_free_node(_g.first_free_node) {}
    522544   
    523     int nodeNum() const { return nodes.size(); }  //FIXME: What is this?
    524     int edgeNum() const { return 0; }  //FIXME: What is this?
    525 
    526     ///\bug This function does something different than
    527     ///its name would suggests...
    528     int maxNodeId() const { return nodes.size(); }  //FIXME: What is this?
    529     ///\bug This function does something different than
    530     ///its name would suggests...
    531     int maxEdgeId() const { return 0; }  //FIXME: What is this?
     545    ///Number of nodes.
     546    int nodeNum() const { return nodes.size(); }
     547    ///Number of edges.
     548    int edgeNum() const { return 0; }
     549
     550    /// Maximum node ID.
     551   
     552    /// Maximum node ID.
     553    ///\sa id(Node)
     554    int maxNodeId() const { return nodes.size()-1; }
     555    /// Maximum edge ID.
     556   
     557    /// Maximum edge ID.
     558    ///\sa id(Edge)
     559    int maxEdgeId() const { return 0; }
    532560
    533561    Node tail(Edge e) const { return INVALID; }
     
    543571      e=InEdgeIt(*this,v); return e; }
    544572
     573    /// Node ID.
     574   
     575    /// The ID of a valid Node is a nonnegative integer not greater than
     576    /// \ref maxNodeId(). The range of the ID's is not surely continuous
     577    /// and the greatest node ID can be actually less then \ref maxNodeId().
     578    ///
     579    /// The ID of the \ref INVALID node is -1.
     580    ///\return The ID of the node \c v.
    545581    int id(Node v) const { return v.n; }
     582    /// Edge ID.
     583   
     584    /// The ID of a valid Edge is a nonnegative integer not greater than
     585    /// \ref maxEdgeId(). The range of the ID's is not surely continuous
     586    /// and the greatest edge ID can be actually less then \ref maxEdgeId().
     587    ///
     588    /// The ID of the \ref INVALID edge is -1.
     589    ///\return The ID of the edge \c e.
    546590    int id(Edge e) const { return -1; }
    547591
    548592    /// Adds a new node to the graph.
    549593
    550     /// \todo It adds the nodes in a reversed order.
     594    /// \warning It adds the new node to the front of the list.
    551595    /// (i.e. the lastly added node becomes the first.)
    552596    Node addNode() {
     
    828872        first_free_edge(_g.first_free_edge) {}
    829873   
    830     int nodeNum() const { return G.nodeNum(); }  //FIXME: What is this?
    831     int edgeNum() const { return edges.size(); }  //FIXME: What is this?
    832 
    833     ///\bug This function does something different than
    834     ///its name would suggests...
    835     int maxNodeId() const { return G.maxNodeId(); }  //FIXME: What is this?
    836     ///\bug This function does something different than
    837     ///its name would suggests...
    838     int maxEdgeId() const { return edges.size(); }  //FIXME: What is this?
     874    ///Number of nodes.
     875    int nodeNum() const { return G.nodeNum(); }
     876    ///Number of edges.
     877    int edgeNum() const { return edges.size(); }
     878
     879    /// Maximum node ID.
     880   
     881    /// Maximum node ID.
     882    ///\sa id(Node)
     883    int maxNodeId() const { return G.maxNodeId(); }
     884    /// Maximum edge ID.
     885   
     886    /// Maximum edge ID.
     887    ///\sa id(Edge)
     888    int maxEdgeId() const { return edges.size()-1; }
    839889
    840890    Node tail(Edge e) const { return edges[e.n].tail; }
     
    850900      e=InEdgeIt(*this,v); return e; }
    851901
     902    /// Node ID.
     903   
     904    /// The ID of a valid Node is a nonnegative integer not greater than
     905    /// \ref maxNodeId(). The range of the ID's is not surely continuous
     906    /// and the greatest node ID can be actually less then \ref maxNodeId().
     907    ///
     908    /// The ID of the \ref INVALID node is -1.
     909    ///\return The ID of the node \c v.
     910    int id(Node v) { return G.id(v); }
     911    /// Edge ID.
     912   
     913    /// The ID of a valid Edge is a nonnegative integer not greater than
     914    /// \ref maxEdgeId(). The range of the ID's is not surely continuous
     915    /// and the greatest edge ID can be actually less then \ref maxEdgeId().
     916    ///
     917    /// The ID of the \ref INVALID edge is -1.
     918    ///\return The ID of the edge \c e.
    852919    int id(Edge e) const { return e.n; }
    853920
  • src/hugo/smart_graph.h

    r798 r813  
    8181    SmartGraph(const SmartGraph &_g) : nodes(_g.nodes), edges(_g.edges) { }
    8282   
    83     int nodeNum() const { return nodes.size(); }  //FIXME: What is this?
    84     int edgeNum() const { return edges.size(); }  //FIXME: What is this?
    85 
    86     ///\bug This function does something different than
    87     ///its name would suggests...
    88     int maxNodeId() const { return nodes.size(); }  //FIXME: What is this?
    89     ///\bug This function does something different than
    90     ///its name would suggests...
    91     int maxEdgeId() const { return edges.size(); }  //FIXME: What is this?
     83    ///Number of nodes.
     84    int nodeNum() const { return nodes.size(); }
     85    ///Number of edges.
     86    int edgeNum() const { return edges.size(); }
     87
     88    /// Maximum node ID.
     89   
     90    /// Maximum node ID.
     91    ///\sa id(Node)
     92    int maxNodeId() const { return nodes.size()-1; }
     93    /// Maximum edge ID.
     94   
     95    /// Maximum edge ID.
     96    ///\sa id(Edge)
     97    int maxEdgeId() const { return edges.size()-1; }
    9298
    9399    Node tail(Edge e) const { return edges[e.n].tail; }
     
    103109      e=InEdgeIt(*this,v); return e; }
    104110
     111    /// Node ID.
     112   
     113    /// The ID of a valid Node is a nonnegative integer not greater than
     114    /// \ref maxNodeId(). The range of the ID's is not surely continuous
     115    /// and the greatest node ID can be actually less then \ref maxNodeId().
     116    ///
     117    /// The ID of the \ref INVALID node is -1.
     118    ///\return The ID of the node \c v.
    105119    static int id(Node v) { return v.n; }
     120    /// Edge ID.
     121   
     122    /// The ID of a valid Edge is a nonnegative integer not greater than
     123    /// \ref maxEdgeId(). The range of the ID's is not surely continuous
     124    /// and the greatest edge ID can be actually less then \ref maxEdgeId().
     125    ///
     126    /// The ID of the \ref INVALID edge is -1.
     127    ///\return The ID of the edge \c e.
    106128    static int id(Edge e) { return e.n; }
    107129
Note: See TracChangeset for help on using the changeset viewer.