lemon/adaptors.h
changeset 956 141f9c0db4a3
parent 834 c2230649a493
child 1159 7fdaa05a69a1
     1.1 --- a/lemon/adaptors.h	Wed Mar 17 12:35:52 2010 +0100
     1.2 +++ b/lemon/adaptors.h	Sat Mar 06 14:35:12 2010 +0000
     1.3 @@ -2,7 +2,7 @@
     1.4   *
     1.5   * This file is a part of LEMON, a generic C++ optimization library.
     1.6   *
     1.7 - * Copyright (C) 2003-2009
     1.8 + * Copyright (C) 2003-2010
     1.9   * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    1.10   * (Egervary Research Group on Combinatorial Optimization, EGRES).
    1.11   *
    1.12 @@ -421,7 +421,7 @@
    1.13      void initialize(DGR& digraph, NF& node_filter, AF& arc_filter) {
    1.14        Parent::initialize(digraph);
    1.15        _node_filter = &node_filter;
    1.16 -      _arc_filter = &arc_filter;      
    1.17 +      _arc_filter = &arc_filter;
    1.18      }
    1.19  
    1.20    public:
    1.21 @@ -508,11 +508,11 @@
    1.22    public:
    1.23  
    1.24      template <typename V>
    1.25 -    class NodeMap 
    1.26 -      : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, 
    1.27 -	      LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
    1.28 +    class NodeMap
    1.29 +      : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
    1.30 +              LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
    1.31        typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
    1.32 -	LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
    1.33 +        LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
    1.34  
    1.35      public:
    1.36        typedef V Value;
    1.37 @@ -535,9 +535,9 @@
    1.38      };
    1.39  
    1.40      template <typename V>
    1.41 -    class ArcMap 
    1.42 +    class ArcMap
    1.43        : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
    1.44 -	      LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
    1.45 +              LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
    1.46        typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
    1.47          LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> Parent;
    1.48  
    1.49 @@ -582,7 +582,7 @@
    1.50      void initialize(DGR& digraph, NF& node_filter, AF& arc_filter) {
    1.51        Parent::initialize(digraph);
    1.52        _node_filter = &node_filter;
    1.53 -      _arc_filter = &arc_filter;      
    1.54 +      _arc_filter = &arc_filter;
    1.55      }
    1.56  
    1.57    public:
    1.58 @@ -651,10 +651,10 @@
    1.59      }
    1.60  
    1.61      template <typename V>
    1.62 -    class NodeMap 
    1.63 +    class NodeMap
    1.64        : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
    1.65            LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
    1.66 -      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, 
    1.67 +      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
    1.68          LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
    1.69  
    1.70      public:
    1.71 @@ -678,7 +678,7 @@
    1.72      };
    1.73  
    1.74      template <typename V>
    1.75 -    class ArcMap 
    1.76 +    class ArcMap
    1.77        : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
    1.78            LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
    1.79        typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
    1.80 @@ -1021,10 +1021,10 @@
    1.81      }
    1.82  
    1.83      template <typename V>
    1.84 -    class NodeMap 
    1.85 +    class NodeMap
    1.86        : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
    1.87            LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
    1.88 -      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
    1.89 +      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
    1.90          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent;
    1.91  
    1.92      public:
    1.93 @@ -1048,10 +1048,10 @@
    1.94      };
    1.95  
    1.96      template <typename V>
    1.97 -    class ArcMap 
    1.98 +    class ArcMap
    1.99        : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
   1.100            LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
   1.101 -      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
   1.102 +      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
   1.103          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent;
   1.104  
   1.105      public:
   1.106 @@ -1075,10 +1075,10 @@
   1.107      };
   1.108  
   1.109      template <typename V>
   1.110 -    class EdgeMap 
   1.111 +    class EdgeMap
   1.112        : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
   1.113          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
   1.114 -      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
   1.115 +      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
   1.116          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
   1.117  
   1.118      public:
   1.119 @@ -1117,8 +1117,8 @@
   1.120    protected:
   1.121      NF* _node_filter;
   1.122      EF* _edge_filter;
   1.123 -    SubGraphBase() 
   1.124 -	  : Parent(), _node_filter(0), _edge_filter(0) { }
   1.125 +    SubGraphBase()
   1.126 +          : Parent(), _node_filter(0), _edge_filter(0) { }
   1.127  
   1.128      void initialize(GR& graph, NF& node_filter, EF& edge_filter) {
   1.129        Parent::initialize(graph);
   1.130 @@ -1219,10 +1219,10 @@
   1.131      }
   1.132  
   1.133      template <typename V>
   1.134 -    class NodeMap 
   1.135 +    class NodeMap
   1.136        : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
   1.137            LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
   1.138 -      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
   1.139 +      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>,
   1.140          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent;
   1.141  
   1.142      public:
   1.143 @@ -1246,10 +1246,10 @@
   1.144      };
   1.145  
   1.146      template <typename V>
   1.147 -    class ArcMap 
   1.148 +    class ArcMap
   1.149        : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
   1.150            LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
   1.151 -      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
   1.152 +      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>,
   1.153          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent;
   1.154  
   1.155      public:
   1.156 @@ -1273,11 +1273,11 @@
   1.157      };
   1.158  
   1.159      template <typename V>
   1.160 -    class EdgeMap 
   1.161 +    class EdgeMap
   1.162        : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
   1.163          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
   1.164 -      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
   1.165 -	LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
   1.166 +      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>,
   1.167 +        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
   1.168  
   1.169      public:
   1.170        typedef V Value;
   1.171 @@ -1504,7 +1504,7 @@
   1.172                       true> > {
   1.173  #endif
   1.174      typedef DigraphAdaptorExtender<
   1.175 -      SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >, 
   1.176 +      SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >,
   1.177                       true> > Parent;
   1.178  
   1.179    public:
   1.180 @@ -1525,7 +1525,7 @@
   1.181      ///
   1.182      /// Creates a subgraph for the given digraph or graph with the
   1.183      /// given node filter map.
   1.184 -    FilterNodes(GR& graph, NF& node_filter) 
   1.185 +    FilterNodes(GR& graph, NF& node_filter)
   1.186        : Parent(), const_true_map()
   1.187      {
   1.188        Parent::initialize(graph, node_filter, const_true_map);
   1.189 @@ -1563,11 +1563,11 @@
   1.190    class FilterNodes<GR, NF,
   1.191                      typename enable_if<UndirectedTagIndicator<GR> >::type> :
   1.192      public GraphAdaptorExtender<
   1.193 -      SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 
   1.194 +      SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >,
   1.195                     true> > {
   1.196  
   1.197      typedef GraphAdaptorExtender<
   1.198 -      SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 
   1.199 +      SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >,
   1.200                     true> > Parent;
   1.201  
   1.202    public:
   1.203 @@ -1653,7 +1653,7 @@
   1.204                       AF, false> > {
   1.205  #endif
   1.206      typedef DigraphAdaptorExtender<
   1.207 -      SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >, 
   1.208 +      SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >,
   1.209                       AF, false> > Parent;
   1.210  
   1.211    public:
   1.212 @@ -1761,11 +1761,11 @@
   1.213             typename EF = typename GR::template EdgeMap<bool> >
   1.214    class FilterEdges :
   1.215      public GraphAdaptorExtender<
   1.216 -      SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true> >, 
   1.217 +      SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true> >,
   1.218                     EF, false> > {
   1.219  #endif
   1.220      typedef GraphAdaptorExtender<
   1.221 -      SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >, 
   1.222 +      SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >,
   1.223                     EF, false> > Parent;
   1.224  
   1.225    public:
   1.226 @@ -1790,7 +1790,7 @@
   1.227      ///
   1.228      /// Creates a subgraph for the given graph with the given edge
   1.229      /// filter map.
   1.230 -    FilterEdges(GR& graph, EF& edge_filter) 
   1.231 +    FilterEdges(GR& graph, EF& edge_filter)
   1.232        : Parent(), const_true_map() {
   1.233        Parent::initialize(graph, const_true_map, edge_filter);
   1.234      }
   1.235 @@ -1858,7 +1858,7 @@
   1.236        Edge _edge;
   1.237        bool _forward;
   1.238  
   1.239 -      Arc(const Edge& edge, bool forward) 
   1.240 +      Arc(const Edge& edge, bool forward)
   1.241          : _edge(edge), _forward(forward) {}
   1.242  
   1.243      public:
   1.244 @@ -2098,7 +2098,7 @@
   1.245          _forward(*adaptor._digraph), _backward(*adaptor._digraph) {}
   1.246  
   1.247        ArcMapBase(const UndirectorBase<DGR>& adaptor, const V& value)
   1.248 -        : _forward(*adaptor._digraph, value), 
   1.249 +        : _forward(*adaptor._digraph, value),
   1.250            _backward(*adaptor._digraph, value) {}
   1.251  
   1.252        void set(const Arc& a, const V& value) {
   1.253 @@ -2216,7 +2216,7 @@
   1.254  
   1.255      typedef typename ItemSetTraits<DGR, Edge>::ItemNotifier EdgeNotifier;
   1.256      EdgeNotifier& notifier(Edge) const { return _digraph->notifier(Edge()); }
   1.257 -    
   1.258 +
   1.259      typedef EdgeNotifier ArcNotifier;
   1.260      ArcNotifier& notifier(Arc) const { return _digraph->notifier(Edge()); }
   1.261  
   1.262 @@ -2728,7 +2728,7 @@
   1.263             typename CM = typename DGR::template ArcMap<int>,
   1.264             typename FM = CM,
   1.265             typename TL = Tolerance<typename CM::Value> >
   1.266 -  class ResidualDigraph 
   1.267 +  class ResidualDigraph
   1.268      : public SubDigraph<
   1.269          Undirector<const DGR>,
   1.270          ConstMap<typename DGR::Node, Const<bool, true> >,
   1.271 @@ -2785,7 +2785,7 @@
   1.272      /// digraph, the capacity map, the flow map, and a tolerance object.
   1.273      ResidualDigraph(const DGR& digraph, const CM& capacity,
   1.274                      FM& flow, const TL& tolerance = Tolerance())
   1.275 -      : Parent(), _capacity(&capacity), _flow(&flow), 
   1.276 +      : Parent(), _capacity(&capacity), _flow(&flow),
   1.277          _graph(digraph), _node_filter(),
   1.278          _forward_filter(capacity, flow, tolerance),
   1.279          _backward_filter(capacity, flow, tolerance),
   1.280 @@ -2867,7 +2867,7 @@
   1.281        typedef typename CapacityMap::Value Value;
   1.282  
   1.283        /// Constructor
   1.284 -      ResidualCapacity(const ResidualDigraph<DGR, CM, FM, TL>& adaptor) 
   1.285 +      ResidualCapacity(const ResidualDigraph<DGR, CM, FM, TL>& adaptor)
   1.286          : _adaptor(&adaptor) {}
   1.287  
   1.288        /// Returns the value associated with the given residual arc
   1.289 @@ -3447,7 +3447,7 @@
   1.290      /// This map adaptor class adapts two node maps of the original digraph
   1.291      /// to get a node map of the split digraph.
   1.292      /// Its value type is inherited from the first node map type (\c IN).
   1.293 -    /// \tparam IN The type of the node map for the in-nodes. 
   1.294 +    /// \tparam IN The type of the node map for the in-nodes.
   1.295      /// \tparam OUT The type of the node map for the out-nodes.
   1.296      template <typename IN, typename OUT>
   1.297      class CombinedNodeMap {