Grouping.VariableWindow<T> Method

Returns a grouping that represents a moving window based on the specified condition.

Definition

Namespace: Extreme.DataAnalysis
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
public static Grouping<T> VariableWindow<T>(
	IList<T> index,
	Func<T, T, bool> condition,
	bool incremental,
	Direction direction
)

Parameters

index  IList<T>
The index the grouping is over.
condition  Func<T, T, Boolean>
A delegate that indicates whether two keys are in the same window.
incremental  Boolean
Indicates that the right edge of the window is not decreasing.
direction  Direction
Specifies whether the condition should be verified moving forward or backward through the values.

Type Parameters

T
The element type of the index.

Return Value

Grouping<T>

Remarks

The extent of each window is determined by the first key value and condition. The window is extended as long as condition returns true whe applied to the first key and the subsequent keys.

Exceptions

ArgumentNullException

index is null

-or-

condition is null

See Also