Grouping.Partition Method
Definition
Namespace: Extreme.DataAnalysis
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
Overload List
Partition( | Constructs a grouping that represents a collection of non-overlapping chunks of fixed length. |
Partition( | Constructs a grouping that represents a collection of non-overlapping chunks of fixed length. |
Partition<T>(IList<T>, Int32, Boolean, Boolean) | Constructs a grouping that represents a collection of non-overlapping chunks of fixed length. |
Partition(IList<Int32>)
Constructs a grouping that represents a collection of
non-overlapping chunks of fixed length.
public static Grouping<int> Partition(
IList<int> offsets
)
Parameters
Return Value
Grouping<Int32>A grouping object that represents the chunking.
Exceptions
Argument | offsets is null |
Argument |
Partition(Int32, Int32)
Constructs a grouping that represents a collection of
non-overlapping chunks of fixed length.
public static Grouping<int> Partition(
int length,
int size
)
Parameters
Return Value
Grouping<Int32>A grouping object that represents the chunking.
Partition<T>(IList<T>, Int32, Boolean, Boolean)
Constructs a grouping that represents a collection
of non-overlapping chunks of fixed length.
public static Grouping<T> Partition<T>(
IList<T> values,
int size,
bool alignToEnd = false,
bool skipIncomplete = false
)
Parameters
- values IList<T>
- The collection the grouping is over.
- size Int32
- The size of the chunks. Must be greater than zero.
- alignToEnd Boolean (Optional)
- Indicates whether groups should be aligned starting from the end of the index.
- skipIncomplete Boolean (Optional)
- Indicates whether the first or last group should be skipped if it does not have full size.
Type Parameters
- T
Return Value
Grouping<T>A grouping object that represents the chunking.
Remarks
If alignToEnd is false (the default) then first element of values in each group is used as the key for the group. If alignToEnd is true then the last element of values in each group is used as the key for the group.
Exceptions
Argument | values is null |
Argument | size is less than or equal to zero. |