test/suurballe_test.cc
branch1.1
changeset 1096 bcb6e4402a6e
parent 670 7c1324b35d89
child 1172 c18ed26f016c
equal deleted inserted replaced
4:f4252eba5ebf 9:7ec4484d38da
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     2  *
     2  *
     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.
     4  *
     4  *
     5  * Copyright (C) 2003-2009
     5  * Copyright (C) 2003-2011
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     8  *
     8  *
     9  * Permission to use, modify and distribute this software is granted
     9  * Permission to use, modify and distribute this software is granted
    10  * provided that this copyright notice appears in all copies. For
    10  * provided that this copyright notice appears in all copies. For
    78   typedef concepts::Digraph Digraph;
    78   typedef concepts::Digraph Digraph;
    79 
    79 
    80   typedef Digraph::Node Node;
    80   typedef Digraph::Node Node;
    81   typedef Digraph::Arc Arc;
    81   typedef Digraph::Arc Arc;
    82   typedef concepts::ReadMap<Arc, VType> LengthMap;
    82   typedef concepts::ReadMap<Arc, VType> LengthMap;
    83   
    83 
    84   typedef Suurballe<Digraph, LengthMap> SuurballeType;
    84   typedef Suurballe<Digraph, LengthMap> SuurballeType;
    85 
    85 
    86   Digraph g;
    86   Digraph g;
    87   Node n;
    87   Node n;
    88   Arc e;
    88   Arc e;
   102   k = suurb_test.run(n, n, k);
   102   k = suurb_test.run(n, n, k);
   103   suurb_test.init(n);
   103   suurb_test.init(n);
   104   k = suurb_test.findFlow(n);
   104   k = suurb_test.findFlow(n);
   105   k = suurb_test.findFlow(n, k);
   105   k = suurb_test.findFlow(n, k);
   106   suurb_test.findPaths();
   106   suurb_test.findPaths();
   107   
   107 
   108   int f;
   108   int f;
   109   VType c;
   109   VType c;
   110   c = const_suurb_test.totalLength();
   110   c = const_suurb_test.totalLength();
   111   f = const_suurb_test.flow(e);
   111   f = const_suurb_test.flow(e);
   112   const SuurballeType::FlowMap& fm =
   112   const SuurballeType::FlowMap& fm =
   114   c = const_suurb_test.potential(n);
   114   c = const_suurb_test.potential(n);
   115   const SuurballeType::PotentialMap& pm =
   115   const SuurballeType::PotentialMap& pm =
   116     const_suurb_test.potentialMap();
   116     const_suurb_test.potentialMap();
   117   k = const_suurb_test.pathNum();
   117   k = const_suurb_test.pathNum();
   118   Path<Digraph> p = const_suurb_test.path(k);
   118   Path<Digraph> p = const_suurb_test.path(k);
   119   
   119 
   120   ignore_unused_variable_warning(fm);
   120   ignore_unused_variable_warning(fm);
   121   ignore_unused_variable_warning(pm);
   121   ignore_unused_variable_warning(pm);
   122 }
   122 }
   123 
   123 
   124 // Check the feasibility of the flow
   124 // Check the feasibility of the flow