56#define MATSTAT_STATE_INIT (const matstat_state_t) { \
static int32_t matstat_mean(const matstat_state_t *state)
Return the computed mean value of all samples so far.
uint64_t matstat_variance(const matstat_state_t *state)
Compute the sample variance of all samples so far.
void matstat_add(matstat_state_t *state, int32_t value)
Add a sample to state.
void matstat_clear(matstat_state_t *state)
Reset state.
void matstat_merge(matstat_state_t *dest, const matstat_state_t *src)
Combine two states.
Internal state for computing running statistics.
uint32_t count
Number of values added.
int64_t sum
Sum of values added.
uint64_t sum_sq
Sum of squared differences.
int32_t max
Maximum value seen.
int32_t min
Minimum value seen.