COIN-OR::LEMON - Graph Library

Changeset 1092:dceba191c00d in lemon-main


Ignore:
Timestamp:
08/09/13 11:28:17 (11 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Children:
1093:fb1c7da561ce, 1165:e0ccc1f0268f
Phase:
public
Message:

Apply unify-sources.sh to the source tree

Files:
130 edited

Legend:

Unmodified
Added
Removed
  • doc/coding_style.dox

    r919 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • doc/dirs.dox

    r925 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • doc/groups.dox

    r1080 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    430430data are required to be integer).
    431431
    432 For more details about these implementations and for a comprehensive 
     432For more details about these implementations and for a comprehensive
    433433experimental study, see the paper \cite KiralyKovacs12MCF.
    434434It also compares these codes to other publicly available
     
    571571\image latex planar.eps "Plane graph" width=\textwidth
    572572*/
    573  
     573
    574574/**
    575575@defgroup tsp Traveling Salesman Problem
  • doc/lgf.dox

    r1074 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • doc/min_cost_flow.dox

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

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

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

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

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

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

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

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

    r877 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/bits/bezier.h

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

    r877 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/bits/edge_set_extender.h

    r1000 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/bits/graph_adaptor_extender.h

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

    r1027 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    844844
    845845    typedef AlterationNotifier<BpGraphExtender, Node> NodeNotifier;
    846     typedef AlterationNotifier<BpGraphExtender, RedNode> RedNodeNotifier; 
     846    typedef AlterationNotifier<BpGraphExtender, RedNode> RedNodeNotifier;
    847847    typedef AlterationNotifier<BpGraphExtender, BlueNode> BlueNodeNotifier;
    848848    typedef AlterationNotifier<BpGraphExtender, Arc> ArcNotifier;
  • lemon/bits/lock.h

    r979 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2012
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    3434    public:
    3535      Lock() {
    36         pthread_mutex_init(&_lock, 0);
     36        pthread_mutex_init(&_lock, 0);
    3737      }
    3838      ~Lock() {
    39         pthread_mutex_destroy(&_lock);
     39        pthread_mutex_destroy(&_lock);
    4040      }
    4141      void lock() {
    42         pthread_mutex_lock(&_lock);
     42        pthread_mutex_lock(&_lock);
    4343      }
    4444      void unlock() {
    45         pthread_mutex_unlock(&_lock);
     45        pthread_mutex_unlock(&_lock);
    4646      }
    4747
     
    5858      void lock() {}
    5959      void unlock() {}
    60     };   
     60    };
    6161#endif
    6262  }
  • lemon/bits/map_extender.h

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

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

    r989 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/bits/traits.h

    r1026 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/bits/windows.cc

    r1001 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    141141#endif
    142142    }
    143    
     143
    144144    WinLock::~WinLock() {
    145145#ifdef WIN32
  • lemon/bits/windows.h

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

    r1080 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    839839      return OPTIMAL;
    840840    }
    841    
     841
    842842    // Check if the upper bound is greater or equal to the lower bound
    843843    // on each arc.
  • lemon/cbc.cc

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

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

    r1074 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    3131
    3232namespace lemon {
    33  
     33
    3434  /// \ingroup tsp
    3535  ///
     
    109109          return _sum = 2 * _cost[_gr.edge(_gr(0), _gr(1))];
    110110        }
    111        
     111
    112112        // Compute min. cost spanning tree
    113113        std::vector<Edge> tree;
    114114        kruskal(_gr, _cost, std::back_inserter(tree));
    115        
     115
    116116        FullGraph::NodeMap<int> deg(_gr, 0);
    117117        for (int i = 0; i != int(tree.size()); ++i) {
     
    126126          if (deg[u] % 2 == 1) odd_nodes.push_back(u);
    127127        }
    128  
     128
    129129        SmartGraph sgr;
    130130        SmartGraph::EdgeMap<Cost> scost(sgr);
     
    140140          }
    141141        }
    142        
     142
    143143        // Compute min. cost perfect matching
    144144        MaxWeightedPerfectMatching<SmartGraph, SmartGraph::EdgeMap<Cost> >
    145145          mwpm(sgr, scost);
    146146        mwpm.run();
    147        
     147
    148148        for (SmartGraph::EdgeIt e(sgr); e != INVALID; ++e) {
    149149          if (mwpm.matching(e)) {
     
    152152          }
    153153        }
    154        
    155         // Join the spanning tree and the matching       
     154
     155        // Join the spanning tree and the matching
    156156        sgr.clear();
    157157        for (int i = 0; i != _gr.nodeNum(); ++i) {
     
    183183
    184184      /// @}
    185      
     185
    186186      /// \name Query Functions
    187187      /// @{
    188      
     188
    189189      /// \brief The total cost of the found tour.
    190190      ///
     
    195195        return _sum;
    196196      }
    197      
     197
    198198      /// \brief Returns a const reference to the node sequence of the
    199199      /// found tour.
     
    228228        std::copy(_path.begin(), _path.end(), out);
    229229      }
    230      
     230
    231231      /// \brief Gives back the found tour as a path.
    232232      ///
     
    245245        }
    246246      }
    247      
     247
    248248      /// @}
    249      
     249
    250250  };
    251251
  • lemon/circulation.h

    r1074 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/clp.cc

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

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

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

    r1087 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    805805
    806806      /// \brief Gives back the red end node of the edge.
    807       /// 
     807      ///
    808808      /// Gives back the red end node of the edge.
    809809      RedNode redNode(const Edge&) const { return RedNode(); }
    810810
    811811      /// \brief Gives back the blue end node of the edge.
    812       /// 
     812      ///
    813813      /// Gives back the blue end node of the edge.
    814814      BlueNode blueNode(const Edge&) const { return BlueNode(); }
  • lemon/concepts/digraph.h

    r1086 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/concepts/graph.h

    r1086 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/concepts/graph_components.h

    r1087 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    392392
    393393      /// \brief Gives back the red end node of the edge.
    394       /// 
     394      ///
    395395      /// Gives back the red end node of the edge.
    396396      RedNode redNode(const Edge&) const { return RedNode(); }
    397397
    398398      /// \brief Gives back the blue end node of the edge.
    399       /// 
     399      ///
    400400      /// Gives back the blue end node of the edge.
    401401      BlueNode blueNode(const Edge&) const { return BlueNode(); }
     
    11511151      typedef typename Base::Arc Arc;
    11521152      typedef typename Base::Edge Edge;
    1153      
     1153
    11541154      typedef IterableBpGraphComponent BpGraph;
    11551155
     
    12111211          typename _BpGraph::RedNode rn(INVALID);
    12121212          bpgraph.first(rn);
    1213           bpgraph.next(rn); 
     1213          bpgraph.next(rn);
    12141214          typename _BpGraph::BlueNode bn(INVALID);
    12151215          bpgraph.first(bn);
  • lemon/concepts/heap.h

    r1084 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/concepts/maps.h

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

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

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

    r1086 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    255255
    256256  namespace _graph_utils_bits {
    257    
     257
    258258    template <typename Graph, typename Enable = void>
    259259    struct CountRedNodesSelector {
     
    265265    template <typename Graph>
    266266    struct CountRedNodesSelector<
    267       Graph, typename 
    268       enable_if<typename Graph::NodeNumTag, void>::type> 
     267      Graph, typename
     268      enable_if<typename Graph::NodeNumTag, void>::type>
    269269    {
    270270      static int count(const Graph &g) {
    271271        return g.redNum();
    272272      }
    273     };   
     273    };
    274274  }
    275275
     
    280280  /// graph structures it is specialized to run in O(1).
    281281  ///
    282   /// If the graph contains a \e redNum() member function and a 
     282  /// If the graph contains a \e redNum() member function and a
    283283  /// \e NodeNumTag tag then this function calls directly the member
    284284  /// function to query the cardinality of the node set.
     
    289289
    290290  namespace _graph_utils_bits {
    291    
     291
    292292    template <typename Graph, typename Enable = void>
    293293    struct CountBlueNodesSelector {
     
    299299    template <typename Graph>
    300300    struct CountBlueNodesSelector<
    301       Graph, typename 
    302       enable_if<typename Graph::NodeNumTag, void>::type> 
     301      Graph, typename
     302      enable_if<typename Graph::NodeNumTag, void>::type>
    303303    {
    304304      static int count(const Graph &g) {
    305305        return g.blueNum();
    306306      }
    307     };   
     307    };
    308308  }
    309309
     
    314314  /// graph structures it is specialized to run in O(1).
    315315  ///
    316   /// If the graph contains a \e blueNum() member function and a 
     316  /// If the graph contains a \e blueNum() member function and a
    317317  /// \e NodeNumTag tag then this function calls directly the member
    318318  /// function to query the cardinality of the node set.
     
    18661866    /// The Digraph type
    18671867    typedef GR Digraph;
    1868    
     1868
    18691869  protected:
    18701870
  • lemon/cost_scaling.h

    r1080 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    905905      return OPTIMAL;
    906906    }
    907    
     907
    908908    // Check if the upper bound is greater or equal to the lower bound
    909909    // on each arc.
  • lemon/cplex.cc

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

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

    r1081 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    784784      return OPTIMAL;
    785785    }
    786    
     786
    787787    // Check if the upper bound is greater or equal to the lower bound
    788788    // on each arc.
     
    961961      buildResidualNetwork();
    962962      while (true) {
    963        
     963
    964964        typename HwMmc::TerminationCause hw_tc =
    965965            hw_mmc.findCycleMean(hw_iter_limit);
     
    977977          hw_mmc.findCycle();
    978978        }
    979        
     979
    980980        // Compute delta value
    981981        Value delta = INF;
  • lemon/dfs.h

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

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

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

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

    r1074 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    3737  struct EdmondsKarpDefaultTraits {
    3838
    39     /// \brief The digraph type the algorithm runs on. 
     39    /// \brief The digraph type the algorithm runs on.
    4040    typedef GR Digraph;
    4141
     
    6161    /// \brief Instantiates a FlowMap.
    6262    ///
    63     /// This function instantiates a \ref FlowMap. 
     63    /// This function instantiates a \ref FlowMap.
    6464    /// \param digraph The digraph for which we would like to define
    6565    /// the flow map.
     
    9696  /// \tparam GR The type of the digraph the algorithm runs on.
    9797  /// \tparam CAP The type of the capacity map. The default map
    98   /// type is \ref concepts::Digraph::ArcMap "GR::ArcMap<int>". 
     98  /// type is \ref concepts::Digraph::ArcMap "GR::ArcMap<int>".
    9999  /// \tparam TR The traits class that defines various types used by the
    100100  /// algorithm. By default, it is \ref EdmondsKarpDefaultTraits
     
    105105#ifdef DOXYGEN
    106106  template <typename GR, typename CAP, typename TR>
    107 #else 
     107#else
    108108  template <typename GR,
    109             typename CAP = typename GR::template ArcMap<int>,
     109            typename CAP = typename GR::template ArcMap<int>,
    110110            typename TR = EdmondsKarpDefaultTraits<GR, CAP> >
    111111#endif
     
    121121    typedef typename Traits::CapacityMap CapacityMap;
    122122    /// The type of the flow values.
    123     typedef typename Traits::Value Value; 
     123    typedef typename Traits::Value Value;
    124124
    125125    /// The type of the flow map.
     
    132132    TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
    133133    typedef typename Digraph::template NodeMap<Arc> PredMap;
    134    
     134
    135135    const Digraph& _graph;
    136136    const CapacityMap* _capacity;
     
    143143    PredMap* _pred;
    144144    std::vector<Node> _queue;
    145    
     145
    146146    Tolerance _tolerance;
    147147    Value _flow_value;
     
    149149    void createStructures() {
    150150      if (!_flow) {
    151         _flow = Traits::createFlowMap(_graph);
    152         _local_flow = true;
     151        _flow = Traits::createFlowMap(_graph);
     152        _local_flow = true;
    153153      }
    154154      if (!_pred) {
    155         _pred = new PredMap(_graph);
     155        _pred = new PredMap(_graph);
    156156      }
    157157      _queue.resize(countNodes(_graph));
     
    160160    void destroyStructures() {
    161161      if (_local_flow) {
    162         delete _flow;
     162        delete _flow;
    163163      }
    164164      if (_pred) {
    165         delete _pred;
    166       }
    167     }
    168    
     165        delete _pred;
     166      }
     167    }
     168
    169169  public:
    170170
     
    179179      typedef T FlowMap;
    180180      static FlowMap *createFlowMap(const Digraph&) {
    181         LEMON_ASSERT(false, "FlowMap is not initialized");
     181        LEMON_ASSERT(false, "FlowMap is not initialized");
    182182        return 0;
    183183      }
     
    190190    /// type
    191191    template <typename T>
    192     struct SetFlowMap 
     192    struct SetFlowMap
    193193      : public EdmondsKarp<Digraph, CapacityMap, SetFlowMapTraits<T> > {
    194194      typedef EdmondsKarp<Digraph, CapacityMap, SetFlowMapTraits<T> > Create;
     
    198198
    199199  protected:
    200    
     200
    201201    EdmondsKarp() {}
    202202
     
    205205    /// \brief The constructor of the class.
    206206    ///
    207     /// The constructor of the class. 
    208     /// \param digraph The digraph the algorithm runs on. 
    209     /// \param capacity The capacity of the arcs. 
     207    /// The constructor of the class.
     208    /// \param digraph The digraph the algorithm runs on.
     209    /// \param capacity The capacity of the arcs.
    210210    /// \param source The source node.
    211211    /// \param target The target node.
    212212    EdmondsKarp(const Digraph& digraph, const CapacityMap& capacity,
    213                 Node source, Node target)
     213                Node source, Node target)
    214214      : _graph(digraph), _capacity(&capacity), _source(source), _target(target),
    215         _flow(0), _local_flow(false), _pred(0), _tolerance(), _flow_value()
     215        _flow(0), _local_flow(false), _pred(0), _tolerance(), _flow_value()
    216216    {
    217217      LEMON_ASSERT(_source != _target,
     
    245245    EdmondsKarp& flowMap(FlowMap& map) {
    246246      if (_local_flow) {
    247         delete _flow;
    248         _local_flow = false;
     247        delete _flow;
     248        _local_flow = false;
    249249      }
    250250      _flow = &map;
     
    277277      _tolerance = tolerance;
    278278      return *this;
    279     } 
     279    }
    280280
    281281    /// \brief Returns a const reference to the tolerance.
     
    285285    const Tolerance& tolerance() const {
    286286      return _tolerance;
    287     } 
     287    }
    288288
    289289    /// \name Execution control
     
    292292    /// you have to call one of the \ref init() functions first, then
    293293    /// \ref start() or multiple times the \ref augment() function.
    294    
     294
    295295    ///@{
    296296
     
    306306      _flow_value = 0;
    307307    }
    308    
     308
    309309    /// \brief Initializes the algorithm using the given flow map.
    310310    ///
     
    318318      createStructures();
    319319      for (ArcIt e(_graph); e != INVALID; ++e) {
    320         _flow->set(e, flowMap[e]);
     320        _flow->set(e, flowMap[e]);
    321321      }
    322322      _flow_value = 0;
     
    335335    /// contain a feasible flow, i.e. at each node excluding the source
    336336    /// and the target, the incoming flow should be equal to the
    337     /// outgoing flow. 
     337    /// outgoing flow.
    338338    /// \return \c false when the given \c flowMap does not contain a
    339339    /// feasible flow.
     
    342342      createStructures();
    343343      for (ArcIt e(_graph); e != INVALID; ++e) {
    344         _flow->set(e, flowMap[e]);
     344        _flow->set(e, flowMap[e]);
    345345      }
    346346      for (NodeIt it(_graph); it != INVALID; ++it) {
     
    373373
    374374    /// \brief Augments the solution along a shortest path.
    375     /// 
     375    ///
    376376    /// Augments the solution along a shortest path. This function searches a
    377377    /// shortest path between the source and the target
     
    384384    bool augment() {
    385385      for (NodeIt n(_graph); n != INVALID; ++n) {
    386         _pred->set(n, INVALID);
    387       }
    388      
     386        _pred->set(n, INVALID);
     387      }
     388
    389389      int first = 0, last = 1;
    390      
     390
    391391      _queue[0] = _source;
    392392      _pred->set(_source, OutArcIt(_graph, _source));
    393393
    394394      while (first != last && (*_pred)[_target] == INVALID) {
    395         Node n = _queue[first++];
    396        
    397         for (OutArcIt e(_graph, n); e != INVALID; ++e) {
    398           Value rem = (*_capacity)[e] - (*_flow)[e];
    399           Node t = _graph.target(e);
    400           if (_tolerance.positive(rem) && (*_pred)[t] == INVALID) {
    401             _pred->set(t, e);
    402             _queue[last++] = t;
    403           }
    404         }
    405         for (InArcIt e(_graph, n); e != INVALID; ++e) {
    406           Value rem = (*_flow)[e];
    407           Node t = _graph.source(e);
    408           if (_tolerance.positive(rem) && (*_pred)[t] == INVALID) {
    409             _pred->set(t, e);
    410             _queue[last++] = t;
    411           }
    412         }
     395        Node n = _queue[first++];
     396
     397        for (OutArcIt e(_graph, n); e != INVALID; ++e) {
     398          Value rem = (*_capacity)[e] - (*_flow)[e];
     399          Node t = _graph.target(e);
     400          if (_tolerance.positive(rem) && (*_pred)[t] == INVALID) {
     401            _pred->set(t, e);
     402            _queue[last++] = t;
     403          }
     404        }
     405        for (InArcIt e(_graph, n); e != INVALID; ++e) {
     406          Value rem = (*_flow)[e];
     407          Node t = _graph.source(e);
     408          if (_tolerance.positive(rem) && (*_pred)[t] == INVALID) {
     409            _pred->set(t, e);
     410            _queue[last++] = t;
     411          }
     412        }
    413413      }
    414414
    415415      if ((*_pred)[_target] != INVALID) {
    416         Node n = _target;
    417         Arc e = (*_pred)[n];
    418 
    419         Value prem = (*_capacity)[e] - (*_flow)[e];
    420         n = _graph.source(e);
    421         while (n != _source) {
    422           e = (*_pred)[n];
    423           if (_graph.target(e) == n) {
    424             Value rem = (*_capacity)[e] - (*_flow)[e];
    425             if (rem < prem) prem = rem;
    426             n = _graph.source(e);
    427           } else {
    428             Value rem = (*_flow)[e];
    429             if (rem < prem) prem = rem;
    430             n = _graph.target(e);   
    431           }
    432         }
    433 
    434         n = _target;
    435         e = (*_pred)[n];
    436 
    437         _flow->set(e, (*_flow)[e] + prem);
    438         n = _graph.source(e);
    439         while (n != _source) {
    440           e = (*_pred)[n];
    441           if (_graph.target(e) == n) {
    442             _flow->set(e, (*_flow)[e] + prem);
    443             n = _graph.source(e);
    444           } else {
    445             _flow->set(e, (*_flow)[e] - prem);
    446             n = _graph.target(e);   
    447           }
    448         }
    449 
    450         _flow_value += prem;   
    451         return true;
     416        Node n = _target;
     417        Arc e = (*_pred)[n];
     418
     419        Value prem = (*_capacity)[e] - (*_flow)[e];
     420        n = _graph.source(e);
     421        while (n != _source) {
     422          e = (*_pred)[n];
     423          if (_graph.target(e) == n) {
     424            Value rem = (*_capacity)[e] - (*_flow)[e];
     425            if (rem < prem) prem = rem;
     426            n = _graph.source(e);
     427          } else {
     428            Value rem = (*_flow)[e];
     429            if (rem < prem) prem = rem;
     430            n = _graph.target(e);
     431          }
     432        }
     433
     434        n = _target;
     435        e = (*_pred)[n];
     436
     437        _flow->set(e, (*_flow)[e] + prem);
     438        n = _graph.source(e);
     439        while (n != _source) {
     440          e = (*_pred)[n];
     441          if (_graph.target(e) == n) {
     442            _flow->set(e, (*_flow)[e] + prem);
     443            n = _graph.source(e);
     444          } else {
     445            _flow->set(e, (*_flow)[e] - prem);
     446            n = _graph.target(e);
     447          }
     448        }
     449
     450        _flow_value += prem;
     451        return true;
    452452      } else {
    453         return false;
     453        return false;
    454454      }
    455455    }
     
    458458    ///
    459459    /// Executes the algorithm by performing augmenting phases until the
    460     /// optimal solution is reached. 
     460    /// optimal solution is reached.
    461461    /// \pre One of the \ref init() functions must be called before
    462462    /// using this function.
     
    466466
    467467    /// \brief Runs the algorithm.
    468     /// 
     468    ///
    469469    /// Runs the Edmonds-Karp algorithm.
    470470    /// \note ek.run() is just a shortcut of the following code.
    471     ///\code 
     471    ///\code
    472472    /// ek.init();
    473473    /// ek.start();
     
    484484    /// functions.\n
    485485    /// Either \ref run() or \ref start() should be called before using them.
    486    
     486
    487487    ///@{
    488488
     
    543543    void minCutMap(CutMap& cutMap) const {
    544544      for (NodeIt n(_graph); n != INVALID; ++n) {
    545         cutMap.set(n, (*_pred)[n] != INVALID);
     545        cutMap.set(n, (*_pred)[n] != INVALID);
    546546      }
    547547      cutMap.set(_source, true);
    548     }   
     548    }
    549549
    550550    /// @}
  • lemon/euler.h

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

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

    r1025 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    875875    static int id(Arc e) { return e._id; }
    876876    static int id(Edge e) { return e._id; }
    877    
     877
    878878    static Node nodeFromId(int id) { return Node(id);}
    879879    static Arc arcFromId(int id) { return Arc(id);}
     
    905905      return n._id - _red_num;
    906906    }
    907        
     907
    908908    void clear() {
    909909      _red_num = 0; _blue_num = 0;
     
    911911    }
    912912
    913     Edge edge(const Node& u, const Node& v) const { 
     913    Edge edge(const Node& u, const Node& v) const {
    914914      if (u._id < _red_num) {
    915915        if (v._id < _red_num) {
     
    927927    }
    928928
    929     Arc arc(const Node& u, const Node& v) const { 
     929    Arc arc(const Node& u, const Node& v) const {
    930930      if (u._id < _red_num) {
    931931        if (v._id < _red_num) {
  • lemon/glpk.cc

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

    r1074 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    149149#ifdef DOXYGEN
    150150    /// Write the problem or the solution to a file in the given format
    151    
     151
    152152    /// This function writes the problem or the solution
    153153    /// to a file in the given format.
  • lemon/gomory_hu.h

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

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

    r1074 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    6868      Cost _sum;
    6969      std::vector<Node> _path;
    70      
     70
    7171    private:
    72    
     72
    7373      // Functor class to compare edges by their costs
    7474      class EdgeComp {
  • lemon/grosso_locatelli_pullan_mc.h

    r1053 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    121121    BoolMatrix _gr;
    122122    int _n;
    123    
     123
    124124    // Search options
    125125    bool _delta_based_restart;
    126126    int _restart_delta_limit;
    127  
     127
    128128    // Search limits
    129129    int _iteration_limit;
     
    443443    /// \name Execution Control
    444444    /// The \ref run() function can be used to execute the algorithm.\n
    445     /// The functions \ref iterationLimit(int), \ref stepLimit(int), and 
     445    /// The functions \ref iterationLimit(int), \ref stepLimit(int), and
    446446    /// \ref sizeLimit(int) can be used to specify various limits for the
    447447    /// search process.
    448    
     448
    449449    /// @{
    450    
     450
    451451    /// \brief Sets the maximum number of iterations.
    452452    ///
     
    460460    /// likely finds larger cliques. For smaller values, the algorithm is
    461461    /// faster but probably gives worse results.
    462     /// 
     462    ///
    463463    /// The default value is \c 1000.
    464464    /// \c -1 means that number of iterations is not limited.
     
    475475      return *this;
    476476    }
    477    
     477
    478478    /// \brief Sets the maximum number of search steps.
    479479    ///
     
    487487    /// likely finds larger cliques. For smaller values, the algorithm is
    488488    /// faster but probably gives worse results.
    489     /// 
     489    ///
    490490    /// The default value is \c -1, which means that number of steps
    491491    /// is not limited explicitly. However, the number of iterations is
     
    503503      return *this;
    504504    }
    505    
     505
    506506    /// \brief Sets the desired clique size.
    507507    ///
     
    509509    /// limit. If a clique of this size (or a larger one) is found, then the
    510510    /// algorithm terminates.
    511     /// 
     511    ///
    512512    /// This function is especially useful if you know an exact upper bound
    513     /// for the size of the cliques in the graph or if any clique above 
     513    /// for the size of the cliques in the graph or if any clique above
    514514    /// a certain size limit is sufficient for your application.
    515     /// 
     515    ///
    516516    /// The default value is \c -1, which means that the size limit is set to
    517517    /// the number of nodes in the graph.
     
    525525      return *this;
    526526    }
    527    
     527
    528528    /// \brief The maximum number of iterations.
    529529    ///
     
    535535      return _iteration_limit;
    536536    }
    537    
     537
    538538    /// \brief The maximum number of search steps.
    539539    ///
     
    545545      return _step_limit;
    546546    }
    547    
     547
    548548    /// \brief The desired clique size.
    549549    ///
     
    584584    /// \name Query Functions
    585585    /// The results of the algorithm can be obtained using these functions.\n
    586     /// The run() function must be called before using them. 
     586    /// The run() function must be called before using them.
    587587
    588588    /// @{
     
    677677
    678678  private:
    679  
     679
    680680    // Initialize search options and limits
    681681    void initOptions() {
     
    683683      _delta_based_restart = true;
    684684      _restart_delta_limit = 4;
    685      
     685
    686686      // Search limits
    687687      _iteration_limit = 1000;
  • lemon/hao_orlin.h

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

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

    r1074 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    156156    /// these values.
    157157    enum TerminationCause {
    158      
     158
    159159      /// No directed cycle can be found in the digraph.
    160160      NO_CYCLE = 0,
    161    
     161
    162162      /// Optimal solution (minimum cycle mean) is found.
    163163      OPTIMAL = 1,
     
    357357    ///
    358358    /// \param limit  The maximum allowed number of iterations during
    359     /// the search process. Its default value implies that the algorithm 
     359    /// the search process. Its default value implies that the algorithm
    360360    /// runs until it finds the exact optimal solution.
    361361    ///
    362362    /// \return The termination cause of the search process.
    363     /// For more information, see \ref TerminationCause. 
     363    /// For more information, see \ref TerminationCause.
    364364    TerminationCause findCycleMean(int limit = std::numeric_limits<int>::max()) {
    365365      // Initialize and find strongly connected components
     
    390390          _best_node = _curr_node;
    391391        }
    392        
     392
    393393        if (iter_limit_reached) break;
    394394      }
  • lemon/insertion_tsp.h

    r1074 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    361361              Node u = _notused[i];
    362362              Cost min_cost = costDiff(_tour.back(), _tour.front(), u);
    363               int min_pos = 0;             
     363              int min_pos = 0;
    364364              for (unsigned int j=1; j<_tour.size(); ++j) {
    365365                Cost curr_cost = costDiff(_tour[j-1], _tour[j], u);
     
    391391            _notused[min_node] = _notused.back();
    392392            _notused.pop_back();
    393            
     393
    394394            // Insert the selected node into the tour
    395395            const int ipos = _ins_pos[sn];
     
    406406              Cost nc1 = costDiff(_tour[ipos_prev], _tour[ipos], u);
    407407              Cost nc2 = costDiff(_tour[ipos], _tour[ipos_next], u);
    408              
     408
    409409              if (nc1 <= curr_cost || nc2 <= curr_cost) {
    410410                // A new position is better than the old one
     
    421421                  // The minimum should be found again
    422422                  curr_cost = costDiff(_tour.back(), _tour.front(), u);
    423                   curr_pos = 0;             
     423                  curr_pos = 0;
    424424                  for (unsigned int j=1; j<_tour.size(); ++j) {
    425425                    Cost tmp_cost = costDiff(_tour[j-1], _tour[j], u);
     
    434434                }
    435435              }
    436              
     436
    437437              _ins_cost[u] = curr_cost;
    438438              _ins_pos[u] = curr_pos;
  • lemon/karp_mmc.h

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

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

    r1074 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2011
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    26392639        _red_node_index.insert(std::make_pair(converter(map[n]), n));
    26402640      }
    2641       for (BlueNodeIt n(_graph); n != INVALID; ++n) {     
     2641      for (BlueNodeIt n(_graph); n != INVALID; ++n) {
    26422642        _blue_node_index.insert(std::make_pair(converter(map[n]), n));
    26432643      }
  • lemon/lgf_writer.h

    r1074 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    186186      ValueStorage(const Value& value, const Converter& converter = Converter())
    187187        : _value(value), _converter(converter) {}
    188      
     188
    189189      virtual std::string get() {
    190190        return _converter(_value);
  • lemon/list_graph.h

    r1049 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    17661766    void next(BlueNode& node) const {
    17671767      node.id = nodes[node.id].partition_next;
    1768     }   
     1768    }
    17691769
    17701770    void first(Arc& e) const {
  • lemon/lp.h

    r1064 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/lp_base.cc

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

    r1076 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    10291029      }
    10301030    };
    1031    
     1031
    10321032  protected:
    10331033    virtual void _write(std::string, std::string format) const
     
    10351035      throw UnsupportedFormatError(format);
    10361036    }
    1037    
     1037
    10381038  public:
    10391039
  • lemon/lp_skeleton.cc

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

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

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

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

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

    r977 r1092  
    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-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    2222
    2323/// \ingroup search
    24 /// \file 
     24/// \file
    2525/// \brief Maximum cardinality search in undirected digraphs.
    2626
     
    4242  template <typename GR, typename CAP>
    4343  struct MaxCardinalitySearchDefaultTraits {
    44     /// The digraph type the algorithm runs on. 
     44    /// The digraph type the algorithm runs on.
    4545    typedef GR Digraph;
    4646
     
    5151
    5252      static CapacityMap *createCapacityMap(const Digraph& g) {
    53         return new CapacityMap(g);
     53        return new CapacityMap(g);
    5454      }
    5555    };
     
    6161
    6262      static CapacityMap *createCapacityMap(const Digraph&) {
    63         return new CapacityMap;
     63        return new CapacityMap;
    6464      }
    6565    };
     
    9191    /// \brief Instantiates a HeapCrossRef.
    9292    ///
    93     /// This function instantiates a \ref HeapCrossRef. 
    94     /// \param digraph is the digraph, to which we would like to define the 
     93    /// This function instantiates a \ref HeapCrossRef.
     94    /// \param digraph is the digraph, to which we would like to define the
    9595    /// HeapCrossRef.
    9696    static HeapCrossRef *createHeapCrossRef(const Digraph &digraph) {
    9797      return new HeapCrossRef(digraph);
    9898    }
    99    
     99
    100100    template <typename CapacityMap>
    101101    struct HeapSelector {
    102102      template <typename Value, typename Ref>
    103       struct Selector { 
     103      struct Selector {
    104104        typedef BinHeap<Value, Ref, std::greater<Value> > Heap;
    105105      };
     
    129129    /// \brief Instantiates a Heap.
    130130    ///
    131     /// This function instantiates a \ref Heap. 
     131    /// This function instantiates a \ref Heap.
    132132    /// \param crossref The cross reference of the heap.
    133133    static Heap *createHeap(HeapCrossRef& crossref) {
     
    144144    /// \brief Instantiates a ProcessedMap.
    145145    ///
    146     /// This function instantiates a \ref ProcessedMap. 
     146    /// This function instantiates a \ref ProcessedMap.
    147147    /// \param digraph is the digraph, to which
    148148    /// we would like to define the \ref ProcessedMap
     
    157157
    158158    /// \brief The type of the map that stores the cardinalities of the nodes.
    159     /// 
     159    ///
    160160    /// The type of the map that stores the cardinalities of the nodes.
    161161    /// It must meet the \ref concepts::WriteMap "WriteMap" concept.
     
    164164    /// \brief Instantiates a CardinalityMap.
    165165    ///
    166     /// This function instantiates a \ref CardinalityMap. 
    167     /// \param digraph is the digraph, to which we would like to define the \ref 
     166    /// This function instantiates a \ref CardinalityMap.
     167    /// \param digraph is the digraph, to which we would like to define the \ref
    168168    /// CardinalityMap
    169169    static CardinalityMap *createCardinalityMap(const Digraph &digraph) {
     
    173173
    174174  };
    175  
     175
    176176  /// \ingroup search
    177177  ///
    178178  /// \brief Maximum Cardinality Search algorithm class.
    179179  ///
    180   /// This class provides an efficient implementation of Maximum Cardinality 
    181   /// Search algorithm. The maximum cardinality search first chooses any 
     180  /// This class provides an efficient implementation of Maximum Cardinality
     181  /// Search algorithm. The maximum cardinality search first chooses any
    182182  /// node of the digraph. Then every time it chooses one unprocessed node
    183183  /// with maximum cardinality, i.e the sum of capacities on out arcs to the nodes
     
    187187
    188188  /// The arc capacities are passed to the algorithm using a
    189   /// \ref concepts::ReadMap "ReadMap", so it is easy to change it to any 
     189  /// \ref concepts::ReadMap "ReadMap", so it is easy to change it to any
    190190  /// kind of capacity.
    191191  ///
    192   /// The type of the capacity is determined by the \ref 
     192  /// The type of the capacity is determined by the \ref
    193193  /// concepts::ReadMap::Value "Value" of the capacity map.
    194194  ///
     
    197197  ///
    198198  /// \param GR The digraph type the algorithm runs on. The value of
    199   /// Digraph is not used directly by the search algorithm, it 
     199  /// Digraph is not used directly by the search algorithm, it
    200200  /// is only passed to \ref MaxCardinalitySearchDefaultTraits.
    201   /// \param CAP This read-only ArcMap determines the capacities of 
     201  /// \param CAP This read-only ArcMap determines the capacities of
    202202  /// the arcs. It is read once for each arc, so the map may involve in
    203203  /// relatively time consuming process to compute the arc capacity if
    204204  /// it is necessary. The default map type is \ref
    205205  /// ConstMap "ConstMap<concepts::Digraph::Arc, Const<int,1> >". The value
    206   /// of CapacityMap is not used directly by search algorithm, it is only 
    207   /// passed to \ref MaxCardinalitySearchDefaultTraits. 
    208   /// \param TR Traits class to set various data types used by the 
    209   /// algorithm.  The default traits class is 
    210   /// \ref MaxCardinalitySearchDefaultTraits 
    211   /// "MaxCardinalitySearchDefaultTraits<GR, CAP>". 
    212   /// See \ref MaxCardinalitySearchDefaultTraits 
     206  /// of CapacityMap is not used directly by search algorithm, it is only
     207  /// passed to \ref MaxCardinalitySearchDefaultTraits.
     208  /// \param TR Traits class to set various data types used by the
     209  /// algorithm.  The default traits class is
     210  /// \ref MaxCardinalitySearchDefaultTraits
     211  /// "MaxCardinalitySearchDefaultTraits<GR, CAP>".
     212  /// See \ref MaxCardinalitySearchDefaultTraits
    213213  /// for the documentation of a MaxCardinalitySearch traits class.
    214214
     
    216216  template <typename GR, typename CAP, typename TR>
    217217#else
    218   template <typename GR, typename CAP = 
    219             ConstMap<typename GR::Arc, Const<int,1> >,
    220             typename TR =
     218  template <typename GR, typename CAP =
     219            ConstMap<typename GR::Arc, Const<int,1> >,
     220            typename TR =
    221221            MaxCardinalitySearchDefaultTraits<GR, CAP> >
    222222#endif
     
    227227    ///The type of the underlying digraph.
    228228    typedef typename Traits::Digraph Digraph;
    229    
     229
    230230    ///The type of the capacity of the arcs.
    231231    typedef typename Traits::CapacityMap::Value Value;
     
    267267
    268268    typedef MaxCardinalitySearch Create;
    269  
     269
    270270    ///\name Named template parameters
    271271
     
    276276      typedef T CapacityMap;
    277277      static CapacityMap *createCapacityMap(const Digraph &) {
    278         LEMON_ASSERT(false,"Uninitialized parameter.");
    279         return 0;
    280       }
    281     };
    282     /// \brief \ref named-templ-param "Named parameter" for setting 
     278               LEMON_ASSERT(false,"Uninitialized parameter.");
     279        return 0;
     280      }
     281    };
     282    /// \brief \ref named-templ-param "Named parameter" for setting
    283283    /// CapacityMap type
    284284    ///
     
    286286    /// for the algorithm.
    287287    template <class T>
    288     struct SetCapacityMap 
    289       : public MaxCardinalitySearch<Digraph, CapacityMap, 
    290                                     DefCapacityMapTraits<T> > { 
    291       typedef MaxCardinalitySearch<Digraph, CapacityMap, 
     288    struct SetCapacityMap
     289      : public MaxCardinalitySearch<Digraph, CapacityMap,
     290                                    DefCapacityMapTraits<T> > {
     291      typedef MaxCardinalitySearch<Digraph, CapacityMap,
    292292                                   DefCapacityMapTraits<T> > Create;
    293293    };
     
    296296    struct DefCardinalityMapTraits : public Traits {
    297297      typedef T CardinalityMap;
    298       static CardinalityMap *createCardinalityMap(const Digraph &) 
     298      static CardinalityMap *createCardinalityMap(const Digraph &)
    299299      {
    300         LEMON_ASSERT(false,"Uninitialized parameter.");
    301         return 0;
    302       }
    303     };
    304     /// \brief \ref named-templ-param "Named parameter" for setting 
     300        LEMON_ASSERT(false,"Uninitialized parameter.");
     301        return 0;
     302      }
     303    };
     304    /// \brief \ref named-templ-param "Named parameter" for setting
    305305    /// CardinalityMap type
    306306    ///
    307     /// \ref named-templ-param "Named parameter" for setting CardinalityMap 
     307    /// \ref named-templ-param "Named parameter" for setting CardinalityMap
    308308    /// type for the algorithm.
    309309    template <class T>
    310     struct SetCardinalityMap 
    311       : public MaxCardinalitySearch<Digraph, CapacityMap, 
    312                                     DefCardinalityMapTraits<T> > { 
    313       typedef MaxCardinalitySearch<Digraph, CapacityMap, 
     310    struct SetCardinalityMap
     311      : public MaxCardinalitySearch<Digraph, CapacityMap,
     312                                    DefCardinalityMapTraits<T> > {
     313      typedef MaxCardinalitySearch<Digraph, CapacityMap,
    314314                                   DefCardinalityMapTraits<T> > Create;
    315315    };
    316    
     316
    317317    template <class T>
    318318    struct DefProcessedMapTraits : public Traits {
    319319      typedef T ProcessedMap;
    320320      static ProcessedMap *createProcessedMap(const Digraph &) {
    321         LEMON_ASSERT(false,"Uninitialized parameter.");
    322         return 0;
    323       }
    324     };
    325     /// \brief \ref named-templ-param "Named parameter" for setting 
     321               LEMON_ASSERT(false,"Uninitialized parameter.");
     322        return 0;
     323      }
     324    };
     325    /// \brief \ref named-templ-param "Named parameter" for setting
    326326    /// ProcessedMap type
    327327    ///
     
    329329    /// for the algorithm.
    330330    template <class T>
    331     struct SetProcessedMap 
    332       : public MaxCardinalitySearch<Digraph, CapacityMap, 
    333                                     DefProcessedMapTraits<T> > { 
    334       typedef MaxCardinalitySearch<Digraph, CapacityMap, 
     331    struct SetProcessedMap
     332      : public MaxCardinalitySearch<Digraph, CapacityMap,
     333                                    DefProcessedMapTraits<T> > {
     334      typedef MaxCardinalitySearch<Digraph, CapacityMap,
    335335                                   DefProcessedMapTraits<T> > Create;
    336336    };
    337    
     337
    338338    template <class H, class CR>
    339339    struct DefHeapTraits : public Traits {
     
    341341      typedef H Heap;
    342342      static HeapCrossRef *createHeapCrossRef(const Digraph &) {
    343         LEMON_ASSERT(false,"Uninitialized parameter.");
    344         return 0;
     343             LEMON_ASSERT(false,"Uninitialized parameter.");
     344        return 0;
    345345      }
    346346      static Heap *createHeap(HeapCrossRef &) {
    347         LEMON_ASSERT(false,"Uninitialized parameter.");
    348         return 0;
    349       }
    350     };
    351     /// \brief \ref named-templ-param "Named parameter" for setting heap 
     347               LEMON_ASSERT(false,"Uninitialized parameter.");
     348        return 0;
     349      }
     350    };
     351    /// \brief \ref named-templ-param "Named parameter" for setting heap
    352352    /// and cross reference type
    353353    ///
    354     /// \ref named-templ-param "Named parameter" for setting heap and cross 
     354    /// \ref named-templ-param "Named parameter" for setting heap and cross
    355355    /// reference type for the algorithm.
    356356    template <class H, class CR = typename Digraph::template NodeMap<int> >
    357357    struct SetHeap
    358       : public MaxCardinalitySearch<Digraph, CapacityMap, 
    359                                     DefHeapTraits<H, CR> > { 
    360       typedef MaxCardinalitySearch< Digraph, CapacityMap, 
     358      : public MaxCardinalitySearch<Digraph, CapacityMap,
     359                                    DefHeapTraits<H, CR> > {
     360      typedef MaxCardinalitySearch< Digraph, CapacityMap,
    361361                                    DefHeapTraits<H, CR> > Create;
    362362    };
     
    367367      typedef H Heap;
    368368      static HeapCrossRef *createHeapCrossRef(const Digraph &digraph) {
    369         return new HeapCrossRef(digraph);
     369        return new HeapCrossRef(digraph);
    370370      }
    371371      static Heap *createHeap(HeapCrossRef &crossref) {
    372         return new Heap(crossref);
    373       }
    374     };
    375 
    376     /// \brief \ref named-templ-param "Named parameter" for setting heap and 
     372        return new Heap(crossref);
     373      }
     374    };
     375
     376    /// \brief \ref named-templ-param "Named parameter" for setting heap and
    377377    /// cross reference type with automatic allocation
    378378    ///
    379     /// \ref named-templ-param "Named parameter" for setting heap and cross 
    380     /// reference type. It can allocate the heap and the cross reference 
    381     /// object if the cross reference's constructor waits for the digraph as 
     379    /// \ref named-templ-param "Named parameter" for setting heap and cross
     380    /// reference type. It can allocate the heap and the cross reference
     381    /// object if the cross reference's constructor waits for the digraph as
    382382    /// parameter and the heap's constructor waits for the cross reference.
    383383    template <class H, class CR = typename Digraph::template NodeMap<int> >
    384384    struct SetStandardHeap
    385       : public MaxCardinalitySearch<Digraph, CapacityMap, 
    386                                     DefStandardHeapTraits<H, CR> > { 
    387       typedef MaxCardinalitySearch<Digraph, CapacityMap, 
    388                                    DefStandardHeapTraits<H, CR> > 
     385      : public MaxCardinalitySearch<Digraph, CapacityMap,
     386                                    DefStandardHeapTraits<H, CR> > {
     387      typedef MaxCardinalitySearch<Digraph, CapacityMap,
     388                                   DefStandardHeapTraits<H, CR> >
    389389      Create;
    390390    };
    391    
     391
    392392    ///@}
    393393
     
    397397    MaxCardinalitySearch() {}
    398398
    399   public:     
    400    
     399  public:
     400
    401401    /// \brief Constructor.
    402402    ///
     
    404404    ///\param capacity the capacity map used by the algorithm.
    405405    MaxCardinalitySearch(const Digraph& digraph,
    406                         const CapacityMap& capacity) :
     406                        const CapacityMap& capacity) :
    407407      _graph(&digraph),
    408408      _capacity(&capacity), local_capacity(false),
     
    442442    MaxCardinalitySearch &capacityMap(const CapacityMap &m) {
    443443      if (local_capacity) {
    444         delete _capacity;
    445         local_capacity=false;
     444        delete _capacity;
     445        local_capacity=false;
    446446      }
    447447      _capacity=&m;
     
    457457    }
    458458
    459     /// \brief Sets the map storing the cardinalities calculated by the 
     459    /// \brief Sets the map storing the cardinalities calculated by the
    460460    /// algorithm.
    461461    ///
     
    467467    MaxCardinalitySearch &cardinalityMap(CardinalityMap &m) {
    468468      if(local_cardinality) {
    469         delete _cardinality;
    470         local_cardinality=false;
     469        delete _cardinality;
     470        local_cardinality=false;
    471471      }
    472472      _cardinality = &m;
     
    481481    /// automatically allocated map, of course.
    482482    /// \return <tt> (*this) </tt>
    483     MaxCardinalitySearch &processedMap(ProcessedMap &m) 
     483    MaxCardinalitySearch &processedMap(ProcessedMap &m)
    484484    {
    485485      if(local_processed) {
    486         delete _processed;
    487         local_processed=false;
     486        delete _processed;
     487        local_processed=false;
    488488      }
    489489      _processed = &m;
     
    508508    MaxCardinalitySearch &heap(Heap& hp, HeapCrossRef &cr) {
    509509      if(local_heap_cross_ref) {
    510         delete _heap_cross_ref;
    511         local_heap_cross_ref = false;
     510        delete _heap_cross_ref;
     511        local_heap_cross_ref = false;
    512512      }
    513513      _heap_cross_ref = &cr;
    514514      if(local_heap) {
    515         delete _heap;
    516         local_heap = false;
     515        delete _heap;
     516        local_heap = false;
    517517      }
    518518      _heap = &hp;
     
    545545    void create_maps() {
    546546      if(!_capacity) {
    547         local_capacity = true;
    548         _capacity = Traits::createCapacityMap(*_graph);
     547        local_capacity = true;
     548        _capacity = Traits::createCapacityMap(*_graph);
    549549      }
    550550      if(!_cardinality) {
    551         local_cardinality = true;
    552         _cardinality = Traits::createCardinalityMap(*_graph);
     551        local_cardinality = true;
     552        _cardinality = Traits::createCardinalityMap(*_graph);
    553553      }
    554554      if(!_processed) {
    555         local_processed = true;
    556         _processed = Traits::createProcessedMap(*_graph);
     555        local_processed = true;
     556        _processed = Traits::createProcessedMap(*_graph);
    557557      }
    558558      if (!_heap_cross_ref) {
    559         local_heap_cross_ref = true;
    560         _heap_cross_ref = Traits::createHeapCrossRef(*_graph);
     559        local_heap_cross_ref = true;
     560        _heap_cross_ref = Traits::createHeapCrossRef(*_graph);
    561561      }
    562562      if (!_heap) {
    563         local_heap = true;
    564         _heap = Traits::createHeap(*_heap_cross_ref);
    565       }
    566     }
    567    
     563        local_heap = true;
     564        _heap = Traits::createHeap(*_heap_cross_ref);
     565      }
     566    }
     567
    568568    void finalizeNodeData(Node node, Value capacity) {
    569569      _processed->set(node, true);
     
    590590      _heap->clear();
    591591      for (NodeIt it(*_graph) ; it != INVALID ; ++it) {
    592         _processed->set(it, false);
    593         _heap_cross_ref->set(it, Heap::PRE_HEAP);
    594       }
    595     }
    596    
     592        _processed->set(it, false);
     593        _heap_cross_ref->set(it, Heap::PRE_HEAP);
     594      }
     595    }
     596
    597597    /// \brief Adds a new source node.
    598     /// 
     598    ///
    599599    /// Adds a new source node to the priority heap.
    600600    ///
     
    602602    void addSource(Node source, Value capacity = 0) {
    603603      if(_heap->state(source) == Heap::PRE_HEAP) {
    604         _heap->push(source, capacity);
    605       } 
    606     }
    607    
     604        _heap->push(source, capacity);
     605      }
     606    }
     607
    608608    /// \brief Processes the next node in the priority heap
    609609    ///
     
    614614    /// \warning The priority heap must not be empty!
    615615    Node processNextNode() {
    616       Node node = _heap->top(); 
     616      Node node = _heap->top();
    617617      finalizeNodeData(node, _heap->prio());
    618618      _heap->pop();
    619      
     619
    620620      for (InArcIt it(*_graph, node); it != INVALID; ++it) {
    621         Node source = _graph->source(it);
    622         switch (_heap->state(source)) {
    623         case Heap::PRE_HEAP:
    624           _heap->push(source, (*_capacity)[it]);
    625           break;
    626         case Heap::IN_HEAP:
    627           _heap->decrease(source, (*_heap)[source] + (*_capacity)[it]);
    628           break;
    629         case Heap::POST_HEAP:
    630           break;
    631         }
     621        Node source = _graph->source(it);
     622        switch (_heap->state(source)) {
     623        case Heap::PRE_HEAP:
     624          _heap->push(source, (*_capacity)[it]);
     625          break;
     626        case Heap::IN_HEAP:
     627          _heap->decrease(source, (*_heap)[source] + (*_capacity)[it]);
     628          break;
     629        case Heap::POST_HEAP:
     630          break;
     631        }
    632632      }
    633633      return node;
     
    638638    /// Next node to be processed.
    639639    ///
    640     /// \return The next node to be processed or INVALID if the 
     640    /// \return The next node to be processed or INVALID if the
    641641    /// priority heap is empty.
    642     Node nextNode() { 
     642    Node nextNode() {
    643643      return !_heap->empty() ? _heap->top() : INVALID;
    644644    }
    645  
     645
    646646    /// \brief Returns \c false if there are nodes
    647647    /// to be processed in the priority heap
     
    650650    /// to be processed in the priority heap
    651651    bool emptyQueue() { return _heap->empty(); }
    652     /// \brief Returns the number of the nodes to be processed 
     652    /// \brief Returns the number of the nodes to be processed
    653653    /// in the priority heap
    654654    ///
    655655    /// Returns the number of the nodes to be processed in the priority heap
    656656    int emptySize() { return _heap->size(); }
    657    
     657
    658658    /// \brief Executes the algorithm.
    659659    ///
     
    663663    /// with addSource() before using this function.
    664664    ///
    665     /// This method runs the Maximum Cardinality Search algorithm from the 
     665    /// This method runs the Maximum Cardinality Search algorithm from the
    666666    /// source node(s).
    667667    void start() {
    668668      while ( !_heap->empty() ) processNextNode();
    669669    }
    670    
     670
    671671    /// \brief Executes the algorithm until \c dest is reached.
    672672    ///
     
    676676    /// with addSource() before using this function.
    677677    ///
    678     /// This method runs the %MaxCardinalitySearch algorithm from the source 
     678    /// This method runs the %MaxCardinalitySearch algorithm from the source
    679679    /// nodes.
    680680    void start(Node dest) {
     
    682682      if ( !_heap->empty() ) finalizeNodeData(_heap->top(), _heap->prio());
    683683    }
    684    
     684
    685685    /// \brief Executes the algorithm until a condition is met.
    686686    ///
     
    697697      if ( !_heap->empty() ) finalizeNodeData(_heap->top(),_heap->prio());
    698698    }
    699    
     699
    700700    /// \brief Runs the maximum cardinality search algorithm from node \c s.
    701701    ///
    702     /// This method runs the %MaxCardinalitySearch algorithm from a root 
     702    /// This method runs the %MaxCardinalitySearch algorithm from a root
    703703    /// node \c s.
    704704    ///
     
    715715    }
    716716
    717     /// \brief Runs the maximum cardinality search algorithm for the 
     717    /// \brief Runs the maximum cardinality search algorithm for the
    718718    /// whole digraph.
    719719    ///
    720     /// This method runs the %MaxCardinalitySearch algorithm from all 
     720    /// This method runs the %MaxCardinalitySearch algorithm from all
    721721    /// unprocessed node of the digraph.
    722722    ///
     
    740740      }
    741741    }
    742    
     742
    743743    ///@}
    744744
    745745    /// \name Query Functions
    746     /// The results of the maximum cardinality search algorithm can be 
     746    /// The results of the maximum cardinality search algorithm can be
    747747    /// obtained using these functions.
    748748    /// \n
    749     /// Before the use of these functions, either run() or start() must be 
     749    /// Before the use of these functions, either run() or start() must be
    750750    /// called.
    751    
     751
    752752    ///@{
    753753
     
    768768    /// \brief Returns a reference to the NodeMap of cardinalities.
    769769    ///
    770     /// Returns a reference to the NodeMap of cardinalities. \pre \ref run() 
     770    /// Returns a reference to the NodeMap of cardinalities. \pre \ref run()
    771771    /// must be called before using this function.
    772772    const CardinalityMap &cardinalityMap() const { return *_cardinality;}
    773  
     773
    774774    /// \brief Checks if a node is reachable from the root.
    775775    ///
     
    785785    /// \pre \ref run() must be called before using this function.
    786786    bool processed(Node v) { return (*_heap_cross_ref)[v] == Heap::POST_HEAP; }
    787    
     787
    788788    ///@}
    789789  };
  • lemon/min_cost_arborescence.h

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

    r978 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    304304    //This is here to avoid a gcc-3.3 compilation error.
    305305    //It should never be called.
    306     NagamochiIbaraki() {} 
    307    
     306    NagamochiIbaraki() {}
     307
    308308  public:
    309309
     
    415415        for (typename Graph::OutArcIt a(_graph, n); a != INVALID; ++a) {
    416416          typename Graph::Node m = _graph.target(a);
    417          
     417
    418418          if (!(n < m)) continue;
    419419
    420420          (*_nodes)[n].sum += (*_capacity)[a];
    421421          (*_nodes)[m].sum += (*_capacity)[a];
    422          
     422
    423423          int c = (*_nodes)[m].curr_arc;
    424424          if (c != -1 && _arcs[c ^ 1].target == n) {
     
    426426          } else {
    427427            _edges[index].capacity = (*_capacity)[a];
    428            
     428
    429429            _arcs[index << 1].prev = -1;
    430430            if ((*_nodes)[n].first_arc != -1) {
     
    436436
    437437            (*_nodes)[m].curr_arc = (index << 1);
    438            
     438
    439439            _arcs[(index << 1) | 1].prev = -1;
    440440            if ((*_nodes)[m].first_arc != -1) {
     
    444444            (*_nodes)[m].first_arc = ((index << 1) | 1);
    445445            _arcs[(index << 1) | 1].target = n;
    446            
     446
    447447            ++index;
    448448          }
     
    453453      _min_cut = std::numeric_limits<Value>::max();
    454454
    455       for (typename Graph::Node n = _first_node; 
     455      for (typename Graph::Node n = _first_node;
    456456           n != INVALID; n = (*_nodes)[n].next) {
    457457        if ((*_nodes)[n].sum < _min_cut) {
     
    478478
    479479      _heap->clear();
    480       for (typename Graph::Node n = _first_node; 
     480      for (typename Graph::Node n = _first_node;
    481481           n != INVALID; n = (*_nodes)[n].next) {
    482482        (*_heap_cross_ref)[n] = Heap::PRE_HEAP;
     
    498498        for (int a = (*_nodes)[n].first_arc; a != -1; a = _arcs[a].next) {
    499499          switch (_heap->state(_arcs[a].target)) {
    500           case Heap::PRE_HEAP: 
     500          case Heap::PRE_HEAP:
    501501            {
    502502              Value nv = _edges[a >> 1].capacity;
     
    564564            if (!merged) {
    565565              for (int b = (*_nodes)[n].first_arc; b != -1; b = _arcs[b].next) {
    566                 (*_nodes)[_arcs[b].target].curr_arc = b;         
     566                (*_nodes)[_arcs[b].target].curr_arc = b;
    567567              }
    568568              merged = true;
     
    574574              if ((b ^ a) == 1) continue;
    575575              typename Graph::Node o = _arcs[b].target;
    576               int c = (*_nodes)[o].curr_arc; 
     576              int c = (*_nodes)[o].curr_arc;
    577577              if (c != -1 && _arcs[c ^ 1].target == n) {
    578578                _edges[c >> 1].capacity += _edges[b >> 1].capacity;
     
    607607            } else {
    608608              (*_nodes)[n].first_arc = _arcs[a].next;
    609             }           
     609            }
    610610            if (_arcs[a].next != -1) {
    611611              _arcs[_arcs[a].next].prev = _arcs[a].prev;
     
    615615            (*_next_rep)[(*_nodes)[n].last_rep] = m;
    616616            (*_nodes)[n].last_rep = (*_nodes)[m].last_rep;
    617            
     617
    618618            if ((*_nodes)[m].prev != INVALID) {
    619619              (*_nodes)[(*_nodes)[m].prev].next = (*_nodes)[m].next;
  • lemon/nearest_neighbor_tsp.h

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

    r1080 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    12351235      return true;
    12361236    }
    1237    
     1237
    12381238    // Check if the upper bound is greater or equal to the lower bound
    12391239    // on each arc.
  • lemon/opt2_tsp.h

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

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

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

    r1080 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    555555        }
    556556      }
    557       for (NodeIt n(_graph); n != INVALID; ++n) 
     557      for (NodeIt n(_graph); n != INVALID; ++n)
    558558        if(n!=_source && n!=_target && _tolerance.positive((*_excess)[n]))
    559559          _level->activate(n);
    560          
     560
    561561      return true;
    562562    }
     
    586586          level = _level->highestActiveLevel();
    587587          --num;
    588          
     588
    589589          Value excess = (*_excess)[n];
    590590          int new_level = _level->maxLevel();
  • lemon/radix_sort.h

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

    r1025 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    12641264            max_red = -1;
    12651265          }
    1266           Parent::notifier(RedNode()).erase(asRedNodeUnsafe(node));         
     1266          Parent::notifier(RedNode()).erase(asRedNodeUnsafe(node));
    12671267        } else {
    12681268          first_blue = nodes[n].partition_next;
  • lemon/soplex.cc

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

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

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

    r1054 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    9999    static Format format() { return _format; }
    100100
    101    
     101
    102102    ///Read the current time values of the process
    103103    void stamp()
     
    523523    ///       on destruction.
    524524    TimeReport(std::string title,std::ostream &os=std::cerr,bool run=true,
    525                bool active=true)
     525               bool active=true)
    526526      : Timer(run), _title(title), _os(os), _active(active) {}
    527527    ///Destructor that prints the ellapsed time
     
    530530      if(_active) _os << _title << *this << std::endl;
    531531    }
    532    
     532
    533533    ///Retrieve the activity status
    534534
  • lemon/unionfind.h

    r877 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/adaptors_test.cc

    r1084 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/arc_look_up_test.cc

    r993 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    6969  std::istringstream lgfs(lgf);
    7070  DigraphReader<ListDigraph>(graph, lgfs).run();
    71  
     71
    7272  AllArcLookUp<ListDigraph> lookup(graph);
    73        
     73
    7474  int numArcs = countArcs(graph);
    75        
     75
    7676  int arcCnt = 0;
    7777  for(ListDigraph::NodeIt n1(graph); n1 != INVALID; ++n1)
    7878    for(ListDigraph::NodeIt n2(graph); n2 != INVALID; ++n2)
    7979      for(ListDigraph::Arc a = lookup(n1, n2); a != INVALID;
    80           a = lookup(n1, n2, a))
    81         ++arcCnt;
     80          a = lookup(n1, n2, a))
     81        ++arcCnt;
    8282  check(arcCnt==numArcs, "Wrong total number of arcs");
    8383
  • test/bellman_ford_test.cc

    r1085 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/bfs_test.cc

    r1084 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/bpgraph_test.cc

    r1026 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    114114  BpGraph G;
    115115  RedNode
    116     n1 = G.addRedNode(), n4 = G.addRedNode(); 
     116    n1 = G.addRedNode(), n4 = G.addRedNode();
    117117  BlueNode
    118118    n2 = G.addBlueNode(), n3 = G.addBlueNode();
     
    162162  BpGraph G;
    163163  RedNode
    164     n1 = G.addRedNode(), n4 = G.addRedNode(); 
     164    n1 = G.addRedNode(), n4 = G.addRedNode();
    165165  BlueNode
    166166    n2 = G.addBlueNode(), n3 = G.addBlueNode();
     
    217217    n2 = G.addBlueNode(),
    218218    n3 = G.addBlueNode();
    219   Edge 
     219  Edge
    220220    e1 = G.addEdge(n1, n2),
    221221    e2 = G.addEdge(n1, n3);
  • test/circulation_test.cc

    r1084 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/connectivity_test.cc

    r1091 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/dfs_test.cc

    r1086 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    224224  check(dfs.run(s1,t1) && dfs.reached(t1),"Node 3 is reachable from Node 6.");
    225225  }
    226  
     226
    227227  {
    228228    NullMap<Node,Arc> myPredMap;
  • test/digraph_test.cc

    r1085 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/dijkstra_test.cc

    r1084 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/edge_set_test.cc

    r1084 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/euler_test.cc

    r1084 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    103103    Digraph::Node n = d.addNode();
    104104    ::lemon::ignore_unused_variable_warning(n);
    105  
     105
    106106    checkDiEulerIt(d);
    107107    checkDiEulerIt(g);
  • test/fractional_matching_test.cc

    r1085 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/gomory_hu_test.cc

    r1084 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/graph_copy_test.cc

    r1026 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    5454    }
    5555  }
    56  
     56
    5757  // Test digraph copy
    5858  GR to;
     
    7373    nodeCrossRef(ncr).arcCrossRef(ecr).
    7474    node(fn, tn).arc(fa, ta).run();
    75  
     75
    7676  check(countNodes(from) == countNodes(to), "Wrong copy.");
    7777  check(countArcs(from) == countArcs(to), "Wrong copy.");
     
    101101  // Test repeated copy
    102102  digraphCopy(from, to).run();
    103  
     103
    104104  check(countNodes(from) == countNodes(to), "Wrong copy.");
    105105  check(countArcs(from) == countArcs(to), "Wrong copy.");
     
    204204  // Test repeated copy
    205205  graphCopy(from, to).run();
    206  
     206
    207207  check(countNodes(from) == countNodes(to), "Wrong copy.");
    208208  check(countEdges(from) == countEdges(to), "Wrong copy.");
     
    367367  // Test repeated copy
    368368  bpGraphCopy(from, to).run();
    369  
     369
    370370  check(countNodes(from) == countNodes(to), "Wrong copy.");
    371371  check(countRedNodes(from) == countRedNodes(to), "Wrong copy.");
  • test/graph_test.cc

    r1084 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/graph_test.h

    r1027 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/hao_orlin_test.cc

    r1084 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/heap_test.cc

    r948 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/lgf_reader_writer_test.cc

    r1030 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    386386  writer.arcMap("arc_map1", arc_map);
    387387  writer.arcMap("arc_map2", arc_map, WriterConverter());
    388   writer.node("node", n2); 
     388  writer.node("node", n2);
    389389  writer.edge("edge", e1);
    390390  writer.arc("arc", graph.direct(e1, false));
     
    493493  writer.arcMap("arc_map2", arc_map, WriterConverter());
    494494  writer.node("node", n);
    495   writer.redNode("red_node", rn1); 
     495  writer.redNode("red_node", rn1);
    496496  writer.blueNode("blue_node", bn2);
    497497  writer.edge("edge", e1);
  • test/lgf_test.cc

    r954 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2011
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    6464
    6565
    66 int main() 
     66int main()
    6767{
    6868  {
    69     ListDigraph d; 
     69    ListDigraph d;
    7070    ListDigraph::Node s,t;
    7171    ListDigraph::ArcMap<int> label(d);
     
    9494
    9595  {
    96     ListDigraph d; 
     96    ListDigraph d;
    9797    std::istringstream input(test_lgf_nomap);
    9898    digraphReader(d, input).
     
    111111
    112112  {
    113     ListDigraph d; 
     113    ListDigraph d;
    114114    std::istringstream input(test_lgf_bad1);
    115115    bool ok=false;
     
    118118        run();
    119119    }
    120     catch (FormatError&) 
     120    catch (FormatError&)
    121121      {
    122122        ok = true;
     
    140140
    141141  {
    142     ListDigraph d; 
     142    ListDigraph d;
    143143    std::istringstream input(test_lgf_bad2);
    144144    bool ok=false;
  • test/lp_test.cc

    r1078 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/maps_test.cc

    r1086 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/matching_test.cc

    r1084 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/max_cardinality_search_test.cc

    r955 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    6868  ProcMap proc;
    6969  HeapCrossRef crossref(g);
    70  
     70
    7171  typedef MaxCardinalitySearch<Digraph,CapMap>
    7272    ::SetCapacityMap<CapMap>
     
    8282  MaxCardType::Heap& heap = const_cast<MaxCardType::Heap&>(heap_const);
    8383  maxcard.heap(heap,crossref);
    84  
     84
    8585  maxcard.capacityMap(cap).cardinalityMap(card).processedMap(proc);
    8686
  • test/max_clique_test.cc

    r918 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    5555  "5 7    14\n"
    5656  "6 7    15\n";
    57      
     57
    5858
    5959// Check with general graphs
     
    6363  typedef GrossoLocatelliPullanMc<GR> McAlg;
    6464  typedef McAlg::CliqueNodeIt CliqueIt;
    65  
     65
    6666  // Basic tests
    6767  {
     
    8282    check(static_cast<GR::Node>(it1) == u && ++it1 == INVALID,
    8383          "Wrong CliqueNodeIt");
    84    
     84
    8585    GR::Node v = g.addNode();
    8686    check(mc.run(rule) == McAlg::ITERATION_LIMIT, "Wrong termination cause");
     
    110110      .nodeMap("max_clique", max_clique)
    111111      .run();
    112    
     112
    113113    McAlg mc(g);
    114114    mc.iterationLimit(50);
     
    134134  typedef GrossoLocatelliPullanMc<FullGraph> McAlg;
    135135  typedef McAlg::CliqueNodeIt CliqueIt;
    136  
     136
    137137  for (int size = 0; size <= 40; size = size * 3 + 1) {
    138138    GR g(size);
     
    157157  GridGraph::NodeMap<char> map(g);
    158158  GrossoLocatelliPullanMc<GridGraph> mc(g);
    159  
     159
    160160  mc.iterationLimit(100);
    161161  check(mc.run(rule) == mc.ITERATION_LIMIT, "Wrong termination cause");
     
    180180  checkMaxCliqueFullGraph(GrossoLocatelliPullanMc<FullGraph>::DEGREE_BASED);
    181181  checkMaxCliqueFullGraph(GrossoLocatelliPullanMc<FullGraph>::PENALTY_BASED);
    182                        
     182
    183183  checkMaxCliqueGridGraph(GrossoLocatelliPullanMc<GridGraph>::RANDOM);
    184184  checkMaxCliqueGridGraph(GrossoLocatelliPullanMc<GridGraph>::DEGREE_BASED);
    185185  checkMaxCliqueGridGraph(GrossoLocatelliPullanMc<GridGraph>::PENALTY_BASED);
    186                        
     186
    187187  return 0;
    188188}
  • test/max_flow_test.cc

    r1087 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    223223{
    224224  DIGRAPH_TYPEDEFS(SmartDigraph);
    225  
     225
    226226  SmartDigraph g;
    227227  SmartDigraph::ArcMap<int> cap(g),iflow(g);
     
    383383  checkMaxFlowAlg<PType2, PreflowStartFunctions<PType2> >();
    384384  initFlowTest();
    385  
     385
    386386  // Check EdmondsKarp
    387387  typedef EdmondsKarp<SmartDigraph, SmartDigraph::ArcMap<int> > EKType1;
     
    391391
    392392  initFlowTest();
    393  
     393
    394394  return 0;
    395395}
  • test/min_cost_arborescence_test.cc

    r1084 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/min_cost_flow_test.cc

    r877 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/min_mean_cycle_test.cc

    r1012 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    211211    checkMmcAlg<HowardMmc<GR, IntArcMap> >(gr, l3, c3,  0, 1);
    212212    checkMmcAlg<HowardMmc<GR, IntArcMap> >(gr, l4, c4, -1, 1);
    213    
     213
    214214    // Howard with iteration limit
    215215    HowardMmc<GR, IntArcMap> mmc(gr, l1);
  • test/nagamochi_ibaraki_test.cc

    r1087 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/path_test.cc

    r1044 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/radix_sort_test.cc

    r1043 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    5353template<class T>
    5454T listsort(typename T::iterator b, typename T::iterator e)
    55 { 
     55{
    5656  if(b==e) return T();
    5757  typename T::iterator bn=b;
  • test/suurballe_test.cc

    r1084 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/time_measure_test.cc

    r1083 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • test/tsp_test.cc

    r1037 r1092  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    4242//   check(checkMetricCost(g, constMap<Edge>(1)), "Wrong checkMetricCost()");
    4343//   check(!checkMetricCost(g, constMap<Edge>(-1)), "Wrong checkMetricCost()");
    44 //   
     44//
    4545//   FullGraph::EdgeMap<float> cost(g);
    4646//   for (NodeIt u(g); u != INVALID; ++u) {
     
    6565bool checkTour(const FullGraph &gr, const Container &p) {
    6666  FullGraph::NodeMap<bool> used(gr, false);
    67  
     67
    6868  int node_cnt = 0;
    6969  for (typename Container::const_iterator it = p.begin(); it != p.end(); ++it) {
     
    7373    ++node_cnt;
    7474  }
    75  
     75
    7676  return (node_cnt == gr.nodeNum());
    7777}
     
    8080bool checkTourPath(const FullGraph &gr, const Path<FullGraph> &p) {
    8181  FullGraph::NodeMap<bool> used(gr, false);
    82  
     82
    8383  if (!checkPath(gr, p)) return false;
    8484  if (gr.nodeNum() <= 1 && p.length() != 0) return false;
     
    182182      }
    183183    }
    184    
     184
    185185    check(alg.run() > 0, alg_name + ": Wrong total cost");
    186186
     
    196196    check(checkCost(g, path, cost, alg.tourCost()),
    197197      alg_name + ": Wrong tour cost");
    198    
     198
    199199    check(!Tolerance<double>().less(alg.tourCost(), opt2.run(alg.tourNodes())),
    200200      "2-opt improvement: Wrong total cost");
     
    203203    check(checkCost(g, opt2.tourNodes(), cost, opt2.tourCost()),
    204204      "2-opt improvement: Wrong tour cost");
    205    
     205
    206206    check(!Tolerance<double>().less(alg.tourCost(), opt2.run(path)),
    207207      "2-opt improvement: Wrong total cost");
     
    213213}
    214214
    215 // Algorithm class for Nearest Insertion 
     215// Algorithm class for Nearest Insertion
    216216template <typename CM>
    217217class NearestInsertionTsp : public InsertionTsp<CM> {
     
    224224};
    225225
    226 // Algorithm class for Farthest Insertion 
     226// Algorithm class for Farthest Insertion
    227227template <typename CM>
    228228class FarthestInsertionTsp : public InsertionTsp<CM> {
     
    235235};
    236236
    237 // Algorithm class for Cheapest Insertion 
     237// Algorithm class for Cheapest Insertion
    238238template <typename CM>
    239239class CheapestInsertionTsp : public InsertionTsp<CM> {
     
    246246};
    247247
    248 // Algorithm class for Random Insertion 
     248// Algorithm class for Random Insertion
    249249template <typename CM>
    250250class RandomInsertionTsp : public InsertionTsp<CM> {
  • tools/dimacs-solver.cc

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