test/suurballe_test.cc
changeset 440 88ed40ad0d4f
parent 423 ff48c2738fb2
child 623 7c1324b35d89
     1.1 --- a/test/suurballe_test.cc	Sun Dec 21 20:47:15 2008 +0100
     1.2 +++ b/test/suurballe_test.cc	Thu Jan 01 00:00:00 2009 +0100
     1.3 @@ -1,8 +1,8 @@
     1.4 -/* -*- C++ -*-
     1.5 +/* -*- mode: C++; indent-tabs-mode: nil; -*-
     1.6   *
     1.7 - * This file is a part of LEMON, a generic C++ optimization library
     1.8 + * This file is a part of LEMON, a generic C++ optimization library.
     1.9   *
    1.10 - * Copyright (C) 2003-2008
    1.11 + * Copyright (C) 2003-2009
    1.12   * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    1.13   * (Egervary Research Group on Combinatorial Optimization, EGRES).
    1.14   *
    1.15 @@ -72,7 +72,7 @@
    1.16  
    1.17  // Check the feasibility of the flow
    1.18  template <typename Digraph, typename FlowMap>
    1.19 -bool checkFlow( const Digraph& gr, const FlowMap& flow, 
    1.20 +bool checkFlow( const Digraph& gr, const FlowMap& flow,
    1.21                  typename Digraph::Node s, typename Digraph::Node t,
    1.22                  int value )
    1.23  {
    1.24 @@ -95,7 +95,7 @@
    1.25  }
    1.26  
    1.27  // Check the optimalitiy of the flow
    1.28 -template < typename Digraph, typename CostMap, 
    1.29 +template < typename Digraph, typename CostMap,
    1.30             typename FlowMap, typename PotentialMap >
    1.31  bool checkOptimality( const Digraph& gr, const CostMap& cost,
    1.32                        const FlowMap& flow, const PotentialMap& pi )
    1.33 @@ -144,7 +144,7 @@
    1.34      node("source", source).
    1.35      node("target", target).
    1.36      run();
    1.37 -  
    1.38 +
    1.39    // Find 2 paths
    1.40    {
    1.41      Suurballe<ListDigraph> suurballe(digraph, length, source, target);
    1.42 @@ -152,7 +152,7 @@
    1.43      check(checkFlow(digraph, suurballe.flowMap(), source, target, 2),
    1.44            "The flow is not feasible");
    1.45      check(suurballe.totalLength() == 510, "The flow is not optimal");
    1.46 -    check(checkOptimality(digraph, length, suurballe.flowMap(), 
    1.47 +    check(checkOptimality(digraph, length, suurballe.flowMap(),
    1.48                            suurballe.potentialMap()),
    1.49            "Wrong potentials");
    1.50      for (int i = 0; i < suurballe.pathNum(); ++i)
    1.51 @@ -167,7 +167,7 @@
    1.52      check(checkFlow(digraph, suurballe.flowMap(), source, target, 3),
    1.53            "The flow is not feasible");
    1.54      check(suurballe.totalLength() == 1040, "The flow is not optimal");
    1.55 -    check(checkOptimality(digraph, length, suurballe.flowMap(), 
    1.56 +    check(checkOptimality(digraph, length, suurballe.flowMap(),
    1.57                            suurballe.potentialMap()),
    1.58            "Wrong potentials");
    1.59      for (int i = 0; i < suurballe.pathNum(); ++i)
    1.60 @@ -182,7 +182,7 @@
    1.61      check(checkFlow(digraph, suurballe.flowMap(), source, target, 3),
    1.62            "The flow is not feasible");
    1.63      check(suurballe.totalLength() == 1040, "The flow is not optimal");
    1.64 -    check(checkOptimality(digraph, length, suurballe.flowMap(), 
    1.65 +    check(checkOptimality(digraph, length, suurballe.flowMap(),
    1.66                            suurballe.potentialMap()),
    1.67            "Wrong potentials");
    1.68      for (int i = 0; i < suurballe.pathNum(); ++i)