Matrix<T>.MapAsSecondCore Method

Definition

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

Overload List

MapAsSecondCore<U, V>(Func<U, T, V>, Matrix<U>, Matrix<V>) Applies a function to the corresponding elements of two matrices.
MapAsSecondCore<U, V>(Func<U, T, V>, Vector<U>, Dimension, Matrix<V>) Applies a function to the corresponding elements of a matrix and a vector broadcast along the specified dimension.

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

Applies a function to the corresponding elements of two matrices.
C#
protected virtual Matrix<V> MapAsSecondCore<U, V>(
	Func<U, T, V> function,
	Matrix<U> first,
	Matrix<V>? result
)

Parameters

function  Func<U, T, V>
A delegate that represents a function of two variables
first  Matrix<U>
A matrix whose elements serve as the first argument to the function.
result  Matrix<V>
The matrix that is to hold the result. May be null.

Type Parameters

U
V

Return Value

Matrix<V>
The result of applying function to the corresponding elements of first and this matrix.

Exceptions

ArgumentNullException

function is null.

-or-

first is null.

DimensionMismatchException

The number of rows of this matrix does not equal the number of rows of first.

-or-

The number of columns of this matrix does not equal the number of columns of first.

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

Applies a function to the corresponding elements of a matrix and a vector broadcast along the specified dimension.
C#
protected virtual Matrix<V> MapAsSecondCore<U, V>(
	Func<U, T, V> function,
	Vector<U> first,
	Dimension broadcastDimension,
	Matrix<V>? result
)

Parameters

function  Func<U, T, V>
A delegate that represents a function of two variables
first  Vector<U>
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.
result  Matrix<V>
The matrix that is to hold the result. May be null.

Type Parameters

U
V

Return Value

Matrix<V>
The result of applying function to the corresponding elements of this matrix and first.

Exceptions

ArgumentNullException

function is null.

-or-

first is null.

DimensionMismatchException

The dimensions of first do not match the dimensions of this matrix.

See Also