lemon/full_graph.h
changeset 937 17e36e175725
parent 582 7a28e215f715
child 735 853fcddcf282
child 778 a143f19f465b
equal deleted inserted replaced
5:836621934b40 6:2043d91a056f
    29 namespace lemon {
    29 namespace lemon {
    30 
    30 
    31   class FullDigraphBase {
    31   class FullDigraphBase {
    32   public:
    32   public:
    33 
    33 
    34     typedef FullDigraphBase Graph;
    34     typedef FullDigraphBase Digraph;
    35 
    35 
    36     class Node;
    36     class Node;
    37     class Arc;
    37     class Arc;
    38 
    38 
    39   protected:
    39   protected:
   167   /// moreover \c FullGraph does not contain a loop arc for each
   167   /// moreover \c FullGraph does not contain a loop arc for each
   168   /// node as \c FullDigraph does.
   168   /// node as \c FullDigraph does.
   169   ///
   169   ///
   170   /// \sa FullGraph
   170   /// \sa FullGraph
   171   class FullDigraph : public ExtendedFullDigraphBase {
   171   class FullDigraph : public ExtendedFullDigraphBase {
       
   172     typedef ExtendedFullDigraphBase Parent;
       
   173 
   172   public:
   174   public:
   173 
       
   174     typedef ExtendedFullDigraphBase Parent;
       
   175 
   175 
   176     /// \brief Constructor
   176     /// \brief Constructor
   177     FullDigraph() { construct(0); }
   177     FullDigraph() { construct(0); }
   178 
   178 
   179     /// \brief Constructor
   179     /// \brief Constructor
   224     int arcNum() const { return Parent::arcNum(); }
   224     int arcNum() const { return Parent::arcNum(); }
   225   };
   225   };
   226 
   226 
   227 
   227 
   228   class FullGraphBase {
   228   class FullGraphBase {
   229     int _node_num;
       
   230     int _edge_num;
       
   231   public:
   229   public:
   232 
   230 
   233     typedef FullGraphBase Graph;
   231     typedef FullGraphBase Graph;
   234 
   232 
   235     class Node;
   233     class Node;
   236     class Arc;
   234     class Arc;
   237     class Edge;
   235     class Edge;
   238 
   236 
   239   protected:
   237   protected:
       
   238 
       
   239     int _node_num;
       
   240     int _edge_num;
   240 
   241 
   241     FullGraphBase() {}
   242     FullGraphBase() {}
   242 
   243 
   243     void construct(int n) { _node_num = n; _edge_num = n * (n - 1) / 2; }
   244     void construct(int n) { _node_num = n; _edge_num = n * (n - 1) / 2; }
   244 
   245 
   535   /// moreover \c FullGraph does not contain a loop arc for each
   536   /// moreover \c FullGraph does not contain a loop arc for each
   536   /// node as \c FullDigraph does.
   537   /// node as \c FullDigraph does.
   537   ///
   538   ///
   538   /// \sa FullDigraph
   539   /// \sa FullDigraph
   539   class FullGraph : public ExtendedFullGraphBase {
   540   class FullGraph : public ExtendedFullGraphBase {
       
   541     typedef ExtendedFullGraphBase Parent;
       
   542 
   540   public:
   543   public:
   541 
       
   542     typedef ExtendedFullGraphBase Parent;
       
   543 
   544 
   544     /// \brief Constructor
   545     /// \brief Constructor
   545     FullGraph() { construct(0); }
   546     FullGraph() { construct(0); }
   546 
   547 
   547     /// \brief Constructor
   548     /// \brief Constructor