2023-12-20 15:25:41 +00:00
|
|
|
#pragma once
|
2012-11-14 22:54:03 +00:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
double weight;
|
|
|
|
double sum;
|
|
|
|
double sum2;
|
|
|
|
} Variable;
|
|
|
|
|
2013-04-21 22:31:36 +00:00
|
|
|
#define VARIABLE_INIT { 0.0, 0.0, 0.0 }
|
2012-11-14 22:54:03 +00:00
|
|
|
|
2013-04-21 22:31:36 +00:00
|
|
|
void variable_init (Variable *variable);
|
2012-11-14 22:54:03 +00:00
|
|
|
void variable_add_weighted (Variable *variable,
|
|
|
|
double value,
|
|
|
|
double weight);
|
|
|
|
void variable_add (Variable *variable,
|
|
|
|
double value);
|
|
|
|
double variable_mean (Variable *variable);
|
|
|
|
double variable_standard_deviation (Variable *variable);
|
|
|
|
void variable_reset (Variable *variable);
|