Matrix.ElementwiseMultiply Method

Definition

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

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

ArgumentNullException

left 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

ArgumentNullException

left is null.

-or-

right is null.

DimensionMismatchException

left 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

ArgumentNullException

left is null.

-or-

right is null.

See Also