src/work/marci/graph_concept.h
changeset 565 18787f6db0db
parent 333 e0a80761dfd9
child 651 a56e043aeab1
equal deleted inserted replaced
2:ff5adcda976f 3:81bef1fc208e
   107       bool operator==(Edge n) const { return true; }
   107       bool operator==(Edge n) const { return true; }
   108       bool operator!=(Edge n) const { return true; }
   108       bool operator!=(Edge n) const { return true; }
   109       bool operator<(Edge n) const { return true; }
   109       bool operator<(Edge n) const { return true; }
   110     };
   110     };
   111     
   111     
   112     /// This iterator goes trough the outgoing edges of a node.
       
   113 
       
   114     /// This iterator goes trough the \e outgoing edges of a certain node
       
   115     /// of a graph.
       
   116     /// Its usage is quite simple, for example you can count the number
       
   117     /// of outgoing edges of a node \c n
       
   118     /// in graph \c G of type \c Graph as follows.
       
   119     /// \code
       
   120     ///int count=0;
       
   121     ///for(Graph::OutEdgeIt e(G,n);G.valid(e);G.next(e)) count++;
       
   122     /// \endcode
       
   123     
       
   124     class OutEdgeIt : public Edge {
       
   125     public:
       
   126       /// @warning The default constructor sets the iterator
       
   127       /// to an undefined value.
       
   128       OutEdgeIt() {}
       
   129       /// Initialize the iterator to be invalid
       
   130       OutEdgeIt(Invalid) {}
       
   131       /// This constructor sets the iterator to first outgoing edge.
       
   132     
       
   133       /// This constructor set the iterator to the first outgoing edge of
       
   134       /// node
       
   135       ///@param n the node
       
   136       ///@param G the graph
       
   137       OutEdgeIt(const GraphSkeleturo & G, Node n) {}
       
   138     };
       
   139 
       
   140     /// This iterator goes trough the incoming edges of a node.
       
   141 
       
   142     /// This iterator goes trough the \e incoming edges of a certain node
       
   143     /// of a graph.
       
   144     /// Its usage is quite simple, for example you can count the number
       
   145     /// of outgoing edges of a node \c n
       
   146     /// in graph \c G of type \c Graph as follows.
       
   147     /// \code
       
   148     ///int count=0;
       
   149     ///for(Graph::InEdgeIt e(G,n);G.valid(e);G.next(e)) count++;
       
   150     /// \endcode
       
   151 
       
   152     class InEdgeIt : public Edge {
       
   153     public:
       
   154       /// @warning The default constructor sets the iterator
       
   155       /// to an undefined value.
       
   156       InEdgeIt() {}
       
   157       /// Initialize the iterator to be invalid
       
   158       InEdgeIt(Invalid) {}
       
   159       InEdgeIt(const GraphSkeleturo &, Node) {}    
       
   160     };
       
   161     //  class SymEdgeIt : public Edge {};
   112     //  class SymEdgeIt : public Edge {};
   162 
   113 
   163     /// This iterator goes through each edge.
   114     /// This iterator goes through each edge.
   164 
   115 
   165     /// This iterator goes through each edge of a graph.
   116     /// This iterator goes through each edge of a graph.
   362     GraphSkeleturo() {}
   313     GraphSkeleturo() {}
   363     ///Copy consructor.
   314     ///Copy consructor.
   364     GraphSkeleturo(const GraphSkeleturo &G) {}
   315     GraphSkeleturo(const GraphSkeleturo &G) {}
   365   };
   316   };
   366 
   317 
       
   318   /// An empty out-edge-iterable graph class.
       
   319   
       
   320   /// An empty graph class which provides a function to 
       
   321   /// iterate on out-edges of any node.
       
   322   class OutEdgeIterableGraphSkeleturo : public GraphSkeleturo
       
   323   {
       
   324   public:
       
   325 
       
   326     /// This iterator goes trough the outgoing edges of a node.
       
   327 
       
   328     /// This iterator goes trough the \e outgoing edges of a certain node
       
   329     /// of a graph.
       
   330     /// Its usage is quite simple, for example you can count the number
       
   331     /// of outgoing edges of a node \c n
       
   332     /// in graph \c G of type \c Graph as follows.
       
   333     /// \code
       
   334     ///int count=0;
       
   335     ///for(Graph::OutEdgeIt e(G,n); G.valid(e); G.next(e)) ++count;
       
   336     /// \endcode
       
   337     class OutEdgeIt : public Edge {
       
   338     public:
       
   339       /// @warning The default constructor sets the iterator
       
   340       /// to an undefined value.
       
   341       OutEdgeIt() {}
       
   342       /// Initialize the iterator to be invalid
       
   343       OutEdgeIt(Invalid) {}
       
   344       /// This constructor sets the iterator to first outgoing edge.
       
   345     
       
   346       /// This constructor set the iterator to the first outgoing edge of
       
   347       /// node
       
   348       ///@param n the node
       
   349       ///@param G the graph
       
   350       OutEdgeIt(const GraphSkeleturo & G, Node n) {}
       
   351     };
       
   352   };
       
   353 
       
   354   /// An empty in-edge-iterable graph class.
       
   355   
       
   356   /// An empty graph class which provides a function to 
       
   357   /// iterate on in-edges of any node.
       
   358   class InEdgeIterableGraphSkeleturo : public GraphSkeleturo
       
   359   {
       
   360   public:
       
   361 
       
   362     /// This iterator goes trough the incoming edges of a node.
       
   363 
       
   364     /// This iterator goes trough the \e incoming edges of a certain node
       
   365     /// of a graph.
       
   366     /// Its usage is quite simple, for example you can count the number
       
   367     /// of incoming edges of a node \c n
       
   368     /// in graph \c G of type \c Graph as follows.
       
   369     /// \code
       
   370     ///int count=0;
       
   371     ///for(Graph::InEdgeIt e(G,n); G.valid(e); G.next(e)) ++count;
       
   372     /// \endcode
       
   373     class InEdgeIt : public Edge {
       
   374     public:
       
   375       /// @warning The default constructor sets the iterator
       
   376       /// to an undefined value.
       
   377       InEdgeIt() {}
       
   378       /// Initialize the iterator to be invalid
       
   379       InEdgeIt(Invalid) {}
       
   380       /// This constructor sets the iterator to first incomig edge.
       
   381     
       
   382       /// This constructor set the iterator to the first incomig edge of
       
   383       /// node
       
   384       ///@param n the node
       
   385       ///@param G the graph
       
   386       InEdgeIt(const GraphSkeleturo & G, Node n) {}
       
   387     };
       
   388   };
       
   389 
       
   390 
   367   /// An empty node-eraseable graph class.
   391   /// An empty node-eraseable graph class.
   368   
   392   
   369   /// An empty graph class which provides a function to 
   393   /// An empty graph class which provides a function to 
   370   /// delete any of its nodes.
   394   /// delete any of its nodes.
   371   class NodeEraseableGraphSkeleturo : public GraphSkeleturo
   395   class NodeEraseableGraphSkeleturo : public GraphSkeleturo