Creates a lookup from a vector according to the specified
key selector function and key comparer.
Namespace:
Extreme.DataAnalysis.Linq
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public static LinqExtensionsLookup<TKey, T> ToLookup<T, TKey>(
this Vector<T> vector,
Func<T, TKey> keySelector,
IEqualityComparer<TKey> comparer
)
<ExtensionAttribute>
Public Shared Function ToLookup(Of T, TKey) (
vector As Vector(Of T),
keySelector As Func(Of T, TKey),
comparer As IEqualityComparer(Of TKey)
) As LinqExtensionsLookup(Of TKey, T)
public:
[ExtensionAttribute]
generic<typename T, typename TKey>
static LinqExtensionsLookup<TKey, T>^ ToLookup(
Vector<T>^ vector,
Func<T, TKey>^ keySelector,
IEqualityComparer<TKey>^ comparer
)
[<ExtensionAttribute>]
static member ToLookup :
vector : Vector<'T> *
keySelector : Func<'T, 'TKey> *
comparer : IEqualityComparer<'TKey> -> LinqExtensionsLookup<'TKey, 'T>
Parameters
- vector
- Type: Extreme.MathematicsVectorT
The vector to create a lookup from. - keySelector
- Type: SystemFuncT, TKey
A function to extract a key from each element. - comparer
- Type: System.Collections.GenericIEqualityComparerTKey
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
Type:
LinqExtensionsLookupTKey,
TA 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
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