mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
hist: make human output more readable
This commit is contained in:
parent
0bdf8192e8
commit
cd0db79517
1 changed files with 15 additions and 9 deletions
24
lib/hist.c
24
lib/hist.c
|
@ -133,17 +133,23 @@ double hist_stddev(struct hist *h)
|
|||
|
||||
void hist_print(struct hist *h, int details)
|
||||
{ INDENT
|
||||
stats("Counted values: %ju (%ju between %f and %f)", h->total, h->total-h->higher-h->lower, h->high, h->low);
|
||||
stats("Highest: %f Lowest: %f", h->highest, h->lowest);
|
||||
stats("Mu: %f Sigma2: %f Sigma: %f", hist_mean(h), hist_var(h), hist_stddev(h));
|
||||
if (h->length > 0) {
|
||||
hist_cnt_t missed = h->total - h->higher - h->lower;
|
||||
|
||||
stats("Counted values: %ju (%ju between %f and %f)", h->total, missed, h->low, h->high);
|
||||
stats("Highest: %f Lowest: %f", h->highest, h->lowest);
|
||||
stats("Mu: %f Sigma2: %f Sigma: %f", hist_mean(h), hist_var(h), hist_stddev(h));
|
||||
|
||||
if (details > 0 && h->total - h->higher - h->lower > 0) {
|
||||
char *buf = hist_dump(h);
|
||||
stats("Matlab: %s", buf);
|
||||
free(buf);
|
||||
if (details > 0 && h->total - h->higher - h->lower > 0) {
|
||||
char *buf = hist_dump(h);
|
||||
stats("Matlab: %s", buf);
|
||||
free(buf);
|
||||
|
||||
hist_plot(h);
|
||||
hist_plot(h);
|
||||
}
|
||||
}
|
||||
else
|
||||
stats("Counted values: %ju", h->total);
|
||||
}
|
||||
|
||||
void hist_plot(struct hist *h)
|
||||
|
@ -168,7 +174,7 @@ void hist_plot(struct hist *h)
|
|||
hist_cnt_t cnt = h->data[i];
|
||||
int bar = HIST_HEIGHT * ((double) cnt / max);
|
||||
|
||||
if (value > h->lowest || value < h->highest)
|
||||
if (value >= h->lowest || value <= h->highest)
|
||||
stats("%+9g | %5ju | %.*s", value, cnt, bar, buf);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue