Matrix.LQRSolve Method

Overload List

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

Overload 1: function LQRSolve(const B: TMtx; const X: TMtx; const R: TMtx; op: TMtxOperation): TMtx;

Solve overdetermined or underdetermined system of real linear equations.

#NameTypeDescription
1BTMtx
2XTMtx
3RTMtx
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 (const Vectors), the routine requires less pre and post processing.

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

Overload 2: function LQRSolve(const B: TMtx; const X: TMtx; rcond: Double; const R: TMtx; op: TMtxOperation): Integer;

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

#NameTypeDescription
1BTMtx
2XTMtx
3rcondDoublescalar
4RTMtx
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. 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: function LQRSolve(const B: TVec; const X: TVec; const R: TMtx; op: TMtxOperation): TMtx;

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

#NameTypeDescription
1BTVec
2XTVec
3RTMtx
4opTMtxOperation

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

Overload 4: function LQRSolve(const B: TVec; const X: TVec; rcond: Double; const R: TMtx; op: TMtxOperation): Integer;

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

#NameTypeDescription
1BTVec
2XTVec
3rcondDoublescalar
4RTMtx
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.