Revision f8c1c6834e3c7da57d0cae114735f1cf643b0498 authored by Nico Schertler on 09 July 2018, 14:15:39 UTC, committed by Nico Schertler on 09 July 2018, 14:15:39 UTC
1 parent 722a9f4
Statistics.h
#pragma once
#include <vector>
class Statistics
{
public:
void AddDatum(float datum);
void Clear();
std::size_t Size() const;
void SetGlobalShift(float shift);
float Average() const;
float Median();
//p between 0 and 1
float Percentile(float p);
float Variance() const;
float Min();
float Max();
private:
void Sort();
std::vector<float> data;
float sum = 0;
bool isSorted = true;
float globalShift = 0; //an offset that is added to all data
};
Computing file changes ...