src/test/minlengthpaths_test.cc
changeset 831 b6ae3446098a
parent 790 2b9a43c0d64e
equal deleted inserted replaced
3:e2a108c9aadb 4:8635eb568937
    56   
    56   
    57   int k=3;
    57   int k=3;
    58   MinLengthPaths< ListGraph, ListGraph::EdgeMap<int> >
    58   MinLengthPaths< ListGraph, ListGraph::EdgeMap<int> >
    59     surb_test(graph, length);
    59     surb_test(graph, length);
    60 
    60 
    61   check(  surb_test.run(s,t,k) == 2 && surb_test.totalLength() == 46,"Two paths, total length should be 46");
    61   check(  surb_test.run(s,t,k) == 2 && surb_test.totalLength() == 46,
       
    62 	  "Two paths, total length should be 46");
    62 
    63 
    63   check(  surb_test.checkComplementarySlackness(), "Complementary slackness conditions are not met.");
    64   check(  surb_test.checkComplementarySlackness(),
       
    65 	  "Complementary slackness conditions are not met.");
    64 
    66 
    65   //  typedef DirPath<ListGraph> DPath;
    67   //  typedef DirPath<ListGraph> DPath;
    66   //  DPath P(graph);
    68   //  DPath P(graph);
    67 
    69 
    68   /*
    70   /*
    73   check(P.length() == 3, "Second path: 3 edges.");
    75   check(P.length() == 3, "Second path: 3 edges.");
    74   cout<<P.length()<<endl;
    76   cout<<P.length()<<endl;
    75   */  
    77   */  
    76 
    78 
    77   k=1;
    79   k=1;
    78   check(  surb_test.run(s,t,k) == 1 && surb_test.totalLength() == 19,"One path, total length should be 19");
    80   check(  surb_test.run(s,t,k) == 1 && surb_test.totalLength() == 19,
       
    81 	  "One path, total length should be 19");
    79 
    82 
    80   check(  surb_test.checkComplementarySlackness(), "Complementary slackness conditions are not met.");
    83   check(  surb_test.checkComplementarySlackness(),
       
    84 	  "Complementary slackness conditions are not met.");
    81  
    85  
    82   //  surb_test.getPath(P,0);
    86   //  surb_test.getPath(P,0);
    83   //  check(P.length() == 4, "First path should contain 4 edges.");  
    87   //  check(P.length() == 4, "First path should contain 4 edges.");  
    84 
    88 
    85   cout << (passed ? "All tests passed." : "Some of the tests failed!!!")
    89   cout << (passed ? "All tests passed." : "Some of the tests failed!!!")