Constructs a grouping that represents a collection
of non-overlapping chunks of fixed length.
Namespace:
Extreme.DataAnalysis
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public static Grouping<T> Partition<T>(
IList<T> values,
int size,
bool alignToEnd = false,
bool skipIncomplete = false
)
Public Shared Function Partition(Of T) (
values As IList(Of T),
size As Integer,
Optional alignToEnd As Boolean = false,
Optional skipIncomplete As Boolean = false
) As Grouping(Of T)
public:
generic<typename T>
static Grouping<T>^ Partition(
IList<T>^ values,
int size,
bool alignToEnd = false,
bool skipIncomplete = false
)
static member Partition :
values : IList<'T> *
size : int *
?alignToEnd : bool *
?skipIncomplete : bool
(* Defaults:
let _alignToEnd = defaultArg alignToEnd false
let _skipIncomplete = defaultArg skipIncomplete false
*)
-> Grouping<'T>
Parameters
- values
- Type: System.Collections.GenericIListT
The collection the grouping is over. - size
- Type: SystemInt32
The size of the chunks. Must be greater than zero. - alignToEnd (Optional)
- Type: SystemBoolean
Indicates whether groups should be aligned
starting from the end of the index. - skipIncomplete (Optional)
- Type: SystemBoolean
Indicates whether the first or last group should be skipped
if it does not have full size.
Type Parameters
- T
Return Value
Type:
GroupingTA grouping object that represents the chunking.
If alignToEnd is
(the default) then first element of values
in each group is used as the key for the group.
If alignToEnd is
then the last element of values
in each group is used as the key for the group.
Reference