cgv
Loading...
Searching...
No Matches
statistics.h
1#pragma once
2
3#include <iostream>
4#include <cmath>
5
6#include "lib_begin.h"
7
8namespace cgv {
9 namespace utils {
10
12class CGV_API statistics
13{
14public:
16 statistics();
18 statistics(const double& v);
20 statistics(const double& v, unsigned int n);
22 void init();
24 void init(const double& v);
26 void init(const double& v, unsigned int n);
28 void update(const double& v);
30 void update(const double& v, unsigned int n);
32 double get_average() const;
34 double get_variance() const;
36 double get_standard_deviation() const;
38 double get_sum() const;
40 double get_sum_of_squares() const;
42 double get_min() const;
44 double get_max() const;
46 unsigned int get_count() const;
47protected:
48 double min, max, sum, sms;
49 unsigned int cnt;
50};
51
52
53extern CGV_API std::ostream& operator << (std::ostream& os, const statistics& s);
54
55 }
56}
57
58#include <cgv/config/lib_end.h>
incrementally accumulate statistical information
Definition statistics.h:13
the cgv namespace
Definition print.h:11