COIN-OR::LEMON - Graph Library

Changeset 1158:8d2e55fac752 in lemon for lemon


Ignore:
Timestamp:
09/13/12 11:52:50 (12 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
1.1
Parents:
1156:939d747055cd (diff), 1157:761fe0846f49 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Message:

Merge #449 to branch 1.1

Location:
lemon
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • lemon/adaptors.h

    r1081 r1158  
    13651365    /// and edge filter maps.
    13661366    SubGraph(GR& graph, NF& node_filter, EF& edge_filter) {
    1367       initialize(graph, node_filter, edge_filter);
     1367      this->initialize(graph, node_filter, edge_filter);
    13681368    }
    13691369
     
    22622262    /// Creates an undirected graph from the given digraph.
    22632263    Undirector(DGR& digraph) {
    2264       initialize(digraph);
     2264      this->initialize(digraph);
    22652265    }
    22662266
  • lemon/adaptors.h

    r1157 r1158  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    419419      Parent::initialize(digraph);
    420420      _node_filter = &node_filter;
    421       _arc_filter = &arc_filter;     
     421      _arc_filter = &arc_filter;
    422422    }
    423423
     
    506506
    507507    template <typename V>
    508     class NodeMap 
    509       : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, 
    510               LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
     508    class NodeMap
     509      : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
     510              LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
    511511      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
    512         LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
     512        LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
    513513
    514514    public:
     
    533533
    534534    template <typename V>
    535     class ArcMap 
     535    class ArcMap
    536536      : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
    537               LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
     537              LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
    538538      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
    539539        LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> Parent;
     
    580580      Parent::initialize(digraph);
    581581      _node_filter = &node_filter;
    582       _arc_filter = &arc_filter;     
     582      _arc_filter = &arc_filter;
    583583    }
    584584
     
    649649
    650650    template <typename V>
    651     class NodeMap 
     651    class NodeMap
    652652      : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
    653653          LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
    654       typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, 
     654      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
    655655        LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
    656656
     
    676676
    677677    template <typename V>
    678     class ArcMap 
     678    class ArcMap
    679679      : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
    680680          LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
     
    10171017
    10181018    template <typename V>
    1019     class NodeMap 
     1019    class NodeMap
    10201020      : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
    10211021          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
    1022       typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
     1022      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
    10231023        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent;
    10241024
     
    10441044
    10451045    template <typename V>
    1046     class ArcMap 
     1046    class ArcMap
    10471047      : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
    10481048          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
    1049       typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
     1049      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
    10501050        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent;
    10511051
     
    10711071
    10721072    template <typename V>
    1073     class EdgeMap 
     1073    class EdgeMap
    10741074      : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
    10751075        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
    1076       typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
     1076      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
    10771077        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
    10781078
     
    11131113    NF* _node_filter;
    11141114    EF* _edge_filter;
    1115     SubGraphBase() 
    1116           : Parent(), _node_filter(0), _edge_filter(0) { }
     1115    SubGraphBase()
     1116          : Parent(), _node_filter(0), _edge_filter(0) { }
    11171117
    11181118    void initialize(GR& graph, NF& node_filter, EF& edge_filter) {
     
    12151215
    12161216    template <typename V>
    1217     class NodeMap 
     1217    class NodeMap
    12181218      : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
    12191219          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
    1220       typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
     1220      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>,
    12211221        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent;
    12221222
     
    12421242
    12431243    template <typename V>
    1244     class ArcMap 
     1244    class ArcMap
    12451245      : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
    12461246          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
    1247       typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
     1247      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>,
    12481248        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent;
    12491249
     
    12691269
    12701270    template <typename V>
    1271     class EdgeMap 
     1271    class EdgeMap
    12721272      : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
    12731273        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
    1274       typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
    1275         LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
     1274      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>,
     1275        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
    12761276
    12771277    public:
     
    14961496#endif
    14971497    typedef DigraphAdaptorExtender<
    1498       SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >, 
     1498      SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >,
    14991499                     true> > Parent;
    15001500
     
    15171517    /// Creates a subgraph for the given digraph or graph with the
    15181518    /// given node filter map.
    1519     FilterNodes(GR& graph, NF& node_filter) 
     1519    FilterNodes(GR& graph, NF& node_filter)
    15201520      : Parent(), const_true_map()
    15211521    {
     
    15551555                    typename enable_if<UndirectedTagIndicator<GR> >::type> :
    15561556    public GraphAdaptorExtender<
    1557       SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 
     1557      SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >,
    15581558                   true> > {
    15591559
    15601560    typedef GraphAdaptorExtender<
    1561       SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 
     1561      SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >,
    15621562                   true> > Parent;
    15631563
     
    16431643#endif
    16441644    typedef DigraphAdaptorExtender<
    1645       SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >, 
     1645      SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >,
    16461646                     AF, false> > Parent;
    16471647
     
    17491749  class FilterEdges :
    17501750    public GraphAdaptorExtender<
    1751       SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true> >, 
     1751      SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true> >,
    17521752                   EF, false> > {
    17531753#endif
    17541754    typedef GraphAdaptorExtender<
    1755       SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >, 
     1755      SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >,
    17561756                   EF, false> > Parent;
    17571757
     
    17781778    /// Creates a subgraph for the given graph with the given edge
    17791779    /// filter map.
    1780     FilterEdges(GR& graph, EF& edge_filter) 
     1780    FilterEdges(GR& graph, EF& edge_filter)
    17811781      : Parent(), const_true_map() {
    17821782      Parent::initialize(graph, const_true_map, edge_filter);
     
    18461846      bool _forward;
    18471847
    1848       Arc(const Edge& edge, bool forward) 
     1848      Arc(const Edge& edge, bool forward)
    18491849        : _edge(edge), _forward(forward) {}
    18501850
     
    20862086
    20872087      ArcMapBase(const UndirectorBase<DGR>& adaptor, const V& value)
    2088         : _forward(*adaptor._digraph, value), 
     2088        : _forward(*adaptor._digraph, value),
    20892089          _backward(*adaptor._digraph, value) {}
    20902090
     
    22042204    typedef typename ItemSetTraits<DGR, Edge>::ItemNotifier EdgeNotifier;
    22052205    EdgeNotifier& notifier(Edge) const { return _digraph->notifier(Edge()); }
    2206    
     2206
    22072207    typedef EdgeNotifier ArcNotifier;
    22082208    ArcNotifier& notifier(Arc) const { return _digraph->notifier(Edge()); }
     
    27082708           typename FM = CM,
    27092709           typename TL = Tolerance<typename CM::Value> >
    2710   class ResidualDigraph 
     2710  class ResidualDigraph
    27112711    : public SubDigraph<
    27122712        Undirector<const DGR>,
     
    27652765    ResidualDigraph(const DGR& digraph, const CM& capacity,
    27662766                    FM& flow, const TL& tolerance = Tolerance())
    2767       : Parent(), _capacity(&capacity), _flow(&flow), 
     2767      : Parent(), _capacity(&capacity), _flow(&flow),
    27682768        _graph(digraph), _node_filter(),
    27692769        _forward_filter(capacity, flow, tolerance),
     
    28472847
    28482848      /// Constructor
    2849       ResidualCapacity(const ResidualDigraph<DGR, CM, FM, TL>& adaptor) 
     2849      ResidualCapacity(const ResidualDigraph<DGR, CM, FM, TL>& adaptor)
    28502850        : _adaptor(&adaptor) {}
    28512851
     
    34243424    /// to get a node map of the split digraph.
    34253425    /// Its value type is inherited from the first node map type (\c IN).
    3426     /// \tparam IN The type of the node map for the in-nodes. 
     3426    /// \tparam IN The type of the node map for the in-nodes.
    34273427    /// \tparam OUT The type of the node map for the out-nodes.
    34283428    template <typename IN, typename OUT>
  • lemon/bits/edge_set_extender.h

    r1081 r1158  
    524524    // Returns the base node of the iterator
    525525    Node baseNode(const IncEdgeIt &e) const {
    526       return e.direction ? u(e) : v(e);
     526      return e.direction ? this->u(e) : this->v(e);
    527527    }
    528528    // Running node of the iterator
     
    530530    // Returns the running node of the iterator
    531531    Node runningNode(const IncEdgeIt &e) const {
    532       return e.direction ? v(e) : u(e);
     532      return e.direction ? this->v(e) : this->u(e);
    533533    }
    534534
  • lemon/bits/edge_set_extender.h

    r1157 r1158  
    1 /* -*- C++ -*-
     1/* -*- mode: C++; indent-tabs-mode: nil; -*-
    22 *
    3  * This file is a part of LEMON, a generic C++ optimization library
     3 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    6464    Node oppositeNode(const Node &n, const Arc &e) const {
    6565      if (n == Parent::source(e))
    66         return Parent::target(e);
     66        return Parent::target(e);
    6767      else if(n==Parent::target(e))
    68         return Parent::source(e);
     68        return Parent::source(e);
    6969      else
    70         return INVALID;
     70        return INVALID;
    7171    }
    7272
     
    9292    // Iterable extensions
    9393
    94     class NodeIt : public Node { 
     94    class NodeIt : public Node {
    9595      const Digraph* digraph;
    9696    public:
     
    101101
    102102      explicit NodeIt(const Digraph& _graph) : digraph(&_graph) {
    103         _graph.first(static_cast<Node&>(*this));
    104       }
    105 
    106       NodeIt(const Digraph& _graph, const Node& node) 
    107         : Node(node), digraph(&_graph) {}
    108 
    109       NodeIt& operator++() { 
    110         digraph->next(*this);
    111         return *this;
    112       }
    113 
    114     };
    115 
    116 
    117     class ArcIt : public Arc { 
     103        _graph.first(static_cast<Node&>(*this));
     104      }
     105
     106      NodeIt(const Digraph& _graph, const Node& node)
     107        : Node(node), digraph(&_graph) {}
     108
     109      NodeIt& operator++() {
     110        digraph->next(*this);
     111        return *this;
     112      }
     113
     114    };
     115
     116
     117    class ArcIt : public Arc {
    118118      const Digraph* digraph;
    119119    public:
     
    124124
    125125      explicit ArcIt(const Digraph& _graph) : digraph(&_graph) {
    126         _graph.first(static_cast<Arc&>(*this));
    127       }
    128 
    129       ArcIt(const Digraph& _graph, const Arc& e) : 
    130         Arc(e), digraph(&_graph) { }
    131 
    132       ArcIt& operator++() { 
    133         digraph->next(*this);
    134         return *this;
    135       }
    136 
    137     };
    138 
    139 
    140     class OutArcIt : public Arc { 
     126        _graph.first(static_cast<Arc&>(*this));
     127      }
     128
     129      ArcIt(const Digraph& _graph, const Arc& e) :
     130        Arc(e), digraph(&_graph) { }
     131
     132      ArcIt& operator++() {
     133        digraph->next(*this);
     134        return *this;
     135      }
     136
     137    };
     138
     139
     140    class OutArcIt : public Arc {
    141141      const Digraph* digraph;
    142142    public:
     
    146146      OutArcIt(Invalid i) : Arc(i) { }
    147147
    148       OutArcIt(const Digraph& _graph, const Node& node) 
    149         : digraph(&_graph) {
    150         _graph.firstOut(*this, node);
    151       }
    152 
    153       OutArcIt(const Digraph& _graph, const Arc& arc) 
    154         : Arc(arc), digraph(&_graph) {}
    155 
    156       OutArcIt& operator++() { 
    157         digraph->nextOut(*this);
    158         return *this;
    159       }
    160 
    161     };
    162 
    163 
    164     class InArcIt : public Arc { 
     148      OutArcIt(const Digraph& _graph, const Node& node)
     149        : digraph(&_graph) {
     150        _graph.firstOut(*this, node);
     151      }
     152
     153      OutArcIt(const Digraph& _graph, const Arc& arc)
     154        : Arc(arc), digraph(&_graph) {}
     155
     156      OutArcIt& operator++() {
     157        digraph->nextOut(*this);
     158        return *this;
     159      }
     160
     161    };
     162
     163
     164    class InArcIt : public Arc {
    165165      const Digraph* digraph;
    166166    public:
     
    170170      InArcIt(Invalid i) : Arc(i) { }
    171171
    172       InArcIt(const Digraph& _graph, const Node& node) 
    173         : digraph(&_graph) {
    174         _graph.firstIn(*this, node);
    175       }
    176 
    177       InArcIt(const Digraph& _graph, const Arc& arc) : 
    178         Arc(arc), digraph(&_graph) {}
    179 
    180       InArcIt& operator++() { 
    181         digraph->nextIn(*this);
    182         return *this;
     172      InArcIt(const Digraph& _graph, const Node& node)
     173        : digraph(&_graph) {
     174        _graph.firstIn(*this, node);
     175      }
     176
     177      InArcIt(const Digraph& _graph, const Arc& arc) :
     178        Arc(arc), digraph(&_graph) {}
     179
     180      InArcIt& operator++() {
     181        digraph->nextIn(*this);
     182        return *this;
    183183      }
    184184
     
    216216
    217217    // Mappable extension
    218    
     218
    219219    template <typename _Value>
    220     class ArcMap 
     220    class ArcMap
    221221      : public MapExtender<DefaultMap<Digraph, Arc, _Value> > {
    222222      typedef MapExtender<DefaultMap<Digraph, Arc, _Value> > Parent;
    223223
    224224    public:
    225       explicit ArcMap(const Digraph& _g) 
    226         : Parent(_g) {}
    227       ArcMap(const Digraph& _g, const _Value& _v) 
    228         : Parent(_g, _v) {}
     225      explicit ArcMap(const Digraph& _g)
     226        : Parent(_g) {}
     227      ArcMap(const Digraph& _g, const _Value& _v)
     228        : Parent(_g, _v) {}
    229229
    230230      ArcMap& operator=(const ArcMap& cmap) {
    231         return operator=<ArcMap>(cmap);
     231        return operator=<ArcMap>(cmap);
    232232      }
    233233
     
    235235      ArcMap& operator=(const CMap& cmap) {
    236236        Parent::operator=(cmap);
    237         return *this;
     237        return *this;
    238238      }
    239239
     
    248248      return arc;
    249249    }
    250    
     250
    251251    void clear() {
    252252      notifier(Arc()).clear();
     
    313313    Node oppositeNode(const Node &n, const Edge &e) const {
    314314      if( n == Parent::u(e))
    315         return Parent::v(e);
     315        return Parent::v(e);
    316316      else if( n == Parent::v(e))
    317         return Parent::u(e);
     317        return Parent::u(e);
    318318      else
    319         return INVALID;
     319        return INVALID;
    320320    }
    321321
     
    341341
    342342    using Parent::notifier;
    343    
     343
    344344    ArcNotifier& notifier(Arc) const {
    345345      return arc_notifier;
     
    351351
    352352
    353     class NodeIt : public Node { 
     353    class NodeIt : public Node {
    354354      const Graph* graph;
    355355    public:
     
    360360
    361361      explicit NodeIt(const Graph& _graph) : graph(&_graph) {
    362         _graph.first(static_cast<Node&>(*this));
    363       }
    364 
    365       NodeIt(const Graph& _graph, const Node& node) 
    366         : Node(node), graph(&_graph) {}
    367 
    368       NodeIt& operator++() { 
    369         graph->next(*this);
    370         return *this;
    371       }
    372 
    373     };
    374 
    375 
    376     class ArcIt : public Arc { 
     362        _graph.first(static_cast<Node&>(*this));
     363      }
     364
     365      NodeIt(const Graph& _graph, const Node& node)
     366        : Node(node), graph(&_graph) {}
     367
     368      NodeIt& operator++() {
     369        graph->next(*this);
     370        return *this;
     371      }
     372
     373    };
     374
     375
     376    class ArcIt : public Arc {
    377377      const Graph* graph;
    378378    public:
     
    383383
    384384      explicit ArcIt(const Graph& _graph) : graph(&_graph) {
    385         _graph.first(static_cast<Arc&>(*this));
    386       }
    387 
    388       ArcIt(const Graph& _graph, const Arc& e) : 
    389         Arc(e), graph(&_graph) { }
    390 
    391       ArcIt& operator++() { 
    392         graph->next(*this);
    393         return *this;
    394       }
    395 
    396     };
    397 
    398 
    399     class OutArcIt : public Arc { 
     385        _graph.first(static_cast<Arc&>(*this));
     386      }
     387
     388      ArcIt(const Graph& _graph, const Arc& e) :
     389        Arc(e), graph(&_graph) { }
     390
     391      ArcIt& operator++() {
     392        graph->next(*this);
     393        return *this;
     394      }
     395
     396    };
     397
     398
     399    class OutArcIt : public Arc {
    400400      const Graph* graph;
    401401    public:
     
    405405      OutArcIt(Invalid i) : Arc(i) { }
    406406
    407       OutArcIt(const Graph& _graph, const Node& node) 
    408         : graph(&_graph) {
    409         _graph.firstOut(*this, node);
    410       }
    411 
    412       OutArcIt(const Graph& _graph, const Arc& arc) 
    413         : Arc(arc), graph(&_graph) {}
    414 
    415       OutArcIt& operator++() { 
    416         graph->nextOut(*this);
    417         return *this;
    418       }
    419 
    420     };
    421 
    422 
    423     class InArcIt : public Arc { 
     407      OutArcIt(const Graph& _graph, const Node& node)
     408        : graph(&_graph) {
     409        _graph.firstOut(*this, node);
     410      }
     411
     412      OutArcIt(const Graph& _graph, const Arc& arc)
     413        : Arc(arc), graph(&_graph) {}
     414
     415      OutArcIt& operator++() {
     416        graph->nextOut(*this);
     417        return *this;
     418      }
     419
     420    };
     421
     422
     423    class InArcIt : public Arc {
    424424      const Graph* graph;
    425425    public:
     
    429429      InArcIt(Invalid i) : Arc(i) { }
    430430
    431       InArcIt(const Graph& _graph, const Node& node) 
    432         : graph(&_graph) {
    433         _graph.firstIn(*this, node);
    434       }
    435 
    436       InArcIt(const Graph& _graph, const Arc& arc) : 
    437         Arc(arc), graph(&_graph) {}
    438 
    439       InArcIt& operator++() { 
    440         graph->nextIn(*this);
    441         return *this;
    442       }
    443 
    444     };
    445 
    446 
    447     class EdgeIt : public Parent::Edge { 
     431      InArcIt(const Graph& _graph, const Node& node)
     432        : graph(&_graph) {
     433        _graph.firstIn(*this, node);
     434      }
     435
     436      InArcIt(const Graph& _graph, const Arc& arc) :
     437        Arc(arc), graph(&_graph) {}
     438
     439      InArcIt& operator++() {
     440        graph->nextIn(*this);
     441        return *this;
     442      }
     443
     444    };
     445
     446
     447    class EdgeIt : public Parent::Edge {
    448448      const Graph* graph;
    449449    public:
     
    454454
    455455      explicit EdgeIt(const Graph& _graph) : graph(&_graph) {
    456         _graph.first(static_cast<Edge&>(*this));
    457       }
    458 
    459       EdgeIt(const Graph& _graph, const Edge& e) : 
    460         Edge(e), graph(&_graph) { }
    461 
    462       EdgeIt& operator++() { 
    463         graph->next(*this);
    464         return *this;
     456        _graph.first(static_cast<Edge&>(*this));
     457      }
     458
     459      EdgeIt(const Graph& _graph, const Edge& e) :
     460        Edge(e), graph(&_graph) { }
     461
     462      EdgeIt& operator++() {
     463        graph->next(*this);
     464        return *this;
    465465      }
    466466
     
    478478
    479479      IncEdgeIt(const Graph& _graph, const Node &n) : graph(&_graph) {
    480         _graph.firstInc(*this, direction, n);
     480        _graph.firstInc(*this, direction, n);
    481481      }
    482482
    483483      IncEdgeIt(const Graph& _graph, const Edge &ue, const Node &n)
    484         : graph(&_graph), Edge(ue) {
    485         direction = (_graph.source(ue) == n);
     484        : graph(&_graph), Edge(ue) {
     485        direction = (_graph.source(ue) == n);
    486486      }
    487487
    488488      IncEdgeIt& operator++() {
    489         graph->nextInc(*this, direction);
    490         return *this;
     489        graph->nextInc(*this, direction);
     490        return *this;
    491491      }
    492492    };
     
    535535
    536536    template <typename _Value>
    537     class ArcMap 
     537    class ArcMap
    538538      : public MapExtender<DefaultMap<Graph, Arc, _Value> > {
    539539      typedef MapExtender<DefaultMap<Graph, Arc, _Value> > Parent;
    540540
    541541    public:
    542       explicit ArcMap(const Graph& _g) 
    543         : Parent(_g) {}
    544       ArcMap(const Graph& _g, const _Value& _v) 
    545         : Parent(_g, _v) {}
     542      explicit ArcMap(const Graph& _g)
     543        : Parent(_g) {}
     544      ArcMap(const Graph& _g, const _Value& _v)
     545        : Parent(_g, _v) {}
    546546
    547547      ArcMap& operator=(const ArcMap& cmap) {
    548         return operator=<ArcMap>(cmap);
     548        return operator=<ArcMap>(cmap);
    549549      }
    550550
     
    552552      ArcMap& operator=(const CMap& cmap) {
    553553        Parent::operator=(cmap);
    554         return *this;
     554        return *this;
    555555      }
    556556
     
    559559
    560560    template <typename _Value>
    561     class EdgeMap 
     561    class EdgeMap
    562562      : public MapExtender<DefaultMap<Graph, Edge, _Value> > {
    563563      typedef MapExtender<DefaultMap<Graph, Edge, _Value> > Parent;
    564564
    565565    public:
    566       explicit EdgeMap(const Graph& _g) 
    567         : Parent(_g) {}
    568 
    569       EdgeMap(const Graph& _g, const _Value& _v) 
    570         : Parent(_g, _v) {}
     566      explicit EdgeMap(const Graph& _g)
     567        : Parent(_g) {}
     568
     569      EdgeMap(const Graph& _g, const _Value& _v)
     570        : Parent(_g, _v) {}
    571571
    572572      EdgeMap& operator=(const EdgeMap& cmap) {
    573         return operator=<EdgeMap>(cmap);
     573        return operator=<EdgeMap>(cmap);
    574574      }
    575575
     
    577577      EdgeMap& operator=(const CMap& cmap) {
    578578        Parent::operator=(cmap);
    579         return *this;
     579        return *this;
    580580      }
    581581
     
    594594      return edge;
    595595    }
    596    
     596
    597597    void clear() {
    598598      notifier(Arc()).clear();
     
    620620      arc_notifier.clear();
    621621    }
    622    
     622
    623623  };
    624624
  • lemon/circulation.h

    r1081 r1158  
    559559
    560560      Node act;
    561       Node bact=INVALID;
    562       Node last_activated=INVALID;
    563561      while((act=_level->highestActive())!=INVALID) {
    564562        int actlevel=(*_level)[act];
  • lemon/circulation.h

    r1157 r1158  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    6060    /// \brief The type of supply map.
    6161    ///
    62     /// The type of the map that stores the signed supply values of the 
    63     /// nodes. 
     62    /// The type of the map that stores the signed supply values of the
     63    /// nodes.
    6464    /// It must conform to the \ref concepts::ReadMap "ReadMap" concept.
    6565    typedef SM SupplyMap;
     
    135135     \geq sup(u) \quad \forall u\in V, \f]
    136136     \f[ lower(uv) \leq f(uv) \leq upper(uv) \quad \forall uv\in A. \f]
    137      
     137
    138138     The sum of the supply values, i.e. \f$\sum_{u\in V} sup(u)\f$ must be
    139139     zero or negative in order to have a feasible solution (since the sum
     
    145145     constraints have to be satisfied with equality, i.e. all demands
    146146     have to be satisfied and all supplies have to be used.
    147      
     147
    148148     If you need the opposite inequalities in the supply/demand constraints
    149149     (i.e. the total demand is less than the total supply and all the demands
     
    326326    /// \param graph The digraph the algorithm runs on.
    327327    /// \param lower The lower bounds for the flow values on the arcs.
    328     /// \param upper The upper bounds (capacities) for the flow values 
     328    /// \param upper The upper bounds (capacities) for the flow values
    329329    /// on the arcs.
    330330    /// \param supply The signed supply values of the nodes.
  • lemon/concepts/graph_components.h

    r1126 r1158  
    495495          _GraphItemIt it3 = it1;
    496496          _GraphItemIt it4 = INVALID;
     497          ignore_unused_variable_warning(it3);
     498          ignore_unused_variable_warning(it4);
    497499
    498500          it2 = ++it1;
     
    584586          _GraphIncIt it3 = it1;
    585587          _GraphIncIt it4 = INVALID;
     588          ignore_unused_variable_warning(it3);
     589          ignore_unused_variable_warning(it4);
    586590
    587591          it2 = ++it1;
  • lemon/concepts/graph_components.h

    r1157 r1158  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    3939    /// \note This class is a template class so that we can use it to
    4040    /// create graph skeleton classes. The reason for this is that \c Node
    41     /// and \c Arc (or \c Edge) types should \e not derive from the same 
     41    /// and \c Arc (or \c Edge) types should \e not derive from the same
    4242    /// base class. For \c Node you should instantiate it with character
    4343    /// \c 'n', for \c Arc with \c 'a' and for \c Edge with \c 'e'.
     
    9090      ///
    9191      /// This operator defines an ordering of the items.
    92       /// It makes possible to use graph item types as key types in 
     92      /// It makes possible to use graph item types as key types in
    9393      /// associative containers (e.g. \c std::map).
    9494      ///
     
    124124    /// This class describes the base interface of directed graph types.
    125125    /// All digraph %concepts have to conform to this class.
    126     /// It just provides types for nodes and arcs and functions 
     126    /// It just provides types for nodes and arcs and functions
    127127    /// to get the source and the target nodes of arcs.
    128128    class BaseDigraphComponent {
     
    432432    /// \brief Concept class for \c NodeIt, \c ArcIt and \c EdgeIt types.
    433433    ///
    434     /// This class describes the concept of \c NodeIt, \c ArcIt and 
     434    /// This class describes the concept of \c NodeIt, \c ArcIt and
    435435    /// \c EdgeIt subtypes of digraph and graph types.
    436436    template <typename GR, typename Item>
     
    472472      /// next item.
    473473      GraphItemIt& operator++() { return *this; }
    474  
     474
    475475      /// \brief Equality operator
    476476      ///
     
    510510    };
    511511
    512     /// \brief Concept class for \c InArcIt, \c OutArcIt and 
     512    /// \brief Concept class for \c InArcIt, \c OutArcIt and
    513513    /// \c IncEdgeIt types.
    514514    ///
    515     /// This class describes the concept of \c InArcIt, \c OutArcIt 
     515    /// This class describes the concept of \c InArcIt, \c OutArcIt
    516516    /// and \c IncEdgeIt subtypes of digraph and graph types.
    517517    ///
    518518    /// \note Since these iterator classes do not inherit from the same
    519519    /// base class, there is an additional template parameter (selector)
    520     /// \c sel. For \c InArcIt you should instantiate it with character 
     520    /// \c sel. For \c InArcIt you should instantiate it with character
    521521    /// \c 'i', for \c OutArcIt with \c 'o' and for \c IncEdgeIt with \c 'e'.
    522522    template <typename GR,
     
    539539      GraphIncIt(const GraphIncIt& it) : Item(it) {}
    540540
    541       /// \brief Constructor that sets the iterator to the first 
     541      /// \brief Constructor that sets the iterator to the first
    542542      /// incoming or outgoing arc.
    543543      ///
    544       /// Constructor that sets the iterator to the first arc 
     544      /// Constructor that sets the iterator to the first arc
    545545      /// incoming to or outgoing from the given node.
    546546      explicit GraphIncIt(const GR&, const Base&) {}
     
    817817      /// \brief Return the first edge incident to the given node.
    818818      ///
    819       /// This function gives back the first edge incident to the given 
     819      /// This function gives back the first edge incident to the given
    820820      /// node. The bool parameter gives back the direction for which the
    821       /// source node of the directed arc representing the edge is the 
     821      /// source node of the directed arc representing the edge is the
    822822      /// given node.
    823823      void firstInc(Edge&, bool&, const Node&) const {}
     
    826826      /// given node.
    827827      ///
    828       /// This function gives back the next edge incident to the given 
     828      /// This function gives back the next edge incident to the given
    829829      /// node. The bool parameter should be used as \c firstInc() use it.
    830830      void nextInc(Edge&, bool&) const {}
     
    10061006    ///
    10071007    /// This class describes the concept of standard graph maps, i.e.
    1008     /// the \c NodeMap, \c ArcMap and \c EdgeMap subtypes of digraph and 
     1008    /// the \c NodeMap, \c ArcMap and \c EdgeMap subtypes of digraph and
    10091009    /// graph types, which can be used for associating data to graph items.
    10101010    /// The standard graph maps must conform to the ReferenceMap concept.
     
    10611061          _Map m1(g);
    10621062          _Map m2(g,t);
    1063          
     1063
    10641064          // Copy constructor
    10651065          // _Map m3(m);
     
    10851085    ///
    10861086    /// This class describes the interface of mappable directed graphs.
    1087     /// It extends \ref BaseDigraphComponent with the standard digraph 
     1087    /// It extends \ref BaseDigraphComponent with the standard digraph
    10881088    /// map classes, namely \c NodeMap and \c ArcMap.
    10891089    /// This concept is part of the Digraph concept.
     
    12231223    ///
    12241224    /// This class describes the interface of mappable undirected graphs.
    1225     /// It extends \ref MappableDigraphComponent with the standard graph 
     1225    /// It extends \ref MappableDigraphComponent with the standard graph
    12261226    /// map class for edges (\c EdgeMap).
    12271227    /// This concept is part of the Graph concept.
     
    13091309    ///
    13101310    /// This class describes the interface of extendable directed graphs.
    1311     /// It extends \ref BaseDigraphComponent with functions for adding 
     1311    /// It extends \ref BaseDigraphComponent with functions for adding
    13121312    /// nodes and arcs to the digraph.
    13131313    /// This concept requires \ref AlterableDigraphComponent.
     
    13541354    ///
    13551355    /// This class describes the interface of extendable undirected graphs.
    1356     /// It extends \ref BaseGraphComponent with functions for adding 
     1356    /// It extends \ref BaseGraphComponent with functions for adding
    13571357    /// nodes and edges to the graph.
    13581358    /// This concept requires \ref AlterableGraphComponent.
     
    13991399    ///
    14001400    /// This class describes the interface of erasable directed graphs.
    1401     /// It extends \ref BaseDigraphComponent with functions for removing 
     1401    /// It extends \ref BaseDigraphComponent with functions for removing
    14021402    /// nodes and arcs from the digraph.
    14031403    /// This concept requires \ref AlterableDigraphComponent.
     
    14121412      /// \brief Erase a node from the digraph.
    14131413      ///
    1414       /// This function erases the given node from the digraph and all arcs 
     1414      /// This function erases the given node from the digraph and all arcs
    14151415      /// connected to the node.
    14161416      void erase(const Node&) {}
     
    14391439    ///
    14401440    /// This class describes the interface of erasable undirected graphs.
    1441     /// It extends \ref BaseGraphComponent with functions for removing 
     1441    /// It extends \ref BaseGraphComponent with functions for removing
    14421442    /// nodes and edges from the graph.
    14431443    /// This concept requires \ref AlterableGraphComponent.
  • lemon/concepts/maps.h

    r1126 r1158  
    5050      /// Returns the value associated with the given key.
    5151      Value operator[](const Key &) const {
    52         return *static_cast<Value *>(0);
     52        return *(static_cast<Value *>(0)+1);
    5353      }
    5454
  • lemon/concepts/maps.h

    r1157 r1158  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/graph_to_eps.h

    r1081 r1158  
    223223  using T::_copyright;
    224224
    225   using T::NodeTextColorType;
     225  using typename T::NodeTextColorType;
    226226  using T::CUST_COL;
    227227  using T::DIST_COL;
  • lemon/graph_to_eps.h

    r1157 r1158  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
Note: See TracChangeset for help on using the changeset viewer.