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 /tests/general_tests/symphonymat | |
parent | b4fe1077092f3dc1c1d965e938b00e0a0d0694d0 (diff) | |
download | FOSSEE-Optimization-toolbox-0eee95dfb1edec6ce52ec3065a3adb1bf169c9f9.tar.gz FOSSEE-Optimization-toolbox-0eee95dfb1edec6ce52ec3065a3adb1bf169c9f9.tar.bz2 FOSSEE-Optimization-toolbox-0eee95dfb1edec6ce52ec3065a3adb1bf169c9f9.zip |
general tests added
Diffstat (limited to 'tests/general_tests/symphonymat')
14 files changed, 403 insertions, 0 deletions
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) |