3
2
3
21
21
13
12
12
12
... | ... |
@@ -55,50 +55,49 @@ |
55 | 55 |
|
56 | 56 |
lemon_HEADERS += \ |
57 | 57 |
lemon/adaptors.h \ |
58 | 58 |
lemon/arg_parser.h \ |
59 | 59 |
lemon/assert.h \ |
60 | 60 |
lemon/bellman_ford.h \ |
61 | 61 |
lemon/bfs.h \ |
62 | 62 |
lemon/bin_heap.h \ |
63 |
lemon/ |
|
63 |
lemon/binomial_heap.h \ |
|
64 | 64 |
lemon/bucket_heap.h \ |
65 | 65 |
lemon/capacity_scaling.h \ |
66 | 66 |
lemon/cbc.h \ |
67 | 67 |
lemon/circulation.h \ |
68 | 68 |
lemon/clp.h \ |
69 | 69 |
lemon/color.h \ |
70 | 70 |
lemon/concept_check.h \ |
71 | 71 |
lemon/connectivity.h \ |
72 | 72 |
lemon/core.h \ |
73 | 73 |
lemon/cost_scaling.h \ |
74 | 74 |
lemon/counter.h \ |
75 | 75 |
lemon/cplex.h \ |
76 | 76 |
lemon/cycle_canceling.h \ |
77 | 77 |
lemon/dfs.h \ |
78 |
lemon/dheap.h \ |
|
78 | 79 |
lemon/dijkstra.h \ |
79 | 80 |
lemon/dim2.h \ |
80 | 81 |
lemon/dimacs.h \ |
81 | 82 |
lemon/edge_set.h \ |
82 | 83 |
lemon/elevator.h \ |
83 | 84 |
lemon/error.h \ |
84 | 85 |
lemon/euler.h \ |
85 | 86 |
lemon/fib_heap.h \ |
86 |
lemon/fourary_heap.h \ |
|
87 | 87 |
lemon/full_graph.h \ |
88 | 88 |
lemon/glpk.h \ |
89 | 89 |
lemon/gomory_hu.h \ |
90 | 90 |
lemon/graph_to_eps.h \ |
91 | 91 |
lemon/grid_graph.h \ |
92 | 92 |
lemon/hartmann_orlin.h \ |
93 | 93 |
lemon/howard.h \ |
94 | 94 |
lemon/hypercube_graph.h \ |
95 | 95 |
lemon/karp.h \ |
96 |
lemon/kary_heap.h \ |
|
97 | 96 |
lemon/kruskal.h \ |
98 | 97 |
lemon/hao_orlin.h \ |
99 | 98 |
lemon/lgf_reader.h \ |
100 | 99 |
lemon/lgf_writer.h \ |
101 | 100 |
lemon/list_graph.h \ |
102 | 101 |
lemon/lp.h \ |
103 | 102 |
lemon/lp_base.h \ |
104 | 103 |
lemon/lp_skeleton.h \ |
... | ... |
@@ -107,16 +106,17 @@ |
107 | 106 |
lemon/math.h \ |
108 | 107 |
lemon/min_cost_arborescence.h \ |
109 | 108 |
lemon/nauty_reader.h \ |
110 | 109 |
lemon/network_simplex.h \ |
111 | 110 |
lemon/pairing_heap.h \ |
112 | 111 |
lemon/path.h \ |
113 | 112 |
lemon/planarity.h \ |
114 | 113 |
lemon/preflow.h \ |
114 |
lemon/quad_heap.h \ |
|
115 | 115 |
lemon/radix_heap.h \ |
116 | 116 |
lemon/radix_sort.h \ |
117 | 117 |
lemon/random.h \ |
118 | 118 |
lemon/smart_graph.h \ |
119 | 119 |
lemon/soplex.h \ |
120 | 120 |
lemon/static_graph.h \ |
121 | 121 |
lemon/suurballe.h \ |
122 | 122 |
lemon/time_measure.h \ |
... | ... |
@@ -11,18 +11,18 @@ |
11 | 11 |
* precise terms see the accompanying LICENSE file. |
12 | 12 |
* |
13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
14 | 14 |
* express or implied, and with no claim as to its suitability for any |
15 | 15 |
* purpose. |
16 | 16 |
* |
17 | 17 |
*/ |
18 | 18 |
|
19 |
#ifndef LEMON_BINOM_HEAP_H |
|
20 |
#define LEMON_BINOM_HEAP_H |
|
19 |
#ifndef LEMON_BINOMIAL_HEAP_H |
|
20 |
#define LEMON_BINOMIAL_HEAP_H |
|
21 | 21 |
|
22 | 22 |
///\file |
23 | 23 |
///\ingroup heaps |
24 | 24 |
///\brief Binomial Heap implementation. |
25 | 25 |
|
26 | 26 |
#include <vector> |
27 | 27 |
#include <utility> |
28 | 28 |
#include <functional> |
... | ... |
@@ -48,17 +48,17 @@ |
48 | 48 |
/// internally to handle the cross references. |
49 | 49 |
/// \tparam CMP A functor class for comparing the priorities. |
50 | 50 |
/// The default is \c std::less<PR>. |
51 | 51 |
#ifdef DOXYGEN |
52 | 52 |
template <typename PR, typename IM, typename CMP> |
53 | 53 |
#else |
54 | 54 |
template <typename PR, typename IM, typename CMP = std::less<PR> > |
55 | 55 |
#endif |
56 |
class |
|
56 |
class BinomialHeap { |
|
57 | 57 |
public: |
58 | 58 |
/// Type of the item-int map. |
59 | 59 |
typedef IM ItemIntMap; |
60 | 60 |
/// Type of the priorities. |
61 | 61 |
typedef PR Prio; |
62 | 62 |
/// Type of the items stored in the heap. |
63 | 63 |
typedef typename ItemIntMap::Key Item; |
64 | 64 |
/// Functor type for comparing the priorities. |
... | ... |
@@ -89,27 +89,27 @@ |
89 | 89 |
|
90 | 90 |
public: |
91 | 91 |
/// \brief Constructor. |
92 | 92 |
/// |
93 | 93 |
/// Constructor. |
94 | 94 |
/// \param map A map that assigns \c int values to the items. |
95 | 95 |
/// It is used internally to handle the cross references. |
96 | 96 |
/// The assigned value must be \c PRE_HEAP (<tt>-1</tt>) for each item. |
97 |
explicit |
|
97 |
explicit BinomialHeap(ItemIntMap &map) |
|
98 | 98 |
: _min(0), _head(-1), _iim(map), _num_items(0) {} |
99 | 99 |
|
100 | 100 |
/// \brief Constructor. |
101 | 101 |
/// |
102 | 102 |
/// Constructor. |
103 | 103 |
/// \param map A map that assigns \c int values to the items. |
104 | 104 |
/// It is used internally to handle the cross references. |
105 | 105 |
/// The assigned value must be \c PRE_HEAP (<tt>-1</tt>) for each item. |
106 | 106 |
/// \param comp The function object used for comparing the priorities. |
107 |
|
|
107 |
BinomialHeap(ItemIntMap &map, const Compare &comp) |
|
108 | 108 |
: _min(0), _head(-1), _iim(map), _comp(comp), _num_items(0) {} |
109 | 109 |
|
110 | 110 |
/// \brief The number of items stored in the heap. |
111 | 111 |
/// |
112 | 112 |
/// This function returns the number of items stored in the heap. |
113 | 113 |
int size() const { return _num_items; } |
114 | 114 |
|
115 | 115 |
/// \brief Check if the heap is empty. |
... | ... |
@@ -419,27 +419,27 @@ |
419 | 419 |
while( _data[other].right_neighbor!=a ) |
420 | 420 |
other=_data[other].right_neighbor; |
421 | 421 |
_data[other].right_neighbor=neighb; |
422 | 422 |
} |
423 | 423 |
|
424 | 424 |
private: |
425 | 425 |
|
426 | 426 |
class Store { |
427 |
friend class |
|
427 |
friend class BinomialHeap; |
|
428 | 428 |
|
429 | 429 |
Item name; |
430 | 430 |
int parent; |
431 | 431 |
int right_neighbor; |
432 | 432 |
int child; |
433 | 433 |
int degree; |
434 | 434 |
bool in; |
435 | 435 |
Prio prio; |
436 | 436 |
|
437 | 437 |
Store() : parent(-1), right_neighbor(-1), child(-1), degree(0), |
438 | 438 |
in(true) {} |
439 | 439 |
}; |
440 | 440 |
}; |
441 | 441 |
|
442 | 442 |
} //namespace lemon |
443 | 443 |
|
444 |
#endif // |
|
444 |
#endif //LEMON_BINOMIAL_HEAP_H |
|
445 | 445 |
... | ... |
@@ -11,61 +11,61 @@ |
11 | 11 |
* precise terms see the accompanying LICENSE file. |
12 | 12 |
* |
13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
14 | 14 |
* express or implied, and with no claim as to its suitability for any |
15 | 15 |
* purpose. |
16 | 16 |
* |
17 | 17 |
*/ |
18 | 18 |
|
19 |
#ifndef LEMON_KARY_HEAP_H |
|
20 |
#define LEMON_KARY_HEAP_H |
|
19 |
#ifndef LEMON_DHEAP_H |
|
20 |
#define LEMON_DHEAP_H |
|
21 | 21 |
|
22 | 22 |
///\ingroup heaps |
23 | 23 |
///\file |
24 |
///\brief |
|
24 |
///\brief D-ary heap implementation. |
|
25 | 25 |
|
26 | 26 |
#include <vector> |
27 | 27 |
#include <utility> |
28 | 28 |
#include <functional> |
29 | 29 |
|
30 | 30 |
namespace lemon { |
31 | 31 |
|
32 | 32 |
/// \ingroup heaps |
33 | 33 |
/// |
34 |
///\brief |
|
34 |
///\brief D-ary heap data structure. |
|
35 | 35 |
/// |
36 |
/// This class implements the \e |
|
36 |
/// This class implements the \e D-ary \e heap data structure. |
|
37 | 37 |
/// It fully conforms to the \ref concepts::Heap "heap concept". |
38 | 38 |
/// |
39 |
/// The \ref |
|
39 |
/// The \ref DHeap "D-ary heap" is a generalization of the |
|
40 | 40 |
/// \ref BinHeap "binary heap" structure, its nodes have at most |
41 |
/// \c K children, instead of two. |
|
42 |
/// \ref BinHeap and \ref FouraryHeap are specialized implementations |
|
43 |
/// |
|
41 |
/// \c D children, instead of two. |
|
42 |
/// \ref BinHeap and \ref QuadHeap are specialized implementations |
|
43 |
/// of this structure for <tt>D=2</tt> and <tt>D=4</tt>, respectively. |
|
44 | 44 |
/// |
45 | 45 |
/// \tparam PR Type of the priorities of the items. |
46 | 46 |
/// \tparam IM A read-writable item map with \c int values, used |
47 | 47 |
/// internally to handle the cross references. |
48 |
/// \tparam |
|
48 |
/// \tparam D The degree of the heap, each node have at most \e D |
|
49 | 49 |
/// children. The default is 16. Powers of two are suggested to use |
50 | 50 |
/// so that the multiplications and divisions needed to traverse the |
51 | 51 |
/// nodes of the heap could be performed faster. |
52 | 52 |
/// \tparam CMP A functor class for comparing the priorities. |
53 | 53 |
/// The default is \c std::less<PR>. |
54 | 54 |
/// |
55 | 55 |
///\sa BinHeap |
56 | 56 |
///\sa FouraryHeap |
57 | 57 |
#ifdef DOXYGEN |
58 |
template <typename PR, typename IM, int |
|
58 |
template <typename PR, typename IM, int D, typename CMP> |
|
59 | 59 |
#else |
60 |
template <typename PR, typename IM, int |
|
60 |
template <typename PR, typename IM, int D = 16, |
|
61 | 61 |
typename CMP = std::less<PR> > |
62 | 62 |
#endif |
63 |
class |
|
63 |
class DHeap { |
|
64 | 64 |
public: |
65 | 65 |
/// Type of the item-int map. |
66 | 66 |
typedef IM ItemIntMap; |
67 | 67 |
/// Type of the priorities. |
68 | 68 |
typedef PR Prio; |
69 | 69 |
/// Type of the items stored in the heap. |
70 | 70 |
typedef typename ItemIntMap::Key Item; |
71 | 71 |
/// Type of the item-priority pairs. |
... | ... |
@@ -94,26 +94,26 @@ |
94 | 94 |
|
95 | 95 |
public: |
96 | 96 |
/// \brief Constructor. |
97 | 97 |
/// |
98 | 98 |
/// Constructor. |
99 | 99 |
/// \param map A map that assigns \c int values to the items. |
100 | 100 |
/// It is used internally to handle the cross references. |
101 | 101 |
/// The assigned value must be \c PRE_HEAP (<tt>-1</tt>) for each item. |
102 |
explicit |
|
102 |
explicit DHeap(ItemIntMap &map) : _iim(map) {} |
|
103 | 103 |
|
104 | 104 |
/// \brief Constructor. |
105 | 105 |
/// |
106 | 106 |
/// Constructor. |
107 | 107 |
/// \param map A map that assigns \c int values to the items. |
108 | 108 |
/// It is used internally to handle the cross references. |
109 | 109 |
/// The assigned value must be \c PRE_HEAP (<tt>-1</tt>) for each item. |
110 | 110 |
/// \param comp The function object used for comparing the priorities. |
111 |
|
|
111 |
DHeap(ItemIntMap &map, const Compare &comp) |
|
112 | 112 |
: _iim(map), _comp(comp) {} |
113 | 113 |
|
114 | 114 |
/// \brief The number of items stored in the heap. |
115 | 115 |
/// |
116 | 116 |
/// This function returns the number of items stored in the heap. |
117 | 117 |
int size() const { return _data.size(); } |
118 | 118 |
|
119 | 119 |
/// \brief Check if the heap is empty. |
... | ... |
@@ -126,18 +126,18 @@ |
126 | 126 |
/// This functon makes the heap empty. |
127 | 127 |
/// It does not change the cross reference map. If you want to reuse |
128 | 128 |
/// a heap that is not surely empty, you should first clear it and |
129 | 129 |
/// then you should set the cross reference map to \c PRE_HEAP |
130 | 130 |
/// for each item. |
131 | 131 |
void clear() { _data.clear(); } |
132 | 132 |
|
133 | 133 |
private: |
134 |
int parent(int i) { return (i-1)/K; } |
|
135 |
int firstChild(int i) { return K*i+1; } |
|
134 |
int parent(int i) { return (i-1)/D; } |
|
135 |
int firstChild(int i) { return D*i+1; } |
|
136 | 136 |
|
137 | 137 |
bool less(const Pair &p1, const Pair &p2) const { |
138 | 138 |
return _comp(p1.second, p2.second); |
139 | 139 |
} |
140 | 140 |
|
141 | 141 |
void bubbleUp(int hole, Pair p) { |
142 | 142 |
int par = parent(hole); |
143 | 143 |
while( hole>0 && less(p,_data[par]) ) { |
... | ... |
@@ -146,19 +146,19 @@ |
146 | 146 |
par = parent(hole); |
147 | 147 |
} |
148 | 148 |
move(p, hole); |
149 | 149 |
} |
150 | 150 |
|
151 | 151 |
void bubbleDown(int hole, Pair p, int length) { |
152 | 152 |
if( length>1 ) { |
153 | 153 |
int child = firstChild(hole); |
154 |
while( child+ |
|
154 |
while( child+D<=length ) { |
|
155 | 155 |
int min=child; |
156 |
for (int i=1; i< |
|
156 |
for (int i=1; i<D; ++i) { |
|
157 | 157 |
if( less(_data[child+i], _data[min]) ) |
158 | 158 |
min=child+i; |
159 | 159 |
} |
160 | 160 |
if( !less(_data[min], p) ) |
161 | 161 |
goto ok; |
162 | 162 |
move(_data[min], hole); |
163 | 163 |
hole = min; |
164 | 164 |
child = firstChild(hole); |
... | ... |
@@ -340,13 +340,13 @@ |
340 | 340 |
/// as item \c i had before. |
341 | 341 |
void replace(const Item& i, const Item& j) { |
342 | 342 |
int idx=_iim[i]; |
343 | 343 |
_iim.set(i, _iim[j]); |
344 | 344 |
_iim.set(j, idx); |
345 | 345 |
_data[idx].first=j; |
346 | 346 |
} |
347 | 347 |
|
348 |
}; // class |
|
348 |
}; // class DHeap |
|
349 | 349 |
|
350 | 350 |
} // namespace lemon |
351 | 351 |
|
352 |
#endif // |
|
352 |
#endif // LEMON_DHEAP_H |
... | ... |
@@ -11,54 +11,55 @@ |
11 | 11 |
* precise terms see the accompanying LICENSE file. |
12 | 12 |
* |
13 | 13 |
* This software is provided "AS IS" with no warranty of any kind, |
14 | 14 |
* express or implied, and with no claim as to its suitability for any |
15 | 15 |
* purpose. |
16 | 16 |
* |
17 | 17 |
*/ |
18 | 18 |
|
19 |
#ifndef LEMON_FOURARY_HEAP_H |
|
20 |
#define LEMON_FOURARY_HEAP_H |
|
19 |
#ifndef LEMON_QUAD_HEAP_H |
|
20 |
#define LEMON_QUAD_HEAP_H |
|
21 | 21 |
|
22 | 22 |
///\ingroup heaps |
23 | 23 |
///\file |
24 |
///\brief Fourary heap implementation. |
|
24 |
///\brief Fourary (quaternary) heap implementation. |
|
25 | 25 |
|
26 | 26 |
#include <vector> |
27 | 27 |
#include <utility> |
28 | 28 |
#include <functional> |
29 | 29 |
|
30 | 30 |
namespace lemon { |
31 | 31 |
|
32 | 32 |
/// \ingroup heaps |
33 | 33 |
/// |
34 |
///\brief Fourary heap data structure. |
|
34 |
///\brief Fourary (quaternary) heap data structure. |
|
35 | 35 |
/// |
36 |
/// This class implements the \e |
|
36 |
/// This class implements the \e Fourary (\e quaternary) \e heap |
|
37 |
/// data structure. |
|
37 | 38 |
/// It fully conforms to the \ref concepts::Heap "heap concept". |
38 | 39 |
/// |
39 |
/// The fourary heap is a specialization of the \ref KaryHeap "K-ary heap" |
|
40 |
/// for <tt>K=4</tt>. It is similar to the \ref BinHeap "binary heap", |
|
40 |
/// The fourary heap is a specialization of the \ref DHeap "D-ary heap" |
|
41 |
/// for <tt>D=4</tt>. It is similar to the \ref BinHeap "binary heap", |
|
41 | 42 |
/// but its nodes have at most four children, instead of two. |
42 | 43 |
/// |
43 | 44 |
/// \tparam PR Type of the priorities of the items. |
44 | 45 |
/// \tparam IM A read-writable item map with \c int values, used |
45 | 46 |
/// internally to handle the cross references. |
46 | 47 |
/// \tparam CMP A functor class for comparing the priorities. |
47 | 48 |
/// The default is \c std::less<PR>. |
48 | 49 |
/// |
49 | 50 |
///\sa BinHeap |
50 |
///\sa |
|
51 |
///\sa DHeap |
|
51 | 52 |
#ifdef DOXYGEN |
52 | 53 |
template <typename PR, typename IM, typename CMP> |
53 | 54 |
#else |
54 | 55 |
template <typename PR, typename IM, typename CMP = std::less<PR> > |
55 | 56 |
#endif |
56 |
class |
|
57 |
class QuadHeap { |
|
57 | 58 |
public: |
58 | 59 |
/// Type of the item-int map. |
59 | 60 |
typedef IM ItemIntMap; |
60 | 61 |
/// Type of the priorities. |
61 | 62 |
typedef PR Prio; |
62 | 63 |
/// Type of the items stored in the heap. |
63 | 64 |
typedef typename ItemIntMap::Key Item; |
64 | 65 |
/// Type of the item-priority pairs. |
... | ... |
@@ -87,26 +88,26 @@ |
87 | 88 |
|
88 | 89 |
public: |
89 | 90 |
/// \brief Constructor. |
90 | 91 |
/// |
91 | 92 |
/// Constructor. |
92 | 93 |
/// \param map A map that assigns \c int values to the items. |
93 | 94 |
/// It is used internally to handle the cross references. |
94 | 95 |
/// The assigned value must be \c PRE_HEAP (<tt>-1</tt>) for each item. |
95 |
explicit |
|
96 |
explicit QuadHeap(ItemIntMap &map) : _iim(map) {} |
|
96 | 97 |
|
97 | 98 |
/// \brief Constructor. |
98 | 99 |
/// |
99 | 100 |
/// Constructor. |
100 | 101 |
/// \param map A map that assigns \c int values to the items. |
101 | 102 |
/// It is used internally to handle the cross references. |
102 | 103 |
/// The assigned value must be \c PRE_HEAP (<tt>-1</tt>) for each item. |
103 | 104 |
/// \param comp The function object used for comparing the priorities. |
104 |
|
|
105 |
QuadHeap(ItemIntMap &map, const Compare &comp) |
|
105 | 106 |
: _iim(map), _comp(comp) {} |
106 | 107 |
|
107 | 108 |
/// \brief The number of items stored in the heap. |
108 | 109 |
/// |
109 | 110 |
/// This function returns the number of items stored in the heap. |
110 | 111 |
int size() const { return _data.size(); } |
111 | 112 |
|
112 | 113 |
/// \brief Check if the heap is empty. |
... | ... |
@@ -330,13 +331,13 @@ |
330 | 331 |
/// as item \c i had before. |
331 | 332 |
void replace(const Item& i, const Item& j) { |
332 | 333 |
int idx = _iim[i]; |
333 | 334 |
_iim.set(i, _iim[j]); |
334 | 335 |
_iim.set(j, idx); |
335 | 336 |
_data[idx].first = j; |
336 | 337 |
} |
337 | 338 |
|
338 |
}; // class |
|
339 |
}; // class QuadHeap |
|
339 | 340 |
|
340 | 341 |
} // namespace lemon |
341 | 342 |
|
342 | 343 |
#endif // LEMON_FOURARY_HEAP_H |
... | ... |
@@ -25,22 +25,22 @@ |
25 | 25 |
#include <lemon/concepts/heap.h> |
26 | 26 |
|
27 | 27 |
#include <lemon/smart_graph.h> |
28 | 28 |
#include <lemon/lgf_reader.h> |
29 | 29 |
#include <lemon/dijkstra.h> |
30 | 30 |
#include <lemon/maps.h> |
31 | 31 |
|
32 | 32 |
#include <lemon/bin_heap.h> |
33 |
#include <lemon/fourary_heap.h> |
|
34 |
#include <lemon/kary_heap.h> |
|
33 |
#include <lemon/quad_heap.h> |
|
34 |
#include <lemon/dheap.h> |
|
35 | 35 |
#include <lemon/fib_heap.h> |
36 | 36 |
#include <lemon/pairing_heap.h> |
37 | 37 |
#include <lemon/radix_heap.h> |
38 |
#include <lemon/ |
|
38 |
#include <lemon/binomial_heap.h> |
|
39 | 39 |
#include <lemon/bucket_heap.h> |
40 | 40 |
|
41 | 41 |
#include "test_tools.h" |
42 | 42 |
|
43 | 43 |
using namespace lemon; |
44 | 44 |
using namespace lemon::concepts; |
45 | 45 |
|
46 | 46 |
typedef ListDigraph Digraph; |
... | ... |
@@ -180,36 +180,36 @@ |
180 | 180 |
heapSortTest<IntHeap>(); |
181 | 181 |
heapIncreaseTest<IntHeap>(); |
182 | 182 |
|
183 | 183 |
typedef BinHeap<Prio, IntNodeMap > NodeHeap; |
184 | 184 |
checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>(); |
185 | 185 |
dijkstraHeapTest<NodeHeap>(digraph, length, source); |
186 | 186 |
} |
187 | 187 |
|
188 |
// |
|
188 |
// QuadHeap |
|
189 | 189 |
{ |
190 |
typedef |
|
190 |
typedef QuadHeap<Prio, ItemIntMap> IntHeap; |
|
191 | 191 |
checkConcept<Heap<Prio, ItemIntMap>, IntHeap>(); |
192 | 192 |
heapSortTest<IntHeap>(); |
193 | 193 |
heapIncreaseTest<IntHeap>(); |
194 | 194 |
|
195 |
typedef |
|
195 |
typedef QuadHeap<Prio, IntNodeMap > NodeHeap; |
|
196 | 196 |
checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>(); |
197 | 197 |
dijkstraHeapTest<NodeHeap>(digraph, length, source); |
198 | 198 |
} |
199 | 199 |
|
200 |
// |
|
200 |
// DHeap |
|
201 | 201 |
{ |
202 |
typedef |
|
202 |
typedef DHeap<Prio, ItemIntMap> IntHeap; |
|
203 | 203 |
checkConcept<Heap<Prio, ItemIntMap>, IntHeap>(); |
204 | 204 |
heapSortTest<IntHeap>(); |
205 | 205 |
heapIncreaseTest<IntHeap>(); |
206 | 206 |
|
207 |
typedef |
|
207 |
typedef DHeap<Prio, IntNodeMap > NodeHeap; |
|
208 | 208 |
checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>(); |
209 | 209 |
dijkstraHeapTest<NodeHeap>(digraph, length, source); |
210 | 210 |
} |
211 | 211 |
|
212 | 212 |
// FibHeap |
213 | 213 |
{ |
214 | 214 |
typedef FibHeap<Prio, ItemIntMap> IntHeap; |
215 | 215 |
checkConcept<Heap<Prio, ItemIntMap>, IntHeap>(); |
... | ... |
@@ -240,24 +240,24 @@ |
240 | 240 |
heapSortTest<IntHeap>(); |
241 | 241 |
heapIncreaseTest<IntHeap>(); |
242 | 242 |
|
243 | 243 |
typedef RadixHeap<IntNodeMap > NodeHeap; |
244 | 244 |
checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>(); |
245 | 245 |
dijkstraHeapTest<NodeHeap>(digraph, length, source); |
246 | 246 |
} |
247 | 247 |
|
248 |
// |
|
248 |
// BinomialHeap |
|
249 | 249 |
{ |
250 |
typedef |
|
250 |
typedef BinomialHeap<Prio, ItemIntMap> IntHeap; |
|
251 | 251 |
checkConcept<Heap<Prio, ItemIntMap>, IntHeap>(); |
252 | 252 |
heapSortTest<IntHeap>(); |
253 | 253 |
heapIncreaseTest<IntHeap>(); |
254 | 254 |
|
255 |
typedef |
|
255 |
typedef BinomialHeap<Prio, IntNodeMap > NodeHeap; |
|
256 | 256 |
checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>(); |
257 | 257 |
dijkstraHeapTest<NodeHeap>(digraph, length, source); |
258 | 258 |
} |
259 | 259 |
|
260 | 260 |
// BucketHeap, SimpleBucketHeap |
261 | 261 |
{ |
262 | 262 |
typedef BucketHeap<ItemIntMap> IntHeap; |
263 | 263 |
checkConcept<Heap<Prio, ItemIntMap>, IntHeap>(); |
0 comments (0 inline)