diff options
author | Harpreet | 2016-01-05 12:22:43 +0530 |
---|---|---|
committer | Harpreet | 2016-01-05 12:22:43 +0530 |
commit | dad86bd42cdc2a0e56df9e0591879e5d26fd56fa (patch) | |
tree | ce56ce617425627652308e2a592527cd9aa2a396 /tests/general_tests | |
parent | d5356061fbd3a9b3052dee25bd9c82c375c42e22 (diff) | |
download | FOSSEE-Optimization-toolbox-dad86bd42cdc2a0e56df9e0591879e5d26fd56fa.tar.gz FOSSEE-Optimization-toolbox-dad86bd42cdc2a0e56df9e0591879e5d26fd56fa.tar.bz2 FOSSEE-Optimization-toolbox-dad86bd42cdc2a0e56df9e0591879e5d26fd56fa.zip |
constrviolation and licence file added
Diffstat (limited to 'tests/general_tests')
31 files changed, 581 insertions, 50 deletions
diff --git a/tests/general_tests/lsqlin/lsqlin_infeasible1.sce b/tests/general_tests/lsqlin/lsqlin_infeasible1.sce index 9509309..414841d 100644 --- a/tests/general_tests/lsqlin/lsqlin_infeasible1.sce +++ b/tests/general_tests/lsqlin/lsqlin_infeasible1.sce @@ -17,20 +17,23 @@ beq = [-6 -6 11]; // ineqlin: [0x0 constant] // output = // -// Iterations: 0 +// Iterations: 105 +// ConstrViolation: 0.3333333 // exitflag = // // 5 // residual = // -// 1. -// 0. -// - 1. +// - 10.333333 +// - 1.021D-13 +// - 12.333333 // resnorm = // -// 2. +// 258.88889 // xopt = // -// [] +// 5.6666667 +// 5.6666667 +// 0. [xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,[],[],Aeq,beq) diff --git a/tests/general_tests/lsqlin/lsqlin_logical1.sce b/tests/general_tests/lsqlin/lsqlin_logical1.sce index 959cc7c..c9930cf 100644 --- a/tests/general_tests/lsqlin/lsqlin_logical1.sce +++ b/tests/general_tests/lsqlin/lsqlin_logical1.sce @@ -21,6 +21,7 @@ b = [4 // output = // // Iterations: 13 +// ConstrViolation: 0 // exitflag = // // 0 diff --git a/tests/general_tests/lsqlin/lsqlin_logical2.sce b/tests/general_tests/lsqlin/lsqlin_logical2.sce new file mode 100644 index 0000000..33cdc79 --- /dev/null +++ b/tests/general_tests/lsqlin/lsqlin_logical2.sce @@ -0,0 +1,53 @@ +// An example with inequality constraints +C = [1 1 1; + 1 1 0; + 0 1 1; + 1 0 0; + 0 0 1] +d = [89; + 67; + 53; + 35; + 20;] +A = [3 2 1; + 2 3 4; + 1 2 3]; +b = [191 + 209 + 162]; +Aeq = [1 2 1]; +beq = 10; + +//Output +//Optimal Solution Found. +// lambda = +// +// lower: [0,0,0] +// upper: [0,0,0] +// eqlin: 73.833333 +// ineqlin: [2.571D-10,2.732D-10,2.571D-10] +// output = +// +// Iterations: 7 +// ConstrViolation: 0 +// exitflag = +// +// 0 +// residual = +// +// 37.666667 +// 54.75 +// 55.25 +// - 18.583333 +// - 19.083333 +// resnorm = +// +// 8178.4167 +// xopt = +// +// 53.583333 +// - 41.333333 +// 39.083333 + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,Aeq,beq) + diff --git a/tests/general_tests/lsqlin/lsqlin_logical3.sce b/tests/general_tests/lsqlin/lsqlin_logical3.sce new file mode 100644 index 0000000..f6a44d6 --- /dev/null +++ b/tests/general_tests/lsqlin/lsqlin_logical3.sce @@ -0,0 +1,55 @@ +// An example with inequality constraints +C = [1 1 1; + 1 1 0; + 0 1 1; + 1 0 0; + 0 0 1] +d = [89; + 67; + 53; + 35; + 20;] +A = [3 2 1; + 2 3 4; + 1 2 3]; +b = [191 + 209 + 162]; +Aeq = [1 2 1]; +beq = 10; +lb = repmat(0.1,3,1); +ub = repmat(4,3,1); + +//Output +//Optimal Solution Found. +// lambda = +// +// lower: [5.357D-12,2.334D-11,5.356D-12] +// upper: [78,6.963D-12,49] +// eqlin: 95 +// ineqlin: [1.206D-13,1.146D-13,1.449D-13] +// output = +// +// Iterations: 8 +// ConstrViolation: 8.000D-08 +// exitflag = +// +// 0 +// residual = +// +// 80. +// 62. +// 48. +// 31. +// 16. +// resnorm = +// +// 13765. +// xopt = +// +// 4. +// 1.0000000 +// 4. + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,Aeq,beq,lb,ub) + diff --git a/tests/general_tests/lsqlin/lsqlin_logical4.sce b/tests/general_tests/lsqlin/lsqlin_logical4.sce new file mode 100644 index 0000000..231fe02 --- /dev/null +++ b/tests/general_tests/lsqlin/lsqlin_logical4.sce @@ -0,0 +1,56 @@ +// An example with inequality constraints +C = [1 1 1; + 1 1 0; + 0 1 1; + 1 0 0; + 0 0 1] +d = [89; + 67; + 53; + 35; + 20;] +A = [3 2 1; + 2 3 4; + 1 2 3]; +b = [191 + 209 + 162]; +Aeq = [1 2 1]; +beq = 10; +lb = repmat(0.1,3,1); +ub = repmat(4,3,1); +x0 = repmat(0,3,1); + +//Output +//Optimal Solution Found. +// lambda = +// +// lower: [5.357D-12,2.334D-11,5.356D-12] +// upper: [78,6.963D-12,49] +// eqlin: 95 +// ineqlin: [1.206D-13,1.146D-13,1.449D-13] +// output = +// +// Iterations: 8 +// ConstrViolation: 8.000D-08 +// exitflag = +// +// 0 +// residual = +// +// 80. +// 62. +// 48. +// 31. +// 16. +// resnorm = +// +// 13765. +// xopt = +// +// 4. +// 1.0000000 +// 4. + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,Aeq,beq,lb,ub,x0) + diff --git a/tests/general_tests/lsqlin/lsqlin_logical5.sce b/tests/general_tests/lsqlin/lsqlin_logical5.sce new file mode 100644 index 0000000..0802609 --- /dev/null +++ b/tests/general_tests/lsqlin/lsqlin_logical5.sce @@ -0,0 +1,57 @@ +// An example with inequality constraints +C = [1 1 1; + 1 1 0; + 0 1 1; + 1 0 0; + 0 0 1] +d = [89; + 67; + 53; + 35; + 20;] +A = [3 2 1; + 2 3 4; + 1 2 3]; +b = [191 + 209 + 162]; +Aeq = [1 2 1]; +beq = 10; +lb = repmat(0.1,3,1); +ub = repmat(4,3,1); +x0 = repmat(0,3,1); +options = list("MaxIter", 300); + +//Output +//Optimal Solution Found. +// lambda = +// +// lower: [5.357D-12,2.334D-11,5.356D-12] +// upper: [78,6.963D-12,49] +// eqlin: 95 +// ineqlin: [1.206D-13,1.146D-13,1.449D-13] +// output = +// +// Iterations: 8 +// ConstrViolation: 8.000D-08 +// exitflag = +// +// 0 +// residual = +// +// 80. +// 62. +// 48. +// 31. +// 16. +// resnorm = +// +// 13765. +// xopt = +// +// 4. +// 1.0000000 +// 4. + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,Aeq,beq,lb,ub,x0,options) + diff --git a/tests/general_tests/lsqlin/lsqlin_x01.sce b/tests/general_tests/lsqlin/lsqlin_x01.sce index d014443..c50c359 100644 --- a/tests/general_tests/lsqlin/lsqlin_x01.sce +++ b/tests/general_tests/lsqlin/lsqlin_x01.sce @@ -23,6 +23,7 @@ x0 = [0 0 0]; // output = // // Iterations: 13 +// ConstrViolation: 0 // exitflag = // // 0 diff --git a/tests/general_tests/lsqlin/lsqlin_zeros.sce b/tests/general_tests/lsqlin/lsqlin_zeros.sce index 2695ff1..309b35f 100644 --- a/tests/general_tests/lsqlin/lsqlin_zeros.sce +++ b/tests/general_tests/lsqlin/lsqlin_zeros.sce @@ -14,6 +14,7 @@ b = [0]; // output = // // Iterations: 2 +// ConstrViolation: 0 // exitflag = // // 0 diff --git a/tests/general_tests/lsqnonneg/lsqnonneg_logical.sce b/tests/general_tests/lsqnonneg/lsqnonneg_logical1.sce index 5f59f8c..b151d73 100644 --- a/tests/general_tests/lsqnonneg/lsqnonneg_logical.sce +++ b/tests/general_tests/lsqnonneg/lsqnonneg_logical1.sce @@ -19,6 +19,7 @@ d = [89; // output = // // Iterations: 7 +// ConstrViolation: 0 // exitflag = // // 0 diff --git a/tests/general_tests/lsqnonneg/lsqnonneg_logical2.sce b/tests/general_tests/lsqnonneg/lsqnonneg_logical2.sce new file mode 100644 index 0000000..f19ab00 --- /dev/null +++ b/tests/general_tests/lsqnonneg/lsqnonneg_logical2.sce @@ -0,0 +1,44 @@ +// An example with C and d as input +C = [1 1 1; + 1 1 0; + 0 1 1; + 1 0 0; + 0 0 1] +d = [89; + 67; + 53; + 35; + 20] +options = list("MaxIter", 300); + +//Output +//Optimal Solution Found. +// lambda = +// +// lower: [5.131D-09,5.546D-09,8.739D-09] +// upper: [0,0,0] +// output = +// +// Iterations: 7 +// ConstrViolation: 0 +// exitflag = +// +// 0 +// residual = +// +// 0.75 +// - 0.625 +// - 0.125 +// - 0.125 +// - 0.625 +// resnorm = +// +// 1.375 +// xopt = +// +// 35.125 +// 32.5 +// 20.625 + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg(C,d,options) + diff --git a/tests/general_tests/lsqnonneg/lsqnonneg_maxiter.sce b/tests/general_tests/lsqnonneg/lsqnonneg_maxiter.sce index fa61c73..cbafee5 100644 --- a/tests/general_tests/lsqnonneg/lsqnonneg_maxiter.sce +++ b/tests/general_tests/lsqnonneg/lsqnonneg_maxiter.sce @@ -19,6 +19,7 @@ options = list("MaxIter",1) // output = // // Iterations: 1 +// ConstrViolation: 0 // exitflag = // // 1 diff --git a/tests/general_tests/lsqnonneg/lsqnonneg_zeros.sce b/tests/general_tests/lsqnonneg/lsqnonneg_zeros.sce index e454f42..cd1eb06 100644 --- a/tests/general_tests/lsqnonneg/lsqnonneg_zeros.sce +++ b/tests/general_tests/lsqnonneg/lsqnonneg_zeros.sce @@ -11,6 +11,7 @@ d = [0]; // output = // // Iterations: 3 +// ConstrViolation: 0 // exitflag = // // 0 diff --git a/tests/general_tests/qpipopt/qpipopt_infeasible.sci b/tests/general_tests/qpipopt/qpipopt_infeasible.sci index 49bb233..b01ee0d 100644 --- a/tests/general_tests/qpipopt/qpipopt_infeasible.sci +++ b/tests/general_tests/qpipopt/qpipopt_infeasible.sci @@ -19,15 +19,17 @@ lb = -1*ub; // constraint: [0x0 constant] // output = // -// Iterations: 0 +// Iterations: -1 +// ConstrViolation: 0.3752562 // exitflag = // // 5 // fopt = // -// 0. +// - 21.80307 // xopt = // -// [] +// 5.6247453 +// 5.6247438 [xopt,fopt,exitflag,output,lamda] = qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB) diff --git a/tests/general_tests/qpipopt/qpipopt_logical_1.sce b/tests/general_tests/qpipopt/qpipopt_logical_1.sce index 52d5493..54ba0a0 100644 --- a/tests/general_tests/qpipopt/qpipopt_logical_1.sce +++ b/tests/general_tests/qpipopt/qpipopt_logical_1.sce @@ -27,7 +27,7 @@ param = list("MaxIter", 300, "CpuTime", 100); // lambda // // Iterations: 13 -// +// ConstrViolation: 9.968D-09 // output // // 0 diff --git a/tests/general_tests/qpipopt/qpipopt_logical_2.sce b/tests/general_tests/qpipopt/qpipopt_logical_2.sce index 7a75ebe..d00b07b 100644 --- a/tests/general_tests/qpipopt/qpipopt_logical_2.sce +++ b/tests/general_tests/qpipopt/qpipopt_logical_2.sce @@ -21,7 +21,7 @@ nbCon = 0; // lambda // // Iterations: 1 -// +// ConstrViolation: 0 // output // // 0 diff --git a/tests/general_tests/qpipopt/qpipopt_maxiter.sce b/tests/general_tests/qpipopt/qpipopt_maxiter.sce index 5851630..4c35c9e 100644 --- a/tests/general_tests/qpipopt/qpipopt_maxiter.sce +++ b/tests/general_tests/qpipopt/qpipopt_maxiter.sce @@ -26,6 +26,7 @@ param = list("MaxIter", 1); // output = // // Iterations: 1 +// ConstrViolation: 1.3770464 // exitflag = // // 1 diff --git a/tests/general_tests/qpipopt/qpipopt_x01.sce b/tests/general_tests/qpipopt/qpipopt_x01.sce index bb37c50..b387a94 100644 --- a/tests/general_tests/qpipopt/qpipopt_x01.sce +++ b/tests/general_tests/qpipopt/qpipopt_x01.sce @@ -26,6 +26,7 @@ param = list("MaxIter", 300, "CpuTime", 100); // output = // // Iterations: 13 +// ConstrViolation: 9.968D-09 // exitflag = // // 0 diff --git a/tests/general_tests/qpipopt/qpipopt_zeros.sce b/tests/general_tests/qpipopt/qpipopt_zeros.sce index 9604c4d..993993a 100644 --- a/tests/general_tests/qpipopt/qpipopt_zeros.sce +++ b/tests/general_tests/qpipopt/qpipopt_zeros.sce @@ -22,7 +22,7 @@ nbCon = 0; // lambda // // Iterations: 0 -// +// ConstrViolation: 0 // output // // 0 diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_infeasible.sci b/tests/general_tests/qpipoptmat/qpipoptmat_infeasible.sci index 123f2c9..8964422 100644 --- a/tests/general_tests/qpipoptmat/qpipoptmat_infeasible.sci +++ b/tests/general_tests/qpipoptmat/qpipoptmat_infeasible.sci @@ -6,7 +6,6 @@ A = [-1 0; 0, -1; 1 1]; b = [-6 -6 11]; ub = [%inf %inf]; lb = -1*ub; -[xopt,fopt,exitflag,output,lamda] = qpipoptmat(H,f,A,b,[],[],lb,ub) //Output //Converged to a point of local infeasibility. @@ -18,13 +17,17 @@ lb = -1*ub; // ineqlin: [0x0 constant] // output = // -// Iterations: 0 +// Iterations: 105 +// ConstrViolation: 0.3752562 // exitflag = // // 5 // fopt = // -// 0. +// - 21.80307 // xopt = // -// [] +// 5.6247453 +// 5.6247438 + +[xopt,fopt,exitflag,output,lamda] = qpipoptmat(H,f,A,b,[],[],lb,ub) diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_logical1.sce b/tests/general_tests/qpipoptmat/qpipoptmat_logical1.sce index 50ddc6e..e1288c6 100644 --- a/tests/general_tests/qpipoptmat/qpipoptmat_logical1.sce +++ b/tests/general_tests/qpipoptmat/qpipoptmat_logical1.sce @@ -1,10 +1,11 @@ // A simple example without constraints f=[2 -35 -47]'; -H =[5 -2 -1; -2 4 3; -1 3 5]; +H =[5 -2 -1; + -2 4 3; + -1 3 5]; [xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f); - //Output // //Optimal Solution Found. @@ -17,7 +18,7 @@ H =[5 -2 -1; -2 4 3; -1 3 5]; // lambda // // Iterations: 1 -// +// ConstrViolation: 0 // output // // 0 diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_logical2.sce b/tests/general_tests/qpipoptmat/qpipoptmat_logical2.sce index e316253..137c7bb 100644 --- a/tests/general_tests/qpipoptmat/qpipoptmat_logical2.sce +++ b/tests/general_tests/qpipoptmat/qpipoptmat_logical2.sce @@ -13,7 +13,8 @@ ub=[10000; 100; 1.5; 100; 100; 1000]; param = list("MaxIter", 300, "CpuTime",100); //and minimize 0.5*x'*H*x + f'*x with f=[1; 2; 3; 4; 5; 6]; H=eye(6,6); -[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,[],param); +x0 = repmat(0,6,1); +[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,x0,param); //Output // @@ -27,7 +28,7 @@ f=[1; 2; 3; 4; 5; 6]; H=eye(6,6); // lambda // // Iterations: 13 -// +// ConstrViolation: 9.968D-09 // output // // 0 diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_logical3.sce b/tests/general_tests/qpipoptmat/qpipoptmat_logical3.sce new file mode 100644 index 0000000..3565d34 --- /dev/null +++ b/tests/general_tests/qpipoptmat/qpipoptmat_logical3.sce @@ -0,0 +1,52 @@ +//Find x in R^6 such that: +// A simple example with constraints + +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'*H*x + f'*x with +f=[1; 2; 3; 4; 5; 6]; H=eye(6,6); +x0 = repmat(0,6,1); +[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,x0); + +//Output +// +//Optimal Solution Found. +// +// lower: [1x6 constant] +// upper: [1x6 constant] +// ineqlin: [0.3091368,1.197D-12] +// eqlin: [-1.5564027,-0.1698164,-0.7054782] +// +// lambda +// +// Iterations: 13 +// ConstrViolation: 9.968D-09 +// output +// +// 0 +// +// exitflag +// +// - 14.843248 +// +// fopt +// +// 1.7975426 +// - 0.3381487 +// 0.1633880 +// - 4.9884023 +// 0.6054943 +// - 3.1155623 +// +// xopt + +disp("xopt",xopt,"fopt",fopt,"exitflag",exitflag,"output",output,"lambda",lambda) + + diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_logical4.sce b/tests/general_tests/qpipoptmat/qpipoptmat_logical4.sce new file mode 100644 index 0000000..bad5b8c --- /dev/null +++ b/tests/general_tests/qpipoptmat/qpipoptmat_logical4.sce @@ -0,0 +1,49 @@ +//Find x in R^6 such that: +// A simple example with constraints + +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]; +//and minimize 0.5*x'*H*x + f'*x with +f=[1; 2; 3; 4; 5; 6]; H=eye(6,6); +[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq); + +//Output +// +//Optimal Solution Found. +// +// lower: [1x6 constant] +// upper: [1x6 constant] +// ineqlin: [0.3091368,1.197D-12] +// eqlin: [-1.5564027,-0.1698164,-0.7054782] +// +// lambda +// +// Iterations: 13 +// ConstrViolation: 9.968D-09 +// output +// +// 0 +// +// exitflag +// +// - 14.843248 +// +// fopt +// +// 1.7975426 +// - 0.3381487 +// 0.1633880 +// - 4.9884023 +// 0.6054943 +// - 3.1155623 +// +// xopt + +disp("xopt",xopt,"fopt",fopt,"exitflag",exitflag,"output",output,"lambda",lambda) + + diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_logical5.sce b/tests/general_tests/qpipoptmat/qpipoptmat_logical5.sce new file mode 100644 index 0000000..2c78091 --- /dev/null +++ b/tests/general_tests/qpipoptmat/qpipoptmat_logical5.sce @@ -0,0 +1,46 @@ +//Find x in R^6 such that: +// A simple example with constraints + +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]; +param = list("MaxIter", 300, "CpuTime",100); +//and minimize 0.5*x'*H*x + f'*x with +f=[1; 2; 3; 4; 5; 6]; H=eye(6,6); +x0 = repmat(0,6,1); +//Output +// +//Optimal Solution Found. +// lambda = +// +// lower: [0,0,0,0,0,0] +// upper: [0,0,0,0,0,0] +// eqlin: [0x0 constant] +// ineqlin: [1.232D-12,6.884D-13] +// output = +// +// Iterations: 5 +// ConstrViolation: 0 +// exitflag = +// +// 0 +// fopt = +// +// - 45.5 +// xopt = +// +// - 1. +// - 2. +// - 3. +// - 4. +// - 5. +// - 6. + +[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b) + diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_maxiter.sce b/tests/general_tests/qpipoptmat/qpipoptmat_maxiter.sce index 5e4b0e5..c49cd78 100644 --- a/tests/general_tests/qpipoptmat/qpipoptmat_maxiter.sce +++ b/tests/general_tests/qpipoptmat/qpipoptmat_maxiter.sce @@ -26,6 +26,7 @@ f=[1; 2; 3; 4; 5; 6]; H=eye(6,6); // output = // // Iterations: 1 +// ConstrViolation: 1.3770464 // exitflag = // // 1 diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_x01.sce b/tests/general_tests/qpipoptmat/qpipoptmat_x01.sce index 71a1c6c..f32dcdd 100644 --- a/tests/general_tests/qpipoptmat/qpipoptmat_x01.sce +++ b/tests/general_tests/qpipoptmat/qpipoptmat_x01.sce @@ -16,6 +16,32 @@ f=[1; 2; 3; 4; 5; 6]; H=eye(6,6); x0 = repmat(0,5,1); // Warning -//WARNING: qpipopt: Ignoring initial guess of variables as it is not equal to the number of variables +//WARNING: qpipoptmat: Ignoring initial guess of variables as it is not equal to the number of variables -[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,x0,param); +//Optimal Solution Found. +// lambda = +// +// lower: [9.982D-15,1.000D-15,7.345D-11,1.005D-14,9.994D-15,1.003D-14] +// upper: [1.000D-15,9.966D-14,7.481D-12,9.525D-14,1.006D-13,9.969D-15] +// eqlin: [-1.5564027,-0.1698164,-0.7054782] +// ineqlin: [0.3091368,1.197D-12] +// output = +// +// Iterations: 13 +// ConstrViolation: 9.968D-09 +// exitflag = +// +// 0 +// fopt = +// +// - 14.843248 +// xopt = +// +// 1.7975426 +// - 0.3381487 +// 0.1633880 +// - 4.9884023 +// 0.6054943 +// - 3.1155623 + +[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,x0,param) diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_zeros.sce b/tests/general_tests/qpipoptmat/qpipoptmat_zeros.sce index ee9cfc9..1433a8e 100644 --- a/tests/general_tests/qpipoptmat/qpipoptmat_zeros.sce +++ b/tests/general_tests/qpipoptmat/qpipoptmat_zeros.sce @@ -15,7 +15,7 @@ H =[0]; // lambda // // Iterations: 0 -// +// ConstrViolation: 0 // output // // 0 @@ -31,5 +31,5 @@ H =[0]; // xopt -[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f); +[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f) diff --git a/tests/general_tests/symphony/symphony_logical1.sce b/tests/general_tests/symphony/symphony_logical1.sce index 2f63ed6..5c41a9a 100644 --- a/tests/general_tests/symphony/symphony_logical1.sce +++ b/tests/general_tests/symphony/symphony_logical1.sce @@ -1,5 +1,6 @@ // A basic case : +// Reference: Westerberg, Carl-Henrik, Bengt Bjorklund, and Eskil Hultman. "An application of mixed integer programming in a Swedish steel mill." Interfaces 7, no. 2 (1977): 39-43. // Objective function c = [350*5,330*3,310*4,280*6,500,450,400,100]'; diff --git a/tests/general_tests/symphonymat/symphonymat_logical2.sce b/tests/general_tests/symphonymat/symphonymat_logical2.sce index 4f3923f..98a3b70 100644 --- a/tests/general_tests/symphonymat/symphonymat_logical2.sce +++ b/tests/general_tests/symphonymat/symphonymat_logical2.sce @@ -2,55 +2,39 @@ // A basic case : -// Objective function c = -1*[20,10,15]'; -// Lower Bound of variable -lb = repmat(0,3,1); - -// Upper Bound of variables -ub = repmat(%inf,3,1); - -// Constraint Matrix A = [3,2,5; 2,1,1; 1,1,3; 5,2,4] -// Upper Bound of constrains b = [ 55;26;30;57] -// Row Matrix for telling symphony that the is integer or not + intcon = []; // Output //Problem loaded into environment. -// + //Note: There is no limit on time. -// + //An optimal solution has been found. -// -// 0. +// output = // // Iterations: 1 -// -// output +// status = // // 227. -// -// status +// f = // // - 268. -// -// f +// x = // // 1.8 // 20.8 -// 1.6 -// -// x +// 1.6 // Calling Symphony -[x,f,status,output] = symphonymat(c,intcon,A,b,[],[],lb,ub) -disp("x",x,"f",f,"status",status,"output",output); +[x,f,status,output] = symphonymat(c,intcon,A,b) diff --git a/tests/general_tests/symphonymat/symphonymat_logical3.sce b/tests/general_tests/symphonymat/symphonymat_logical3.sce new file mode 100644 index 0000000..1b2b60c --- /dev/null +++ b/tests/general_tests/symphonymat/symphonymat_logical3.sce @@ -0,0 +1,43 @@ +// An example with equality constraints and variable bounds + +// A basic case : + +c = -1*[20,10,15]'; + +A = [3,2,5; + 2,1,1; + 1,1,3; + 5,2,4] + +b = [ 55;26;30;57] + +Aeq = [2 3 5] + +beq = [5] + +intcon = []; + +// Output +//Problem loaded into environment. +// +//Note: There is no limit on time. +// +//An optimal solution has been found. +// output = +// +// Iterations: 1 +// status = +// +// 227. +// f = +// +// - 233.5 +// x = +// +// 15.6 +// 0.1 +// - 5.3 + +// Calling Symphony +[x,f,status,output] = symphonymat(c,intcon,A,b,Aeq,beq) + diff --git a/tests/general_tests/symphonymat/symphonymat_logical4.sce b/tests/general_tests/symphonymat/symphonymat_logical4.sce new file mode 100644 index 0000000..ccb53a5 --- /dev/null +++ b/tests/general_tests/symphonymat/symphonymat_logical4.sce @@ -0,0 +1,46 @@ +// An example with equality constraints and variable bounds + +// A basic case : + +c = -1*[20,10,15]'; + +A = [3,2,5; + 2,1,1; + 1,1,3; + 5,2,4] + +b = [ 55;26;30;57] + +Aeq = [2 3 5] + +beq = [5] + +intcon = []; + +lb = repmat(0,3,1); +ub = repmat(8,3,1); + +// Output +//Problem loaded into environment. + +//Note: There is no limit on time. + +//An optimal solution has been found. +// output = +// +// Iterations: 1 +// status = +// +// 227. +// f = +// +// - 50. +// x = +// +// 2.5 +// 0. +// 0. + +// Calling Symphony +[x,f,status,output] = symphonymat(c,intcon,A,b,Aeq,beq,lb,ub) + |