Matrix::LQR Method

Overload List

#SignatureDescription
1TMtx *LQR(TMtx *L, TMtx *Q, TMtx *R, bool Minimized = true) const;QR or LQ factorization.
2TMtx *LQR(TMtx *L, TMtx *Q, TMtx *R, TVecInt *P, bool Minimized = true) const;QR or LQ factorization.

Overload 1: TMtx *LQR(TMtx *L, TMtx *Q, TMtx *R, bool Minimized = true) const;

QR or LQ factorization.

#NameTypeDescription
1LTMtx *
2QTMtx *
3RTMtx *
4Minimized = truebool
Remarks:

Performs QR or LQ factorization. If Matrix::Rows is bigger or equal than Matrix::Cols for the calling matrix, the linear system of equations is overdetermined and the method performs QR factorization. The matrix L is not used and can be nil. If Rows is smaller than Cols, the linear system equations is underdetermined and the method performs LQ factorization. The matrix R is not used and can be nil. If the Matrix Q is nil, then it's not explicitly formed. If the pointer is not nil, the full size Q is computed. If you do not want economy size L, Q and R, set MinSize to false. The calling matrix must have full rank. If the rank is not full, use the Matrix::SVD method.

Examples
#include "MtxExpr.h"

using namespace Dew;
using namespace Dew::Math;

void Example()
{
    Matrix Q, R, A;

    A.SetIt(3, 2, false, DewArray<double>{1, 2, 3, 4, 3, 3});
    A.LQR(nullptr, Q, R, false);
}
See Also: Matrix::SVD, Matrix::LQRSolve
Declared in Dew::Math::Matrix · Dew.Math/MtxExpr.h · Cross-compiler

Overload 2: TMtx *LQR(TMtx *L, TMtx *Q, TMtx *R, TVecInt *P, bool Minimized = true) const;

QR or LQ factorization.

#NameTypeDescription
1LTMtx *
2QTMtx *
3RTMtx *
4PTVecInt *
5Minimized = truebool
Remarks:

Performs QR factorization with optional pivoting or LQ factorization. The pivoting of columns in the calling matrix is performed only when P is not nil and Rows > Cols.

The P[i] holds the permutation of columns in A, so that:

P(A) = Q*R
Examples
#include "MtxExpr.h"

using namespace Dew;
using namespace Dew::Math;

void Example()
{
    Matrix Q, R, A;

    A = {{1, 2}, {3, 4}, {3, 3}};
    A.LQR(nullptr, Q, R, false);
}
Declared in Dew::Math::Matrix · Dew.Math/MtxExpr.h · Cross-compiler