Go to the documentation of this file.
17 #ifndef GZ_MATH_ROLLINGMEAN_HH_
18 #define GZ_MATH_ROLLINGMEAN_HH_
21 #include <gz/math/Export.hh>
22 #include <gz/math/config.hh>
29 inline namespace IGNITION_MATH_VERSION_NAMESPACE {
32 class RollingMeanPrivate;
43 public:
explicit RollingMean(
size_t _windowSize = 10);
52 public:
double Mean()
const;
56 public:
size_t Count()
const;
60 public:
void Push(
double _value);
68 public:
void SetWindowSize(
size_t _windowSize);
72 public:
size_t WindowSize()
const;
78 #pragma warning(disable: 4251)
double Mean() const
Get the mean value.
Definition: gz/math/AdditivelySeparableScalarField3.hh:27
void Push(double _value)
Insert a new value.
~RollingMean()
Destructor.
void Clear()
Remove all the pushed values.
RollingMean(size_t _windowSize=10)
Constructor.
size_t WindowSize() const
Get the window size.
A class that computes the mean over a series of data points. The window size determines the maximum n...
Definition: gz/math/RollingMean.hh:38
void SetWindowSize(size_t _windowSize)
Set the new window size. This will also clear the data. Nothing happens if the _windowSize is zero.
size_t Count() const
Get the number of data points.