Performs a matrix multiplication.
Transformational function
The significance of the value of MINDIM is:
By default, MATMUL employs the conventional O(N**3) method of matrix multiplication.
If you link the libpthreads.a library, the Winograd variation of the O(N**2.81) Strassen method is employed under these conditions:
At least one of the arguments must be of rank two. The size of the first or only dimension of MATRIX_B must be equal to the last or only dimension of MATRIX_A.
The result is an array. If one of the arguments is of rank one, the result has a rank of one. If both arguments are of rank two, the result has a rank of two.
The data type of the result depends on the data type of the arguments, according to the rules in Table 11 and Table 12.
If MATRIX_A and MATRIX_B have a numeric data type, the array elements of the result are:
If MATRIX_A and MATRIX_B are of type logical, the array elements of the result are:
! A is the array | 1 2 3 |, B is the array | 7 10 | ! | 4 5 6 | | 8 11 | ! | 9 12 | RES = MATMUL(A, B) ! The result is | 50 68 | ! | 122 167 |
! HUGE_ARRAY and GIGANTIC_ARRAY in this example are ! large arrays of real or complex type, so the operation ! might be faster with the Strassen algorithm. RES = MATMUL(HUGE_ARRAY, GIGANTIC_ARRAY, MINDIM=196)
The numerical stability of Strassen's method for matrix multiplication is discussed in: