COIN-OR::LEMON - Graph Library

Changeset 209:765619b7cbb2 in lemon for test/kruskal_test.cc


Ignore:
Timestamp:
07/13/08 20:51:02 (11 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Phase:
public
Message:

Apply unify-sources.sh to the source tree

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/kruskal_test.cc

    r171 r209  
    1 /* -*- C++ -*-
     1/* -*- mode: C++; indent-tabs-mode: nil; -*-
    22 *
    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.
    44 *
    55 * Copyright (C) 2003-2008
     
    7474  Node v4=G.addNode();
    7575  Node t=G.addNode();
    76  
     76
    7777  Edge e1 = G.addEdge(s, v1);
    7878  Edge e2 = G.addEdge(s, v2);
     
    9191  ECostMap edge_cost_map(G, 2);
    9292  EBoolMap tree_map(G);
    93  
     93
    9494
    9595  //Test with const map.
    9696  check(kruskal(G, ConstMap<ListGraph::Edge,int>(2), tree_map)==10,
    97         "Total cost should be 10");
     97        "Total cost should be 10");
    9898  //Test with an edge map (filled with uniform costs).
    9999  check(kruskal(G, edge_cost_map, tree_map)==10,
    100         "Total cost should be 10");
     100        "Total cost should be 10");
    101101
    102102  edge_cost_map.set(e1, -10);
     
    115115  //Test with a edge map and inserter.
    116116  check(kruskal(G, edge_cost_map,
    117                 tree_edge_vec.begin())
    118         ==-31,
    119         "Total cost should be -31.");
    120  
     117                tree_edge_vec.begin())
     118        ==-31,
     119        "Total cost should be -31.");
     120
    121121  tree_edge_vec.clear();
    122122
    123123  check(kruskal(G, edge_cost_map,
    124                 back_inserter(tree_edge_vec))
    125         ==-31,
    126         "Total cost should be -31.");
    127  
     124                back_inserter(tree_edge_vec))
     125        ==-31,
     126        "Total cost should be -31.");
     127
    128128//   tree_edge_vec.clear();
    129  
     129
    130130//   //The above test could also be coded like this:
    131131//   check(kruskal(G,
    132 //              makeKruskalMapInput(G, edge_cost_map),
    133 //              makeKruskalSequenceOutput(back_inserter(tree_edge_vec)))
    134 //      ==-31,
    135 //      "Total cost should be -31.");
     132//                 makeKruskalMapInput(G, edge_cost_map),
     133//                 makeKruskalSequenceOutput(back_inserter(tree_edge_vec)))
     134//         ==-31,
     135//         "Total cost should be -31.");
    136136
    137137  check(tree_edge_vec.size()==5,"The tree should have 5 edges.");
    138138
    139139  check(tree_edge_vec[0]==e1 &&
    140         tree_edge_vec[1]==e2 &&
    141         tree_edge_vec[2]==e5 &&
    142         tree_edge_vec[3]==e7 &&
    143         tree_edge_vec[4]==e9,
    144         "Wrong tree.");
     140        tree_edge_vec[1]==e2 &&
     141        tree_edge_vec[2]==e5 &&
     142        tree_edge_vec[3]==e7 &&
     143        tree_edge_vec[4]==e9,
     144        "Wrong tree.");
    145145
    146146  return 0;
Note: See TracChangeset for help on using the changeset viewer.