diff options
Diffstat (limited to 'tests/general_tests/qpipoptmat')
16 files changed, 81 insertions, 20 deletions
diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_A1.sce b/tests/general_tests/qpipoptmat/qpipoptmat_A1.sce index 1c8d055..56880ab 100644 --- a/tests/general_tests/qpipoptmat/qpipoptmat_A1.sce +++ b/tests/general_tests/qpipoptmat/qpipoptmat_A1.sce @@ -14,9 +14,12 @@ 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) + +[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 index be35586..b44480d 100644 --- a/tests/general_tests/qpipoptmat/qpipoptmat_Aeq1.sce +++ b/tests/general_tests/qpipoptmat/qpipoptmat_Aeq1.sce @@ -14,9 +14,10 @@ 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) + +[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 index 0bc90df..b4f2e3a 100644 --- a/tests/general_tests/qpipoptmat/qpipoptmat_H1.sce +++ b/tests/general_tests/qpipoptmat/qpipoptmat_H1.sce @@ -14,9 +14,11 @@ 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) + +[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 index 507487f..158c142 100644 --- a/tests/general_tests/qpipoptmat/qpipoptmat_H2.sce +++ b/tests/general_tests/qpipoptmat/qpipoptmat_H2.sce @@ -14,9 +14,10 @@ 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) + +[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 index f039833..3940fa0 100644 --- a/tests/general_tests/qpipoptmat/qpipoptmat_b1.sce +++ b/tests/general_tests/qpipoptmat/qpipoptmat_b1.sce @@ -14,9 +14,10 @@ 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) + +[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 index 2641ac4..bcdda3c 100644 --- a/tests/general_tests/qpipoptmat/qpipoptmat_beq1.sce +++ b/tests/general_tests/qpipoptmat/qpipoptmat_beq1.sce @@ -14,9 +14,11 @@ 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) + +[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 index 7f55175..bf863a4 100644 --- a/tests/general_tests/qpipoptmat/qpipoptmat_f1.sce +++ b/tests/general_tests/qpipoptmat/qpipoptmat_f1.sce @@ -14,9 +14,11 @@ 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) + +[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,[],param) + diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_infeasible.sci b/tests/general_tests/qpipoptmat/qpipoptmat_infeasible.sci new file mode 100644 index 0000000..123f2c9 --- /dev/null +++ b/tests/general_tests/qpipoptmat/qpipoptmat_infeasible.sci @@ -0,0 +1,30 @@ +// qpipopt infeasibility test + +H = [2 0;0 8]; +f = [0 -32]; +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. +// lamda = +// +// lower: [0x0 constant] +// upper: [0x0 constant] +// eqlin: [0x0 constant] +// ineqlin: [0x0 constant] +// output = +// +// Iterations: 0 +// exitflag = +// +// 5 +// fopt = +// +// 0. +// xopt = +// +// [] diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_lb1.sce b/tests/general_tests/qpipoptmat/qpipoptmat_lb1.sce index e96150e..10229af 100644 --- a/tests/general_tests/qpipoptmat/qpipoptmat_lb1.sce +++ b/tests/general_tests/qpipoptmat/qpipoptmat_lb1.sce @@ -14,9 +14,10 @@ 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) + +[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 index 8832300..50ddc6e 100644 --- a/tests/general_tests/qpipoptmat/qpipoptmat_logical1.sce +++ b/tests/general_tests/qpipoptmat/qpipoptmat_logical1.sce @@ -1,9 +1,9 @@ -// Check for the Q to be a symmetric matrix +// A simple example without constraints 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) +[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f); + //Output // @@ -33,3 +33,6 @@ disp("xopt",xopt,"fopt",fopt,"exitflag",exitflag,"output",output,"lambda",lambda // 7. // // xopt + +disp("xopt",xopt,"fopt",fopt,"exitflag",exitflag,"output",output,"lambda",lambda) + diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_logical2.sce b/tests/general_tests/qpipoptmat/qpipoptmat_logical2.sce index 80802cf..9f11d1d 100644 --- a/tests/general_tests/qpipoptmat/qpipoptmat_logical2.sce +++ b/tests/general_tests/qpipoptmat/qpipoptmat_logical2.sce @@ -13,8 +13,7 @@ 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) +[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,[],param); //Output // @@ -46,4 +45,8 @@ disp("xopt",xopt,"fopt",fopt,"exitflag",exitflag,"output",output,"lambda",lambda // 0.6054943 // - 3.1155623 // -// xopt +// xopt + +disp("xopt",xopt,"fopt",fopt,"exitflag",exitflag,"output",output,"lambda",lambda) + + diff --git a/tests/general_tests/qpipoptmat/qpipoptmat_param1.sce b/tests/general_tests/qpipoptmat/qpipoptmat_param1.sce index ba3915e..6ae5345 100644 --- a/tests/general_tests/qpipoptmat/qpipoptmat_param1.sce +++ b/tests/general_tests/qpipoptmat/qpipoptmat_param1.sce @@ -14,9 +14,12 @@ 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) + +[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 index 801e0f9..d038962 100644 --- a/tests/general_tests/qpipoptmat/qpipoptmat_param2.sce +++ b/tests/general_tests/qpipoptmat/qpipoptmat_param2.sce @@ -14,9 +14,12 @@ 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) + +[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 index e9198e6..f7cbcf5 100644 --- a/tests/general_tests/qpipoptmat/qpipoptmat_param3.sce +++ b/tests/general_tests/qpipoptmat/qpipoptmat_param3.sce @@ -14,9 +14,12 @@ 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) + +[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 index 28ec92e..f3b1559 100644 --- a/tests/general_tests/qpipoptmat/qpipoptmat_ub1.sce +++ b/tests/general_tests/qpipoptmat/qpipoptmat_ub1.sce @@ -14,9 +14,11 @@ 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) + +[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 index 59710bb..71a1c6c 100644 --- a/tests/general_tests/qpipoptmat/qpipoptmat_x01.sce +++ b/tests/general_tests/qpipoptmat/qpipoptmat_x01.sce @@ -1,4 +1,4 @@ -// Check for the size of H matrix +// Check for the initial guess x0 //Find x in R^6 such that: Aeq= [1,-1,1,0,3,1; @@ -14,7 +14,8 @@ 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 + +[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,x0,param); |