Matthew's Portfolio
stat-tracker.h
Go to the documentation of this file.
1
15{
16protected:
18 uint32_t numPoints;
20 float sum;
22 float sumSquared;
24 float Sx;
25
26public:
27 StatTracker(void); // Constructor to initialize variables.
28 void add_data(float new_float); // Add one data point to the set being tracked.
29 void add_data(int32_t new_int); // Add a signed integer point to the data set.
30 void add_data(uint32_t new_uint); // Add an unsigned integer point to the data set.
31 uint32_t num_points(void); // Returns the number of data points added.
32 float average(void); // Returns the average of the data.
33 float std_dev(void); // Returns the standard deviation of the data.
34 void clear(void); // Deletes all the data, returning to no points added state.
35};
Class which is given measurements and computes some statistical parameters.
Definition: stat-tracker.h:15
float std_dev(void)
Computes a standard deviation of all data.
Definition: stat-tracker.cpp:84
void clear(void)
Clears all the arrays.
Definition: stat-tracker.cpp:93
void add_data(float new_float)
Add a float-type number to the database.
Definition: stat-tracker.cpp:32
StatTracker(void)
Initialize variables for future statistical calculations.
Definition: stat-tracker.cpp:19
float average(void)
Computes an average of all data.
Definition: stat-tracker.cpp:74
float Sx
Standard deviation of data within the class StatTracker.
Definition: stat-tracker.h:24
uint32_t num_points(void)
Counts and returns the total number of data points added to the data set.
Definition: stat-tracker.cpp:66
float sum
Total sum of all data types within the class StatTracker.
Definition: stat-tracker.h:20
uint32_t numPoints
Number of individual data points added to the class StatTracker.
Definition: stat-tracker.h:18
float sumSquared
Sum of squared added data within the class StatTracker.
Definition: stat-tracker.h:22