The MATRIX_MULTIPLY function calculates the IDL # operator of two (possibly transposed) arrays. The transpose operation (if desired) is done simultaneously with the multiplication, thus conserving memory and increasing the speed of the operation. If the arrays are not transposed, then MATRIX_MULTIPLY is equivalent to using the # operator.
The following table illustrates how various operations are performed using the # operator versus the MATRIX_MULTIPLY function:
| Note |
Result = MATRIX_MULTIPLY( A, B [, /ATRANSPOSE] [, /BTRANSPOSE] )
The type for the result depends upon the input type. For byte or integer arrays, the result has the type of the next-larger integer type that could contain the result (for example, byte, integer, or long input returns type long integer). For floating-point, the result has the same type as the input.
For the case of no transpose, the resulting array has the same number of columns as the first array and the same number of rows as the second array. The second array must have the same number of columns as the first array has rows.
| Note |
The left operand for the matrix multiplication. Dimensions higher than two are ignored.
The right operand for the matrix multiplication. Dimensions higher than two are ignored.
Set this keyword to multiply using the transpose of A.
Set this keyword to multiply using the transpose of B.
This routine is written to make use of IDL's thread pool, which can increase execution speed on systems with multiple CPUs. The values stored in the
Introduced: 5.4
MATRIX_POWER, "Multiplying Arrays" in the Using IDL manual.