Linq Extensions.To Lookup<T, TKey, TElement>(Vector<T>, Func<T, TKey>, Func<T, TElement>, IEquality Comparer<TKey>) Method
Creates a lookup from a vector according to the specified
key selector and element selector functions, and key comparer.
Definition
Namespace: Extreme.DataAnalysis.Linq
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
A lookup that contains keys and values selected from the input using elementSelector.
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
public static LinqExtensions.Lookup<TKey, TElement> ToLookup<T, TKey, TElement>(
this Vector<T> vector,
Func<T, TKey> keySelector,
Func<T, TElement> elementSelector,
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.
- elementSelector Func<T, TElement>
- A function that transforms each input 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.
- 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.