test/kruskal_test.cc
changeset 209 765619b7cbb2
parent 171 02f4d5d9bfd7
     1.1 --- a/test/kruskal_test.cc	Sun Jul 13 16:46:56 2008 +0100
     1.2 +++ b/test/kruskal_test.cc	Sun Jul 13 19:51:02 2008 +0100
     1.3 @@ -1,6 +1,6 @@
     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   * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    1.12 @@ -73,7 +73,7 @@
    1.13    Node v3=G.addNode();
    1.14    Node v4=G.addNode();
    1.15    Node t=G.addNode();
    1.16 -  
    1.17 +
    1.18    Edge e1 = G.addEdge(s, v1);
    1.19    Edge e2 = G.addEdge(s, v2);
    1.20    Edge e3 = G.addEdge(v1, v2);
    1.21 @@ -90,14 +90,14 @@
    1.22  
    1.23    ECostMap edge_cost_map(G, 2);
    1.24    EBoolMap tree_map(G);
    1.25 -  
    1.26 +
    1.27  
    1.28    //Test with const map.
    1.29    check(kruskal(G, ConstMap<ListGraph::Edge,int>(2), tree_map)==10,
    1.30 -	"Total cost should be 10");
    1.31 +        "Total cost should be 10");
    1.32    //Test with an edge map (filled with uniform costs).
    1.33    check(kruskal(G, edge_cost_map, tree_map)==10,
    1.34 -	"Total cost should be 10");
    1.35 +        "Total cost should be 10");
    1.36  
    1.37    edge_cost_map.set(e1, -10);
    1.38    edge_cost_map.set(e2, -9);
    1.39 @@ -114,34 +114,34 @@
    1.40  
    1.41    //Test with a edge map and inserter.
    1.42    check(kruskal(G, edge_cost_map,
    1.43 -		 tree_edge_vec.begin())
    1.44 -	==-31,
    1.45 -	"Total cost should be -31.");
    1.46 -  
    1.47 +                 tree_edge_vec.begin())
    1.48 +        ==-31,
    1.49 +        "Total cost should be -31.");
    1.50 +
    1.51    tree_edge_vec.clear();
    1.52  
    1.53    check(kruskal(G, edge_cost_map,
    1.54 -		back_inserter(tree_edge_vec))
    1.55 -	==-31,
    1.56 -	"Total cost should be -31.");
    1.57 -  
    1.58 +                back_inserter(tree_edge_vec))
    1.59 +        ==-31,
    1.60 +        "Total cost should be -31.");
    1.61 +
    1.62  //   tree_edge_vec.clear();
    1.63 -  
    1.64 +
    1.65  //   //The above test could also be coded like this:
    1.66  //   check(kruskal(G,
    1.67 -// 		makeKruskalMapInput(G, edge_cost_map),
    1.68 -// 		makeKruskalSequenceOutput(back_inserter(tree_edge_vec)))
    1.69 -// 	==-31,
    1.70 -// 	"Total cost should be -31.");
    1.71 +//                 makeKruskalMapInput(G, edge_cost_map),
    1.72 +//                 makeKruskalSequenceOutput(back_inserter(tree_edge_vec)))
    1.73 +//         ==-31,
    1.74 +//         "Total cost should be -31.");
    1.75  
    1.76    check(tree_edge_vec.size()==5,"The tree should have 5 edges.");
    1.77  
    1.78    check(tree_edge_vec[0]==e1 &&
    1.79 -	tree_edge_vec[1]==e2 &&
    1.80 -	tree_edge_vec[2]==e5 &&
    1.81 -	tree_edge_vec[3]==e7 &&
    1.82 -	tree_edge_vec[4]==e9,
    1.83 -	"Wrong tree.");
    1.84 +        tree_edge_vec[1]==e2 &&
    1.85 +        tree_edge_vec[2]==e5 &&
    1.86 +        tree_edge_vec[3]==e7 &&
    1.87 +        tree_edge_vec[4]==e9,
    1.88 +        "Wrong tree.");
    1.89  
    1.90    return 0;
    1.91  }