DenseMatrix<T, TSlice, TStorage2D>.Multiply Method

Definition

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

Overload List

Multiply(Matrix<T>) Multiplies this matrix on the right by a square Matrix<T>.
Multiply(Vector<T>)Applies the linear operator to a vector.
Multiply(DenseMatrix<T>, DenseMatrix<T>) Multiplies two matrix objects.
Multiply(DenseMatrix<T>, DenseMatrix<T>, DenseMatrix<T>) Multiplies two DenseMatrix<T, TSlice, TStorage2D> objects and stores the result in a third DenseMatrix<T, TSlice, TStorage2D>.

Multiply(Matrix<T>)

Multiplies this matrix on the right by a square Matrix<T>.
C#
public override DenseMatrix<T> Multiply(
	Matrix<T> matrix
)

Parameters

matrix  Matrix<T>
The second Matrix<T>.

Return Value

DenseMatrix<T>
A reference to this instance, which is the product of the original DenseMatrix<T, TSlice, TStorage2D> with matrix.

Remarks

The matrix matrix must be square, and the number of rows and columns of matrix must be equal to the number of columns of this instance. Otherwise, an exception of type DimensionMismatchException is thrown.

Exceptions

ArgumentNullException

matrix is null.

DimensionMismatchException

The number of rows of matrix does not match the number of columns in this matrix.

-or-

matrix is not square.

Multiply(DenseMatrix<T>, DenseMatrix<T>)

Multiplies two matrix objects.
C#
public static DenseMatrix<T> Multiply(
	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 the product of matrix1 and matrix2.

Remarks

The number of columns of matrix1 must be equal to the number of rows of matrix2. Otherwise, an exception of type DimensionMismatchException is thrown.

This method uses the BLAS routine DGEMM.

Exceptions

ArgumentNullException

matrix1 is null.

-or-

matrix2 is null.

DimensionMismatchException

The number of columns of matrix1 does not equal the number of rows of matrix2.

Multiply(DenseMatrix<T>, DenseMatrix<T>, DenseMatrix<T>)

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

Parameters

matrix1  DenseMatrix<T>
A DenseMatrix<T, TSlice, TStorage2D> that is the left factor of the multiplication.
matrix2  DenseMatrix<T>
A DenseMatrix<T, TSlice, TStorage2D> that is the right factor of the multiplication.
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.

Remarks

The number of columns of matrix1 must be equal to the number of rows of matrix2. The number of rows of matrix1 must be equal to the number of rows of resultMatrix. The number of columns of matrix2 must be equal to the number of columns of resultMatrix. Otherwise, an exception of type DimensionMismatchException is thrown.

This method uses the BLAS routine DGEMM.

Exceptions

ArgumentNullException

matrix1 is null.

-or-

matrix2 is null.

-or-

resultMatrix is null.

DimensionMismatchException

The number of rows of matrix1 does not equal the number of rows of resultMatrix.

-or-

The number of columns of matrix1 does not equal the number of columns of resultMatrix.

-or-

The number of columns of matrix1 does not equal the number of rows of matrix2.

See Also