Vector.ElementwiseMultiplyInto Method

Definition

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

Overload List

ElementwiseMultiplyInto<T>(Vector<T>, Vector<T>, Vector<T>) Multiplies a vector element-wise by another vector.
ElementwiseMultiplyInto<T>(Vector<T>, Vector<T>, Vector<T>, SparseElementwiseMode) Multiplies a vector element-wise by another vector.

ElementwiseMultiplyInto<T>(Vector<T>, Vector<T>, Vector<T>)

Multiplies a vector element-wise by another vector.
C#
public static Vector<T> ElementwiseMultiplyInto<T>(
	Vector<T> left,
	Vector<T> right,
	Vector<T>? result
)

Parameters

left  Vector<T>
A vector.
right  Vector<T>
A vector.
result  Vector<T>
The vector that is to hold the result. May be null.

Type Parameters

T

Return Value

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

Remarks

If either operand is sparse, this overload uses PatternIntersection. If result is null, the operation chooses the result representation. Otherwise, result is overwritten and its representation is preserved. The result may alias either operand.

Exceptions

ArgumentNullException

left is null.

-or-

right is null.

DimensionMismatchException

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

ElementwiseMultiplyInto<T>(Vector<T>, Vector<T>, Vector<T>, SparseElementwiseMode)

Multiplies a vector element-wise by another vector.
C#
public static Vector<T> ElementwiseMultiplyInto<T>(
	Vector<T> left,
	Vector<T> right,
	Vector<T>? result,
	SparseElementwiseMode mode
)

Parameters

left  Vector<T>
A vector.
right  Vector<T>
A vector.
result  Vector<T>
The vector that is to hold the result. May be null.
mode  SparseElementwiseMode
The sparse element-wise arithmetic mode. This parameter affects sparse operands only.

Type Parameters

T

Return Value

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

Remarks

If result is null, the operation chooses the result representation. Otherwise, result is overwritten and its representation is preserved. The result may alias either operand.

In Strict mode, sparse operands are treated as logical dense vectors. A sparse explicit destination may be fully materialized.

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