ClassesClassesClassesClasses | | | | Operators

mult_matrixmult_matrixMultMatrixmult_matrixMultMatrixMultMatrix (Operator)

Name

mult_matrixmult_matrixMultMatrixmult_matrixMultMatrixMultMatrix — Multiply two matrices.

Signature

mult_matrix( : : MatrixAID, MatrixBID, MultType : MatrixMultID)

Herror mult_matrix(const Hlong MatrixAID, const Hlong MatrixBID, const char* MultType, Hlong* MatrixMultID)

Herror T_mult_matrix(const Htuple MatrixAID, const Htuple MatrixBID, const Htuple MultType, Htuple* MatrixMultID)

Herror mult_matrix(const HTuple& MatrixAID, const HTuple& MatrixBID, const HTuple& MultType, Hlong* MatrixMultID)

HMatrix HMatrix::MultMatrix(const HMatrix& MatrixBID, const HTuple& MultType) const

void MultMatrix(const HTuple& MatrixAID, const HTuple& MatrixBID, const HTuple& MultType, HTuple* MatrixMultID)

HMatrix HMatrix::MultMatrix(const HMatrix& MatrixBID, const HString& MultType) const

HMatrix HMatrix::MultMatrix(const HMatrix& MatrixBID, const char* MultType) const

void HOperatorSetX.MultMatrix(
[in] VARIANT MatrixAID, [in] VARIANT MatrixBID, [in] VARIANT MultType, [out] VARIANT* MatrixMultID)

IHMatrixX* HMatrixX.MultMatrix(
[in] IHMatrixX* MatrixBID, [in] BSTR MultType)

static void HOperatorSet.MultMatrix(HTuple matrixAID, HTuple matrixBID, HTuple multType, out HTuple matrixMultID)

HMatrix HMatrix.MultMatrix(HMatrix matrixBID, string multType)

Description

The operator mult_matrixmult_matrixMultMatrixmult_matrixMultMatrixMultMatrix computes the product of the input matrices MatrixAMatrixAMatrixAMatrixAMatrixAmatrixA and MatrixBMatrixBMatrixBMatrixBMatrixBmatrixB defined by the matrix handles MatrixAIDMatrixAIDMatrixAIDMatrixAIDMatrixAIDmatrixAID and MatrixBIDMatrixBIDMatrixBIDMatrixBIDMatrixBIDmatrixBID. A new matrix MatrixMultMatrixMultMatrixMultMatrixMultMatrixMultmatrixMult is generated with the result. The operator returns the matrix handle MatrixMultIDMatrixMultIDMatrixMultIDMatrixMultIDMatrixMultIDmatrixMultID of the matrix MatrixMultMatrixMultMatrixMultMatrixMultMatrixMultmatrixMult. Access to the elements of the matrix is possible e.g. with the operator get_full_matrixget_full_matrixGetFullMatrixget_full_matrixGetFullMatrixGetFullMatrix. If desired, one or both input matrices will be transposed for the multiplication.

The type of multiplication can be selected via MultTypeMultTypeMultTypeMultTypeMultTypemultType:

'AB'"AB""AB""AB""AB""AB":

The matrices MatrixAMatrixAMatrixAMatrixAMatrixAmatrixA and MatrixBMatrixBMatrixBMatrixBMatrixBmatrixB will not be transposed. Therefore, the formula for the calculation of the result is:

    MatrixMultMatrixMultMatrixMultMatrixMultMatrixMultmatrixMult = MatrixAMatrixAMatrixAMatrixAMatrixAmatrixA * MatrixBMatrixBMatrixBMatrixBMatrixBmatrixB.
  

The number of columns of the matrix MatrixAMatrixAMatrixAMatrixAMatrixAmatrixA must be identical to the number of rows of the matrix MatrixBMatrixBMatrixBMatrixBMatrixBmatrixB.

Example:

'ATB'"ATB""ATB""ATB""ATB""ATB":

The matrix MatrixAMatrixAMatrixAMatrixAMatrixAmatrixA will be transposed. The matrix MatrixBMatrixBMatrixBMatrixBMatrixBmatrixB will not be transposed. Therefore, the formula for the calculation of the result is:

