MATRIX_POWER
Syntax | Return Value | Arguments | Keywords | Example | Version History | See Also
The MATRIX_POWER function computes the product of a matrix with itself. For example, the fifth power of array A is A # A # A # A # A. Negative powers are computed using the matrix inverse of the positive power.
Syntax
Result = MATRIX_POWER(Array, N [, /DOUBLE] [, STATUS=value])
Return Value
The result is a square array containing the value of the matrix raised to the specified power. A power of zero returns the identity matrix.
Arguments
Array
A square, two-dimensional array of any numeric type.
N
An integer representing the power. N may be positive or negative.
Keywords
DOUBLE
Set this keyword to return a double-precision result. Explicitly set this keyword equal to zero to return a single-precision result. The default return type depends upon the precision of Array.
Note
Computations are always performed using double-precision arithmetic.
STATUS
Set this keyword equal to a named variable that will contain the status of the matrix inverse for negative powers. Possible values are:
For non-negative powers, STATUS is always set to 0.
Example
Print an array to the one millionth power:
array = [ [0.401d, 0.600d], $
[0.525d, 0.475d] ]
PRINT, MATRIX_POWER(array, 1e6)
IDL prints:
Version History
See Also
MATRIX_MULTIPLY, Multiplying Arrays (Application Programming)