diff options
Diffstat (limited to 'macros')
-rw-r--r-- | macros/lsqlin.bin | bin | 57812 -> 58956 bytes | |||
-rw-r--r-- | macros/lsqlin.sci | 23 | ||||
-rw-r--r-- | macros/lsqnonneg.bin | bin | 29824 -> 29856 bytes | |||
-rw-r--r-- | macros/lsqnonneg.sci | 8 | ||||
-rw-r--r-- | macros/qpipopt.bin | bin | 57148 -> 58352 bytes | |||
-rw-r--r-- | macros/qpipopt.sci | 13 | ||||
-rw-r--r-- | macros/qpipoptmat.bin | bin | 59596 -> 60708 bytes | |||
-rw-r--r-- | macros/qpipoptmat.sci | 15 | ||||
-rw-r--r-- | macros/symphony.bin | bin | 59376 -> 59692 bytes | |||
-rw-r--r-- | macros/symphony.sci | 6 | ||||
-rw-r--r-- | macros/symphonymat.bin | bin | 63876 -> 62364 bytes | |||
-rw-r--r-- | macros/symphonymat.sci | 8 |
12 files changed, 47 insertions, 26 deletions
diff --git a/macros/lsqlin.bin b/macros/lsqlin.bin Binary files differindex 67446ac..eb02534 100644 --- a/macros/lsqlin.bin +++ b/macros/lsqlin.bin diff --git a/macros/lsqlin.sci b/macros/lsqlin.sci index 532e6ad..960b4db 100644 --- a/macros/lsqlin.sci +++ b/macros/lsqlin.sci @@ -22,19 +22,19 @@ function [xopt,resnorm,residual,exitflag,output,lambda] = lsqlin (varargin) // [xopt,resnorm,residual,exitflag,output,lambda] = lsqlin( ... ) // // Parameters - // C : a matrix of double, represents the multiplier of the solution x in the expression C*x - d. Number of columns in C is equal to the number of elements in x. - // d : a vector of double, represents the additive constant term in the expression C*x - d. Number of elements in d is equal to the number of rows in C matrix. - // A : a vector of double, represents the linear coefficients in the inequality constraints - // b : a vector of double, represents the linear coefficients in the inequality constraints - // Aeq : a matrix of double, represents the linear coefficients in the equality constraints - // beq : a vector of double, represents the linear coefficients in the equality constraints + // C : a matrix of double, represents the multiplier of the solution x in the expression C⋅x - d. Number of columns in C is equal to the number of elements in x. + // d : a vector of double, represents the additive constant term in the expression C⋅x - d. Number of elements in d is equal to the number of rows in C matrix. + // A : a matrix of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b. + // b : a vector of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b. + // Aeq : a matrix of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq. + // beq : a vector of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq. // lb : a vector of double, contains lower bounds of the variables. // ub : a vector of double, contains upper bounds of the variables. // 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. - // resnorm : a double, objective value returned as the scalar value norm(C*x-d)^2. - // residual : a vector of double, solution residuals returned as the vector d-C*x. + // resnorm : a double, objective value returned as the scalar value norm(C⋅x-d)^2. + // residual : a vector of double, solution residuals returned as the vector d-C⋅x. // exitflag : The exit status. See below for details. // output : The structure consist of statistics about the optimization. See below for details. // lambda : The structure consist of the Lagrange multipliers at the solution of problem. See below for details. @@ -341,6 +341,13 @@ function [xopt,resnorm,residual,exitflag,output,lambda] = lsqlin (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 + //Converting it into Quadratic Programming Problem H = C'*C; diff --git a/macros/lsqnonneg.bin b/macros/lsqnonneg.bin Binary files differindex bc44ed5..7ea7f4a 100644 --- a/macros/lsqnonneg.bin +++ b/macros/lsqnonneg.bin diff --git a/macros/lsqnonneg.sci b/macros/lsqnonneg.sci index d95ee86..3b152bf 100644 --- a/macros/lsqnonneg.sci +++ b/macros/lsqnonneg.sci @@ -19,11 +19,11 @@ function [xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg (varargin) // [xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg( ... ) // // Parameters - // C : a matrix of double, represents the multiplier of the solution x in the expression C*x - d. Number of columns in C is equal to the number of elements in x. - // d : a vector of double, represents the additive constant term in the expression C*x - d. Number of elements in d is equal to the number of rows in C matrix. + // C : a matrix of double, represents the multiplier of the solution x in the expression C⋅x - d. Number of columns in C is equal to the number of elements in x. + // d : a vector of double, represents the additive constant term in the expression C⋅x - d. Number of elements in d is equal to the number of rows in C matrix. // xopt : a vector of double, the computed solution of the optimization problem. - // resnorm : a double, objective value returned as the scalar value norm(C*x-d)^2. - // residual : a vector of double, solution residuals returned as the vector d-C*x. + // resnorm : a double, objective value returned as the scalar value norm(C⋅x-d)^2. + // residual : a vector of double, solution residuals returned as the vector d-C⋅x. // exitflag : The exit status. See below for details. // output : The structure consist of statistics about the optimization. See below for details. // lambda : The structure consist of the Lagrange multipliers at the solution of problem. See below for details. diff --git a/macros/qpipopt.bin b/macros/qpipopt.bin Binary files differindex 71c0d8e..d5e2bd1 100644 --- a/macros/qpipopt.bin +++ b/macros/qpipopt.bin 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'; diff --git a/macros/qpipoptmat.bin b/macros/qpipoptmat.bin Binary files differindex 5dd2df1..64e0b44 100644 --- a/macros/qpipoptmat.bin +++ b/macros/qpipoptmat.bin diff --git a/macros/qpipoptmat.sci b/macros/qpipoptmat.sci index f501094..b74c718 100644 --- a/macros/qpipoptmat.sci +++ b/macros/qpipoptmat.sci @@ -25,10 +25,10 @@ function [xopt,fopt,exitflag,output,lambda] = qpipoptmat (varargin) // Parameters // H : a symmetric matrix of double, represents coefficients of quadratic in the quadratic problem. // f : a vector of double, represents coefficients of linear in the quadratic problem - // A : a vector of double, represents the linear coefficients in the inequality constraints - // b : a vector of double, represents the linear coefficients in the inequality constraints - // Aeq : a matrix of double, represents the linear coefficients in the equality constraints - // beq : a vector of double, represents the linear coefficients in the equality constraints + // A : a matrix of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b. + // b : a vector of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b. + // Aeq : a matrix of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq. + // beq : a vector of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq. // lb : a vector of double, contains lower bounds of the variables. // ub : a vector of double, contains upper bounds of the variables. // x0 : a vector of double, contains initial guess of variables. @@ -352,6 +352,13 @@ function [xopt,fopt,exitflag,output,lambda] = qpipoptmat (varargin) error(errmsg); 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 //Converting it into ipopt format f = f'; diff --git a/macros/symphony.bin b/macros/symphony.bin Binary files differindex 0259139..b98094e 100644 --- a/macros/symphony.bin +++ b/macros/symphony.bin diff --git a/macros/symphony.sci b/macros/symphony.sci index 686eb5a..81b24fb 100644 --- a/macros/symphony.sci +++ b/macros/symphony.sci @@ -25,9 +25,9 @@ function [xopt,fopt,status,output] = symphony (varargin) // isInt : a vector of boolean, represents wether a variable is constrained to be an integer. // lb : a vector of double, represents lower bounds of the variables. // ub : a vector of double, represents upper bounds of the variables. - // A : a matrix of double, represents matrix representing the constraint matrix. - // conLB : a vector of double, represents lower bounds of the constraints. - // conUB : a vector of double, represents upper bounds of the constraints + // A : a matrix of double, represents matrix representing the constraint matrix conLB ≤ A⋅x ≤ conUB. + // conLB : a vector of double, represents lower bounds of the constraints conLB ≤ A⋅x ≤ conUB. + // conUB : a vector of double, represents upper bounds of the constraints conLB ≤ A⋅x ≤ conUB. // objSense : The sense (maximization/minimization) of the objective. Use 1(sym_minimize ) or -1 (sym_maximize) here. // options : a list containing the parameters to be set. // xopt : a vector of double, the computed solution of the optimization problem. diff --git a/macros/symphonymat.bin b/macros/symphonymat.bin Binary files differindex 5534f4d..ec35ee2 100644 --- a/macros/symphonymat.bin +++ b/macros/symphonymat.bin diff --git a/macros/symphonymat.sci b/macros/symphonymat.sci index 9dd11a8..2d51b84 100644 --- a/macros/symphonymat.sci +++ b/macros/symphonymat.sci @@ -22,10 +22,10 @@ function [xopt,fopt,status,iter] = symphonymat (varargin) // Parameters // c : a vector of double, contains coefficients of the variables in the objective // intcon : Vector of integer constraints, specified as a vector of positive integers. The values in intcon indicate the components of the decision variable x that are integer-valued. intcon has values from 1 through number of variable. - // A : Linear inequality constraint matrix, specified as a matrix of double. A represents the linear coefficients in the constraints A*x ≤ b. A has the size where columns equals to the number of variables. - // b : Linear inequality constraint vector, specified as a vector of double. b represents the constant vector in the constraints A*x ≤ b. b has size equals to the number of rows in A. - // Aeq : Linear equality constraint matrix, specified as a matrix of double. Aeq represents the linear coefficients in the constraints Aeq*x = beq. Aeq has the size where columns equals to the number of variables. - // beq : Linear equality constraint vector, specified as a vector of double. beq represents the constant vector in the constraints Aeq*x = beq. beq has size equals to the number of rows in Aeq. + // A : a matrix of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b. + // b : a vector of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b. + // Aeq : a matrix of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq. + // beq : a vector of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq. // lb : Lower bounds, specified as a vector or array of double. lb represents the lower bounds elementwise in lb ≤ x ≤ ub. // ub : Upper bounds, specified as a vector or array of double. ub represents the upper bounds elementwise in lb ≤ x ≤ ub. // options : a list containing the parameters to be set. |