Matrix::LQRSolve Method

Overload List

#SignatureDescription
1TMtx *LQRSolve(TMtx *B, TMtx *X, TMtx *R = null, TMtxOperation op = TMtxOperation::opNone) const;Solve overdetermined or underdetermined system of real linear equations.
2TMtx *LQRSolve(TVec *B, TVec *X, TMtx *R = null, TMtxOperation op = TMtxOperation::opNone) const;Matrix version of LQRSolve. Perfroms a LQRSolve for each B and X matrices columns in single pass.
3int LQRSolve(TVec *B, TVec *X, double rcond, TMtx *R = null, TMtxOperation op = TMtxOperation::opNone) const;Rank deficient version of LQRSolve. Perfroms LQRSolve for B vector.
4int LQRSolve(TMtx *B, TMtx *X, double rcond, TMtx *R = null, TMtxOperation op = TMtxOperation::opNone) const;Rank deficient version of LQRSolve. Perfroms LQRSolve for each B column in one pass.

Overload 1: TMtx *LQRSolve(TMtx *B, TMtx *X, TMtx *R = null, TMtxOperation op = TMtxOperation::opNone) const;

Solve overdetermined or underdetermined system of real linear equations.

#NameTypeDescription
1BTMtx *
2XTMtx *
3R = nullTMtx *
4op = TMtxOperation::opNoneTMtxOperation
Remarks:

Solve overdetermined or underdetermined real linear systems involving a Rows-by-Cols matrix or its transpose, using a QR or LQ factorization of the calling matrix. It is assumed that the calling matrix has full rank. The following options are provided:

*1.*If Op = opNone and m >= n: find the least squares solution of an overdetermined system, i.e., solve
the least squares problem

minimize || B - A*X ||.

*2.*If Op = opNone and m < n: find the minimum norm solution of an underdetermined system

A * X = B.

*3.*If Op = opTrans and m >= n: find the minimum norm solution of an undetermined system

A**T * X = B.

*4.*If Op = opTran and m < n: find the least squares solution of an overdetermined system, i.e., solve
the least squares problem

minimize || B - A**T * X ||

*5.*If Op = opHerm and m >= n: find the minimum norm solution of an undetermined system

A**H * X = B.

*6.*If Op = opHerm and m < n: find the least squares solution of an overdetermined system, i.e., solve
the least squares problem

minimize || B - A**H * X ||.

Note
If the parameters are of TVec type (const Vectors), the routine requires less pre and post processing.

See Also: Matrix::LQR, Matrix::SVDSolve, Matrix::MtxError
Declared in Dew::Math::Matrix · Dew.Math/MtxExpr.h · Cross-compiler

Overload 2: TMtx *LQRSolve(TVec *B, TVec *X, TMtx *R = null, TMtxOperation op = TMtxOperation::opNone) const;

Matrix version of LQRSolve. Perfroms a LQRSolve for each B and X matrices columns in single pass.

#NameTypeDescription
1BTVec *
2XTVec *
3R = nullTMtx *
4op = TMtxOperation::opNoneTMtxOperation
Declared in Dew::Math::Matrix · Dew.Math/MtxExpr.h · Cross-compiler

Overload 3: int LQRSolve(TVec *B, TVec *X, double rcond, TMtx *R = null, TMtxOperation op = TMtxOperation::opNone) const;

Rank deficient version of LQRSolve. Perfroms LQRSolve for B vector.

#NameTypeDescription
1BTVec *
2XTVec *
3rconddouble
4R = nullTMtx *
5op = TMtxOperation::opNoneTMtxOperation
Remarks:

Computes the minimum-norm solution to a linear least squares problem:

minimize || A * X - B ||

using a complete orthogonal factorization of A. A is an M-by-N matrix which may be rank-deficient.

The function returns the effective rank of the matrix A. The effective rank is determined with the rcond parameter. A is factorized in such a way that condition number of leading submatrix of A will be less then 1/rcond. Set value of rcond to 1E-6 for less strict and to 1E-3 for more strict stability conditition. If R is assigned, the function returns the factorization of matrix A. Op parameter specified the operation to be applied to A before the computation.

Declared in Dew::Math::Matrix · Dew.Math/MtxExpr.h · Cross-compiler

Overload 4: int LQRSolve(TMtx *B, TMtx *X, double rcond, TMtx *R = null, TMtxOperation op = TMtxOperation::opNone) const;

Rank deficient version of LQRSolve. Perfroms LQRSolve for each B column in one pass.

#NameTypeDescription
1BTMtx *
2XTMtx *
3rconddouble
4R = nullTMtx *
5op = TMtxOperation::opNoneTMtxOperation
Remarks:

Computes the minimum-norm solution to a linear least squares problem:

minimize || A * X - B ||

using a complete orthogonal factorization of A. A is an M-by-N matrix which may be rank-deficient.

The function returns the effective rank of the matrix A. The effective rank is determined with the rcond parameter. A is factorized in such a way that condition number of leading submatrix of A will be less then 1/rcond. If R is assigned, the function returns the factorization of matrix A. Op parameter specified the operation to be applied to A before the computation.

Declared in Dew::Math::Matrix · Dew.Math/MtxExpr.h · Cross-compiler