TMtx::PowerMtx Method

TMtx *PowerMtx(TMtx *Base, TMtx *Exponent);

Raises matrix elements to any power.

#NameTypeDescription
1BaseTMtx *
2ExponentTMtx *
Remarks:

Raises Base matrix elements to the Exponent matrix elements power and stores the results in the calling matrix. The TMtx::Rows, TMtx::Cols and TMtx::Complex properties of the calling matrix are adjusted automatically. The TMtx::Rows, TMtx::Cols and TMtx::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 "MtxVec.h"
#include "Units.MtxVec.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVec;

void Example()
{
    TMtx *A, *B, *C;

    CreateIt(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);
    FreeIt(A, B, C);
}
See Also: TMtx::Power
Declared in Dew::Math::TMtx · Dew.Math/MtxVec.h · Cross-compiler