Lines Matching defs:syms

116       syms: number of symbols remaining to code
122 syms: 3..totsym (totsym == total symbols to code)
123 left: 2..syms - 1, but only the evens (so syms == 8 -> 2, 4, 6)
126 syms == 2 is not saved since that immediately leads to a single code. left
129 left ends at syms-1 since left == syms immediately results in a single code.
134 first one (syms) being outermost, and the last one (len) being innermost.
135 We build the array with length max-1 lists for the len index, with syms-3
148 to the num[] array as described above for the (syms, left, len) triplet.
196 len through max inclusive, coding syms symbols, with left bit patterns of
200 local big_t count(int syms, int len, int left)
204 int least; /* least number of syms to use at this juncture */
205 int most; /* most number of syms to use at this juncture */
210 if (syms == left)
214 assert(syms > left && left > 0 && len < max);
217 index = INDEX(syms, left, len);
224 least = (left << 1) - syms;
231 most = (((code_t)left << (max - len)) - syms) /
237 got = count(syms - use, len + 1, (left - use) << 1);
252 bit vector to indicate visiting this state. Each (syms,len,left) state
255 local int beenhere(int syms, int len, int left, int mem, int rem)
263 /* point to vector for (syms,left,len), bit in vector for (mem,rem) */
264 index = INDEX(syms, left, len);
314 /* Examine all possible codes from the given node (syms, len, left). Compute
319 local void examine(int syms, int len, int left, int mem, int rem)
321 int least; /* least number of syms to use at this juncture */
322 int most; /* most number of syms to use at this juncture */
326 if (syms == left) {
355 if (beenhere(syms, len, left, mem, rem))
360 least = (left << 1) - syms;
367 most = (((code_t)left << (max - len)) - syms) /
382 examine(syms - use, len + 1, (left - use) << 1,
396 intermediate code states (syms, left, len). For each completed code,
400 local void enough(int syms)
413 for (n = 3; n <= syms; n++)
457 int syms; /* total number of symbols to code */
468 syms = 286;
472 syms = atoi(argv[1]);
479 if (argc > 4 || syms < 2 || root < 1 || max < 1) {
485 /* if not restricting the code length, the longest is syms - 1 */
486 if (max > syms - 1)
487 max = syms - 1;
495 if (max > n || syms - 2 >= (((code_t)0 - 1) >> (max - 1))) {
501 if (syms - 1 > ((code_t)1 << max) - 1) {
503 syms, max);
516 if (syms == 2) /* iff max == 1 */
519 size = syms >> 1;
520 if (size > ((size_t)0 - 1) / (n = (syms - 1) >> 1) ||
532 for (n = 2; n <= syms; n++) {
542 printf("%llu total codes for 2 to %d symbols", sum, syms);
543 if (max < syms - 1)
549 if (syms == 2)
561 if (syms < ((code_t)1 << (root + 1)))
562 enough(syms);