Matrix.Multiply Method
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
Overload List
Multiply<T>(Matrix<T>, T) | Multiplies a matrix by a scalar. |
Multiply<T>(Matrix<T>, Matrix<T>) | Multiplies two matrix objects. |
Multiply<T>(Matrix<T>, Vector<T>) | Multiplies a vector by a matrix. |
Multiply<T>(T, Matrix<T>) | Multiplies a matrix by a scalar. |
Multiply<T>(Matrix<T>, TransposeOperation, Vector<T>) | Multiplies a vector by a matrix. |
Multiply<T>(Matrix<T>, TransposeOperation, Matrix<T>, TransposeOperation) | Multiplies one matrix by another matrix and returns the result. |
Multiply<T>(Matrix<T>, T)
Multiplies a matrix by a scalar.
public static Matrix<T> Multiply<T>(
Matrix<T> matrix,
T factor
)
Parameters
- matrix Matrix<T>
- A matrix.
- factor T
- A number.
Type Parameters
- T
Return Value
Matrix<T>A matrix whose elements are the corresponding elements of matrix multiplied by factor.
Exceptions
Argument | matrix is null. |
Multiply<T>(Matrix<T>, Matrix<T>)
Multiplies two matrix objects.
public static Matrix<T> Multiply<T>(
Matrix<T> matrix1,
Matrix<T> matrix2
)
Parameters
Type Parameters
- T
Return Value
Matrix<T>A Matrix<T> that is the product of matrix1 and matrix2.
Remarks
This method returns the matrix product of its two arguments. For this operation to be defined, the number of columns of matrix1 must equal the number of rows of matrix2.
Exceptions
Argument | matrix1 is null. -or- matrix2 is null. |
Dimension | The number of columns of matrix1 does not equal the number of rows of matrix2. |
Multiply<T>(Matrix<T>, Vector<T>)
Multiplies a vector by a matrix.
public static Vector<T> Multiply<T>(
Matrix<T> matrix,
Vector<T> vector
)
Parameters
Type Parameters
- T
Return Value
Vector<T>Exceptions
Argument | matrix is null. -or- vector is null. |
Multiply<T>(T, Matrix<T>)
Multiplies a matrix by a scalar.
public static Matrix<T> Multiply<T>(
T factor,
Matrix<T> matrix
)
Parameters
- factor T
- A number.
- matrix Matrix<T>
- A matrix.
Type Parameters
- T
Return Value
Matrix<T>A matrix whose elements are the corresponding elements of matrix multiplied by factor.
Exceptions
Argument | matrix is null. |
Multiply<T>(Matrix<T>, TransposeOperation, Vector<T>)
Multiplies a vector by a matrix.
public static Vector<T> Multiply<T>(
Matrix<T> matrix,
TransposeOperation operation,
Vector<T> vector
)
Parameters
- matrix Matrix<T>
- A matrix.
- operation TransposeOperation
- The operation to apply to matrix before multiplying.
- vector Vector<T>
- A vector.
Type Parameters
- T
Return Value
Vector<T>Exceptions
Argument | matrix is null. -or- vector is null. |
Multiply<T>(Matrix<T>, TransposeOperation, Matrix<T>, TransposeOperation)
Multiplies one matrix by another matrix and returns
the result.
public static Matrix<T> Multiply<T>(
Matrix<T> left,
TransposeOperation leftOperation,
Matrix<T> right,
TransposeOperation rightOperation
)
Parameters
- left Matrix<T>
- The left operand of the multiplication.
- leftOperation TransposeOperation
- A TransposeOperation value that indicates which operation, if any, should be performed on this instance before multiplying.
- right Matrix<T>
- The right operand of the multiplication.
- rightOperation TransposeOperation
- A TransposeOperation value that indicates which operation, if any, should be performed on the matrix right before multiplying.
Type Parameters
- T
Return Value
Matrix<T>A matrix that is the product of the matrix left, transformed as specified by leftOperation, with the matrix right, transformed as specified by rightOperation.
Remarks
This method calculates the matrix product of two matrices. The exact form of the operation is determined by the other parameters. The dimensions of the two matrices must be compatible with this form.
Exceptions
Argument | left is null. -or- right is null. |