diff --git a/test/heap_test.cc b/test/heap_test.cc --- a/test/heap_test.cc +++ b/test/heap_test.cc @@ -1,6 +1,6 @@ -/* -*- C++ -*- +/* -*- mode: C++; indent-tabs-mode: nil; -*- * - * This file is a part of LEMON, a generic C++ optimization library + * This file is a part of LEMON, a generic C++ optimization library. * * Copyright (C) 2003-2008 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport @@ -40,42 +40,42 @@ typedef ListDigraph Digraph; DIGRAPH_TYPEDEFS(Digraph); -char test_lgf[] = - "@nodes\n" - "label\n" - "0\n" - "1\n" - "2\n" - "3\n" - "4\n" - "5\n" - "6\n" - "7\n" - "8\n" - "9\n" - "@arcs\n" - " label capacity\n" - "0 5 0 94\n" - "3 9 1 11\n" - "8 7 2 83\n" - "1 2 3 94\n" - "5 7 4 35\n" - "7 4 5 84\n" - "9 5 6 38\n" - "0 4 7 96\n" - "6 7 8 6\n" - "3 1 9 27\n" - "5 2 10 77\n" - "5 6 11 69\n" - "6 5 12 41\n" - "4 6 13 70\n" - "3 2 14 45\n" - "7 9 15 93\n" - "5 9 16 50\n" - "9 0 17 94\n" - "9 6 18 67\n" - "0 9 19 86\n" - "@attributes\n" +char test_lgf[] = + "@nodes\n" + "label\n" + "0\n" + "1\n" + "2\n" + "3\n" + "4\n" + "5\n" + "6\n" + "7\n" + "8\n" + "9\n" + "@arcs\n" + " label capacity\n" + "0 5 0 94\n" + "3 9 1 11\n" + "8 7 2 83\n" + "1 2 3 94\n" + "5 7 4 35\n" + "7 4 5 84\n" + "9 5 6 38\n" + "0 4 7 96\n" + "6 7 8 6\n" + "3 1 9 27\n" + "5 2 10 77\n" + "5 6 11 69\n" + "6 5 12 41\n" + "4 6 13 70\n" + "3 2 14 45\n" + "7 9 15 93\n" + "5 9 16 50\n" + "9 0 17 94\n" + "9 6 18 67\n" + "0 9 19 86\n" + "@attributes\n" "source 3\n"; int test_seq[] = { 2, 28, 19, 27, 33, 25, 13, 41, 10, 26, 1, 9, 4, 34}; @@ -88,7 +88,7 @@ RangeMap map(test_len, -1); Heap heap(map); - + std::vector v(test_len); for (int i = 0; i < test_len; ++i) { @@ -107,7 +107,7 @@ RangeMap map(test_len, -1); Heap heap(map); - + std::vector v(test_len); for (int i = 0; i < test_len; ++i) { @@ -128,20 +128,20 @@ template -void dijkstraHeapTest(const Digraph& digraph, const IntArcMap& length, - Node source) { - +void dijkstraHeapTest(const Digraph& digraph, const IntArcMap& length, + Node source) { + typename Dijkstra::template DefStandardHeap:: Create dijkstra(digraph, length); dijkstra.run(source); for(ArcIt a(digraph); a != INVALID; ++a) { - Node s = digraph.source(a); + Node s = digraph.source(a); Node t = digraph.target(a); if (dijkstra.reached(s)) { check( dijkstra.dist(t) - dijkstra.dist(s) <= length[a], - "Error in a shortest path tree!"); + "Error in a shortest path tree!"); } } @@ -150,7 +150,7 @@ Arc a = dijkstra.predArc(n); Node s = digraph.source(a); check( dijkstra.dist(n) - dijkstra.dist(s) == length[a], - "Error in a shortest path tree!"); + "Error in a shortest path tree!"); } } @@ -161,7 +161,7 @@ typedef int Item; typedef int Prio; typedef RangeMap ItemIntMap; - + Digraph digraph; IntArcMap length(digraph); Node source; @@ -170,14 +170,14 @@ digraphReader(input, digraph). arcMap("capacity", length). node("source", source). - run(); - + run(); + { typedef BinHeap IntHeap; checkConcept, IntHeap>(); heapSortTest(); heapIncreaseTest(); - + typedef BinHeap NodeHeap; checkConcept, NodeHeap>(); dijkstraHeapTest(digraph, length, source);