lemon/full_graph.h
changeset 1979 c2992fd74dad
parent 1956 a055123339d5
child 1986 9b56cca61e2e
     1.1 --- a/lemon/full_graph.h	Wed Feb 22 12:45:59 2006 +0000
     1.2 +++ b/lemon/full_graph.h	Wed Feb 22 18:26:56 2006 +0000
     1.3 @@ -22,11 +22,9 @@
     1.4  #include <cmath>
     1.5  
     1.6  
     1.7 -#include <lemon/bits/iterable_graph_extender.h>
     1.8 -#include <lemon/bits/alteration_notifier.h>
     1.9 -#include <lemon/bits/static_map.h>
    1.10  #include <lemon/bits/graph_extender.h>
    1.11  
    1.12 +
    1.13  #include <lemon/invalid.h>
    1.14  #include <lemon/utility.h>
    1.15  
    1.16 @@ -191,10 +189,7 @@
    1.17  
    1.18    };
    1.19  
    1.20 -  typedef StaticMappableGraphExtender<
    1.21 -    IterableGraphExtender<
    1.22 -    AlterableGraphExtender<
    1.23 -    GraphExtender<FullGraphBase> > > > ExtendedFullGraphBase;
    1.24 +  typedef GraphExtender<FullGraphBase> ExtendedFullGraphBase;
    1.25  
    1.26    /// \ingroup graphs
    1.27    ///
    1.28 @@ -211,7 +206,21 @@
    1.29    class FullGraph : public ExtendedFullGraphBase {
    1.30    public:
    1.31  
    1.32 +    typedef ExtendedFullGraphBase Parent;
    1.33 +
    1.34 +    /// \brief Constructor
    1.35 +    ///
    1.36      FullGraph(int n) { construct(n); }
    1.37 +
    1.38 +    /// \brief Resize the graph
    1.39 +    ///
    1.40 +    void resize(int n) {
    1.41 +      Parent::getNotifier(Edge()).clear();
    1.42 +      Parent::getNotifier(Node()).clear();
    1.43 +      construct(n);
    1.44 +      Parent::getNotifier(Node()).build();
    1.45 +      Parent::getNotifier(Edge()).build();
    1.46 +    }
    1.47    };
    1.48  
    1.49  
    1.50 @@ -379,10 +388,8 @@
    1.51  
    1.52    };
    1.53  
    1.54 -  typedef StaticMappableUGraphExtender<
    1.55 -    IterableUGraphExtender<
    1.56 -    AlterableUGraphExtender<
    1.57 -    UGraphExtender<FullUGraphBase> > > > ExtendedFullUGraphBase;
    1.58 +  typedef UGraphExtender<UGraphBaseExtender<FullUGraphBase> > 
    1.59 +  ExtendedFullUGraphBase;
    1.60  
    1.61    /// \ingroup graphs
    1.62    ///
    1.63 @@ -401,7 +408,23 @@
    1.64    /// \author Balazs Dezso
    1.65    class FullUGraph : public ExtendedFullUGraphBase {
    1.66    public:
    1.67 +
    1.68 +    typedef ExtendedFullUGraphBase Parent;
    1.69 +
    1.70 +    /// \brief Constructor
    1.71      FullUGraph(int n) { construct(n); }
    1.72 +
    1.73 +    /// \brief Resize the graph
    1.74 +    ///
    1.75 +    void resize(int n) {
    1.76 +      Parent::getNotifier(Edge()).clear();
    1.77 +      Parent::getNotifier(UEdge()).clear();
    1.78 +      Parent::getNotifier(Node()).clear();
    1.79 +      construct(n);
    1.80 +      Parent::getNotifier(Node()).build();
    1.81 +      Parent::getNotifier(UEdge()).build();
    1.82 +      Parent::getNotifier(Edge()).build();
    1.83 +    }
    1.84    };
    1.85  
    1.86  
    1.87 @@ -577,12 +600,8 @@
    1.88    };
    1.89  
    1.90  
    1.91 -  typedef StaticMappableBpUGraphExtender<
    1.92 -    IterableBpUGraphExtender<
    1.93 -    AlterableBpUGraphExtender<
    1.94 -    BpUGraphExtender <
    1.95 -    FullBpUGraphBase> > > >
    1.96 -  ExtendedFullBpUGraphBase;
    1.97 +  typedef BpUGraphExtender< BpUGraphBaseExtender<
    1.98 +    FullBpUGraphBase> > ExtendedFullBpUGraphBase;
    1.99  
   1.100  
   1.101    /// \ingroup graphs
   1.102 @@ -599,10 +618,23 @@
   1.103    class FullBpUGraph : 
   1.104      public ExtendedFullBpUGraphBase {
   1.105    public:
   1.106 +
   1.107      typedef ExtendedFullBpUGraphBase Parent;
   1.108 +
   1.109      FullBpUGraph(int aNodeNum, int bNodeNum) {
   1.110        Parent::construct(aNodeNum, bNodeNum);
   1.111      }
   1.112 +    /// \brief Resize the graph
   1.113 +    ///
   1.114 +    void resize(int n, int m) {
   1.115 +      Parent::getNotifier(Edge()).clear();
   1.116 +      Parent::getNotifier(UEdge()).clear();
   1.117 +      Parent::getNotifier(Node()).clear();
   1.118 +      construct(n, m);
   1.119 +      Parent::getNotifier(Node()).build();
   1.120 +      Parent::getNotifier(UEdge()).build();
   1.121 +      Parent::getNotifier(Edge()).build();
   1.122 +    }
   1.123    };
   1.124  
   1.125  } //namespace lemon