COIN-OR::LEMON - Graph Library

Changes in / [708:5d313b76f323:700:6f7c1052d260] in lemon-1.2


Ignore:
Files:
4 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • lemon/Makefile.am

    r708 r700  
    6161        lemon/bfs.h \
    6262        lemon/bin_heap.h \
    63         lemon/binom_heap.h \
    6463        lemon/bucket_heap.h \
    6564        lemon/cbc.h \
     
    8180        lemon/euler.h \
    8281        lemon/fib_heap.h \
    83         lemon/fourary_heap.h \
    8482        lemon/full_graph.h \
    8583        lemon/glpk.h \
     
    8886        lemon/grid_graph.h \
    8987        lemon/hypercube_graph.h \
    90         lemon/kary_heap.h \
    9188        lemon/kruskal.h \
    9289        lemon/hao_orlin.h \
     
    103100        lemon/nauty_reader.h \
    104101        lemon/network_simplex.h \
    105         lemon/pairing_heap.h \
    106102        lemon/path.h \
    107103        lemon/preflow.h \
  • test/heap_test.cc

    r702 r681  
    2626
    2727#include <lemon/smart_graph.h>
     28
    2829#include <lemon/lgf_reader.h>
    2930#include <lemon/dijkstra.h>
     
    3132
    3233#include <lemon/bin_heap.h>
    33 #include <lemon/fourary_heap.h>
    34 #include <lemon/kary_heap.h>
    3534#include <lemon/fib_heap.h>
    36 #include <lemon/pairing_heap.h>
    3735#include <lemon/radix_heap.h>
    38 #include <lemon/binom_heap.h>
    3936#include <lemon/bucket_heap.h>
    4037
     
    9390void heapSortTest() {
    9491  RangeMap<int> map(test_len, -1);
     92
    9593  Heap heap(map);
    9694
    9795  std::vector<int> v(test_len);
     96
    9897  for (int i = 0; i < test_len; ++i) {
    9998    v[i] = test_seq[i];
     
    102101  std::sort(v.begin(), v.end());
    103102  for (int i = 0; i < test_len; ++i) {
    104     check(v[i] == heap.prio(), "Wrong order in heap sort.");
     103    check(v[i] == heap.prio() ,"Wrong order in heap sort.");
    105104    heap.pop();
    106105  }
     
    114113
    115114  std::vector<int> v(test_len);
     115
    116116  for (int i = 0; i < test_len; ++i) {
    117117    v[i] = test_seq[i];
     
    124124  std::sort(v.begin(), v.end());
    125125  for (int i = 0; i < test_len; ++i) {
    126     check(v[i] == heap.prio(), "Wrong order in heap increase test.");
     126    check(v[i] == heap.prio() ,"Wrong order in heap increase test.");
    127127    heap.pop();
    128128  }
    129129}
     130
     131
    130132
    131133template <typename Heap>
     
    143145    if (dijkstra.reached(s)) {
    144146      check( dijkstra.dist(t) - dijkstra.dist(s) <= length[a],
    145              "Error in shortest path tree.");
     147             "Error in a shortest path tree!");
    146148    }
    147149  }
     
    152154      Node s = digraph.source(a);
    153155      check( dijkstra.dist(n) - dijkstra.dist(s) == length[a],
    154              "Error in shortest path tree.");
     156             "Error in a shortest path tree!");
    155157    }
    156158  }
     
    174176    run();
    175177
    176   // BinHeap
    177178  {
    178179    typedef BinHeap<Prio, ItemIntMap> IntHeap;
     
    186187  }
    187188
    188   // FouraryHeap
    189   {
    190     typedef FouraryHeap<Prio, ItemIntMap> IntHeap;
    191     checkConcept<Heap<Prio, ItemIntMap>, IntHeap>();
    192     heapSortTest<IntHeap>();
    193     heapIncreaseTest<IntHeap>();
    194 
    195     typedef FouraryHeap<Prio, IntNodeMap > NodeHeap;
    196     checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>();
    197     dijkstraHeapTest<NodeHeap>(digraph, length, source);
    198   }
    199 
    200   // KaryHeap
    201   {
    202     typedef KaryHeap<Prio, ItemIntMap> IntHeap;
    203     checkConcept<Heap<Prio, ItemIntMap>, IntHeap>();
    204     heapSortTest<IntHeap>();
    205     heapIncreaseTest<IntHeap>();
    206 
    207     typedef KaryHeap<Prio, IntNodeMap > NodeHeap;
    208     checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>();
    209     dijkstraHeapTest<NodeHeap>(digraph, length, source);
    210   }
    211 
    212   // FibHeap
    213189  {
    214190    typedef FibHeap<Prio, ItemIntMap> IntHeap;
     
    222198  }
    223199
    224   // PairingHeap
    225   {
    226     typedef PairingHeap<Prio, ItemIntMap> IntHeap;
    227     checkConcept<Heap<Prio, ItemIntMap>, IntHeap>();
    228     heapSortTest<IntHeap>();
    229     heapIncreaseTest<IntHeap>();
    230 
    231     typedef PairingHeap<Prio, IntNodeMap > NodeHeap;
    232     checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>();
    233     dijkstraHeapTest<NodeHeap>(digraph, length, source);
    234   }
    235 
    236   // RadixHeap
    237200  {
    238201    typedef RadixHeap<ItemIntMap> IntHeap;
     
    246209  }
    247210
    248   // BinomHeap
    249   {
    250     typedef BinomHeap<Prio, ItemIntMap> IntHeap;
    251     checkConcept<Heap<Prio, ItemIntMap>, IntHeap>();
    252     heapSortTest<IntHeap>();
    253     heapIncreaseTest<IntHeap>();
    254 
    255     typedef BinomHeap<Prio, IntNodeMap > NodeHeap;
    256     checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>();
    257     dijkstraHeapTest<NodeHeap>(digraph, length, source);
    258   }
    259 
    260   // BucketHeap, SimpleBucketHeap
    261211  {
    262212    typedef BucketHeap<ItemIntMap> IntHeap;
     
    268218    checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>();
    269219    dijkstraHeapTest<NodeHeap>(digraph, length, source);
    270 
    271     typedef SimpleBucketHeap<ItemIntMap> SimpleIntHeap;
    272     heapSortTest<SimpleIntHeap>();
    273   }
     220  }
     221
    274222
    275223  return 0;
Note: See TracChangeset for help on using the changeset viewer.