Lines Matching full:heap

5  * Test cases for the min max heap.
27 struct min_heap_test *heap, in pop_verify_heap() argument
30 int *values = heap->data; in pop_verify_heap()
35 min_heap_pop_inline(heap, funcs, NULL); in pop_verify_heap()
36 while (heap->nr > 0) { in pop_verify_heap()
51 min_heap_pop_inline(heap, funcs, NULL); in pop_verify_heap()
60 struct min_heap_test heap = { in test_heapify_all() local
72 min_heapify_all_inline(&heap, &funcs, NULL); in test_heapify_all()
73 err = pop_verify_heap(min_heap, &heap, &funcs); in test_heapify_all()
77 heap.nr = ARRAY_SIZE(values); in test_heapify_all()
78 for (i = 0; i < heap.nr; i++) in test_heapify_all()
81 min_heapify_all_inline(&heap, &funcs, NULL); in test_heapify_all()
82 err += pop_verify_heap(min_heap, &heap, &funcs); in test_heapify_all()
92 struct min_heap_test heap = { in test_heap_push() local
105 min_heap_push_inline(&heap, &data[i], &funcs, NULL); in test_heap_push()
107 err = pop_verify_heap(min_heap, &heap, &funcs); in test_heap_push()
110 while (heap.nr < heap.size) { in test_heap_push()
112 min_heap_push_inline(&heap, &temp, &funcs, NULL); in test_heap_push()
114 err += pop_verify_heap(min_heap, &heap, &funcs); in test_heap_push()
124 struct min_heap_test heap = { in test_heap_pop_push() local
138 min_heap_push_inline(&heap, &temp, &funcs, NULL); in test_heap_pop_push()
142 min_heap_pop_push_inline(&heap, &data[i], &funcs, NULL); in test_heap_pop_push()
144 err = pop_verify_heap(min_heap, &heap, &funcs); in test_heap_pop_push()
146 heap.nr = 0; in test_heap_pop_push()
148 min_heap_push_inline(&heap, &temp, &funcs, NULL); in test_heap_pop_push()
153 min_heap_pop_push_inline(&heap, &temp, &funcs, NULL); in test_heap_pop_push()
155 err += pop_verify_heap(min_heap, &heap, &funcs); in test_heap_pop_push()
164 struct min_heap_test heap; in test_heap_del() local
166 min_heap_init_inline(&heap, values, ARRAY_SIZE(values)); in test_heap_del()
167 heap.nr = ARRAY_SIZE(values); in test_heap_del()
175 min_heapify_all_inline(&heap, &funcs, NULL); in test_heap_del()
177 min_heap_del_inline(&heap, get_random_u32() % heap.nr, &funcs, NULL); in test_heap_del()
178 err = pop_verify_heap(min_heap, &heap, &funcs); in test_heap_del()
182 heap.nr = ARRAY_SIZE(values); in test_heap_del()
183 for (i = 0; i < heap.nr; i++) in test_heap_del()
185 min_heapify_all_inline(&heap, &funcs, NULL); in test_heap_del()
188 min_heap_del_inline(&heap, get_random_u32() % heap.nr, &funcs, NULL); in test_heap_del()
189 err += pop_verify_heap(min_heap, &heap, &funcs); in test_heap_del()
221 MODULE_DESCRIPTION("Test cases for the min max heap");