Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <running_stat.h>
Public Member Functions | |
RunningMax (int window_size) | |
Takes the size of the running window. The size must be positive. | |
RunningMax (const RunningMax &)=delete | |
This type is neither copyable nor movable. | |
RunningMax & | operator= (const RunningMax &)=delete |
void | Add (Number value) |
Processes a new element from the stream. | |
Number | GetCurrentMax () |
Simple class to efficiently compute the maximum over a fixed size window of a numeric stream. This works in constant average amortized time.
Definition at line 70 of file running_stat.h.
|
explicit |
Takes the size of the running window. The size must be positive.
Definition at line 146 of file running_stat.h.
|
delete |
This type is neither copyable nor movable.
void operations_research::RunningMax< Number >::Add | ( | Number | value | ) |
Processes a new element from the stream.
Starting phase until values_ reaches its final size.
We are in the steady state.
Note the use of >= instead of > to get the O(1) behavior in presence of many identical values.
We need to recompute the max.
Definition at line 152 of file running_stat.h.
Number operations_research::RunningMax< Number >::GetCurrentMax | ( | ) |
Returns the current maximum element in the window. An element must have been added before calling this function.
Definition at line 191 of file running_stat.h.
|
delete |