mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
refactoring: hist_create() => hist_init()
This commit is contained in:
parent
46ff3462cc
commit
e2213b0b99
3 changed files with 3 additions and 5 deletions
|
@ -44,7 +44,7 @@ struct hist {
|
|||
};
|
||||
|
||||
/** Initialize struct hist with supplied values and allocate memory for buckets. */
|
||||
int hist_create(struct hist *h, double start, double end, double resolution);
|
||||
int hist_init(struct hist *h, double start, double end, double resolution);
|
||||
|
||||
/** Free the dynamically allocated memory. */
|
||||
int hist_destroy(struct hist *h);
|
||||
|
@ -79,8 +79,6 @@ char * hist_dump(struct hist *h);
|
|||
/** Prints Matlab struct containing all infos to file. */
|
||||
int hist_dump_matlab(struct hist *h, FILE *f);
|
||||
|
||||
#ifdef WITH_JANSSON
|
||||
int hist_dump_json(struct hist *h, FILE *f);
|
||||
|
||||
json_t * hist_json(struct hist *h);
|
||||
#endif
|
|
@ -17,7 +17,7 @@
|
|||
#define VAL(h, i) ((h)->low + (i) * (h)->resolution)
|
||||
#define INDEX(h, v) round((v - (h)->low) / (h)->resolution)
|
||||
|
||||
int hist_create(struct hist *h, double low, double high, double resolution)
|
||||
int hist_init(struct hist *h, double low, double high, double resolution)
|
||||
{
|
||||
h->low = low;
|
||||
h->high = high;
|
||||
|
|
|
@ -36,7 +36,7 @@ int stats_init(struct stats *s)
|
|||
{
|
||||
for (int i = 0; i < STATS_COUNT; i++) {
|
||||
struct stats_desc *desc = &stats_table[i];
|
||||
hist_create(&s->histograms[i], desc->hist.min, desc->hist.max, desc->hist.resolution);
|
||||
hist_init(&s->histograms[i], desc->hist.min, desc->hist.max, desc->hist.resolution);
|
||||
}
|
||||
|
||||
s->delta = alloc(sizeof(struct stats_delta));
|
||||
|
|
Loading…
Add table
Reference in a new issue