Calculates the running count, mean, variance, and standard deviation.
More...
#include <stddef.h>
Go to the source code of this file.
Calculates the running count, mean, variance, and standard deviation.
Definition in file running_stats.h.
Value to add to the running stats.
- Parameters
-
s | Stat structure |
d | Value to add |
int sa_deserialize_running_stats |
( |
sa_running_stats * |
s, |
|
|
const char * |
buf, |
|
|
size_t |
len |
|
) |
| |
Restores the internal state from the serialized output.
- Parameters
-
s | Stat structure |
buf | Buffer containing the output of serialize_running_stats |
len | Length of the buffer |
- Returns
- 0 = success 1 = invalid buffer length 2 = invalid count value
Zeros out the stats counters.
- Parameters
-
s | Stat structure to zero out |
Returns the corrected sample standard deviation of the stats.
- Parameters
-
- Returns
- double Standard deviation of the stats up to this point
Serialize the internal state to a buffer.
- Parameters
-
s | Stat structure |
len | Length of the returned buffer |
- Returns
- char* Serialized representation MUST be freed by the caller
Returns the uncorrected sample standard deviation of the stats.
- Parameters
-
- Returns
- double Uncorrected standard deviation of the stats up to this point
Returns the variance of the stats.
- Parameters
-
- Returns
- double Variance of the stats up to this point