COIN-OR::LEMON - Graph Library

Changeset 941:186aa53d2802 in lemon-0.x for src/test/suurballe_test.cc


Ignore:
Timestamp:
10/08/04 15:07:51 (16 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1283
Message:

Suurballe and MinCostFlow? classes are now able to increase the flow 1 by 1 with
this->augment()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/test/suurballe_test.cc

    r921 r941  
    2121#include "test_tools.h"
    2222
    23 using namespace std;
    2423using namespace lemon;
    25 
    2624
    2725
     
    3129int main()
    3230{
     31  typedef ListGraph Graph;
     32  typedef Graph::Node Node;
     33  typedef Graph::Edge Edge;
    3334
    34   typedef ListGraph::Node Node;
    35   typedef ListGraph::Edge Edge;
    36 
    37   ListGraph graph;
     35  Graph graph;
    3836
    3937  //Ahuja könyv példája
     
    5755 
    5856
    59   ListGraph::EdgeMap<int> length(graph);
     57  Graph::EdgeMap<int> length(graph);
    6058
    6159  length.set(s_v1, 6);
     
    7270 
    7371  int k=3;
    74   Suurballe< ListGraph, ListGraph::EdgeMap<int> >
    75     surb_test(graph, length);
     72  Suurballe< Graph, Graph::EdgeMap<int> >
     73    surb_test(graph, length, s, t);
    7674
    77   check(  surb_test.run(s,t,k) == 2 && surb_test.totalLength() == 46,
     75  check(  surb_test.run(k) == 2 && surb_test.totalLength() == 46,
    7876          "Two paths, total length should be 46");
    7977
     
    8179          "Complementary slackness conditions are not met.");
    8280
    83   //  typedef DirPath<ListGraph> DPath;
     81  //  typedef DirPath<Graph> DPath;
    8482  //  DPath P(graph);
    8583
     
    8785  surb_test.getPath(P,0);
    8886  check(P.length() == 4, "First path should contain 4 edges."); 
    89   cout<<P.length()<<endl;
     87  std::cout<<P.length()<<std::endl;
    9088  surb_test.getPath(P,1);
    9189  check(P.length() == 3, "Second path: 3 edges.");
    92   cout<<P.length()<<endl;
     90  std::cout<<P.length()<<std::endl;
    9391  */ 
    9492
    9593  k=1;
    96   check(  surb_test.run(s,t,k) == 1 && surb_test.totalLength() == 19,
     94  check(  surb_test.run(k) == 1 && surb_test.totalLength() == 19,
    9795          "One path, total length should be 19");
    9896
     
    103101  //  check(P.length() == 4, "First path should contain 4 edges."); 
    104102
    105   cout << (passed ? "All tests passed." : "Some of the tests failed!!!")
    106        << endl;
     103  std::cout << (passed ? "All tests passed." : "Some of the tests failed!!!")
     104            << std::endl;
    107105
    108106  return passed ? 0 : 1;
Note: See TracChangeset for help on using the changeset viewer.