-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCompoundStats.hpp
38 lines (36 loc) · 906 Bytes
/
CompoundStats.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class StatClass{
private:
float lowerBound;
float upperBound;
float midPoint;
long frequency;
public:
StatClass(float lb, float ub);
long getLowerBound();
long getUpperBound();
long getFrequency();
float getMidPoint();
float getSum();
bool ValueBelongs(float val);
bool ValueBelongsAdd(float val);
void Add(int value);
};
class CompoundStats{
private:
long valueCount; //<-- init on construction
long classCount; //<-- receive on construction
float classWidth; //<-- calculate on construction
float minVal; //<-- receive on construction
float maxVal; //<-- receive on construction
StatClass** classes;
public:
CompoundStats(float MinVal, float MaxVal, int ClassCount);
~CompoundStats();
void AddStat(float value);
float Mean();
float Median();
float Mode();
float MeanDeviation();
float Variance();
float StandarDeviation();
};