TMtx.LQRSolve Method

Overload List

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

Overload 1: TMtx LQRSolve(TMtx B, TMtx X, TMtx R, TMtxOperation op)

Solve overdetermined or underdetermined system of real linear equations.

#NameTypeDescription
1BTMtxsource TMtx
2XTMtxsource TMtx
3RTMtxsource TMtx
4opTMtxOperation

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

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 (vectors), the routine requires less pre and post processing.

See Also: TMtx.LQR, TMtx.SVDSolve, TMtx.MtxError

Overload 2: Int32 LQRSolve(TMtx B, TMtx X, Double rcond, TMtx R, TMtxOperation op)

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

#NameTypeDescription
1BTMtxsource TMtx
2XTMtxsource TMtx
3rcondDoublescalar
4RTMtxsource TMtx
5opTMtxOperation

Returns: Int32

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.

Overload 3: TMtx LQRSolve(TVec B, TVec X, TMtx R, TMtxOperation op)

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

#NameTypeDescription
1BTVecsource TVec
2XTVecsource TVec
3RTMtxsource TMtx
4opTMtxOperation

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

Overload 4: Int32 LQRSolve(TVec B, TVec X, Double rcond, TMtx R, TMtxOperation op)

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

#NameTypeDescription
1BTVecsource TVec
2XTVecsource TVec
3rcondDoublescalar
4RTMtxsource TMtx
5opTMtxOperation

Returns: Int32

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.