Vector<T>.Map Method

Definition

Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23

Overload List

Map<U>(Func<T, U>) Applies a function to the elements of a vector and returns the result.
Map<U>(Func<T, U>, Vector<T>) Applies a function to the elements of a vector and returns the result in a new vector.
Map<U, V>(Func<T, U, V>, Vector<T>, Vector<U>) Applies a function to the corresponding elements of two vectors and returns the result in a new vector.

Vector<T>.Map<U>(Func<T, U>)

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

Parameters

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.

Exceptions

ArgumentNullExceptionfunction is null.

Vector<T>.Map<U>(Func<T, U>, Vector<T>)

Applies a function to the elements of a vector and returns the result in a new vector.
C#
public static Vector<U> Map<U>(
	Func<T, U> function,
	Vector<T> vector
)

Parameters

function  Func<T, U>
A delegate that represents a function of one variable
vector  Vector<T>
A vector whose elements to apply function to.

Type Parameters

U

Return Value

Vector<U>
A new vector.

Exceptions

ArgumentNullExceptionfunction is null.

-or-

vector is null

Vector<T>.Map<U, V>(Func<T, U, V>, Vector<T>, Vector<U>)

Applies a function to the corresponding elements of two vectors and returns the result in a new vector.
C#
public static Vector<V> Map<U, V>(
	Func<T, U, V> function,
	Vector<T> first,
	Vector<U> second
)

Parameters

function  Func<T, U, V>
A delegate that represents a function of two variables
first  Vector<T>
A vector whose elements serve as the first argument to the function.
second  Vector<U>
A vector whose elements serve as the second argument to the function.

Type Parameters

U
V

Return Value

Vector<V>
A vector that is the result of applying function to the corresponding elements of first and this vector.

Exceptions

ArgumentNullExceptionfunction is null.

-or-

first is null

-or-

second is null

DimensionMismatchException

The length of first does not equal the length of second.

See Also