summaryrefslogtreecommitdiff
path: root/tests/unit_tests/qpipopt_base.dia.ref
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit_tests/qpipopt_base.dia.ref')
-rw-r--r--tests/unit_tests/qpipopt_base.dia.ref38
1 files changed, 19 insertions, 19 deletions
diff --git a/tests/unit_tests/qpipopt_base.dia.ref b/tests/unit_tests/qpipopt_base.dia.ref
index 0cc59f1..25b440f 100644
--- a/tests/unit_tests/qpipopt_base.dia.ref
+++ b/tests/unit_tests/qpipopt_base.dia.ref
@@ -52,25 +52,25 @@ endfunction
// if flag <> 1 then pause,end
//endfunction
-//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.
-Q = [1 -1; -1 2];
-p = [-2; -6];
-conMatrix = [1 1; -1 2; 2 1];
-conUB = [2; 2; 3];
-conLB = [-%inf; -%inf; -%inf];
-lb = [0; 0];
-ub = [%inf; %inf];
-nbVar = 2;
-nbCon = 3;
-[xopt,fopt,exitflag,output,lambda] = qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB)
+//Find x in R^6 such that:
+A= [1,-1,1,0,3,1;
+-1,0,-3,-4,5,6;
+2,5,3,0,1,0
+0,1,0,1,2,-1;
+-1,0,2,1,1,0];
+conLB=[1;2;3;-%inf;-%inf];
+conUB = [1;2;3;-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);
+nbVar = 6;
+nbCon = 5;
+x0 = repmat(0,nbVar,1);
+param = list("MaxIter", 300, "CpuTime", 100);
+[xopt,fopt,exitflag,output,lambda] = qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param)
-assert_close ( xopt , [0.6666667 1.3333333]' , 1.e-7 );
-assert_close ( fopt , [ - 8.2222223] , 1.e-7 );
+assert_close ( xopt , [1.7975426 -0.3381487 0.1633880 - 4.9884023 0.6054943 -3.1155623]' , 1.e-7 );
+assert_close ( fopt , [ -14.843248] , 1.e-7 );
assert_checkequal( exitflag , int32(0) );
printf("Test Successful");