Matrix.ElementwiseMultiply Method

Definition

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

Overload List

ElementwiseMultiply<T>(Matrix<T>, Matrix<T>) Multiplies the elements of a matrix by the corresponding elements of another matrix.
ElementwiseMultiply<T>(Matrix<T>, Vector<T>, Dimension) Multiplies the elements of a matrix and a vector broadcast along the specified dimension elementwise.
ElementwiseMultiply<T>(Vector<T>, Dimension, Vector<T>) Multiplies the elements of two broadcast vectors.

ElementwiseMultiply<T>(Matrix<T>, Matrix<T>)

Multiplies the elements of a matrix by the corresponding elements of another matrix.
C#
public static Matrix<T> ElementwiseMultiply<T>(
	Matrix<T> left,
	Matrix<T> right
)

Parameters

left  Matrix<T>
The first matrix.
right  Matrix<T>
The second matrix.

Type Parameters

T

Return Value

Matrix<T>
A new matrix whose elements are equal to the products of the elements of left and right .

Exceptions

ArgumentNullExceptionleft is null

-or-

right is null

DimensionMismatchException The length of left does not equal the length of right.

ElementwiseMultiply<T>(Matrix<T>, Vector<T>, Dimension)

Multiplies the elements of a matrix and a vector broadcast along the specified dimension elementwise.
C#
public static Matrix<T> ElementwiseMultiply<T>(
	Matrix<T> left,
	Vector<T> right,
	Dimension broadcastDimension
)

Parameters

left  Matrix<T>
A matrix.
right  Vector<T>
A vector.
broadcastDimension  Dimension
A value that specifies whether the elements in right should be broadcast across rows or columns.

Type Parameters

T

Return Value

Matrix<T>
A matrix whose elements are the product of the corresponding elements of left and right.

Exceptions

ArgumentNullExceptionleft is null

-or-

right is null

DimensionMismatchExceptionleft and right do not have the same dimension.

ElementwiseMultiply<T>(Vector<T>, Dimension, Vector<T>)

Multiplies the elements of two broadcast vectors.
C#
public static Matrix<T> ElementwiseMultiply<T>(
	Vector<T> left,
	Dimension leftBroadcastDimension,
	Vector<T> right
)

Parameters

left  Vector<T>
A vector.
leftBroadcastDimension  Dimension
A value that specifies whether the elements in left should be broadcast across rows or columns.
right  Vector<T>
A vector.

Type Parameters

T

Return Value

Matrix<T>
A matrix whose elements are the product of the corresponding elements of left and right.

Exceptions

ArgumentNullExceptionleft is null

-or-

right is null

See Also