Lines Matching refs:index
42 * not 0-based. The parent is index/2, and the left-child is index*2.
43 * The right child is index*2+1.
72 isc_heapindex_t index;
77 isc_heapindex_t index, unsigned int size_increment,
98 heap->index = index;
152 if (heap->index != NULL)
153 (heap->index)(heap->array[i], i);
156 if (heap->index != NULL)
157 (heap->index)(heap->array[i], i);
176 if (heap->index != NULL)
177 (heap->index)(heap->array[i], i);
181 if (heap->index != NULL)
182 (heap->index)(heap->array[i], i);
203 isc_heap_delete(isc_heap_t *heap, unsigned int index) {
208 REQUIRE(index >= 1 && index <= heap->last);
210 if (index == heap->last) {
218 less = heap->compare(elt, heap->array[index]);
219 heap->array[index] = elt;
221 float_up(heap, index, heap->array[index]);
223 sink_down(heap, index, heap->array[index]);
228 isc_heap_increased(isc_heap_t *heap, unsigned int index) {
230 REQUIRE(index >= 1 && index <= heap->last);
232 float_up(heap, index, heap->array[index]);
236 isc_heap_decreased(isc_heap_t *heap, unsigned int index) {
238 REQUIRE(index >= 1 && index <= heap->last);
240 sink_down(heap, index, heap->array[index]);
244 isc_heap_element(isc_heap_t *heap, unsigned int index) {
246 REQUIRE(index >= 1);
248 if (index <= heap->last)
249 return (heap->array[index]);