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

Groups the elements of a vector according to the specified key selector function and key comparer.

Definition

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

Parameters

vector  Vector<T>
The vector to create a lookup from.
keySelector  Func<T, TKey>
A function to extract a key from each element.
comparer  IEqualityComparer<TKey>
An object that compares two keys for equality.

Type Parameters

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

Return Value

LinqExtensions.Lookup<TKey, T>
A lookup that contains keys and values.

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