Lines Matching full:heap
21 * Binary Heap Fibonacci Heap
31 * The Fibonacci heap is quite a bit more complicated to implement and has
32 * larger overhead in practice. We favour the binary heap here. A multi-way
33 * (ternary or quaternary) heap might elicit a performance advantage via better
43 size_t posn; /* Current index in heap[] or link in free list */
50 struct pq_heap_st *heap; member
53 size_t htop; /* Highest used heap element */
54 size_t hmax; /* Allocated heap & element space */
59 * The initial and maximum number of elements in the heap.
67 assert(pq->elements[pq->heap[idx].index].used); \
68 assert(pq->elements[pq->heap[idx].index].posn == idx)
105 struct pq_heap_st *h = pq->heap, t_h; in pqueue_swap_elem()
121 struct pq_heap_st *h = pq->heap; in pqueue_move_elem()
131 * Force the specified element to the front of the heap. This breaks
132 * the heap partial ordering pre-condition.
152 struct pq_heap_st *h = pq->heap; in pqueue_move_down()
172 struct pq_heap_st *h = pq->heap; in pqueue_move_up()
206 pq->heap[n].data = data; in ossl_pqueue_push()
207 pq->heap[n].index = m; in ossl_pqueue_push()
223 return pq->heap->data; in ossl_pqueue_peek()
237 res = pq->heap->data; in ossl_pqueue_pop()
238 elem = pq->heap->index; in ossl_pqueue_pop()
271 return pq->heap[--pq->htop].data; in ossl_pqueue_remove()
311 h = OPENSSL_realloc(pq->heap, new_max * sizeof(*pq->heap)); in ossl_pqueue_reserve()
314 pq->heap = h; in ossl_pqueue_reserve()
340 pq->heap = OPENSSL_malloc(sizeof(*pq->heap) * min_nodes); in ossl_pqueue_new()
342 if (pq->heap == NULL || pq->elements == NULL) { in ossl_pqueue_new()
353 OPENSSL_free(pq->heap); in ossl_pqueue_free()
365 (*freefunc)(pq->heap[i].data); in ossl_pqueue_pop_free()