Matrix.Map Method

Definition

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

Overload List

Map<T, U>(Func<T, U>, Matrix<T>) Applies a function to the elements of a matrix and returns the result in a new matrix.
Map<T, U, V>(Func<T, U, V>, Matrix<T>, Matrix<U>) Applies a function to the corresponding elements of two matrices and returns the result in a new matrix.
Map<T, U, V>(Func<T, U, V>, Matrix<T>, Vector<U>, Dimension) Applies a function to the corresponding elements of two matrices and returns the result in a new matrix.
Map<T, U, V>(Func<T, U, V>, Vector<T>, Dimension, Matrix<U>) Applies a function to the corresponding elements of two matrices and returns the result in a new matrix.
Map<T, U, V>(Func<T, U, V>, Vector<T>, Dimension, Vector<U>) Maps two broadcast vectors to form a matrix.

Map<T, U>(Func<T, U>, Matrix<T>)

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

Parameters

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

Type Parameters

T
U

Return Value

Matrix<U>
A new matrix.

Exceptions

ArgumentNullExceptionfunction is null.

-or-

matrix is null

Map<T, U, V>(Func<T, U, V>, Matrix<T>, Matrix<U>)

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

Parameters

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

Type Parameters

T
U
V

Return Value

Matrix<V>
A matrix that is the result of applying function to the corresponding elements of first and second.

Exceptions

ArgumentNullExceptionfunction is null.

-or-

first is null

-or-

second is null

DimensionMismatchException

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

Map<T, U, V>(Func<T, U, V>, Matrix<T>, Vector<U>, Dimension)

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

Parameters

function  Func<T, U, V>
A delegate that represents a function of two variables
first  Matrix<T>
A matrix whose elements serve as the first argument to the function.
second  Vector<U>
A vector whose elements, broadcast in the dimension specified by broadcastDimension, serve as the second argument to the function.
broadcastDimension  Dimension
A value that specifies whether the elements in second should be broadcast across rows or columns.

Type Parameters

T
U
V

Return Value

Matrix<V>
A matrix that is the result of applying function to the corresponding elements of first and second.

Exceptions

ArgumentNullExceptionfunction is null.

-or-

first is null

-or-

second is null

DimensionMismatchException

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

Map<T, U, V>(Func<T, U, V>, Vector<T>, Dimension, Matrix<U>)

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

Parameters

function  Func<T, U, V>
A delegate that represents a function of two variables
first  Vector<T>
A vector whose elements, broadcast in the dimension specified by broadcastDimension, serve as the first argument to the function.
broadcastDimension  Dimension
A value that specifies whether the elements in first should be broadcast across rows or columns.
second  Matrix<U>
A matrix whose elements serve as the second argument to the function.

Type Parameters

T
U
V

Return Value

Matrix<V>
A matrix that is the result of applying function to the corresponding elements of first and second.

Exceptions

ArgumentNullExceptionfunction is null.

-or-

first is null

-or-

second is null

DimensionMismatchException

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

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

Maps two broadcast vectors to form a matrix.
C#
public static Matrix<V> Map<T, U, V>(
	Func<T, U, V> function,
	Vector<T> first,
	Dimension firstBroadcastDimension,
	Vector<U> second
)

Parameters

function  Func<T, U, V>
A delegate that represents a function of two variables
first  Vector<T>
A vector.
firstBroadcastDimension  Dimension
A value that specifies whether the elements in first should be broadcast across rows or columns.
second  Vector<U>
A vector.

Type Parameters

T
U
V

Return Value

Matrix<V>
A matrix whose elements are the sum of the corresponding elements of first and second.

Exceptions

ArgumentNullExceptionfirst is null

-or-

second is null

See Also