Filters the elements of a vector based on a predicate.
Each element's index is used in the logic of the predicate function.
Namespace:
Extreme.DataAnalysis.Linq
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public static Vector<T> Where<T>(
this Vector<T> vector,
Func<T, int, bool> predicate
)
<ExtensionAttribute>
Public Shared Function Where(Of T) (
vector As Vector(Of T),
predicate As Func(Of T, Integer, Boolean)
) As Vector(Of T)
public:
[ExtensionAttribute]
generic<typename T>
static Vector<T>^ Where(
Vector<T>^ vector,
Func<T, int, bool>^ predicate
)
[<ExtensionAttribute>]
static member Where :
vector : Vector<'T> *
predicate : Func<'T, int, bool> -> Vector<'T>
Parameters
- vector
- Type: Extreme.MathematicsVectorT
A vector to filter. - predicate
- Type: SystemFuncT, Int32, Boolean
A function to test each element for a condition.
The second parameter of the function represents the index of the element.
Type Parameters
- T
- The element type of the vector.
Return Value
Type:
VectorTA vector that contains the elements from
vector
that satisfy the condition.
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