Groups the elements of a vector according to the specified key selector function
and creates a result value from each group and its key.
Namespace:
Extreme.DataAnalysis.Linq
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public static Vector<TResult> GroupBy<T, TKey, TResult>(
this Vector<T> vector,
Func<T, TKey> keySelector,
Func<TKey, IEnumerable<T>, TResult> resultSelector
)
<ExtensionAttribute>
Public Shared Function GroupBy(Of T, TKey, TResult) (
vector As Vector(Of T),
keySelector As Func(Of T, TKey),
resultSelector As Func(Of TKey, IEnumerable(Of T), TResult)
) As Vector(Of TResult)
public:
[ExtensionAttribute]
generic<typename T, typename TKey, typename TResult>
static Vector<TResult>^ GroupBy(
Vector<T>^ vector,
Func<T, TKey>^ keySelector,
Func<TKey, IEnumerable<T>^, TResult>^ resultSelector
)
[<ExtensionAttribute>]
static member GroupBy :
vector : Vector<'T> *
keySelector : Func<'T, 'TKey> *
resultSelector : Func<'TKey, IEnumerable<'T>, 'TResult> -> Vector<'TResult>
Parameters
- vector
- Type: Extreme.MathematicsVectorT
A vector whose elements to group. - keySelector
- Type: SystemFuncT, TKey
A function to extract the key for each element. - resultSelector
- Type: SystemFuncTKey, IEnumerableT, TResult
A function that maps each group to a final result.
Type Parameters
- T
- The type of the elements of the vector.
- TKey
- The type of the keys.
- TResult
- The type of the final result for each group.
Return Value
Type:
VectorTResultA vector of elements of type
TResult where each element
is obtained by applying
resultSelector to each group resulting
from using
keySelector to obtain the key on each element
of
vector.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
VectorT. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Reference