Vector.ElementwiseDivide Method

Definition

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

Overload List

ElementwiseDivide<T>(Vector<T>, Vector<T>) Divides a vector element-wise by another vector.
ElementwiseDivide<T>(T, Vector<T>) Divides a scalar by each element of a vector.
ElementwiseDivide<T>(Vector<T>, Vector<T>, SparseElementwiseMode) Divides a vector element-wise by another vector.

ElementwiseDivide<T>(Vector<T>, Vector<T>)

Divides a vector element-wise by another vector.
C#
public static Vector<T> ElementwiseDivide<T>(
	Vector<T> left,
	Vector<T> right
)

Parameters

left  Vector<T>
A vector.
right  Vector<T>
A vector.

Type Parameters

T

Return Value

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

Exceptions

ArgumentNullException

left is null.

-or-

right is null.

DimensionMismatchException

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

ElementwiseDivide<T>(T, Vector<T>)

Divides a scalar by each element of a vector.
C#
public static Vector<T> ElementwiseDivide<T>(
	T left,
	Vector<T> right
)

Parameters

left  T
A scalar.
right  Vector<T>
A vector.

Type Parameters

T

Return Value

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

Remarks

If either operand is sparse, this overload uses PatternIntersection.

Exceptions

ArgumentNullException

right is null.

DimensionMismatchException

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

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

Divides a vector element-wise by another vector.
C#
public static Vector<T> ElementwiseDivide<T>(
	Vector<T> left,
	Vector<T> right,
	SparseElementwiseMode mode
)

Parameters

left  Vector<T>
A vector.
right  Vector<T>
A 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 quotient of the elements of left divided 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