\n");
puts ("\n");
if (histoResults)
printf("%d bin histogram on %u values (zero count bins not shown) | \n",
histoResults->binCount - 1, histoResults->count);
else
printf(" histogram (zero count bins not shown) | \n");
puts (" bin | \n");
puts (" \n");
puts (" \nrange in bin | \n");
puts (" minimum | \n");
puts (" maximum | \n");
puts (" \n");
puts (" | \n");
puts (" count | \n");
puts (" Relative Frequency | \n");
puts (" log2(Frequency) | Cumulative Relative Frequency (CRF) | \n");
puts (" 1.0 - CRF | \n");
}
else
{
if (histoResults)
printf("#\tbin histogram (zero count bins not shown)\n");
else
printf("#\t%d bin histogram on %u values (zero count bins not shown)\n",
histoResults->binCount - 1, histoResults->count);
printf("# bin range count pValue log2(pValue) CPD 1.0 - CPD\n");
printf("# [min max)\n");
}
if (histoResults)
{
boolean someDisplayed = FALSE;
double cpd = 0.0;
double log2_0 = log(2.0);
int i;
for (i=0; i < histoResults->binCount; ++i)
{
if (histoResults->binCounts[i] > 0)
{
double min, max, pValue;
min = ((double)i * histoResults->binSize) +
histoResults->binZero;
max = min + histoResults->binSize;
if (html)
{
printf (" %d | \n", i );
printf (" %g | %g | \n", min, max);
printf (" %u | \n",
histoResults->binCounts[i] );
}
else
printf ("%02d %g %g %u", i, min, max,
histoResults->binCounts[i]);
if (histoResults->binCounts[i] > 0)
{
pValue = (double) histoResults->binCounts[i] /
(double) histoResults->count;
cpd += pValue;
if (html)
{
printf (" %g | \n", pValue);
printf (" %g | \n",
log(pValue)/log2_0);
}
else
printf ("\t%f\t%f", pValue, log(pValue)/log2_0);
}
else
{
if (html)
{
printf (" 0.0 | \n");
printf (" N/A | \n");
}
else
printf ("\t0.0\tN/A");
}
if (html)
{
printf (" %g | \n", cpd);
printf (" %g | \n", 1.0 - cpd);
}
else
printf ("\t%f\t%f\n", cpd, 1.0 - cpd);
someDisplayed = TRUE;
}
}
if (!someDisplayed)
{
if (html)
puts (" "
"no data found for histogram | \n");
else
puts ("#\tno data found for histogram\n");
}
}
else
{
if (html)
puts (" "
"no data found for histogram | \n");
else
puts ("#\tno data found for histogram\n");
}
if (html)
{
printf (" |