Given a sequence of numeric values that will be added to this instance, the algorithm keeps track of the minimum value of the last numberOfItems
added values.
The name of the algorithm is ascending minima algorithm, one of the algorithms in the class of "minimum on a sliding window algorithms".
Constructor | Description |
Full Usage:
MinimumOnSlidingWindow(numberOfItems, startValue)
Parameters:
int
-
The number of items N. The algorithm evaluates the minimum of the last N items that where added to this instance.
startValue : 'T
-
The start value. This is the first entry to add to the instance. Thus, the MinimumOnSlidingWindow.MinimumValue always return a valid value.
|
|
Instance member | Description |
Full Usage:
this.Add
Parameters:
'T
-
The val.
|
Adds the specified value to the window, and removes the item that is now expired from the window.
|
Full Usage:
this.MinimumValue
Returns: 'T
|
Gets the current minimum value of the window.
|
Full Usage:
this.Remove
|
Removes the expired element from this window. Note: normally this is done when you use the MinimumOnSlidingWindow.Add function, thus there is no need to call this function separately. When the minimum item is the item that is expired now, then this function will remove this item from the collection and sets the current minimum to the next greater item. |