Vector.ElementwiseMultiply Method

Definition

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

Overload List

ElementwiseMultiply<T>(Vector<T>, Vector<T>) Multiplies the elements of a vector by the corresponding elements of another vector.
ElementwiseMultiply<T>(Vector<T>, Vector<T>, SparseElementwiseMode) Multiplies the elements of a vector by the corresponding elements of another vector.

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

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

Parameters

left  Vector<T>
The first vector.
right  Vector<T>
The second vector.

Type Parameters

T

Return Value

Vector<T>
A new vector 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>(Vector<T>, Vector<T>, SparseElementwiseMode)

Multiplies the elements of a vector by the corresponding elements of another vector.
C#
public static Vector<T> ElementwiseMultiply<T>(
	Vector<T> left,
	Vector<T> right,
	SparseElementwiseMode mode
)

Parameters

left  Vector<T>
The first vector.
right  Vector<T>
The second vector.
mode  SparseElementwiseMode
The sparse element-wise arithmetic mode. This parameter affects sparse operands only.

Type Parameters

T

Return Value

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

Remarks

The operation chooses the result representation. Sparse structural modes return sparse results when their result pattern is sparse. In Strict mode, sparse operands are treated as logical dense vectors and the result may be dense.

Exceptions

ArgumentNullException

left is null.

-or-

right is null.

ArgumentOutOfRangeExceptionmode is not a valid SparseElementwiseMode value.
DimensionMismatchException

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

See Also