LinqExtensions.GroupBy<T, TKey, TElement>(Vector<T>, Func<T, TKey>, Func<T, TElement>) Method

Groups the elements of a vector according to the specified key selector and element selector functions.

Definition

Namespace: Extreme.DataAnalysis.Linq
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
public static LinqExtensions.Lookup<TKey, TElement> GroupBy<T, TKey, TElement>(
	this Vector<T> vector,
	Func<T, TKey> keySelector,
	Func<T, TElement> elementSelector
)

Parameters

vector  Vector<T>
The vector to create a lookup from.
keySelector  Func<T, TKey>
A function to extract a key from each element.
elementSelector  Func<T, TElement>
A function that transforms each input element.

Type Parameters

T
The type of the elements of the vector.
TKey
The type of the key returned by the key selector.
TElement
The type of the value returned by the element selector.

Return Value

LinqExtensions.Lookup<TKey, TElement>
A lookup that contains keys and values selected from the input using elementSelector.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Vector<T>. 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).

See Also