diff options
author | Harpreet | 2015-12-22 16:45:38 +0530 |
---|---|---|
committer | Harpreet | 2015-12-22 16:45:38 +0530 |
commit | 0eee95dfb1edec6ce52ec3065a3adb1bf169c9f9 (patch) | |
tree | 1a38ee971248f8c1efe226dced15b66764c412d1 | |
parent | b4fe1077092f3dc1c1d965e938b00e0a0d0694d0 (diff) | |
download | FOSSEE-Optimization-toolbox-0eee95dfb1edec6ce52ec3065a3adb1bf169c9f9.tar.gz FOSSEE-Optimization-toolbox-0eee95dfb1edec6ce52ec3065a3adb1bf169c9f9.tar.bz2 FOSSEE-Optimization-toolbox-0eee95dfb1edec6ce52ec3065a3adb1bf169c9f9.zip |
general tests added
67 files changed, 1881 insertions, 0 deletions
diff --git a/tests/general_tests/qpipopt/qpipopt_LB1.sce b/tests/general_tests/qpipopt/qpipopt_LB1.sce new file mode 100644 index 0000000..b2b92ce --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_LB1.sce @@ -0,0 +1,23 @@ +//Find x in R^6 such that: +// Check if the user gives lower bound unequal to the number of variables +conMatrix= [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]; +ub=[10000; 100; 1.5; 100; 100; 1000]; +//and minimize 0.5*x'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=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) + +//Error +//qpipopt: The Lower Bound is not equal to the number of variables +//at line 191 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) diff --git a/tests/general_tests/qpipopt/qpipopt_LB2.sce b/tests/general_tests/qpipopt/qpipopt_LB2.sce new file mode 100644 index 0000000..e6df705 --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_LB2.sce @@ -0,0 +1,23 @@ +//Find x in R^6 such that: +// Check if the user gives lower bound as a row vector +conMatrix= [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'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=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) + +//Error +//qpipopt: The Lower Bound should be a column vector +//at line 188 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) diff --git a/tests/general_tests/qpipopt/qpipopt_Q1.sce b/tests/general_tests/qpipopt/qpipopt_Q1.sce new file mode 100644 index 0000000..06cceea --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_Q1.sce @@ -0,0 +1,24 @@ +//Find x in R^6 such that: +// Check for the size of Q matrix +conMatrix= [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'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=eye(5,5); +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) + +//error +// +//qpipopt: The Size of Q is not equal to the number of variables +//at line 158 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) diff --git a/tests/general_tests/qpipopt/qpipopt_Q2.sce b/tests/general_tests/qpipopt/qpipopt_Q2.sce new file mode 100644 index 0000000..ea23ee4 --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_Q2.sce @@ -0,0 +1,23 @@ +//Find x in R^6 such that: +// Check for the Q to be a symmetric matrix +conMatrix= [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'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=eye(6,5); +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) + +//Error +//qpipopt: Q is not a symmetric matrix +//at line 152 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) diff --git a/tests/general_tests/qpipopt/qpipopt_UB1.sce b/tests/general_tests/qpipopt/qpipopt_UB1.sce new file mode 100644 index 0000000..155c695 --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_UB1.sce @@ -0,0 +1,23 @@ +//Find x in R^6 such that: + // Check if the user gives unequal size of Upper Bound as of the number of variables +conMatrix= [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]; +//and minimize 0.5*x'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=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) + +//Error +//qpipopt: The Upper Bound is not equal to the number of variables +//at line 201 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) diff --git a/tests/general_tests/qpipopt/qpipopt_UB2.sce b/tests/general_tests/qpipopt/qpipopt_UB2.sce new file mode 100644 index 0000000..a4f5270 --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_UB2.sce @@ -0,0 +1,23 @@ +//Find x in R^6 such that: +// Check if the user gives Upper Bound matrix as a row vector +conMatrix= [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'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=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) + +//Error +//qpipopt: The Upper Bound should be a column vector +//at line 224 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) diff --git a/tests/general_tests/qpipopt/qpipopt_conLB1.sce b/tests/general_tests/qpipopt/qpipopt_conLB1.sce new file mode 100644 index 0000000..09105e7 --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_conLB1.sce @@ -0,0 +1,23 @@ +//Find x in R^6 such that: +// Checking if a user gives less or number of constraints Lower Bound +conMatrix= [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]; +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'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=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) + +//Error +//qpipopt: The Lower Bound of constraints is not equal to the number of constraints +//at line 211 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) diff --git a/tests/general_tests/qpipopt/qpipopt_conLB2.sce b/tests/general_tests/qpipopt/qpipopt_conLB2.sce new file mode 100644 index 0000000..d0236c0 --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_conLB2.sce @@ -0,0 +1,23 @@ +//Find x in R^6 such that: +// Checking if a user gives a column vector +conMatrix= [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'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=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) + +//Error +//qpipopt: The Lower Bound should be a column vector +//at line 208 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) diff --git a/tests/general_tests/qpipopt/qpipopt_conMatrix1.sce b/tests/general_tests/qpipopt/qpipopt_conMatrix1.sce new file mode 100644 index 0000000..96ee3eb --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_conMatrix1.sce @@ -0,0 +1,23 @@ +//Find x in R^6 such that: +// Check if a user gives unequal number of constraints as given by him + +conMatrix= [1,-1,1,0,3,1; +-1,0,-3,-4,5,6; +2,5,3,0,1,0 +0,1,0,1,2,-1;]; +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'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=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) + +//Error +//qpipopt: The number of constraints is not equal to the number of constraint given i.e. 5 +//at line 181 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) diff --git a/tests/general_tests/qpipopt/qpipopt_conMatrix2.sce b/tests/general_tests/qpipopt/qpipopt_conMatrix2.sce new file mode 100644 index 0000000..f5e3106 --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_conMatrix2.sce @@ -0,0 +1,23 @@ +//Find x in R^6 such that: +//Check for the size of constraints +conMatrix= [-1,1,0,3,1; +-1,0,-3,-4,5; +2,5,3,0,1 +0,1,0,1,2; +-1,0,2,1,1]; +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'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=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) + +//Error +//qpipopt: The size of constraints is not equal to the number of variables +//at line 175 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) diff --git a/tests/general_tests/qpipopt/qpipopt_conUB1.sce b/tests/general_tests/qpipopt/qpipopt_conUB1.sce new file mode 100644 index 0000000..2c4bfa6 --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_conUB1.sce @@ -0,0 +1,23 @@ +//Find x in R^6 such that: +// Check for the Upper Bound of constraints is which should be equal to the number of constraints +conMatrix= [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]; +lb=[-1000;-10000; 0; -1000; -1000; -1000]; +ub=[10000; 100; 1.5; 100; 100; 1000]; +//and minimize 0.5*x'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=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) + +//Error +//qpipopt: The Upper Bound of constraints is not equal to the number of constraints +//at line 221 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) diff --git a/tests/general_tests/qpipopt/qpipopt_conUB2.sce b/tests/general_tests/qpipopt/qpipopt_conUB2.sce new file mode 100644 index 0000000..33b3f2d --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_conUB2.sce @@ -0,0 +1,23 @@ +//Find x in R^6 such that: +// Check for the Upper Bound of the constraints which should be a column vector +conMatrix= [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'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=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) + +//Error +//qpipopt: The Upper Bound should be a column vector +//at line 218 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) diff --git a/tests/general_tests/qpipopt/qpipopt_input.sce b/tests/general_tests/qpipopt/qpipopt_input.sce new file mode 100644 index 0000000..08bd468 --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_input.sce @@ -0,0 +1,23 @@ +//Find x in R^6 such that: +// Check for the number of inputs +conMatrix= [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'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=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) + +//Error +//qpipopt: Unexpected number of input arguments : 8 provided while should be 9, 10 or 11 +//at line 91 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB) diff --git a/tests/general_tests/qpipopt/qpipopt_input2.sce b/tests/general_tests/qpipopt/qpipopt_input2.sce new file mode 100644 index 0000000..decc8a8 --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_input2.sce @@ -0,0 +1,23 @@ +//Find x in R^6 such that: +// Check if the number of input is more +conMatrix= [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'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=eye(6,5); +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,[]) + +//Error +//qpipopt: Unexpected number of input arguments : 12 provided while should be 9, 10 or 11 +//at line 91 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB) diff --git a/tests/general_tests/qpipopt/qpipopt_logical_1.sce b/tests/general_tests/qpipopt/qpipopt_logical_1.sce new file mode 100644 index 0000000..03853a7 --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_logical_1.sce @@ -0,0 +1,51 @@ +//Find x in R^6 such that: +// A simple example with constraints +conMatrix= [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'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=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) + +disp("xopt",xopt,"fopt",fopt,"exitflag",exitflag,"output",output,"lambda",lambda) + +//Output +// +//Optimal Solution Found. +// +// lower: [1x6 constant] +// upper: [1x6 constant] +// constraint: [1x5 constant] +// +// 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/qpipopt/qpipopt_logical_2.sce b/tests/general_tests/qpipopt/qpipopt_logical_2.sce new file mode 100644 index 0000000..933508b --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_logical_2.sce @@ -0,0 +1,42 @@ + +// A simple example without constraints +conMatrix= []; +conLB=[]; +conUB = []; +lb=[]; +ub=[]; +p=[2 -35 -47]'; +Q =[5 -2 -1; -2 4 3; -1 3 5]; +nbVar = 3; +nbCon = 0; +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB) +disp("xopt",xopt,"fopt",fopt,"exitflag",exitflag,"output",output,"lambda",lambda) + + +//Output +// +//Optimal Solution Found. +// +// lower: [0,0,0] +// upper: [0,0,0] +// constraint: [0x0 constant] +// +// lambda +// +// Iterations: 1 +// +// output +// +// 0 +// +// exitflag +// +// - 249. +// +// fopt +// +// 3. +// 5. +// 7. +// +// xopt diff --git a/tests/general_tests/qpipopt/qpipopt_options1.sce b/tests/general_tests/qpipopt/qpipopt_options1.sce new file mode 100644 index 0000000..6cebc51 --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_options1.sce @@ -0,0 +1,23 @@ +//Find x in R^6 such that: +//Check if the user gives uneven number of parameters +conMatrix= [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'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=eye(6,6); +nbVar = 6; +nbCon = 5; +x0 = repmat(0,nbVar,1); +param = list("MaxIter", "CpuTime", 100); +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) + +//Error +//qpipopt: Size of parameters should be even +//at line 120 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) diff --git a/tests/general_tests/qpipopt/qpipopt_options2.sce b/tests/general_tests/qpipopt/qpipopt_options2.sce new file mode 100644 index 0000000..ba5208b --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_options2.sce @@ -0,0 +1,23 @@ +//Find x in R^6 such that: +// Check if the user gives different parameter other than predefined +conMatrix= [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'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=eye(6,6); +nbVar = 6; +nbCon = 5; +x0 = repmat(0,nbVar,1); +param = list("MaxIter", 300, "Time", 100); +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) + +//Error +//qpipopt: Unrecognized parameter name 'Time'. +//at line 137 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) diff --git a/tests/general_tests/qpipopt/qpipopt_options3.sce b/tests/general_tests/qpipopt/qpipopt_options3.sce new file mode 100644 index 0000000..b267d77 --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_options3.sce @@ -0,0 +1,23 @@ +//Find x in R^6 such that: +// Check if the user for a list for the param +conMatrix= [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'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=eye(6,6); +nbVar = 6; +nbCon = 5; +x0 = repmat(0,nbVar,1); +param = ["MaxIter", "CpuTime"]; +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) + +//Error +//qpipopt: param should be a list +//at line 120 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) diff --git a/tests/general_tests/qpipopt/qpipopt_p1.sce b/tests/general_tests/qpipopt/qpipopt_p1.sce new file mode 100644 index 0000000..2e9ed37 --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_p1.sce @@ -0,0 +1,23 @@ +//Find x in R^6 such that: +// Check if the user gives unequal size of 'p' as of the number of variables +conMatrix= [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'*Q*x + p'*x with +p=[1; 2; 3; 4; 5]; Q=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) + +//Error +//qpipopt: The Size of p is not equal to the number of variables +//at line 168 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) diff --git a/tests/general_tests/qpipopt/qpipopt_p2.sce b/tests/general_tests/qpipopt/qpipopt_p2.sce new file mode 100644 index 0000000..2e9ed37 --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_p2.sce @@ -0,0 +1,23 @@ +//Find x in R^6 such that: +// Check if the user gives unequal size of 'p' as of the number of variables +conMatrix= [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'*Q*x + p'*x with +p=[1; 2; 3; 4; 5]; Q=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) + +//Error +//qpipopt: The Size of p is not equal to the number of variables +//at line 168 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) diff --git a/tests/general_tests/qpipopt/qpipopt_x0.sce b/tests/general_tests/qpipopt/qpipopt_x0.sce new file mode 100644 index 0000000..ef69b3d --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_x0.sce @@ -0,0 +1,23 @@ +//Find x in R^6 such that: +// Check if the user gives initial guess matrix as a row vector +conMatrix= [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'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=eye(6,6); +nbVar = 6; +nbCon = 5; +x0 = repmat(0,1,nbVar); +param = list("MaxIter", 300, "CpuTime", 100); +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) + +//Error +//qpipopt: The initial guess should be a column vector +//at line 228 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) diff --git a/tests/general_tests/qpipopt/qpipopt_x01.sce b/tests/general_tests/qpipopt/qpipopt_x01.sce new file mode 100644 index 0000000..6a57269 --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_x01.sce @@ -0,0 +1,43 @@ +//Find x in R^6 such that: +// Check if the user gives unequal size of initial guess as of the number of variables +conMatrix= [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'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=eye(6,6); +nbVar = 6; +nbCon = 5; +x0 = repmat(0,5,1); +param = list("MaxIter", 300, "CpuTime", 100); +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) + +//Error +// WARNING: qpipopt: Ignoring initial guess of variables as it is not equal to the number of variables +// lambda = +// +// lower: [1x6 constant] +// upper: [1x6 constant] +// constraint: [1x5 constant] +// output = +// +// Iterations: 13 +// exitflag = +// +// 0 +// fopt = +// +// - 14.843248 +// xopt = +// +// 1.7975426 +// - 0.3381487 +// 0.1633880 +// - 4.9884023 +// 0.6054943 +// - 3.1155623 diff --git a/tests/general_tests/qpipopt/qpipopt_x02.sce b/tests/general_tests/qpipopt/qpipopt_x02.sce new file mode 100644 index 0000000..52b0b89 --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_x02.sce @@ -0,0 +1,23 @@ +//Find x in R^6 such that: +// Check if the user gives unequal size of initial guess as of the number of variables +conMatrix= [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'*Q*x + p'*x with +p=[1; 2; 3; 4; 5; 6]; Q=eye(6,6); +nbVar = 6; +nbCon = 5; +x0 = repmat(0,5,1); +param = list("MaxIter", 300, "CpuTime", 100); +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) + +//Error +//qpipopt: The initial guess of variables is not equal to the number of variables +//at line 231 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) 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 diff --git a/tests/general_tests/symphony/symphony_c1.sce b/tests/general_tests/symphony/symphony_c1.sce new file mode 100644 index 0000000..7b5b7e9 --- /dev/null +++ b/tests/general_tests/symphony/symphony_c1.sce @@ -0,0 +1,33 @@ +// Check for size of Objective Coefficient +// A basic case : + +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400]'; + +// Lower Bound of variable +lb = repmat(0,8,1); + +// Upper Bound of variables +ub = [repmat(1,4,1);repmat(%inf,4,1)]; + +// Constraint Matrix +conMatrix = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +// Lower Bound of constrains +conlb = [ 25; 1.25; 1.25] + +// Upper Bound of constrains +conub = [ 25; 1.25; 1.25] + +// Row Matrix for telling symphony that the is integer or not +isInt = [repmat(%t,1,4) repmat(%f,1,4)]; + +// Calling Symphony +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) + +// Error +//Symphony: Number of variables in Objective Coefficients is not equal to number of variables given +//at line 214 of function symphony called by : +//[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) diff --git a/tests/general_tests/symphony/symphony_c2.sce b/tests/general_tests/symphony/symphony_c2.sce new file mode 100644 index 0000000..41f9720 --- /dev/null +++ b/tests/general_tests/symphony/symphony_c2.sce @@ -0,0 +1,33 @@ +// Check for size of Objective Coefficient +// A basic case : + +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400]; + +// Lower Bound of variable +lb = repmat(0,8,1); + +// Upper Bound of variables +ub = [repmat(1,4,1);repmat(%inf,4,1)]; + +// Constraint Matrix +conMatrix = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +// Lower Bound of constrains +conlb = [ 25; 1.25; 1.25] + +// Upper Bound of constrains +conub = [ 25; 1.25; 1.25] + +// Row Matrix for telling symphony that the is integer or not +isInt = [repmat(%t,1,4) repmat(%f,1,4)]; + +// Calling Symphony +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) + +// Error +//Symphony: Objective Coefficients should be a column matrix +//at line 209 of function symphony called by : +//[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) diff --git a/tests/general_tests/symphony/symphony_conlb1.sce b/tests/general_tests/symphony/symphony_conlb1.sce new file mode 100644 index 0000000..fe100e0 --- /dev/null +++ b/tests/general_tests/symphony/symphony_conlb1.sce @@ -0,0 +1,33 @@ +// Check for size of conlb +// A basic case : + +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; + +// Lower Bound of variable +lb = repmat(0,8,1); + +// Upper Bound of variables +ub = [repmat(1,4,1);repmat(%inf,4,1)]; + +// Constraint Matrix +conMatrix = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +// Lower Bound of constrains +conlb = [ 25; 1.25; ] + +// Upper Bound of constrains +conub = [ 25; 1.25; 1.25] + +// Row Matrix for telling symphony that the is integer or not +isInt = [repmat(%t,1,4) repmat(%f,1,4)]; + +// Calling Symphony +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) + +// Error +//Symphony: The Lower Bound of constraint is not equal to the number of constraint +//at line 226 of function symphony called by : +//[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) diff --git a/tests/general_tests/symphony/symphony_conlb2.sce b/tests/general_tests/symphony/symphony_conlb2.sce new file mode 100644 index 0000000..74f4af1 --- /dev/null +++ b/tests/general_tests/symphony/symphony_conlb2.sce @@ -0,0 +1,33 @@ +// Check for size of Objective Coefficient +// A basic case : + +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; + +// Lower Bound of variable +lb = repmat(0,8,1); + +// Upper Bound of variables +ub = [repmat(1,4,1);repmat(%inf,4,1)]; + +// Constraint Matrix +conMatrix = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +// Lower Bound of constrains +conlb = [ 25; 1.25; 1.25] + +// Upper Bound of constrains +conub = [ 25; 1.25;] + +// Row Matrix for telling symphony that the is integer or not +isInt = [repmat(%t,1,4) repmat(%f,1,4)]; + +// Calling Symphony +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) + +// Error +//Symphony: The Upper Bound of constraint is not equal to the number of constraint +//at line 232 of function symphony called by : +//[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) diff --git a/tests/general_tests/symphony/symphony_conmatrix1.sce b/tests/general_tests/symphony/symphony_conmatrix1.sce new file mode 100644 index 0000000..280c973 --- /dev/null +++ b/tests/general_tests/symphony/symphony_conmatrix1.sce @@ -0,0 +1,33 @@ +// Check the size for conMatrix +// A basic case : + +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; + +// Lower Bound of variable +lb = repmat(0,8,1); + +// Upper Bound of variables +ub = [repmat(1,4,1);repmat(%inf,4,1)]; + +// Constraint Matrix +conMatrix = [5,3,4,6,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08;] + +// Lower Bound of constrains +conlb = [ 25; 1.25; 1.25] + +// Upper Bound of constrains +conub = [ 25; 1.25; 1.25] + +// Row Matrix for telling symphony that the is integer or not +isInt = [repmat(%t,1,4) repmat(%f,1,4)]; + +// Calling Symphony +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) + +// Error +//Symphony: The number of columns in constraint should equal to the number of variables +//at line 244 of function symphony called by : +//[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) diff --git a/tests/general_tests/symphony/symphony_conmatrix2.sce b/tests/general_tests/symphony/symphony_conmatrix2.sce new file mode 100644 index 0000000..0091f7d --- /dev/null +++ b/tests/general_tests/symphony/symphony_conmatrix2.sce @@ -0,0 +1,32 @@ +// Check the size for conMatrix +// A basic case : + +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; + +// Lower Bound of variable +lb = repmat(0,8,1); + +// Upper Bound of variables +ub = [repmat(1,4,1);repmat(%inf,4,1)]; + +// Constraint Matrix +conMatrix = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03;] + +// Lower Bound of constrains +conlb = [ 25; 1.25; 1.25] + +// Upper Bound of constrains +conub = [ 25; 1.25; 1.25] + +// Row Matrix for telling symphony that the is integer or not +isInt = [repmat(%t,1,4) repmat(%f,1,4)]; + +// Calling Symphony +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) + +// Error +//Symphony: The number of rows in constraint should be equal to the number of constraints +//at line 238 of function symphony called by : +//[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) diff --git a/tests/general_tests/symphony/symphony_infeasible.sci b/tests/general_tests/symphony/symphony_infeasible.sci new file mode 100644 index 0000000..04fe76a --- /dev/null +++ b/tests/general_tests/symphony/symphony_infeasible.sci @@ -0,0 +1,11 @@ +// Infeasible problem +objCoef = -1 * [1 1]' +conMatrix = [-1 0; 0, -1; 1 1] +conLB = -1*[%inf %inf %inf ] +conUB = [-6 -6 11] +nbVar = 2; +nbCon = 3; +isInt = repmat(%f,1,nbVar) +LB = -1*[%inf %inf] +UB = [%inf %inf] +[xopt, fopt, exitflag, output] = symphony(nbVar,nbCon,objCoef,isInt,LB,UB,conMatrix,conLB,conUB); diff --git a/tests/general_tests/symphony/symphony_input1.sce b/tests/general_tests/symphony/symphony_input1.sce new file mode 100644 index 0000000..4168710 --- /dev/null +++ b/tests/general_tests/symphony/symphony_input1.sce @@ -0,0 +1,33 @@ +// Check for size of Objective Coefficient +// A basic case : + +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; + +// Lower Bound of variable +lb = repmat(0,8,1); + +// Upper Bound of variables +ub = [repmat(1,4,1);repmat(%inf,4,1)]; + +// Constraint Matrix +conMatrix = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +// Lower Bound of constrains +conlb = [ 25; 1.25; 1.25] + +// Upper Bound of constrains +conub = [ 25; 1.25; 1.25] + +// Row Matrix for telling symphony that the is integer or not +isInt = [repmat(%t,1,4) repmat(%f,1,4)]; + +// Calling Symphony +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub) + +// Error +//Symphony: Unexpected number of input arguments : 6 provided while should be in the set [9 10 11] +//at line 158 of function symphony called by : +//[x,f,status,output] = symphony(8,3,c,isInt,lb,ub) diff --git a/tests/general_tests/symphony/symphony_input2.sce b/tests/general_tests/symphony/symphony_input2.sce new file mode 100644 index 0000000..d4fa96b --- /dev/null +++ b/tests/general_tests/symphony/symphony_input2.sce @@ -0,0 +1,33 @@ +// Check for size of Objective Coefficient +// A basic case : + +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; + +// Lower Bound of variable +lb = repmat(0,8,1); + +// Upper Bound of variables +ub = [repmat(1,4,1);repmat(%inf,4,1)]; + +// Constraint Matrix +conMatrix = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +// Lower Bound of constrains +conlb = [ 25; 1.25; 1.25] + +// Upper Bound of constrains +conub = [ 25; 1.25; 1.25] + +// Row Matrix for telling symphony that the is integer or not +isInt = [repmat(%t,1,4) repmat(%f,1,4)]; + +// Calling Symphony +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1,[],[],[]) + +// Error +//Symphony: Unexpected number of input arguments : 13 provided while should be in the set [9 10 11] +//at line 158 of function symphony called by : +//[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1,[],[],[]) diff --git a/tests/general_tests/symphony/symphony_isInt1.sce b/tests/general_tests/symphony/symphony_isInt1.sce new file mode 100644 index 0000000..914ccb2 --- /dev/null +++ b/tests/general_tests/symphony/symphony_isInt1.sce @@ -0,0 +1,33 @@ +// Check for size of Objective Coefficient +// A basic case : + +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; + +// Lower Bound of variable +lb = repmat(0,8,1); + +// Upper Bound of variables +ub = [repmat(1,4,1);repmat(%inf,4,1)]; + +// Constraint Matrix +conMatrix = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +// Lower Bound of constrains +conlb = [ 25; 1.25; 1.25] + +// Upper Bound of constrains +conub = [ 25; 1.25; 1.25] + +// Row Matrix for telling symphony that the is integer or not +isInt = [repmat(%t,1,4) repmat(%f,1,2)]; + +// Calling Symphony +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) + +// Error +//Symphony: The size of isInt is not equal to the number of variables +//at line 220 of function symphony called by : +//[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) diff --git a/tests/general_tests/symphony/symphony_lb1.sce b/tests/general_tests/symphony/symphony_lb1.sce new file mode 100644 index 0000000..feef9ff --- /dev/null +++ b/tests/general_tests/symphony/symphony_lb1.sce @@ -0,0 +1,33 @@ +// Check for size of Objective Coefficient +// A basic case : + +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; + +// Lower Bound of variable +lb = repmat(0,8,1); + +// Upper Bound of variables +ub = [repmat(1,4,1);repmat(%inf,4,1)]; + +// Constraint Matrix +conMatrix = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +// Lower Bound of constrains +conlb = [ 25; 1.25;] + +// Upper Bound of constrains +conub = [ 25; 1.25; 1.25] + +// Row Matrix for telling symphony that the is integer or not +isInt = [repmat(%t,1,4) repmat(%f,1,4)]; + +// Calling Symphony +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) + +// Error +//Symphony: The Lower Bound of constraint is not equal to the number of constraint +//at line 226 of function symphony called by : +//[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) diff --git a/tests/general_tests/symphony/symphony_logical1.sce b/tests/general_tests/symphony/symphony_logical1.sce new file mode 100644 index 0000000..1f728c8 --- /dev/null +++ b/tests/general_tests/symphony/symphony_logical1.sce @@ -0,0 +1,61 @@ +// Check for size of Objective Coefficient +// A basic case : + +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; + +// Lower Bound of variable +lb = repmat(0,8,1); + +// Upper Bound of variables +ub = [repmat(1,4,1);repmat(%inf,4,1)]; + +// Constraint Matrix +conMatrix = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +// Lower Bound of constrains +conlb = [ 25; 1.25; 1.25] + +// Upper Bound of constrains +conub = [ 25; 1.25; 1.25] + +// Row Matrix for telling symphony that the is integer or not +isInt = [repmat(%t,1,4) repmat(%f,1,4)]; + +// Calling Symphony +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) +disp("x",x,"f",f,"status",status,"output",output); + +// Output +//Problem loaded into environment. +// +//Note: There is no limit on time. +// +//An optimal solution has been found. +// +// 0. +// +// Iterations: 1 +// +// output +// +// 227. +// +// status +// +// 8495. +// +// f +// +// 1. +// 1. +// 0. +// 1. +// 7.25 +// 0. +// 0.25 +// 3.5 +// +// x diff --git a/tests/general_tests/symphony/symphony_logical2.sce b/tests/general_tests/symphony/symphony_logical2.sce new file mode 100644 index 0000000..4666fdc --- /dev/null +++ b/tests/general_tests/symphony/symphony_logical2.sce @@ -0,0 +1,56 @@ +// Check for size of Objective Coefficient +// A basic case : + +// Objective function +c = [20,10,15]'; + +// Lower Bound of variable +lb = repmat(0,3,1); + +// Upper Bound of variables +ub = repmat(%inf,3,1); + +// Constraint Matrix +conMatrix = [3,2,5; + 2,1,1; + 1,1,3; + 5,2,4] + +// Lower Bound of constrains +conlb = repmat(-%inf,4,1) + +// Upper Bound of constrains +conub = [ 55;26;30;57] + +// Row Matrix for telling symphony that the is integer or not +isInt = [repmat(%f,1,3)]; + +// Calling Symphony +[x,f,status,output] = symphony(3,4,c,isInt,lb,ub,conMatrix,conlb,conub,-1) +disp("x",x,"f",f,"status",status,"output",output); +// Output +//Problem loaded into environment. +// +//Note: There is no limit on time. +// +//An optimal solution has been found. +// +// 0. +// +// Iterations: 1 +// +// output +// +// 227. +// +// status +// +// 268. +// +// f +// +// 1.8 +// 20.8 +// 1.6 +// +// x diff --git a/tests/general_tests/symphony/symphony_ub1.sce b/tests/general_tests/symphony/symphony_ub1.sce new file mode 100644 index 0000000..74f4af1 --- /dev/null +++ b/tests/general_tests/symphony/symphony_ub1.sce @@ -0,0 +1,33 @@ +// Check for size of Objective Coefficient +// A basic case : + +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; + +// Lower Bound of variable +lb = repmat(0,8,1); + +// Upper Bound of variables +ub = [repmat(1,4,1);repmat(%inf,4,1)]; + +// Constraint Matrix +conMatrix = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +// Lower Bound of constrains +conlb = [ 25; 1.25; 1.25] + +// Upper Bound of constrains +conub = [ 25; 1.25;] + +// Row Matrix for telling symphony that the is integer or not +isInt = [repmat(%t,1,4) repmat(%f,1,4)]; + +// Calling Symphony +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) + +// Error +//Symphony: The Upper Bound of constraint is not equal to the number of constraint +//at line 232 of function symphony called by : +//[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) diff --git a/tests/general_tests/symphonymat/symphonymat_b1.sce b/tests/general_tests/symphonymat/symphonymat_b1.sce new file mode 100644 index 0000000..68975c3 --- /dev/null +++ b/tests/general_tests/symphonymat/symphonymat_b1.sce @@ -0,0 +1,26 @@ +// Check for size of Objective Coefficients +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; + +// Lower Bound of variable +lb = repmat(0,1,8); + +// Upper Bound of variables +ub = [repmat(1,1,4) repmat(%inf,1,4)]; + +// Constraint Matrix +Aeq = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +beq = [ 25, 1.25] + +intcon = [1 2 3 4]; + +// Calling Symphony +[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub) + +//Error +//Symphonymat: The equality constraint upper bound is not equal to the number of equality constraint +//at line 239 of function symphonymat called by : +//[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub) diff --git a/tests/general_tests/symphonymat/symphonymat_c1.sce b/tests/general_tests/symphonymat/symphonymat_c1.sce new file mode 100644 index 0000000..6b8d5f8 --- /dev/null +++ b/tests/general_tests/symphonymat/symphonymat_c1.sce @@ -0,0 +1,26 @@ +// Check for size of Objective Coefficients +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]; + +// Lower Bound of variable +lb = repmat(0,1,8); + +// Upper Bound of variables +ub = [repmat(1,1,4) repmat(%inf,1,4)]; + +// Constraint Matrix +Aeq = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +beq = [ 25, 1.25, 1.25] + +intcon = [1 2 3 4]; + +// Calling Symphony +[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub) + +//Error +//Symphonymat: Objective Coefficients should be a column matrix +//at line 160 of function symphonymat called by : +//[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub) diff --git a/tests/general_tests/symphonymat/symphonymat_infeasible.sce b/tests/general_tests/symphonymat/symphonymat_infeasible.sce new file mode 100644 index 0000000..ed393e9 --- /dev/null +++ b/tests/general_tests/symphonymat/symphonymat_infeasible.sce @@ -0,0 +1,5 @@ +// Infeasible problem +C = -1 * [1 1]' +A = [-1 0; 0, -1; 1 1] +b = [-6 -6 11] +[xopt, fopt, exitflag, output] = symphonymat(C,1,A,b); diff --git a/tests/general_tests/symphonymat/symphonymat_input1.sce b/tests/general_tests/symphonymat/symphonymat_input1.sce new file mode 100644 index 0000000..b5ee515 --- /dev/null +++ b/tests/general_tests/symphonymat/symphonymat_input1.sce @@ -0,0 +1,26 @@ +// Check for size of input for symphony +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; + +// Lower Bound of variable +lb = repmat(0,1,8); + +// Upper Bound of variables +ub = [repmat(1,1,4) repmat(%inf,1,4)]; + +// Constraint Matrix +Aeq = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +beq = [ 25, 1.25, 1.25] + +intcon = [1 2 3 4]; + +// Calling Symphony +[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub,[],[]) + +//Error +//Symphony: Unexpected number of input arguments : 10 provided while should be in the set [4 6 8 9] +//at line 149 of function symphonymat called by : +//[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub,[],[]) diff --git a/tests/general_tests/symphonymat/symphonymat_input2.sce b/tests/general_tests/symphonymat/symphonymat_input2.sce new file mode 100644 index 0000000..4be6d87 --- /dev/null +++ b/tests/general_tests/symphonymat/symphonymat_input2.sce @@ -0,0 +1,26 @@ +// Check for size of input for symphony +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; + +// Lower Bound of variable +lb = repmat(0,1,8); + +// Upper Bound of variables +ub = [repmat(1,1,4) repmat(%inf,1,4)]; + +// Constraint Matrix +Aeq = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +beq = [ 25, 1.25, 1.25] + +intcon = [1 2 3 4]; + +// Calling Symphony +[x,f,status,output] = symphonymat(c,intcon) + +//Error +//Symphony: Unexpected number of input arguments : 2 provided while should be in the set [4 6 8 9] +//at line 149 of function symphonymat called by : +//[x,f,status,output] = symphonymat(c,intcon) diff --git a/tests/general_tests/symphonymat/symphonymat_intcon1.sce b/tests/general_tests/symphonymat/symphonymat_intcon1.sce new file mode 100644 index 0000000..0c24f4c --- /dev/null +++ b/tests/general_tests/symphonymat/symphonymat_intcon1.sce @@ -0,0 +1,26 @@ +// Check for size of Objective Coefficients +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; + +// Lower Bound of variable +lb = repmat(0,1,8); + +// Upper Bound of variables +ub = [repmat(1,1,4) repmat(%inf,1,4)]; + +// Constraint Matrix +Aeq = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +beq = [ 25, 1.25, 1.25] + +intcon = [1 2 3 10]; + +// Calling Symphony +[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub) + +//Error +//Symphonymat: Objective Coefficients should be a column matrix +//at line 160 of function symphonymat called by : +//[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub) diff --git a/tests/general_tests/symphonymat/symphonymat_intcon2.sce b/tests/general_tests/symphonymat/symphonymat_intcon2.sce new file mode 100644 index 0000000..47b7572 --- /dev/null +++ b/tests/general_tests/symphonymat/symphonymat_intcon2.sce @@ -0,0 +1,26 @@ +// Check for size of Objective Coefficients +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; + +// Lower Bound of variable +lb = repmat(0,1,8); + +// Upper Bound of variables +ub = [repmat(1,1,4) repmat(%inf,1,4)]; + +// Constraint Matrix +Aeq = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +beq = [ 25, 1.25, 1.25] + +intcon = [1 2 3 -10]; + +// Calling Symphony +[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub) + +//Error +//Symphonymat: The values inside intcon should be greater than 0 +//at line 218 of function symphonymat called by : +//[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub) diff --git a/tests/general_tests/symphonymat/symphonymat_intcon3.sce b/tests/general_tests/symphonymat/symphonymat_intcon3.sce new file mode 100644 index 0000000..e644967 --- /dev/null +++ b/tests/general_tests/symphonymat/symphonymat_intcon3.sce @@ -0,0 +1,26 @@ +// Check if the user have given floating value in intcon +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; + +// Lower Bound of variable +lb = repmat(0,1,8); + +// Upper Bound of variables +ub = [repmat(1,1,4) repmat(%inf,1,4)]; + +// Constraint Matrix +Aeq = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +beq = [ 25, 1.25, 1.25] + +intcon = [1 2 3.5 4]; + +// Calling Symphony +[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub) + +//Error +//Symphonymat: The values inside intcon should be integer +//at line 223 of function symphonymat called by : +//[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub) diff --git a/tests/general_tests/symphonymat/symphonymat_lb1.sce b/tests/general_tests/symphonymat/symphonymat_lb1.sce new file mode 100644 index 0000000..f9a4b29 --- /dev/null +++ b/tests/general_tests/symphonymat/symphonymat_lb1.sce @@ -0,0 +1,26 @@ +// Check for size of lower bound +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; + +// Lower Bound of variable +lb = repmat(0,1,5); + +// Upper Bound of variables +ub = [repmat(1,1,4) repmat(%inf,1,4)]; + +// Constraint Matrix +Aeq = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +beq = [ 25, 1.25, 1.25] + +intcon = [1 2 3 4]; + +// Calling Symphony +[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub) + +//Error +//Symphonymat: The Lower Bound is not equal to the number of variables +//at line 245 of function symphonymat called by : +//[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub) diff --git a/tests/general_tests/symphonymat/symphonymat_logical1.sce b/tests/general_tests/symphonymat/symphonymat_logical1.sce new file mode 100644 index 0000000..70ad9f8 --- /dev/null +++ b/tests/general_tests/symphonymat/symphonymat_logical1.sce @@ -0,0 +1,55 @@ +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; + +// Lower Bound of variable +lb = repmat(0,1,8)'; + +// Upper Bound of variables +ub = [repmat(1,1,4) repmat(%inf,1,4)]'; + +// Constraint Matrix +Aeq = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +beq = [ 25, 1.25, 1.25;]' + +intcon = [1 2 3 4 4]; + +options = list("time_limit",250); + +// Calling Symphony +[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub,options) +disp("x",x,"f",f,"status",status,"output",output); +//Output +//setting of double parameter function executed successfully +//Problem loaded into environment. +// +//Note: Time limit has been set to 250.000000. +// +//An optimal solution has been found. +// +// 0. +// +// Iterations: 1 +// +// output +// +// 227. +// +// status +// +// 8495. +// +// f +// +// 1. +// 1. +// 0. +// 1. +// 7.25 +// 0. +// 0.25 +// 3.5 +// +// x diff --git a/tests/general_tests/symphonymat/symphonymat_logical2.sce b/tests/general_tests/symphonymat/symphonymat_logical2.sce new file mode 100644 index 0000000..6bdd1b3 --- /dev/null +++ b/tests/general_tests/symphonymat/symphonymat_logical2.sce @@ -0,0 +1,53 @@ +// Check for size of Objective Coefficient +// 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 = []; + +// Calling Symphony +[x,f,status,output] = symphonymat(c,intcon,A,b,[],[],lb,ub) +disp("x",x,"f",f,"status",status,"output",output); +// Output +//Problem loaded into environment. +// +//Note: There is no limit on time. +// +//An optimal solution has been found. +// +// 0. +// +// Iterations: 1 +// +// output +// +// 227. +// +// status +// +// - 268. +// +// f +// +// 1.8 +// 20.8 +// 1.6 +// +// x diff --git a/tests/general_tests/symphonymat/symphonymat_options1.sce b/tests/general_tests/symphonymat/symphonymat_options1.sce new file mode 100644 index 0000000..8da8547 --- /dev/null +++ b/tests/general_tests/symphonymat/symphonymat_options1.sce @@ -0,0 +1,28 @@ +// Check for size of input of options +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; + +// Lower Bound of variable +lb = repmat(0,1,8); + +// Upper Bound of variables +ub = [repmat(1,1,4) repmat(%inf,1,4)]; + +// Constraint Matrix +Aeq = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +beq = [ 25, 1.25, 1.25] + +intcon = [1 2 3 4]; + +options = list("time_limit"); + +// Calling Symphony +[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub,options) + +//Error +//Symphonymat: Size of parameters should be even +//at line 272 of function symphonymat called by : +//[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub,options) diff --git a/tests/general_tests/symphonymat/symphonymat_options2.sce b/tests/general_tests/symphonymat/symphonymat_options2.sce new file mode 100644 index 0000000..89d3e14 --- /dev/null +++ b/tests/general_tests/symphonymat/symphonymat_options2.sce @@ -0,0 +1,28 @@ +// Check for the type of option +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; + +// Lower Bound of variable +lb = repmat(0,1,8); + +// Upper Bound of variables +ub = [repmat(1,1,4) repmat(%inf,1,4)]; + +// Constraint Matrix +Aeq = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +beq = [ 25, 1.25, 1.25] + +intcon = [1 2 3 4]; + +options = ["time_limit" 250]; + +// Calling Symphony +[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub,options) + +//Error +//Symphonymat: Options should be a list +//at line 266 of function symphonymat called by : +//[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub,options) diff --git a/tests/general_tests/symphonymat/symphonymat_ub1.sce b/tests/general_tests/symphonymat/symphonymat_ub1.sce new file mode 100644 index 0000000..fdf345a --- /dev/null +++ b/tests/general_tests/symphonymat/symphonymat_ub1.sce @@ -0,0 +1,26 @@ +// Check for size of lower bound +// Objective function +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; + +// Lower Bound of variable +lb = repmat(0,1,8); + +// Upper Bound of variables +ub = [repmat(1,1,2) repmat(%inf,1,4)]; + +// Constraint Matrix +Aeq = [5,3,4,6,1,1,1,1; +5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; +5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] + +beq = [ 25, 1.25, 1.25] + +intcon = [1 2 3 4]; + +// Calling Symphony +[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub) + +//Error +//Symphonymat: The Upper Bound is not equal to the number of variables +//at line 251 of function symphonymat called by : +//[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub) |