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