TMtx *PowerMtx(TMtx *Base, TMtx *Exponent) const;
Raises matrix elements to any power.
Remarks:
Raises Base matrix elements to the Exponent matrix elements power and stores the results in the calling matrix. The Matrix::Rows, Matrix::Cols and Matrix::Complex properties of the calling matrix are adjusted automatically. The Matrix::Rows, Matrix::Cols and Matrix::Complex properties of Base and Exponent matrices must match otherwise an exception is raised.
Note
Only positive exponents can be handled if Exponent matrix is not complex.
Examples
#include "MtxExpr.h"
#include "Units.MtxExpr.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxExpr;
void Example()
{
Matrix A, B, C;
A.SetIt(2, 2, false, DewArray<double>{1, 2, 2, 4});
B.SetIt(2, 2, false, DewArray<double>{1, 2, 2, 4});
C.Power(A, B); // or
C = Power(A, B);
}
See Also: Matrix::Power
Declared in Dew::Math::Matrix · Dew.Math/MtxExpr.h · Cross-compiler