Matrix<T>.Subtraction Operator

Definition

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

Overload List

Subtraction(T, Matrix<T>) Subtracts a matrix from a scalar.
Subtraction(Matrix<T>, T) Subtracts a scalar from a matrix.
Subtraction(Matrix<T>, Matrix<T>) Subtracts two matrices.

Subtraction(T, Matrix<T>) Operator

Subtracts a matrix from a scalar.
C#
public static Matrix<T> operator -(
	T value,
	Matrix<T> matrix
)

Parameters

value  T
The constant.
matrix  Matrix<T>
A matrix.

Return Value

Matrix<T>
A matrix whose elements are the difference between the corresponding elements of matrix and value.

Exceptions

ArgumentNullException

matrix is null.

Subtraction(Matrix<T>, T) Operator

Subtracts a scalar from a matrix.
C#
public static Matrix<T> operator -(
	Matrix<T> matrix,
	T value
)

Parameters

matrix  Matrix<T>
A matrix.
value  T
The constant.

Return Value

Matrix<T>
A matrix whose elements are the difference of the corresponding elements of matrix and value.

Exceptions

ArgumentNullException

matrix is null.

Subtraction(Matrix<T>, Matrix<T>) Operator

Subtracts two matrices.
C#
public static Matrix<T> operator -(
	Matrix<T> left,
	Matrix<T> right
)

Parameters

left  Matrix<T>
The matrix to subtract from.
right  Matrix<T>
The matrix to subtract.

Return Value

Matrix<T>
A matrix whose elements are equal to the corresponding element of left minus the corresponding element of right.

Exceptions

ArgumentNullException

left is null.

-or-

right is null.

DimensionMismatchException

left and right do not have the same length.

See Also