1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

add possibility to print histogram in different verbosity levels

This commit is contained in:
Steffen Vogel 2016-10-30 22:55:56 -04:00
parent c0d5bbb47b
commit 3d694cf4d9
3 changed files with 4 additions and 4 deletions

View file

@ -67,7 +67,7 @@ double hist_mean(struct hist *h);
double hist_stddev(struct hist *h);
/** Print all statistical properties of distribution including a graphilcal plot of the histogram. */
void hist_print(struct hist *h);
void hist_print(struct hist *h, int details);
/** Print ASCII style plot of histogram */
void hist_plot(struct hist *h);

View file

@ -112,13 +112,13 @@ double hist_stddev(struct hist *h)
return sqrt(hist_var(h));
}
void hist_print(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->total - h->higher - h->lower > 0) {
if (details > 0 && h->total - h->higher - h->lower > 0) {
char *buf = hist_dump(h);
stats("Matlab: %s", buf);
free(buf);

View file

@ -182,7 +182,7 @@ void test_rtt() {
else
error("Invalid file descriptor: %u", fd);
hist_print(&hist);
hist_print(&hist, 1);
hist_destroy(&hist);
}