The number of rows of the matrix MatrixAMatrixAMatrixAMatrixAMatrixAmatrixA must be identical to the number of rows of the matrix MatrixBMatrixBMatrixBMatrixBMatrixBmatrixB.

Example:

'ABT'"ABT""ABT""ABT""ABT""ABT":

The matrix MatrixAMatrixAMatrixAMatrixAMatrixAmatrixA will not be transposed. The matrix MatrixBMatrixBMatrixBMatrixBMatrixBmatrixB will be transposed. Therefore, the formula for the calculation of the result is:

The number of columns of the matrix MatrixAMatrixAMatrixAMatrixAMatrixAmatrixA must be identical to the number of columns of the matrix MatrixBMatrixBMatrixBMatrixBMatrixBmatrixB.

Example:

'ATBT'"ATBT""ATBT""ATBT""ATBT""ATBT":

The matrix MatrixAMatrixAMatrixAMatrixAMatrixAmatrixA and the matrix MatrixBMatrixBMatrixBMatrixBMatrixBmatrixB will be transposed. Therefore, the formula for the calculation of the result is:

The number of rows of the matrix MatrixAMatrixAMatrixAMatrixAMatrixAmatrixA must be identical to the number of columns of the matrix MatrixBMatrixBMatrixBMatrixBMatrixBmatrixB.

Example:

Parallelization

Parameters

MatrixAIDMatrixAIDMatrixAIDMatrixAIDMatrixAIDmatrixAID (input_control)  matrix HMatrix, HTupleHTupleHMatrix, HTupleHMatrixX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Matrix handle of the input matrix A.

MatrixBIDMatrixBIDMatrixBIDMatrixBIDMatrixBIDmatrixBID (input_control)  matrix HMatrix, HTupleHTupleHMatrix, HTupleHMatrixX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Matrix handle of the input matrix B.

MultTypeMultTypeMultTypeMultTypeMultTypemultType (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Type of the input matrices.

Default value: 'AB' "AB" "AB" "AB" "AB" "AB"

List of values: 'AB'"AB""AB""AB""AB""AB", 'ABT'"ABT""ABT""ABT""ABT""ABT", 'ATB'"ATB""ATB""ATB""ATB""ATB", 'ATBT'"ATBT""ATBT""ATBT""ATBT""ATBT"

MatrixMultIDMatrixMultIDMatrixMultIDMatrixMultIDMatrixMultIDmatrixMultID (output_control)  matrix HMatrix, HTupleHTupleHMatrix, HTupleHMatrixX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Matrix handle of the multiplied matrices.

Result

If the parameters are valid, the operator mult_matrixmult_matrixMultMatrixmult_matrixMultMatrixMultMatrix returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.

Possible Predecessors

create_matrixcreate_matrixCreateMatrixcreate_matrixCreateMatrixCreateMatrix

Possible Successors

get_full_matrixget_full_matrixGetFullMatrixget_full_matrixGetFullMatrixGetFullMatrix, get_value_matrixget_value_matrixGetValueMatrixget_value_matrixGetValueMatrixGetValueMatrix

Alternatives

mult_matrix_modmult_matrix_modMultMatrixModmult_matrix_modMultMatrixModMultMatrixMod

See also

mult_element_matrixmult_element_matrixMultElementMatrixmult_element_matrixMultElementMatrixMultElementMatrix, mult_element_matrix_modmult_element_matrix_modMultElementMatrixModmult_element_matrix_modMultElementMatrixModMultElementMatrixMod, div_element_matrixdiv_element_matrixDivElementMatrixdiv_element_matrixDivElementMatrixDivElementMatrix, div_element_matrix_moddiv_element_matrix_modDivElementMatrixModdiv_element_matrix_modDivElementMatrixModDivElementMatrixMod, transpose_matrixtranspose_matrixTransposeMatrixtranspose_matrixTransposeMatrixTransposeMatrix, transpose_matrix_modtranspose_matrix_modTransposeMatrixModtranspose_matrix_modTransposeMatrixModTransposeMatrixMod

References

David Poole: “Linear Algebra: A Modern Introduction”; Thomson; Belmont; 2006.
Gene H. Golub, Charles F. van Loan: “Matrix Computations”; The Johns Hopkins University Press; Baltimore and London; 1996.

Module

Foundation


ClassesClassesClassesClasses | | | | Operators