DenseMatrix<T, TSlice, TStorage2D>.Subtract Method

Definition

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

Overload List

Subtract(DenseMatrix<T>, DenseMatrix<T>)

Subtracts two dense matrix objects.
C#
public static DenseMatrix<T> Subtract(
	DenseMatrix<T> matrix1,
	DenseMatrix<T> matrix2
)

Parameters

matrix1  DenseMatrix<T>
The first DenseMatrix<T, TSlice, TStorage2D>.
matrix2  DenseMatrix<T>
The second DenseMatrix<T, TSlice, TStorage2D>.

Return Value

DenseMatrix<T>
A DenseMatrix<T, TSlice, TStorage2D> that is equals the matrix matrix2 subtracted from matrix1.

Exceptions

ArgumentNullException

matrix1 is null.

-or-

matrix2 is null.

DimensionMismatchException

The dimensions of matrix1 do not equal the dimensions of matrix2.

Subtract(DenseMatrix<T>, DenseMatrix<T>, DenseMatrix<T>)

Subtracts two DenseMatrix<T, TSlice, TStorage2D> objects and stores the result in a third DenseMatrix<T, TSlice, TStorage2D>.
C#
public static DenseMatrix<T> Subtract(
	DenseMatrix<T> matrix1,
	DenseMatrix<T> matrix2,
	DenseMatrix<T> resultMatrix
)

Parameters

matrix1  DenseMatrix<T>
The first DenseMatrix<T, TSlice, TStorage2D>.
matrix2  DenseMatrix<T>
The second DenseMatrix<T, TSlice, TStorage2D>.
resultMatrix  DenseMatrix<T>
A DenseMatrix<T, TSlice, TStorage2D> that is to receive the result of the multiplication.

Return Value

DenseMatrix<T>
A reference to resultMatrix.

Exceptions

ArgumentNullException

matrix1 is null.

-or-

matrix2 is null.

-or-

resultMatrix is null.

DimensionMismatchException

The dimensions of matrix2 does not equal the dimensions of matrix1.

-or-

The dimensions of resultMatrix does not equal the dimensions of matrix1.

See Also