72 while (si != si_start);
119 ASSERT (found_first_child);
200 u32 list_has_single_element = prev_ni == ni;
209 p->
first_child = list_has_single_element ? ~0 : next_ni;
227 return list_has_single_element ? ~0 : next_ni;
247 u32 ri, lo_i, hi_i, k;
271 lo =
hi, lo_i = hi_i;
336 u32 ri_last, ri_next,
i, min_ds;
377 return to_delete_min_ri;
456 fheap_node_add_sibling
#define vec_foreach_index(var, v)
Iterate over vector indices.
void fheap_add(fheap_t *f, u32 ni, u32 key)
clib_memset(h->entries, 0, sizeof(h->entries[0])*entries)
static u32 fheap_node_remove_and_invalidate(fheap_t *f, u32 ni)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static u32 fheap_node_remove_internal(fheap_t *f, u32 ni, u32 invalidate)
static void fheap_link_root(fheap_t *f, u32 ni)
#define foreach_fheap_node_sibling(f, ni, first_ni, body)
static fheap_node_t * fheap_get_node(fheap_t *f, u32 i)
static u32 fheap_node_remove(fheap_t *f, u32 ni)
static void fheap_node_add_sibling(fheap_t *f, u32 ni, u32 ni_to_add)
static fheap_node_t * fheap_get_root(fheap_t *f)
static void fheap_mark_parent(fheap_t *f, u32 pi)
void fheap_del(fheap_t *f, u32 ni)
void fheap_decrease_key(fheap_t *f, u32 ni, u32 new_key)
u32 fheap_del_min(fheap_t *f, u32 *min_key)
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
static void fheap_validate(fheap_t *f)