Programming with Judy
Using Judy
Using JudyL
Chapter 340
}
(*PGenCount)++; // increment hit count
}
ENDTm;
(void) printf("That took %.3f Secs or %.3f uSec/Index\n\n",
DeltaUSec/1000000, DeltaUSec/unique_nums);
// PRINT DUPLICATES HISTOGRAM
(void) puts("Duplicates Histogram:");
for (Index = 0L,
PValue = (ulong_t *)JudyLFirst(PJCountArray, &Index, &JError);
PValue;
PValue = (ulong_t *)JudyLNext(PJCountArray, &Index, &JError))
{
(void) printf(" %ld numbers were generated %ld time%s\n",
*PValue, Index, PLURAL(Index));
}
}
// PRINT DISTRIBUTION HISTOGRAM
(void) puts("\nCompute the random number distribution by counting index");
(void) puts("ranges.");
histo_incr = ((ulong_t)~0L / DEFAULT_HISTO_BUCKETS) >> 1;
Index = 0L;
for (iter = 0; iter < DEFAULT_HISTO_BUCKETS; iter++)
{