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

Applies a function to the corresponding elements of two matrices and returns the result in a new matrix.

Definition

Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
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.

See Also