COIN-OR::LEMON - Graph Library

Changeset 2111:ea1fa1bc3f6d in lemon-0.x for lemon/list_graph.h


Ignore:
Timestamp:
06/28/06 17:06:24 (13 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2817
Message:

Removing concepts for extendable and erasable graphs
Renaming StaticGraph? to Graph

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/list_graph.h

    r2107 r2111  
    275275
    276276  protected:
    277     void _changeTarget(Edge e, Node n)
     277    void changeTarget(Edge e, Node n)
    278278    {
    279279      if(edges[e.id].next_in != -1)
     
    290290      nodes[n.id].first_in = e.id;
    291291    }
    292     void _changeSource(Edge e, Node n)
     292    void changeSource(Edge e, Node n)
    293293    {
    294294      if(edges[e.id].next_out != -1)
     
    317317  ///This is a simple and fast erasable graph implementation.
    318318  ///
    319   ///It conforms to the
    320   ///\ref concept::ErasableGraph "ErasableGraph" concept and
    321   ///it also provides several additional useful extra functionalities.
    322   ///\sa concept::ErasableGraph.
     319  ///It conforms to the \ref concept::Graph "Graph" concept and it
     320  ///also provides several additional useful extra functionalities.
     321  ///The most of the member functions and nested classes are
     322  ///documented only in the concept class.
     323  ///\sa concept::Graph.
    323324
    324325  class ListGraph : public ExtendedListGraphBase {
     
    326327
    327328    typedef ExtendedListGraphBase Parent;
     329
     330    ///Add a new node to the graph.
     331   
     332    /// \return the new node.
     333    ///
     334    Node addNode() { return Parent::addNode(); }
     335
     336    ///Add a new edge to the graph.
     337   
     338    ///Add a new edge to the graph with source node \c s
     339    ///and target node \c t.
     340    ///\return the new edge.
     341    Edge addEdge(const Node& s, const Node& t) {
     342      return Parent::addEdge(s, t);
     343    }
    328344
    329345    /// Changes the target of \c e to \c n
     
    335351    ///valid. However <tt>InEdge</tt>s are invalidated.
    336352    void changeTarget(Edge e, Node n) {
    337       _changeTarget(e,n);
     353      Parent::changeTarget(e,n);
    338354    }
    339355    /// Changes the source of \c e to \c n
     
    345361    ///valid. However <tt>OutEdge</tt>s are invalidated.
    346362    void changeSource(Edge e, Node n) {
    347       _changeSource(e,n);
     363      Parent::changeSource(e,n);
    348364    }
    349365
     
    355371    void reverseEdge(Edge e) {
    356372      Node t=target(e);
    357       _changeTarget(e,source(e));
    358       _changeSource(e,t);
    359     }
    360 
    361     ///Using this it is possible to avoid the superfluous memory
    362     ///allocation.
     373      changeTarget(e,source(e));
     374      changeSource(e,t);
     375    }
     376
     377    /// \brief Using this it is possible to avoid the superfluous memory
     378    /// allocation.
    363379
    364380    ///Using this it is possible to avoid the superfluous memory
     
    368384    void reserveNode(int n) { nodes.reserve(n); };
    369385
    370     ///Using this it is possible to avoid the superfluous memory
    371     ///allocation.
     386    /// \brief Using this it is possible to avoid the superfluous memory
     387    /// allocation.
    372388
    373389    ///Using this it is possible to avoid the superfluous memory
     
    599615  public:
    600616    typedef ExtendedListUGraphBase Parent;
     617    /// \brief Add a new node to the graph.
     618    ///
     619    /// \return the new node.
     620    ///
     621    Node addNode() { return Parent::addNode(); }
     622
     623    /// \brief Add a new edge to the graph.
     624    ///
     625    /// Add a new edge to the graph with source node \c s
     626    /// and target node \c t.
     627    /// \return the new undirected edge.
     628    UEdge addEdge(const Node& s, const Node& t) {
     629      return Parent::addEdge(s, t);
     630    }
    601631    /// \brief Changes the target of \c e to \c n
    602632    ///
     
    607637    /// valid. However <tt>InEdge</tt>'s are invalidated.
    608638    void changeTarget(UEdge e, Node n) {
    609       _changeTarget(e,n);
     639      Parent::changeTarget(e,n);
    610640    }
    611641    /// Changes the source of \c e to \c n
     
    617647    ///valid. However <tt>OutEdge</tt>'s are invalidated.
    618648    void changeSource(UEdge e, Node n) {
    619       _changeSource(e,n);
     649      Parent::changeSource(e,n);
    620650    }
    621651    /// \brief Contract two nodes.
Note: See TracChangeset for help on using the changeset viewer.