src/work/alpar/list_graph.h
changeset 401 2d0cccf7cc94
parent 400 cb377609cf1d
child 404 d888ca4e6c00
     1.1 --- a/src/work/alpar/list_graph.h	Sun Apr 25 20:16:16 2004 +0000
     1.2 +++ b/src/work/alpar/list_graph.h	Sun Apr 25 22:26:19 2004 +0000
     1.3 @@ -15,7 +15,7 @@
     1.4  
     1.5    class SymListGraph;
     1.6  
     1.7 -  ///A smart graph class.
     1.8 +  ///A list graph class.
     1.9  
    1.10    ///This is a simple and fast erasable graph implementation.
    1.11    ///
    1.12 @@ -723,13 +723,18 @@
    1.13    };
    1.14    
    1.15  
    1.16 -  ///A smart graph class.
    1.17 +  ///A graph class containing only nodes.
    1.18  
    1.19 -  ///This is a simple and fast erasable graph implementation.
    1.20 +  ///This class implements a graph structure without edges.
    1.21 +  ///The most useful application of this class is to be the node set of an
    1.22 +  ///\ref EdgeSet class.
    1.23    ///
    1.24    ///It conforms to the graph interface documented under
    1.25 -  ///the description of \ref GraphSkeleton.
    1.26 -  ///\sa \ref GraphSkeleton.
    1.27 +  ///the description of \ref GraphSkeleton with the exception that you cannot
    1.28 +  ///add (or delete) edges. The usual edge iterators are exists, but they are
    1.29 +  ///always \ref INVALID.
    1.30 +  ///\sa \ref GraphSkeleton
    1.31 +  ///\se \ref EdgeSet
    1.32    class NodeSet {
    1.33  
    1.34      //Nodes are double linked.
    1.35 @@ -1114,11 +1119,20 @@
    1.36  
    1.37  
    1.38  
    1.39 -  ///This is a simple and fast erasable graph implementation.
    1.40 +  ///Graph structure using a node set of another graph.
    1.41 +
    1.42 +  ///This structure can be used to establish another graph over a node set
    1.43 +  /// of an existing one. The node iterator will go through the nodes of the
    1.44 +  /// original graph, and the NodeMap's of both graphs will convert to
    1.45 +  /// each other.
    1.46 +  ///
    1.47 +  ///\param GG The type of the graph which shares its node set with this class.
    1.48 +  ///Its interface must conform with \ref GraphSkeleton.
    1.49    ///
    1.50    ///It conforms to the graph interface documented under
    1.51    ///the description of \ref GraphSkeleton.
    1.52    ///\sa \ref GraphSkeleton.
    1.53 +  ///\sa \ref NodeSet.
    1.54    template<typename GG>
    1.55    class EdgeSet {
    1.56  
    1.57 @@ -1191,11 +1205,11 @@
    1.58      
    1.59    public:
    1.60  
    1.61 -    EdgeSet(const NodeGraphType &_G) : G(_G),
    1.62 -				       nodes(_G), edges(),
    1.63 -				       first_free_edge(-1) {}
    1.64 +    EdgeSet(NodeGraphType &_G) : G(_G),
    1.65 +				 nodes(_G), edges(),
    1.66 +				 first_free_edge(-1) { }
    1.67      EdgeSet(const EdgeSet &_g) : G(_g.G), nodes(_g.G), edges(_g.edges),
    1.68 -				 first_free_edge(_g.first_free_edge) {}
    1.69 +				 first_free_edge(_g.first_free_edge) { }
    1.70      
    1.71      ~EdgeSet()
    1.72      {
    1.73 @@ -1287,15 +1301,15 @@
    1.74  	first_free_edge = edges[n].next_in;
    1.75        }
    1.76        
    1.77 -      edges[n].tail = u.n; edges[n].head = v.n;
    1.78 +      edges[n].tail = u; edges[n].head = v;
    1.79  
    1.80 -      edges[n].next_out = nodes[u.n].first_out;
    1.81 -      if(nodes[u.n].first_out != -1) edges[nodes[u.n].first_out].prev_out = n;
    1.82 -      edges[n].next_in = nodes[v.n].first_in;
    1.83 -      if(nodes[v.n].first_in != -1) edges[nodes[v.n].first_in].prev_in = n;
    1.84 +      edges[n].next_out = nodes[u].first_out;
    1.85 +      if(nodes[u].first_out != -1) edges[nodes[u].first_out].prev_out = n;
    1.86 +      edges[n].next_in = nodes[v].first_in;
    1.87 +      if(nodes[v].first_in != -1) edges[nodes[v].first_in].prev_in = n;
    1.88        edges[n].prev_in = edges[n].prev_out = -1;
    1.89  	
    1.90 -      nodes[u.n].first_out = nodes[v.n].first_in = n;
    1.91 +      nodes[u].first_out = nodes[v].first_in = n;
    1.92  
    1.93        Edge e; e.n=n;
    1.94  
    1.95 @@ -1373,7 +1387,7 @@
    1.96      public:
    1.97        NodeIt() : NodeGraphType::NodeIt() { }
    1.98        NodeIt (Invalid i) : NodeGraphType::NodeIt(i) {}
    1.99 -      NodeIt(const EdgeSet& _G) : NodeGraphType::Node(_G.G) { }
   1.100 +      NodeIt(const EdgeSet& _G) : NodeGraphType::NodeIt(_G.G) { }
   1.101        NodeIt(const typename NodeGraphType::NodeIt &n)
   1.102  	: NodeGraphType::NodeIt(n) {}
   1.103        operator Node() { return Node(*this);}
   1.104 @@ -1451,7 +1465,7 @@
   1.105  
   1.106        ///\todo It can copy between different types.
   1.107        ///
   1.108 -      template<typename TT> friend class NodeMap;
   1.109 +      template<typename TT>
   1.110        NodeMap(const typename NodeGraphType::NodeMap<TT> &m)
   1.111  	: NodeGraphType::NodeMap<T>(m) { }
   1.112      };