From 2af2dd71492d5485bd921cfe7b832811881947bb Mon Sep 17 00:00:00 2001 From: Harpreet Date: Thu, 26 Nov 2015 13:13:46 +0530 Subject: lsqlin added --- demos/lsqlin.dem.sce | 49 +++ demos/qpipopt_mat.dem.sce | 40 --- help/en_US/lsqlin.xml | 156 +++++++++ help/en_US/master_help.xml | 2 + help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS | Bin 7155 -> 7351 bytes .../scilab_en_US_help/JavaHelpSearch/DOCS.TAB | Bin 807 -> 850 bytes .../en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS | Bin 262 -> 266 bytes .../scilab_en_US_help/JavaHelpSearch/POSITIONS | Bin 34829 -> 35734 bytes help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA | 2 +- help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP | Bin 16384 -> 16384 bytes .../scilab_en_US_help/_LaTeX_lsqlin.xml_1.png | Bin 0 -> 3026 bytes help/en_US/scilab_en_US_help/index.html | 8 +- help/en_US/scilab_en_US_help/jhelpmap.jhm | 1 + help/en_US/scilab_en_US_help/jhelptoc.xml | 1 + help/en_US/scilab_en_US_help/lsqlin.html | 153 +++++++++ help/en_US/scilab_en_US_help/qpipopt.html | 4 +- .../section_19f4f1e5726c01d683e8b82be0a7e910.html | 8 +- jar/scilab_en_US_help.jar | Bin 202473 -> 209125 bytes macros/lib | Bin 504 -> 528 bytes macros/lsqlin.bin | Bin 0 -> 51024 bytes macros/lsqlin.sci | 372 +++++++++++++++++++++ macros/names | 1 + macros/qpipopt.bin | Bin 47232 -> 49496 bytes macros/qpipopt.sci | 8 +- macros/qpipoptmat.bin | Bin 49536 -> 51124 bytes macros/qpipoptmat.sci | 4 +- sci_gateway/cpp/libFAMOS.so | Bin 126944 -> 122920 bytes tests/unit_tests/lsqlin.dia.ref | 82 +++++ tests/unit_tests/lsqlin.tst | 82 +++++ tests/unit_tests/qpipopt_base.dia.ref | 6 +- tests/unit_tests/qpipopt_base.tst | 6 +- tests/unit_tests/qpipoptmat_base .dia.ref | 73 ---- tests/unit_tests/qpipoptmat_base .tst | 73 ---- tests/unit_tests/qpipoptmat_base.dia.ref | 73 ++++ tests/unit_tests/qpipoptmat_base.tst | 73 ++++ tests/unit_tests/symphony_mat_base.dia.ref | 83 ----- tests/unit_tests/symphony_mat_base.tst | 80 ----- tests/unit_tests/symphonymat_base.dia.ref | 83 +++++ tests/unit_tests/symphonymat_base.tst | 80 +++++ 39 files changed, 1237 insertions(+), 366 deletions(-) create mode 100644 demos/lsqlin.dem.sce delete mode 100644 demos/qpipopt_mat.dem.sce create mode 100644 help/en_US/lsqlin.xml create mode 100644 help/en_US/scilab_en_US_help/_LaTeX_lsqlin.xml_1.png create mode 100644 help/en_US/scilab_en_US_help/lsqlin.html create mode 100644 macros/lsqlin.bin create mode 100644 macros/lsqlin.sci create mode 100644 tests/unit_tests/lsqlin.dia.ref create mode 100644 tests/unit_tests/lsqlin.tst delete mode 100644 tests/unit_tests/qpipoptmat_base .dia.ref delete mode 100644 tests/unit_tests/qpipoptmat_base .tst create mode 100644 tests/unit_tests/qpipoptmat_base.dia.ref create mode 100644 tests/unit_tests/qpipoptmat_base.tst delete mode 100644 tests/unit_tests/symphony_mat_base.dia.ref delete mode 100644 tests/unit_tests/symphony_mat_base.tst create mode 100644 tests/unit_tests/symphonymat_base.dia.ref create mode 100644 tests/unit_tests/symphonymat_base.tst diff --git a/demos/lsqlin.dem.sce b/demos/lsqlin.dem.sce new file mode 100644 index 0000000..d417bf0 --- /dev/null +++ b/demos/lsqlin.dem.sce @@ -0,0 +1,49 @@ +mode(1) +// +// Demo of lsqlin.sci +// + +//A simple linear least square example +C = [0.9501 0.7620 0.6153 0.4057 +0.2311 0.4564 0.7919 0.9354 +0.6068 0.0185 0.9218 0.9169 +0.4859 0.8214 0.7382 0.4102 +0.8912 0.4447 0.1762 0.8936]; +d = [0.0578 +0.3528 +0.8131 +0.0098 +0.1388]; +A = [0.2027 0.2721 0.7467 0.4659 +0.1987 0.1988 0.4450 0.4186 +0.6037 0.0152 0.9318 0.8462]; +b = [0.5251 +0.2026 +0.6721]; +[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b) +halt() // Press return to continue + +C = [0.9501 0.7620 0.6153 0.4057 +0.2311 0.4564 0.7919 0.9354 +0.6068 0.0185 0.9218 0.9169 +0.4859 0.8214 0.7382 0.4102 +0.8912 0.4447 0.1762 0.8936]; +d = [0.0578 +0.3528 +0.8131 +0.0098 +0.1388]; +A =[0.2027 0.2721 0.7467 0.4659 +0.1987 0.1988 0.4450 0.4186 +0.6037 0.0152 0.9318 0.8462]; +b =[0.5251 +0.2026 +0.6721]; +Aeq = [3 5 7 9]; +beq = 4; +lb = -0.1*ones(4,1); +ub = 2*ones(4,1); +[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,Aeq,beq,lb,ub) +halt() // Press return to continue + +//========= E N D === O F === D E M O =========// diff --git a/demos/qpipopt_mat.dem.sce b/demos/qpipopt_mat.dem.sce deleted file mode 100644 index 0f65036..0000000 --- a/demos/qpipopt_mat.dem.sce +++ /dev/null @@ -1,40 +0,0 @@ -mode(1) -// -// Demo of qpipopt_mat.sci -// - -//Find x in R^6 such that: -halt() // Press return to continue - -Aeq= [1,-1,1,0,3,1; --1,0,-3,-4,5,6; -2,5,3,0,1,0]; -beq=[1; 2; 3]; -A= [0,1,0,1,2,-1; --1,0,2,1,1,0]; -b = [-1; 2.5]; -lb=[-1000; -10000; 0; -1000; -1000; -1000]; -ub=[10000; 100; 1.5; 100; 100; 1000]; -//and minimize 0.5*x'*Q*x + p'*x with -f=[1; 2; 3; 4; 5; 6]; H=eye(6,6); -[xopt,fopt,exitflag,output,lambda]=qpipopt_mat(H,f,A,b,Aeq,beq,lb,ub) -clear H f A b Aeq beq lb ub; -halt() // Press return to continue - -//Find the value of x that minimize following function -// f(x) = 0.5*x1^2 + x2^2 - x1*x2 - 2*x1 - 6*x2 -// Subject to: -// x1 + x2 ≤ 2 -// –x1 + 2x2 ≤ 2 -// 2x1 + x2 ≤ 3 -// 0 ≤ x1, 0 ≤ x2. -H = [1 -1; -1 2]; -f = [-2; -6]; -A = [1 1; -1 2; 2 1]; -b = [2; 2; 3]; -lb = [0; 0]; -ub = [%inf; %inf]; -[xopt,fopt,exitflag,output,lambda] = qpipopt_mat(H,f,A,b,[],[],lb,ub) -halt() // Press return to continue - -//========= E N D === O F === D E M O =========// diff --git a/help/en_US/lsqlin.xml b/help/en_US/lsqlin.xml new file mode 100644 index 0000000..92dbd91 --- /dev/null +++ b/help/en_US/lsqlin.xml @@ -0,0 +1,156 @@ + + + + + + + + lsqlin + Solves a linear quadratic problem. + + + + + Calling Sequence + + x = lsqlin(C,d,A,b) + x = lsqlin(C,d,A,b,Aeq,beq) + x = lsqlin(C,d,A,b,Aeq,beq,lb,ub) + x = lsqlin(C,d,A,b,Aeq,beq,lb,ub,x0) + x = lsqlin(C,d,A,b,Aeq,beq,lb,ub,x0,param) + [xopt,resnorm,residual,exitflag,output,lambda] = lsqlin( ... ) + + + + + + Parameters + + C : + a matrix of doubles, represents the multiplier of the solution x in the expression C*x - d. C is M-by-N, where M is the number of equations, and N is the number of elements of x. + d : + a vector of doubles, represents the additive constant term in the expression C*x - d. d is M-by-1, where M is the number of equations. + A : + a vector of doubles, represents the linear coefficients in the inequality constraints + b : + a vector of doubles, represents the linear coefficients in the inequality constraints + Aeq : + a matrix of doubles, represents the linear coefficients in the equality constraints + beq : + a vector of doubles, represents the linear coefficients in the equality constraints + LB : + a vector of doubles, where n is number of variables, contains lower bounds of the variables. + UB : + a vector of doubles, where n is number of variables, contains upper bounds of the variables. + x0 : + a vector of doubles, contains initial guess of variables. + param : + a list containing the the parameters to be set. + xopt : + a vector of doubles, the computed solution of the optimization problem. + fopt : + a double, the function value at x. + exitflag : + Integer identifying the reason the algorithm terminated. + output : + Structure containing information about the optimization. + lambda : + Structure containing the Lagrange multipliers at the solution x (separated by constraint type). + + + + + Description + +Search the minimum of a constrained linear least square problem specified by : +find the minimum of f(x) such that + + + +\begin{eqnarray} +&\mbox{min}_{x} +& 1/2||C*x - d||_2^2 \\ +& \text{subject to} & A.x \leq b \\ +& & Aeq.x \leq beq \\ +& & lb \leq x \leq ub \\ +\end{eqnarray} + + + +We are calling IPOpt for solving the linear least square problem, IPOpt is a library written in C++. The code has been written by ​Andreas Wächter and ​Carl Laird. + + + + + + + Examples + + + + + Examples + + + + + Authors + + Harpreet Singh + + + diff --git a/help/en_US/master_help.xml b/help/en_US/master_help.xml index 66b8e0d..05f5acd 100644 --- a/help/en_US/master_help.xml +++ b/help/en_US/master_help.xml @@ -1,6 +1,7 @@ + @@ -81,6 +82,7 @@ Symphony Toolbox +&a3d4ec65684b561d91f7a255acd23f51c; &a6b85f6e0c98751f20b68663a23cb4cd2; &a44928acec52adf395379e18fcff06730; &a8549a3935858ed104f4749ca2243456a; diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS index d5a7298..d7917b0 100644 Binary files a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS and b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS differ diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB index 0095d6c..1359fb5 100644 Binary files a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB and b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB differ diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS b/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS index 3fdc4c1..ae82060 100644 Binary files a/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS and b/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS differ diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS b/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS index d69ed8d..a0643a5 100644 Binary files a/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS and b/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS differ diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA b/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA index c0f76d2..c32f6ae 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA @@ -1,2 +1,2 @@ JavaSearch 1.0 -TMAP bs=2048 rt=1 fl=-1 id1=1355 id2=1 +TMAP bs=2048 rt=1 fl=-1 id1=1413 id2=1 diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP b/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP index 39ca223..dd780c5 100644 Binary files a/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP and b/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP differ diff --git a/help/en_US/scilab_en_US_help/_LaTeX_lsqlin.xml_1.png b/help/en_US/scilab_en_US_help/_LaTeX_lsqlin.xml_1.png new file mode 100644 index 0000000..d89b104 Binary files /dev/null and b/help/en_US/scilab_en_US_help/_LaTeX_lsqlin.xml_1.png differ diff --git a/help/en_US/scilab_en_US_help/index.html b/help/en_US/scilab_en_US_help/index.html index b1cfd9c..af31f16 100644 --- a/help/en_US/scilab_en_US_help/index.html +++ b/help/en_US/scilab_en_US_help/index.html @@ -32,7 +32,13 @@