diff options
author | Harpreet | 2016-01-07 17:14:07 +0530 |
---|---|---|
committer | Harpreet | 2016-01-07 17:14:07 +0530 |
commit | dd3d72ae2cdb43311b4e501966f09694bbd3e505 (patch) | |
tree | 22a62596c6cae995f4693d75d52d96cd787c40b8 /macros/qpipopt.sci | |
parent | dad86bd42cdc2a0e56df9e0591879e5d26fd56fa (diff) | |
download | FOSSEE-Optimization-toolbox-dd3d72ae2cdb43311b4e501966f09694bbd3e505.tar.gz FOSSEE-Optimization-toolbox-dd3d72ae2cdb43311b4e501966f09694bbd3e505.tar.bz2 FOSSEE-Optimization-toolbox-dd3d72ae2cdb43311b4e501966f09694bbd3e505.zip |
lower bound, upper bound test added
Diffstat (limited to 'macros/qpipopt.sci')
-rw-r--r-- | macros/qpipopt.sci | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/macros/qpipopt.sci b/macros/qpipopt.sci index 33b31bb..25e7c07 100644 --- a/macros/qpipopt.sci +++ b/macros/qpipopt.sci @@ -26,9 +26,9 @@ function [xopt,fopt,exitflag,output,lambda] = qpipopt (varargin) // f : a vector of double, represents coefficients of linear in the quadratic problem // lb : a vector of double, contains lower bounds of the variables. // ub : a vector of double, contains upper bounds of the variables. - // A : a matrix of double, contains the constraint matrix - // conLB : a vector of double, contains lower bounds of the constraints. - // conUB : a vector of double, contains upper bounds of the constraints. + // A : a matrix of double, contains the constraint matrix conLB ≤ A⋅x ≤ conUB. + // conLB : a vector of double, contains lower bounds of the constraints conLB ≤ A⋅x ≤ conUB. + // conUB : a vector of double, contains upper bounds of the constraints conLB ≤ A⋅x ≤ conUB. // x0 : a vector of double, contains initial guess of variables. // param : a list containing the parameters to be set. // xopt : a vector of double, the computed solution of the optimization problem. @@ -345,6 +345,13 @@ function [xopt,fopt,exitflag,output,lambda] = qpipopt (varargin) end end + for i = 1:nbVar + if(lb(i)>ub(i)) + errmsg = msprintf(gettext("%s: Problem has inconsistent variable bounds"), "lsqlin"); + error(errmsg); + end + end + [xopt,fopt,status,iter,Zl,Zu,lmbda] = solveqp(nbVar,nbCon,H,f,A,conLB,conUB,lb,ub,x0,options); xopt = xopt'; |