diff options
author | Damien Lespiau <damien.lespiau@intel.com> | 2015-06-25 23:59:21 +0100 |
---|---|---|
committer | Damien Lespiau <damien.lespiau@intel.com> | 2015-06-27 16:03:27 +0100 |
commit | 515cec1210764241153f5d46d70ba5e943201b14 (patch) | |
tree | 4b7866c6de7bfbf32423bbbe30dde0af78bcefb8 /lib/igt_stats.c | |
parent | 05c10f940f9df3a5b24e2a0b476052fbe5a22282 (diff) |
stats: Add a way to retrieve the standard deviation
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Diffstat (limited to 'lib/igt_stats.c')
-rw-r--r-- | lib/igt_stats.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/igt_stats.c b/lib/igt_stats.c index 20db806d..65c0ac62 100644 --- a/lib/igt_stats.c +++ b/lib/igt_stats.c @@ -22,6 +22,8 @@ * */ +#include <math.h> + #include "igt_core.h" #include "igt_stats.h" @@ -86,3 +88,10 @@ double igt_stats_get_variance(igt_stats_t *stats) return stats->variance; } + +double igt_stats_get_std_deviation(igt_stats_t *stats) +{ + igt_stats_knuth_mean_variance(stats); + + return sqrt(stats->variance); +} |