• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/ap/gpl/ppp-2.4.4/pppdump/

Lines Matching refs:heap

171 /* maximum heap size */
324 int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
325 int heap_len; /* number of elements in the heap */
327 /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
328 * The same heap array is used to build all trees.
1523 * need for the L_CODES extra codes used during heap construction. However
1785 /* Index within the heap array of least frequent node in the Huffman tree */
1789 * Remove the smallest element from the heap and recreate the heap with
1790 * one less element. Updates heap and heap_len.
1794 top = s->heap[SMALLEST]; \
1795 s->heap[SMALLEST] = s->heap[s->heap_len--]; \
1808 * Restore the heap property by moving down the tree starting at node k,
1810 * when the heap property is re-established (each father smaller than its
1818 int v = s->heap[k];
1823 smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
1827 if (smaller(tree, v, s->heap[j], s->depth)) break;
1830 s->heap[k] = s->heap[j]; k = j;
1835 s->heap[k] = v;
1841 * IN assertion: the fields freq and dad are set, heap[heap_max] and
1858 int h; /* heap index */
1870 tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
1873 n = s->heap[h];
1914 m = s->heap[--h];
1984 int n, m; /* iterate over heap elements */
1988 /* Construct the initial heap, with least frequent element in
1989 * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
1990 * heap[0] is not used.
1996 s->heap[++(s->heap_len)] = max_code = n;
2009 node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
2017 /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
2028 m = s->heap[SMALLEST]; /* m = node of next least frequency */
2030 s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
2031 s->heap[--(s->heap_max)] = m;
2043 /* and insert the new node in the heap */
2044 s->heap[SMALLEST] = node++;
2049 s->heap[--(s->heap_max)] = s->heap[SMALLEST];