diff options
Diffstat (limited to 'tests/general_tests/qpipoptmat')
-rw-r--r-- | tests/general_tests/qpipoptmat/qpipoptmat_A1.sce | 22 | ||||
-rw-r--r-- | tests/general_tests/qpipoptmat/qpipoptmat_Aeq1.sce | 22 | ||||
-rw-r--r-- | tests/general_tests/qpipoptmat/qpipoptmat_H1.sce | 22 | ||||
-rw-r--r-- | tests/general_tests/qpipoptmat/qpipoptmat_H2.sce | 22 | ||||
-rw-r--r-- | tests/general_tests/qpipoptmat/qpipoptmat_b1.sce | 22 | ||||
-rw-r--r-- | tests/general_tests/qpipoptmat/qpipoptmat_beq1.sce | 22 | ||||
-rw-r--r-- | tests/general_tests/qpipoptmat/qpipoptmat_f1.sce | 22 | ||||
-rw-r--r-- | tests/general_tests/qpipoptmat/qpipoptmat_lb1.sce | 22 | ||||
-rw-r--r-- | tests/general_tests/qpipoptmat/qpipoptmat_logical1.sce | 35 | ||||
-rw-r--r-- | tests/general_tests/qpipoptmat/qpipoptmat_logical2.sce | 49 | ||||
-rw-r--r-- | tests/general_tests/qpipoptmat/qpipoptmat_param1.sce | 22 | ||||
-rw-r--r-- | tests/general_tests/qpipoptmat/qpipoptmat_param2.sce | 22 | ||||
-rw-r--r-- | tests/general_tests/qpipoptmat/qpipoptmat_param3.sce | 22 | ||||
-rw-r--r-- | tests/general_tests/qpipoptmat/qpipoptmat_ub1.sce | 22 | ||||
-rw-r--r-- | tests/general_tests/qpipoptmat/qpipoptmat_x01.sce | 20 |
15 files changed, 368 insertions, 0 deletions
diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_A1.sce b/tests/general_tests/qpipoptmat/qpipoptmat_A1.sce new file mode 100644 index 0000000..1c8d055 --- /dev/null +++ b/tests/general_tests/qpipoptmat/qpipoptmat_A1.sce @@ -0,0 +1,22 @@ +// Check for the size of A matrix +//Find x in R^6 such that: + +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,0,2,1,1]; +b = [-1; 2.5]; +lb=[-1000; -10000; 0; -1000; -1000; -1000]; +ub=[10000; 100; 1.5; 100; 100; 1000]; +x0 = repmat(0,6,1); +param = list("MaxIter", 300, "CpuTime", 100); +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,[],param) + +// Error +//qpipoptmat: The number of columns in A must be the same as the number of elements of f +//at line 222 of function qpipoptmat called by : +//[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,[],param) diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_Aeq1.sce b/tests/general_tests/qpipoptmat/qpipoptmat_Aeq1.sce new file mode 100644 index 0000000..be35586 --- /dev/null +++ b/tests/general_tests/qpipoptmat/qpipoptmat_Aeq1.sce @@ -0,0 +1,22 @@ +// Check for the size of Aeq matrix +//Find x in R^6 such that: + +Aeq= [1,-1,1,0,3,; +-1,0,-3,-4,5,; +2,5,3,0,1,]; +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]; +x0 = repmat(0,6,1); +param = list("MaxIter", 300, "CpuTime", 100); +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,[],param) + +// Error +//qpipoptmat: The number of columns in Aeq must be the same as the number of elements of f +//at line 228 of function qpipoptmat called by : +//[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,[],param) diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_H1.sce b/tests/general_tests/qpipoptmat/qpipoptmat_H1.sce new file mode 100644 index 0000000..0bc90df --- /dev/null +++ b/tests/general_tests/qpipoptmat/qpipoptmat_H1.sce @@ -0,0 +1,22 @@ +// Check for the size of H matrix +//Find x in R^6 such that: + +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]; +x0 = repmat(0,6,1); +param = list("MaxIter", 300, "CpuTime", 100); +f=[1; 2; 3; 4; 5; 6]; H=eye(4,4); +x0 = repmat(0,6,1); +[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,[],param) + +// Error +//qpipoptmat: The number of rows and columns in H must be equal the number of elements of f +//at line 215 of function qpipoptmat called by : +//[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,[],param) diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_H2.sce b/tests/general_tests/qpipoptmat/qpipoptmat_H2.sce new file mode 100644 index 0000000..507487f --- /dev/null +++ b/tests/general_tests/qpipoptmat/qpipoptmat_H2.sce @@ -0,0 +1,22 @@ +// Check if H is a symmetric matrix +//Find x in R^6 such that: + +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]; +x0 = repmat(0,6,1); +param = list("MaxIter", 300, "CpuTime", 100); +f=[1; 2; 3; 4; 5; 6]; H=eye(6,4); +x0 = repmat(0,6,1); +[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,[],param) + +// Error +//qpipoptmat: H is not a symmetric matrix +//at line 208 of function qpipoptmat called by : +//[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,[],param) diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_b1.sce b/tests/general_tests/qpipoptmat/qpipoptmat_b1.sce new file mode 100644 index 0000000..f039833 --- /dev/null +++ b/tests/general_tests/qpipoptmat/qpipoptmat_b1.sce @@ -0,0 +1,22 @@ +// Check for the size of b matrix +//Find x in R^6 such that: + +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]; +lb=[-1000; -10000; 0; -1000; -1000; -1000]; +ub=[10000; 100; 1.5; 100; 100; 1000]; +x0 = repmat(0,6,1); +param = list("MaxIter", 300, "CpuTime", 100); +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,[],param) + +// Error +//qpipoptmat: The number of rows in A must be the same as the number of elementsof b +//at line 247 of function qpipoptmat called by : +//[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,[],param) diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_beq1.sce b/tests/general_tests/qpipoptmat/qpipoptmat_beq1.sce new file mode 100644 index 0000000..2641ac4 --- /dev/null +++ b/tests/general_tests/qpipoptmat/qpipoptmat_beq1.sce @@ -0,0 +1,22 @@ +// Check for the size of beq matrix +//Find x in R^6 such that: + +Aeq= [1,-1,1,0,3,1; +-1,0,-3,-4,5,6; +2,5,3,0,1,0]; +beq=[1; 2]; +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]; +x0 = repmat(0,6,1); +param = list("MaxIter", 300, "CpuTime", 100); +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,[],param) + +// Error +//qpipoptmat: The number of rows in Aeq must be the same as the number of elements of beq +//at line 253 of function qpipoptmat called by : +//[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,[],param) diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_f1.sce b/tests/general_tests/qpipoptmat/qpipoptmat_f1.sce new file mode 100644 index 0000000..7f55175 --- /dev/null +++ b/tests/general_tests/qpipoptmat/qpipoptmat_f1.sce @@ -0,0 +1,22 @@ +// Check for the size of f matrix +//Find x in R^6 such that: + +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]; +x0 = repmat(0,6,1); +param = list("MaxIter", 300, "CpuTime", 100); +f=[1; 2; 3; 4; 5]; H=eye(6,6); +x0 = repmat(0,6,1); +[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,[],param) + +// Error +//qpipoptmat: The number of rows and columns in H must be equal the number of elements of f +//at line 215 of function qpipoptmat called by : +//[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,[],param) diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_lb1.sce b/tests/general_tests/qpipoptmat/qpipoptmat_lb1.sce new file mode 100644 index 0000000..e96150e --- /dev/null +++ b/tests/general_tests/qpipoptmat/qpipoptmat_lb1.sce @@ -0,0 +1,22 @@ +// Check for the size of lb matrix +//Find x in R^6 such that: + +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]; +ub=[10000; 100; 1.5; 100; 100; 1000]; +x0 = repmat(0,6,1); +param = list("MaxIter", 300, "CpuTime", 100); +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,[],param) + +// Error +//qpipoptmat: The Lower Bound is not equal to the number of variables +//at line 235 of function qpipoptmat called by : +//[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,[],param) diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_logical1.sce b/tests/general_tests/qpipoptmat/qpipoptmat_logical1.sce new file mode 100644 index 0000000..8832300 --- /dev/null +++ b/tests/general_tests/qpipoptmat/qpipoptmat_logical1.sce @@ -0,0 +1,35 @@ +// Check for the Q to be a symmetric matrix + +f=[2 -35 -47]'; +H =[5 -2 -1; -2 4 3; -1 3 5]; +[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f) +disp("xopt",xopt,"fopt",fopt,"exitflag",exitflag,"output",output,"lambda",lambda) + +//Output +// +//Optimal Solution Found. +// +// lower: [0,0,0] +// upper: [0,0,0] +// ineqlin: [0x0 constant] +// eqlin: [0x0 constant] +// +// lambda +// +// Iterations: 1 +// +// output +// +// 0 +// +// exitflag +// +// - 249. +// +// fopt +// +// 3. +// 5. +// 7. +// +// xopt diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_logical2.sce b/tests/general_tests/qpipoptmat/qpipoptmat_logical2.sce new file mode 100644 index 0000000..80802cf --- /dev/null +++ b/tests/general_tests/qpipoptmat/qpipoptmat_logical2.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]; +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'*Q*x + p'*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) +disp("xopt",xopt,"fopt",fopt,"exitflag",exitflag,"output",output,"lambda",lambda) + +//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 +// +// output +// +// 0 +// +// exitflag +// +// - 14.843248 +// +// fopt +// +// 1.7975426 +// - 0.3381487 +// 0.1633880 +// - 4.9884023 +// 0.6054943 +// - 3.1155623 +// +// xopt diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_param1.sce b/tests/general_tests/qpipoptmat/qpipoptmat_param1.sce new file mode 100644 index 0000000..ba3915e --- /dev/null +++ b/tests/general_tests/qpipoptmat/qpipoptmat_param1.sce @@ -0,0 +1,22 @@ +//Check if the user gives uneven number of parameters +//Find x in R^6 such that: + +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]; +x0 = repmat(0,6,1); +param = list("MaxIter", 300, 100); +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,[],param) + +// Error +//qpipoptmat: Size of parameters should be even +//at line 153 of function qpipoptmat called by : +//[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,[],param) diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_param2.sce b/tests/general_tests/qpipoptmat/qpipoptmat_param2.sce new file mode 100644 index 0000000..801e0f9 --- /dev/null +++ b/tests/general_tests/qpipoptmat/qpipoptmat_param2.sce @@ -0,0 +1,22 @@ +// Check if the user gives different parameter other than predefined +//Find x in R^6 such that: + +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]; +x0 = repmat(0,6,1); +param = list("MaxIter", 300, "Time", 100); +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,[],param) + +// Error +//qpipoptmat: Unrecognized parameter name 'Time'. +//at line 170 of function qpipoptmat called by : +//[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,[],param) diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_param3.sce b/tests/general_tests/qpipoptmat/qpipoptmat_param3.sce new file mode 100644 index 0000000..e9198e6 --- /dev/null +++ b/tests/general_tests/qpipoptmat/qpipoptmat_param3.sce @@ -0,0 +1,22 @@ +// Check if the user for a list for the param +//Find x in R^6 such that: + +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]; +x0 = repmat(0,6,1); +param = ["MaxIter", "CpuTime"]; +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,[],param) + +// Error +//qpipopt: param should be a list +//at line 147 of function qpipoptmat called by : +//[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,[],param) diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_ub1.sce b/tests/general_tests/qpipoptmat/qpipoptmat_ub1.sce new file mode 100644 index 0000000..28ec92e --- /dev/null +++ b/tests/general_tests/qpipoptmat/qpipoptmat_ub1.sce @@ -0,0 +1,22 @@ +// Check for the size of ub matrix +//Find x in R^6 such that: + +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]; +x0 = repmat(0,6,1); +param = list("MaxIter", 300, "CpuTime", 100); +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,[],param) + +// Error +//qpipoptmat: The Upper Bound is not equal to the number of variables +//at line 241 of function qpipoptmat called by : +//[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,[],param) diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_x01.sce b/tests/general_tests/qpipoptmat/qpipoptmat_x01.sce new file mode 100644 index 0000000..59710bb --- /dev/null +++ b/tests/general_tests/qpipoptmat/qpipoptmat_x01.sce @@ -0,0 +1,20 @@ +// Check for the size of H matrix +//Find x in R^6 such that: + +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]; +x0 = repmat(0,6,1); +param = list("MaxIter", 300, "CpuTime", 100); +f=[1; 2; 3; 4; 5; 6]; H=eye(6,6); +x0 = repmat(0,5,1); +[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,[],param) + +// Warning +//WARNING: qpipopt: Ignoring initial guess of variables as it is not equal to the number of variables |