COIN-OR::LEMON - Graph Library

Changeset 1158:8d2e55fac752 in 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

Files:
22 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).
  • test/adaptors_test.cc

    r1156 r1158  
    6666  Digraph::Arc a2 = digraph.addArc(n1, n3);
    6767  Digraph::Arc a3 = digraph.addArc(n2, n3);
     68  ignore_unused_variable_warning(a3);
    6869
    6970  // Check the adaptor
     
    100101  Adaptor::Arc a7 = adaptor.addArc(n1, n4);
    101102  Adaptor::Arc a8 = adaptor.addArc(n1, n2);
     103  ignore_unused_variable_warning(a6,a7,a8);
    102104
    103105  adaptor.erase(a1);
     
    759761  Digraph::Arc a2 = digraph.addArc(n1, n3);
    760762  Digraph::Arc a3 = digraph.addArc(n2, n3);
     763  ignore_unused_variable_warning(a1,a2,a3);
    761764
    762765  checkGraphNodeList(adaptor, 6);
  • test/adaptors_test.cc

    r1157 r1158  
    13811381
    13821382  // Apply several adaptors on the grid graph
    1383   typedef SplitNodes< ReverseDigraph< const Orienter<
    1384             const GridGraph, GridGraph::EdgeMap<bool> > > >
    1385     RevSplitGridGraph;
     1383  typedef Orienter<const GridGraph, GridGraph::EdgeMap<bool> >
     1384    OrientedGridGraph;
     1385  typedef ReverseDigraph<const OrientedGridGraph> RevOrientedGridGraph;
     1386  typedef SplitNodes<RevOrientedGridGraph> RevSplitGridGraph;
    13861387  typedef ReverseDigraph<const RevSplitGridGraph> SplitGridGraph;
    13871388  typedef Undirector<const SplitGridGraph> USplitGridGraph;
     
    13921393  checkConcept<concepts::Graph, UUSplitGridGraph>();
    13931394
     1395  OrientedGridGraph ori_adaptor = orienter(graph, dir_map);
     1396  RevOrientedGridGraph rev_ori_adaptor = reverseDigraph(ori_adaptor);
    13941397  RevSplitGridGraph rev_adaptor =
    1395     splitNodes(reverseDigraph(orienter(graph, dir_map)));
     1398    splitNodes(rev_ori_adaptor);
    13961399  SplitGridGraph adaptor = reverseDigraph(rev_adaptor);
    13971400  USplitGridGraph uadaptor = undirector(adaptor);
  • test/connectivity_test.cc

    r1081 r1158  
    6969    Graph g(d);
    7070    Digraph::Node n = d.addNode();
     71    ignore_unused_variable_warning(n);
    7172
    7273    check(stronglyConnected(d), "This digraph is strongly connected");
     
    246247    Digraph::Node watch = d.addNode();
    247248    Digraph::Node pants = d.addNode();
     249    ignore_unused_variable_warning(watch);
    248250
    249251    d.addArc(socks, shoe);
  • test/connectivity_test.cc

    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).
     
    3030  typedef ListDigraph Digraph;
    3131  typedef Undirector<Digraph> Graph;
    32  
    33   {
    34     Digraph d;
    35     Digraph::NodeMap<int> order(d);
    36     Graph g(d);
    37    
     32
     33  {
     34    Digraph d;
     35    Digraph::NodeMap<int> order(d);
     36    Graph g(d);
     37
    3838    check(stronglyConnected(d), "The empty digraph is strongly connected");
    3939    check(countStronglyConnectedComponents(d) == 0,
     
    4949    check(countBiEdgeConnectedComponents(g) == 0,
    5050          "The empty graph has 0 bi-edge-connected component");
    51          
     51
    5252    check(dag(d), "The empty digraph is DAG.");
    5353    check(checkedTopologicalSort(d, order), "The empty digraph is DAG.");
     
    8484    check(countBiEdgeConnectedComponents(g) == 1,
    8585          "This graph has 1 bi-edge-connected component");
    86          
     86
    8787    check(dag(d), "This digraph is DAG.");
    8888    check(checkedTopologicalSort(d, order), "This digraph is DAG.");
     
    103103    Digraph::NodeMap<int> order(d);
    104104    Graph g(d);
    105    
     105
    106106    Digraph::Node n1 = d.addNode();
    107107    Digraph::Node n2 = d.addNode();
     
    110110    Digraph::Node n5 = d.addNode();
    111111    Digraph::Node n6 = d.addNode();
    112    
     112
    113113    d.addArc(n1, n3);
    114114    d.addArc(n3, n2);
     
    138138    check(!parallelFree(g), "This graph is not parallel-free.");
    139139    check(!simpleGraph(g), "This graph is not simple.");
    140    
     140
    141141    d.addArc(n3, n3);
    142    
     142
    143143    check(!loopFree(d), "This digraph is not loop-free.");
    144144    check(!loopFree(g), "This graph is not loop-free.");
    145145    check(!simpleGraph(d), "This digraph is not simple.");
    146    
     146
    147147    d.addArc(n3, n2);
    148    
     148
    149149    check(!parallelFree(d), "This digraph is not parallel-free.");
    150150  }
    151  
     151
    152152  {
    153153    Digraph d;
    154154    Digraph::ArcMap<bool> cutarcs(d, false);
    155155    Graph g(d);
    156    
     156
    157157    Digraph::Node n1 = d.addNode();
    158158    Digraph::Node n2 = d.addNode();
     
    174174    d.addArc(n6, n7);
    175175    d.addArc(n7, n6);
    176    
     176
    177177    check(!stronglyConnected(d), "This digraph is not strongly connected");
    178178    check(countStronglyConnectedComponents(d) == 3,
     
    237237    Digraph d;
    238238    Digraph::NodeMap<int> order(d);
    239    
     239
    240240    Digraph::Node belt = d.addNode();
    241241    Digraph::Node trousers = d.addNode();
     
    258258    d.addArc(shirt, necktie);
    259259    d.addArc(necktie, coat);
    260    
     260
    261261    check(dag(d), "This digraph is DAG.");
    262262    topologicalSort(d, order);
     
    270270    ListGraph g;
    271271    ListGraph::NodeMap<bool> map(g);
    272    
     272
    273273    ListGraph::Node n1 = g.addNode();
    274274    ListGraph::Node n2 = g.addNode();
     
    286286    g.addEdge(n4, n7);
    287287    g.addEdge(n5, n7);
    288    
     288
    289289    check(bipartite(g), "This graph is bipartite");
    290290    check(bipartitePartitions(g, map), "This graph is bipartite");
    291    
     291
    292292    check(map[n1] == map[n2] && map[n1] == map[n6] && map[n1] == map[n7],
    293293          "Wrong bipartitePartitions()");
  • test/edge_set_test.cc

    r1081 r1158  
    4545
    4646  Digraph::Arc ga1 = digraph.addArc(n1, n2);
     47  ignore_unused_variable_warning(ga1);
    4748
    4849  ArcSet arc_set(digraph);
    4950
    5051  Digraph::Arc ga2 = digraph.addArc(n2, n1);
     52  ignore_unused_variable_warning(ga2);
    5153
    5254  checkGraphNodeList(arc_set, 2);
     
    7678    a3 = arc_set.addArc(n2, n3),
    7779    a4 = arc_set.addArc(n2, n3);
     80  ignore_unused_variable_warning(a2,a3,a4);
     81
    7882  checkGraphNodeList(arc_set, 3);
    7983  checkGraphArcList(arc_set, 4);
     
    111115
    112116  Digraph::Arc ga1 = digraph.addArc(n1, n2);
     117  ignore_unused_variable_warning(ga1);
    113118
    114119  ArcSet arc_set(digraph);
    115120
    116121  Digraph::Arc ga2 = digraph.addArc(n2, n1);
     122  ignore_unused_variable_warning(ga2);
    117123
    118124  checkGraphNodeList(arc_set, 2);
     
    142148    a3 = arc_set.addArc(n2, n3),
    143149    a4 = arc_set.addArc(n2, n3);
     150  ignore_unused_variable_warning(a2,a3,a4);
     151
    144152  checkGraphNodeList(arc_set, 3);
    145153  checkGraphArcList(arc_set, 4);
     
    191199
    192200  Digraph::Arc ga1 = digraph.addArc(n1, n2);
     201  ignore_unused_variable_warning(ga1);
    193202
    194203  EdgeSet edge_set(digraph);
    195204
    196205  Digraph::Arc ga2 = digraph.addArc(n2, n1);
     206  ignore_unused_variable_warning(ga2);
    197207
    198208  checkGraphNodeList(edge_set, 2);
     
    231241    e3 = edge_set.addEdge(n2, n3),
    232242    e4 = edge_set.addEdge(n2, n3);
     243  ignore_unused_variable_warning(e2,e3,e4);
     244
    233245  checkGraphNodeList(edge_set, 3);
    234246  checkGraphEdgeList(edge_set, 4);
     
    275287
    276288  Digraph::Arc ga1 = digraph.addArc(n1, n2);
     289  ignore_unused_variable_warning(ga1);
    277290
    278291  EdgeSet edge_set(digraph);
    279292
    280293  Digraph::Arc ga2 = digraph.addArc(n2, n1);
     294  ignore_unused_variable_warning(ga2);
    281295
    282296  checkGraphNodeList(edge_set, 2);
     
    315329    e3 = edge_set.addEdge(n2, n3),
    316330    e4 = edge_set.addEdge(n2, n3);
     331  ignore_unused_variable_warning(e2,e3,e4);
     332
    317333  checkGraphNodeList(edge_set, 3);
    318334  checkGraphEdgeList(edge_set, 4);
  • test/edge_set_test.cc

    r1157 r1158  
    33 * 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).
  • test/euler_test.cc

    r1081 r1158  
    102102    Graph g(d);
    103103    Digraph::Node n = d.addNode();
    104 
     104    ignore_unused_variable_warning(n);
     105 
    105106    checkDiEulerIt(d);
    106107    checkDiEulerIt(g);
     
    190191    Digraph::Node n4 = d.addNode();
    191192    Digraph::Node n5 = d.addNode();
     193    ignore_unused_variable_warning(n0,n4,n5);
    192194
    193195    d.addArc(n1, n2);
  • test/euler_test.cc

    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).
     
    8686  typedef ListDigraph Digraph;
    8787  typedef Undirector<Digraph> Graph;
    88  
    89   {
    90     Digraph d;
    91     Graph g(d);
    92    
     88
     89  {
     90    Digraph d;
     91    Graph g(d);
     92
    9393    checkDiEulerIt(d);
    9494    checkDiEulerIt(g);
     
    130130    Digraph::Node n2 = d.addNode();
    131131    Digraph::Node n3 = d.addNode();
    132    
     132
    133133    d.addArc(n1, n2);
    134134    d.addArc(n2, n1);
     
    155155    Digraph::Node n5 = d.addNode();
    156156    Digraph::Node n6 = d.addNode();
    157    
     157
    158158    d.addArc(n1, n2);
    159159    d.addArc(n2, n4);
     
    214214    Digraph::Node n2 = d.addNode();
    215215    Digraph::Node n3 = d.addNode();
    216    
     216
    217217    d.addArc(n1, n2);
    218218    d.addArc(n2, n3);
  • test/maps_test.cc

    r1081 r1158  
    8181    NullMap<A,B> map1;
    8282    NullMap<A,B> map2 = map1;
     83    ignore_unused_variable_warning(map2);
    8384    map1 = nullMap<A,B>();
    8485  }
     
    9192    ConstMap<A,B> map2 = B();
    9293    ConstMap<A,B> map3 = map1;
     94    ignore_unused_variable_warning(map2,map3);
     95
    9396    map1 = constMap<A>(B());
    9497    map1 = constMap<A,B>();
     
    9699    ConstMap<A,C> map4(C(1));
    97100    ConstMap<A,C> map5 = map4;
     101    ignore_unused_variable_warning(map5);
     102
    98103    map4 = constMap<A>(C(2));
    99104    map4.setAll(C(3));
     
    116121    IdentityMap<A> map1;
    117122    IdentityMap<A> map2 = map1;
     123    ignore_unused_variable_warning(map2);
     124
    118125    map1 = identityMap<A>();
    119126
     
    175182    checkConcept<ReadMap<B,double>, CompMap>();
    176183    CompMap map1 = CompMap(DoubleMap(),ReadMap<B,A>());
     184    ignore_unused_variable_warning(map1);
    177185    CompMap map2 = composeMap(DoubleMap(), ReadMap<B,A>());
     186    ignore_unused_variable_warning(map2);
    178187
    179188    SparseMap<double, bool> m1(false); m1[3.14] = true;
     
    188197    checkConcept<ReadMap<A,double>, CombMap>();
    189198    CombMap map1 = CombMap(DoubleMap(), DoubleMap());
     199    ignore_unused_variable_warning(map1);
    190200    CombMap map2 = combineMap(DoubleMap(), DoubleMap(), std::plus<double>());
     201    ignore_unused_variable_warning(map2);
    191202
    192203    check(combineMap(constMap<B,int,2>(), identityMap<B>(), &binc)[B()] == 3,
     
    200211    FunctorToMap<F> map1;
    201212    FunctorToMap<F> map2 = FunctorToMap<F>(F());
     213    ignore_unused_variable_warning(map2);
     214
    202215    B b = functorToMap(F())[A()];
     216    ignore_unused_variable_warning(b);
    203217
    204218    checkConcept<ReadMap<A,B>, MapToFunctor<ReadMap<A,B> > >();
    205219    MapToFunctor<ReadMap<A,B> > map =
    206220      MapToFunctor<ReadMap<A,B> >(ReadMap<A,B>());
     221    ignore_unused_variable_warning(map);
    207222
    208223    check(functorToMap(&func)[A()] == 3,
     
    222237      ConvertMap<ReadMap<double, int>, double> >();
    223238    ConvertMap<RangeMap<bool>, int> map1(rangeMap(1, true));
     239    ignore_unused_variable_warning(map1);
    224240    ConvertMap<RangeMap<bool>, int> map2 = convertMap<int>(rangeMap(2, false));
     241    ignore_unused_variable_warning(map2);
     242
    225243  }
    226244
  • test/maps_test.cc

    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).
     
    7171  checkConcept<ReadWriteMap<A,B>, ReadWriteMap<A,B> >();
    7272  checkConcept<ReadWriteMap<A,C>, ReadWriteMap<A,C> >();
    73   checkConcept<ReferenceMap<A,B,B&,const B&>, ReferenceMap<A,B,B&,const B&> >();
    74   checkConcept<ReferenceMap<A,C,C&,const C&>, ReferenceMap<A,C,C&,const C&> >();
     73  checkConcept<ReferenceMap<A,B,B&,const B&>,
     74               ReferenceMap<A,B,B&,const B&> >();
     75  checkConcept<ReferenceMap<A,C,C&,const C&>,
     76               ReferenceMap<A,C,C&,const C&> >();
    7577
    7678  // NullMap
     
    369371      check(v1[i++] == *it, "Something is wrong with LoggerBoolMap");
    370372  }
    371  
     373
    372374  // CrossRefMap
    373375  {
     
    377379    checkConcept<ReadWriteMap<Node, int>,
    378380                 CrossRefMap<Graph, Node, int> >();
    379    
     381
    380382    Graph gr;
    381383    typedef CrossRefMap<Graph, Node, char> CRMap;
    382384    typedef CRMap::ValueIterator ValueIt;
    383385    CRMap map(gr);
    384    
     386
    385387    Node n0 = gr.addNode();
    386388    Node n1 = gr.addNode();
    387389    Node n2 = gr.addNode();
    388    
     390
    389391    map.set(n0, 'A');
    390392    map.set(n1, 'B');
Note: See TracChangeset for help on using the changeset viewer.