|
lsei
Purpose
MEX interface for lsei
For solving linearly constrained least squares problems with both equality and inequality constraints.
Syntax
[x, rNormE, rNormL, mode, Cov, eqRank, rlsRank] = lsei ( ...
A, b, E, f, G, h, CompCov, ScaleCov, ColScale, D, epsEQ, epsRank)
Description
lsei solves a linearly constrained least squares
problem with both equality and inequality constraints.
May return a covariance matrix of the solution parameters.
Given dense matrices E, A and G of
respective dimensions mE by N, mA by
N and mG by N, and vectors
f, b and h of
respective lengths ME, MA and MG. This
subroutine solves the linearly constrained least squares problem formulated as:
min || A x - b || subject to
E x = f Equations to be exactly satisfied
G x >= h Inequality constraints
In case the equality constraints cannot be satisfied, a
generalized inverse solution residual vector length is obtained
for f-Ex. This is the minimal length possible for f-Ex.
Any number of rows in A, E and G are
permitted.
Input Parameters
At least 2 input parameters needed
A mA x n dense matrix b mA x 1 dense vector E mE x n dense matrix f mE x 1 dense vector G mG x n dense matrix h mG x 1 dense vector CompCov If > 0 compute covariance matrix. Default 0 ScaleCov If > 0 scale covariance matrix. Default 1 ColScale If > 0 column scaling of full matrix W. Default 0 D If nonempty, n x 1 dense vector with diagonal scaling of columns epsEQ Linear equality feasibility tolerance epsRank Rank tolerance in least squares part
Output Parameters
x Solution x
rNormE ||Ex-f||
rNormL ||Ax-b||
mode Exit status:
0 Both equality and inequality constraints are compatible
and have been satisfied.
1 Equality constraints are contradictory.
A generalized inverse solution of Ex=f was used
to minimize the residual vector length f-Ex.
2 Inequality constraints are contradictory.
3 Both equality and inequality constraints are contradictory.
4 Usage error occurred. This should not occur.
Cov Covariance matrix, if CompCov > 0
eqRank Rank of E matrix part
rlsRank Rank of A matrix part
See Also
lseiTL
![]() |
lseiTL |