Constructs a grouping that represents a collection of non-overlapping chunks
based on the specified condition.
Namespace:
Extreme.DataAnalysis
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public static Grouping<T> VariablePartition<T>(
IList<T> index,
Func<T, T, bool> condition,
Direction direction = Direction.Forward
)
Public Shared Function VariablePartition(Of T) (
index As IList(Of T),
condition As Func(Of T, T, Boolean),
Optional direction As Direction = Direction.Forward
) As Grouping(Of T)
public:
generic<typename T>
static Grouping<T>^ VariablePartition(
IList<T>^ index,
Func<T, T, bool>^ condition,
Direction direction = Direction::Forward
)
static member VariablePartition :
index : IList<'T> *
condition : Func<'T, 'T, bool> *
?direction : Direction
(* Defaults:
let _direction = defaultArg direction Direction.Forward
*)
-> Grouping<'T>
Parameters
- index
- Type: System.Collections.GenericIListT
The index the grouping is over. - condition
- Type: SystemFuncT, T, Boolean
A delegate that indicates whether two keys are
in the same window. - direction (Optional)
- Type: Extreme.DataAnalysisDirection
The direction in which index
is traversed to validate the condition.
Type Parameters
- T
Return Value
Type:
GroupingT
The extent of each chunk is determined by the first key value and
condition. The window is extended as long as
condition returns whe applied
to the first key and the subsequent keys.
The direction parameter determines whether chunks
are created and extended from the beginning (forward) or the end (backward).
The grouping is still in the original order even if going backward.
Reference