MATMUL (The GNU Fortran Compiler)

### 8.194 `MATMUL` — matrix multiplication ¶

Synopsis:

  `RESULT = MATMUL(MATRIX_A, MATRIX_B)`

Description:

  Performs a matrix multiplication on numeric or logical arguments.

Class:

  Transformational function

Arguments:

  MATRIX_A | An array of `INTEGER`, `REAL`, `COMPLEX`, `UNSIGNED` or `LOGICAL` type, with a rank of one or two.
  MATRIX_B | An array of `INTEGER`, `REAL`, or `COMPLEX` type if MATRIX_A is of `INTEGER`, `REAL`, or `COMPLEX` type. Otherwise, if MATRIX_A is an array of `UNSIGNED` or `LOGICAL` type, the type shall be the same as that of MATRIX_A. The rank shall be one or two, and the first (or only) dimension of MATRIX_B shall be equal to the last (or only) dimension of MATRIX_A. MATRIX_A and MATRIX_B shall not both be rank one arrays.

Return value:

  The matrix product of MATRIX_A and MATRIX_B. The type and kind of the result follow the usual type and kind promotion rules, as for the `*` or `.AND.` operators.

Standard:

  Fortran 90 and later. Extension for`UNSIGNED` (see Unsigned integers)