TMtx.LQR Method

Overload List

#SignatureDescription
1TMtx LQR(TMtx L, TMtx Q, TMtx R, TVecInt P, Boolean Minimized)QR or LQ factorization.
2TMtx LQR(TMtx L, TMtx Q, TMtx R, Boolean Minimized)QR or LQ factorization.

Overload 1: TMtx LQR(TMtx L, TMtx Q, TMtx R, TVecInt P, Boolean Minimized)

QR or LQ factorization.

#NameTypeDescription
1LTMtxsource TMtx
2QTMtxsource TMtx
3RTMtxsource TMtx
4PTVecIntsource TVecInt
5MinimizedBoolean

Result: stored in self (calling object), returns self for chaining

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

Overload 2: TMtx LQR(TMtx L, TMtx Q, TMtx R, Boolean Minimized)

QR or LQ factorization.

#NameTypeDescription
1LTMtxsource TMtx
2QTMtxsource TMtx
3RTMtxsource TMtx
4MinimizedBoolean

Result: stored in self (calling object), returns self for chaining

Remarks:

Performs QR or LQ factorization. If Dew.Math.TMtx.Rows is bigger or equal than Dew.Math.TMtx.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 Dew.Math.TMtx.SVD method. If the Minimized parameter is false, the following holds true:

A = Q*R

A = L*Q
Examples
TMtx L;
TMtx Q;
TMtx R;
TMtx A;
MtxVec.CreateIt(out Q, out R, out A);
try
    {
        A.SetIt(3,2,false,[1,2,
        3,4,
        3,3]);
        A.LQR(nil,Q,R,false);
    }
finally
    {
        MtxVec.FreeIt(ref Q, ref R, ref A);
    }
See Also: TMtx.SVD, TMtx.LQRSolve