Lines Matching refs:k
2236 #define HPARENT(k) ((((k) - HEAP0 - 1) / DHEAP) + HEAP0) argument
2237 #define UPHEAP_DONE(p,k) ((p) == (k)) argument
2241 downheap (ANHE *heap, int N, int k) in downheap() argument
2243 ANHE he = heap [k]; in downheap()
2250 ANHE *pos = heap + DHEAP * (k - HEAP0) + HEAP0 + 1; in downheap()
2273 heap [k] = *minpos; in downheap()
2274 ev_active (ANHE_w (*minpos)) = k; in downheap()
2276 k = minpos - heap; in downheap()
2279 heap [k] = he; in downheap()
2280 ev_active (ANHE_w (he)) = k; in downheap()
2286 #define HPARENT(k) ((k) >> 1) argument
2287 #define UPHEAP_DONE(p,k) (!(p)) argument
2291 downheap (ANHE *heap, int N, int k) in downheap() argument
2293 ANHE he = heap [k]; in downheap()
2297 int c = k << 1; in downheap()
2308 heap [k] = heap [c]; in downheap()
2309 ev_active (ANHE_w (heap [k])) = k; in downheap()
2311 k = c; in downheap()
2314 heap [k] = he; in downheap()
2315 ev_active (ANHE_w (he)) = k; in downheap()
2321 upheap (ANHE *heap, int k) in upheap() argument
2323 ANHE he = heap [k]; in upheap()
2327 int p = HPARENT (k); in upheap()
2329 if (UPHEAP_DONE (p, k) || ANHE_at (heap [p]) <= ANHE_at (he)) in upheap()
2332 heap [k] = heap [p]; in upheap()
2333 ev_active (ANHE_w (heap [k])) = k; in upheap()
2334 k = p; in upheap()
2337 heap [k] = he; in upheap()
2338 ev_active (ANHE_w (he)) = k; in upheap()
2343 adjustheap (ANHE *heap, int N, int k) in adjustheap() argument
2345 if (k > HEAP0 && ANHE_at (heap [k]) <= ANHE_at (heap [HPARENT (k)])) in adjustheap()
2346 upheap (heap, k); in adjustheap()
2348 downheap (heap, N, k); in adjustheap()