Creates a lookup from a vector according to the specified
key selector and element selector functions.
Namespace:
Extreme.DataAnalysis.Linq
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public static LinqExtensionsLookup<TKey, TElement> ToLookup<T, TKey, TElement>(
this Vector<T> vector,
Func<T, TKey> keySelector,
Func<T, TElement> elementSelector
)
<ExtensionAttribute>
Public Shared Function ToLookup(Of T, TKey, TElement) (
vector As Vector(Of T),
keySelector As Func(Of T, TKey),
elementSelector As Func(Of T, TElement)
) As LinqExtensionsLookup(Of TKey, TElement)
public:
[ExtensionAttribute]
generic<typename T, typename TKey, typename TElement>
static LinqExtensionsLookup<TKey, TElement>^ ToLookup(
Vector<T>^ vector,
Func<T, TKey>^ keySelector,
Func<T, TElement>^ elementSelector
)
[<ExtensionAttribute>]
static member ToLookup :
vector : Vector<'T> *
keySelector : Func<'T, 'TKey> *
elementSelector : Func<'T, 'TElement> -> LinqExtensionsLookup<'TKey, 'TElement>
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. - elementSelector
- Type: SystemFuncT, 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
Type:
LinqExtensionsLookupTKey,
TElementA 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
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