LinqExtensions.Where<T>(Vector<T>, Func<T, Int32, Boolean>) Method

Filters the elements of a vector based on a predicate. Each element's index is used in the logic of the predicate function.

Definition

Namespace: Extreme.DataAnalysis.Linq
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
public static Vector<T> Where<T>(
	this Vector<T> vector,
	Func<T, int, bool> predicate
)

Parameters

vector  Vector<T>
A vector to filter.
predicate  Func<T, 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

Vector<T>
A 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 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).

Exceptions

ArgumentNullException

vector is null.

-or-

predicate is null.

See Also