|
Power
Raise a square matrix to the integer power.
matrix matrix::Power(
|
Parameters
power
[in] The exponent can be any integer, positive, negative, or zero.
Return Value
Matrix.
Note
The resulting matrix has the same size as the original matrix. In raised to the power of 0, the identity matrix is returned. The positive power n means that the original matrix is multiplied n times by itself. The negative power -n means that the original matrix is first inverted, and then the inverted matrix is multiplied by itself n times.
A simple algorithm for raising a matrix to a power in MQL5:
bool MatrixPower(matrix& c, const matrix& a, const int power)
|
MQL5 example:
matrix i= {{0, 1}, {-1, 0}};
|
Python example:
import numpy as np
|