summaryrefslogtreecommitdiff
path: root/tests/general_tests/qpipoptmat
diff options
context:
space:
mode:
Diffstat (limited to 'tests/general_tests/qpipoptmat')
-rw-r--r--tests/general_tests/qpipoptmat/qpipoptmat_infeasible.sci11
-rw-r--r--tests/general_tests/qpipoptmat/qpipoptmat_logical1.sce7
-rw-r--r--tests/general_tests/qpipoptmat/qpipoptmat_logical2.sce5
-rw-r--r--tests/general_tests/qpipoptmat/qpipoptmat_logical3.sce52
-rw-r--r--tests/general_tests/qpipoptmat/qpipoptmat_logical4.sce49
-rw-r--r--tests/general_tests/qpipoptmat/qpipoptmat_logical5.sce46
-rw-r--r--tests/general_tests/qpipoptmat/qpipoptmat_maxiter.sce1
-rw-r--r--tests/general_tests/qpipoptmat/qpipoptmat_x01.sce30
-rw-r--r--tests/general_tests/qpipoptmat/qpipoptmat_zeros.sce4
9 files changed, 192 insertions, 13 deletions
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)