Vector<T>.MapWhere Method

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.2

Overload List

MapWhere<U>(Func<T, Boolean>, Func<T, U>) Applies a function to the elements of a vector that meet a condition and returns the result.
MapWhere<U>(Func<Int32, T, Boolean>, Func<T, U>) Applies a function to the elements of a vector that meet a condition and returns the result.

MapWhere<U>(Func<T, Boolean>, Func<T, U>)

Applies a function to the elements of a vector that meet a condition and returns the result.
C#
public Vector<U> MapWhere<U>(
	Func<T, bool> condition,
	Func<T, U> function
)

Parameters

condition  Func<T, Boolean>
A predicate that computes whether a value should be mapped.
function  Func<T, U>
A delegate that represents a function of one variable

Type Parameters

U

Return Value

Vector<U>
The result of applying function to each element of this vector that matches condition. When condition is false, a missing value is returned.

Exceptions

ArgumentNullException

function is null.

-or-

condition is null.

MapWhere<U>(Func<Int32, T, Boolean>, Func<T, U>)

Applies a function to the elements of a vector that meet a condition and returns the result.
C#
public Vector<U> MapWhere<U>(
	Func<int, T, bool> condition,
	Func<T, U> function
)

Parameters

condition  Func<Int32, T, Boolean>
A predicate that computes whether a value should be mapped based on the index and value of the element.
function  Func<T, U>
A delegate that represents a function of one variable

Type Parameters

U

Return Value

Vector<U>
The result of applying function to each element of this vector that matches condition. When condition is false, a missing value is returned.

Exceptions

ArgumentNullException

function is null.

-or-

condition is null.

See Also