diff options
author | Harpreet | 2015-12-29 00:38:48 +0530 |
---|---|---|
committer | Harpreet | 2015-12-29 00:38:48 +0530 |
commit | eb9ca1191c94059cd7adcf69805906c809fe9712 (patch) | |
tree | f98e728341812b8a0eb46aa4159b062a22225f05 /tests | |
parent | 0eee95dfb1edec6ce52ec3065a3adb1bf169c9f9 (diff) | |
download | FOSSEE-Optimization-toolbox-eb9ca1191c94059cd7adcf69805906c809fe9712.tar.gz FOSSEE-Optimization-toolbox-eb9ca1191c94059cd7adcf69805906c809fe9712.tar.bz2 FOSSEE-Optimization-toolbox-eb9ca1191c94059cd7adcf69805906c809fe9712.zip |
Bugs fixed 4
Diffstat (limited to 'tests')
94 files changed, 1140 insertions, 366 deletions
diff --git a/tests/general_tests/lsqlin/lsqlin_A1.sce b/tests/general_tests/lsqlin/lsqlin_A1.sce new file mode 100644 index 0000000..ba9b5be --- /dev/null +++ b/tests/general_tests/lsqlin/lsqlin_A1.sce @@ -0,0 +1,25 @@ +// Check for elements in A +C = [0.9501 0.7620 0.6153 0.4057 + 0.2311 0.4564 0.7919 0.9354 + 0.6068 0.0185 0.9218 0.9169 + 0.4859 0.8214 0.7382 0.4102 + 0.8912 0.4447 0.1762 0.8936]; +d = [0.0578 + 0.3528 + 0.8131 + 0.0098 + 0.1388]; +A = [0.2027 0.2721 0.7467 0.4659 0 + 0.1987 0.1988 0.4450 0.4186 0 + 0.6037 0.0152 0.9318 0.8462 0]; +b = [0.5251 + 0.2026 + 0.6721]; + +//Error +//lsqlin: The number of columns in A must be the same as the number of elements of d +//at line 213 of function lsqlin called by : +//[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b) + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b) + diff --git a/tests/general_tests/lsqlin/lsqlin_Aeq1.sce b/tests/general_tests/lsqlin/lsqlin_Aeq1.sce new file mode 100644 index 0000000..458cbb0 --- /dev/null +++ b/tests/general_tests/lsqlin/lsqlin_Aeq1.sce @@ -0,0 +1,25 @@ +// Check for elements in Aeq +C = [0.9501 0.7620 0.6153 0.4057 + 0.2311 0.4564 0.7919 0.9354 + 0.6068 0.0185 0.9218 0.9169 + 0.4859 0.8214 0.7382 0.4102 + 0.8912 0.4447 0.1762 0.8936]; +d = [0.0578 + 0.3528 + 0.8131 + 0.0098 + 0.1388]; +Aeq = [0.2027 0.2721 0.7467 0.4659 0 + 0.1987 0.1988 0.4450 0.4186 0 + 0.6037 0.0152 0.9318 0.8462 0]; +beq = [0.5251 + 0.2026 + 0.6721]; + +//Error +//lsqlin: The number of columns in Aeq must be the same as the number of elements of d +//at line 219 of function lsqlin called by : +//[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,[],[],Aeq,beq) + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,[],[],Aeq,beq) + diff --git a/tests/general_tests/lsqlin/lsqlin_C1.sce b/tests/general_tests/lsqlin/lsqlin_C1.sce new file mode 100644 index 0000000..55fe976 --- /dev/null +++ b/tests/general_tests/lsqlin/lsqlin_C1.sce @@ -0,0 +1,26 @@ +// Check for elements in C and d +C = [0.9501 0.7620 0.6153 0.4057 + 0.2311 0.4564 0.7919 0.9354 + 0.6068 0.0185 0.9218 0.9169 + 0.4859 0.8214 0.7382 0.4102 + 0.8912 0.4447 0.1762 0.8936]; +d = [0.0578 + 0.3528 + 0.8131 + 0.0098 + 0.1388 + 0.2536]; +A = [0.2027 0.2721 0.7467 0.4659 + 0.1987 0.1988 0.4450 0.4186 + 0.6037 0.0152 0.9318 0.8462]; +b = [0.5251 + 0.2026 + 0.6721]; + +//Error +//lsqlin: The number of rows in C must be equal the number of elements of d +//at line 207 of function lsqlin called by : +//[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b) + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b) + diff --git a/tests/general_tests/lsqlin/lsqlin_b1.sce b/tests/general_tests/lsqlin/lsqlin_b1.sce new file mode 100644 index 0000000..49b6dec --- /dev/null +++ b/tests/general_tests/lsqlin/lsqlin_b1.sce @@ -0,0 +1,23 @@ +// Check for elements in b +C = [0.9501 0.7620 0.6153 0.4057 + 0.2311 0.4564 0.7919 0.9354 + 0.6068 0.0185 0.9218 0.9169 + 0.4859 0.8214 0.7382 0.4102 + 0.8912 0.4447 0.1762 0.8936]; +d = [0.0578 + 0.3528 + 0.8131 + 0.0098 + 0.1388]; +A = [0.2027 0.2721 0.7467 0.4659 + 0.1987 0.1988 0.4450 0.4186 + 0.6037 0.0152 0.9318 0.8462]; +b = [-%inf -%inf -%inf]; + +//Error +//lsqlin: Value of b can not be negative infinity +//at line 286 of function lsqlin called by : +//[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b) + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b) + diff --git a/tests/general_tests/lsqlin/lsqlin_beq1.sce b/tests/general_tests/lsqlin/lsqlin_beq1.sce new file mode 100644 index 0000000..b71486e --- /dev/null +++ b/tests/general_tests/lsqlin/lsqlin_beq1.sce @@ -0,0 +1,23 @@ +// Check for elements in beq +C = [0.9501 0.7620 0.6153 0.4057 + 0.2311 0.4564 0.7919 0.9354 + 0.6068 0.0185 0.9218 0.9169 + 0.4859 0.8214 0.7382 0.4102 + 0.8912 0.4447 0.1762 0.8936]; +d = [0.0578 + 0.3528 + 0.8131 + 0.0098 + 0.1388]; +Aeq = [0.2027 0.2721 0.7467 0.4659 + 0.1987 0.1988 0.4450 0.4186 + 0.6037 0.0152 0.9318 0.8462]; +beq = [-%inf -%inf -%inf]; + +//Error +//lsqlin: Value of beq can not be negative infinity +//at line 293 of function lsqlin called by : +//[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,[],[],Aeq,beq) + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,[],[],Aeq,beq) + diff --git a/tests/general_tests/lsqlin/lsqlin_infeasible1.sce b/tests/general_tests/lsqlin/lsqlin_infeasible1.sce new file mode 100644 index 0000000..a66dd0f --- /dev/null +++ b/tests/general_tests/lsqlin/lsqlin_infeasible1.sce @@ -0,0 +1,43 @@ +// Check for the infeasible problem +C = [0.9501 0.7620 0.6153 0.4057 + 0.2311 0.4564 0.7919 0.9354 + 0.6068 0.0185 0.9218 0.9169 + 0.4859 0.8214 0.7382 0.4102 + 0.8912 0.4447 0.1762 0.8936]; +d = [0.0578 + 0.3528 + 0.8131 + 0.0098 + 0.1388]; +Aeq = [-1 0 0 0; 0 -1 0 0; 1 1 0 0 ]; +beq = [-6 -6 11]; + +//Converged to a point of local infeasibility. +// lambda = +// +// lower: [0x0 constant] +// upper: [0x0 constant] +// eqlin: [0x0 constant] +// ineqlin: [0x0 constant] +// output = +// +// Iterations: 0 +// exitflag = +// +// 5 +// residual = +// +// 0.0578 +// 0.3528 +// 0.8131 +// 0.0098 +// 0.1388 +// resnorm = +// +// 0.8083018 +// xopt = +// +// [] + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,[],[],Aeq,beq) + diff --git a/tests/general_tests/lsqlin/lsqlin_input1.sce b/tests/general_tests/lsqlin/lsqlin_input1.sce new file mode 100644 index 0000000..7521f61 --- /dev/null +++ b/tests/general_tests/lsqlin/lsqlin_input1.sce @@ -0,0 +1,25 @@ +// Check for the input arguments +C = [0.9501 0.7620 0.6153 0.4057 + 0.2311 0.4564 0.7919 0.9354 + 0.6068 0.0185 0.9218 0.9169 + 0.4859 0.8214 0.7382 0.4102 + 0.8912 0.4447 0.1762 0.8936]; +d = [0.0578 + 0.3528 + 0.8131 + 0.0098 + 0.1388]; +A = [0.2027 0.2721 0.7467 0.4659 + 0.1987 0.1988 0.4450 0.4186 + 0.6037 0.0152 0.9318 0.8462]; +b = [0.5251 + 0.2026 + 0.6721]; + +//Error +//lsqlin: Unexpected number of input arguments : 2 provided while should be in the set of [4 6 8 9 10] +//at line 99 of function lsqlin called by : +//[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d) + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d) + diff --git a/tests/general_tests/lsqlin/lsqlin_input2.sce b/tests/general_tests/lsqlin/lsqlin_input2.sce new file mode 100644 index 0000000..9826583 --- /dev/null +++ b/tests/general_tests/lsqlin/lsqlin_input2.sce @@ -0,0 +1,25 @@ +// Check for the input arguments +C = [0.9501 0.7620 0.6153 0.4057 + 0.2311 0.4564 0.7919 0.9354 + 0.6068 0.0185 0.9218 0.9169 + 0.4859 0.8214 0.7382 0.4102 + 0.8912 0.4447 0.1762 0.8936]; +d = [0.0578 + 0.3528 + 0.8131 + 0.0098 + 0.1388]; +A = [0.2027 0.2721 0.7467 0.4659 + 0.1987 0.1988 0.4450 0.4186 + 0.6037 0.0152 0.9318 0.8462]; +b = [0.5251 + 0.2026 + 0.6721]; + +//Error +//lsqlin: Unexpected number of input arguments : 14 provided while should be in the set of [4 6 8 9 10] +//at line 99 of function lsqlin called by : +//[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,[],[],[],[],[],[],[],[],[],[]) + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,[],[],[],[],[],[],[],[],[],[]) + diff --git a/tests/general_tests/lsqlin/lsqlin_logical1.sce b/tests/general_tests/lsqlin/lsqlin_logical1.sce new file mode 100644 index 0000000..bc0dc06 --- /dev/null +++ b/tests/general_tests/lsqlin/lsqlin_logical1.sce @@ -0,0 +1,52 @@ +// Check for elements in A +C = [0.9501 0.7620 0.6153 0.4057 + 0.2311 0.4564 0.7919 0.9354 + 0.6068 0.0185 0.9218 0.9169 + 0.4859 0.8214 0.7382 0.4102 + 0.8912 0.4447 0.1762 0.8936]; +d = [0.0578 + 0.3528 + 0.8131 + 0.0098 + 0.1388]; +A = [0.2027 0.2721 0.7467 0.4659 + 0.1987 0.1988 0.4450 0.4186 + 0.6037 0.0152 0.9318 0.8462]; +b = [0.5251 + 0.2026 + 0.6721]; + +// Output +//Optimal Solution Found. +// lambda = +// +// lower: [0,0,0,0] +// upper: [0,0,0,0] +// eqlin: [0x0 constant] +// ineqlin: [8.697D-11,0.0925859,0.1118582] +// output = +// +// Iterations: 7 +// exitflag = +// +// 0 +// residual = +// +// 0.0126031 +// 0.0208054 +// 0.1295085 +// 0.0057397 +// - 0.0137246 +// resnorm = +// +// 0.0175855 +// xopt = +// +// 0.1298639 +// - 0.5756958 +// 0.4251033 +// 0.2438436 + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b) + + diff --git a/tests/general_tests/lsqlin/lsqlin_param1.sce b/tests/general_tests/lsqlin/lsqlin_param1.sce new file mode 100644 index 0000000..a9d24bc --- /dev/null +++ b/tests/general_tests/lsqlin/lsqlin_param1.sce @@ -0,0 +1,26 @@ +// Check for the param to be a list +C = [0.9501 0.7620 0.6153 0.4057 + 0.2311 0.4564 0.7919 0.9354 + 0.6068 0.0185 0.9218 0.9169 + 0.4859 0.8214 0.7382 0.4102 + 0.8912 0.4447 0.1762 0.8936]; +d = [0.0578 + 0.3528 + 0.8131 + 0.0098 + 0.1388]; +A = [0.2027 0.2721 0.7467 0.4659 + 0.1987 0.1988 0.4450 0.4186 + 0.6037 0.0152 0.9318 0.8462]; +b = [0.5251 + 0.2026 + 0.6721]; +param = 0; + +//Error +//lsqlin: param should be a list +//at line 147 of function lsqlin called by : +//[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,[],[],[],[],[],0) + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,[],[],[],[],[],param) + diff --git a/tests/general_tests/lsqlin/lsqlin_param2.sce b/tests/general_tests/lsqlin/lsqlin_param2.sce new file mode 100644 index 0000000..bb7cffa --- /dev/null +++ b/tests/general_tests/lsqlin/lsqlin_param2.sce @@ -0,0 +1,26 @@ +// Check for the param to be even in number +C = [0.9501 0.7620 0.6153 0.4057 + 0.2311 0.4564 0.7919 0.9354 + 0.6068 0.0185 0.9218 0.9169 + 0.4859 0.8214 0.7382 0.4102 + 0.8912 0.4447 0.1762 0.8936]; +d = [0.0578 + 0.3528 + 0.8131 + 0.0098 + 0.1388]; +A = [0.2027 0.2721 0.7467 0.4659 + 0.1987 0.1988 0.4450 0.4186 + 0.6037 0.0152 0.9318 0.8462]; +b = [0.5251 + 0.2026 + 0.6721]; +param = list("MaxIter"); + +//Error +//lsqlin: Size of parameters should be even +//at line 153 of function lsqlin called by : +//[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,[],[],[],[],[],param) + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,[],[],[],[],[],param) + diff --git a/tests/general_tests/lsqlin/lsqlin_param3.sce b/tests/general_tests/lsqlin/lsqlin_param3.sce new file mode 100644 index 0000000..60e960d --- /dev/null +++ b/tests/general_tests/lsqlin/lsqlin_param3.sce @@ -0,0 +1,26 @@ +// Check for the param to be even in number +C = [0.9501 0.7620 0.6153 0.4057 + 0.2311 0.4564 0.7919 0.9354 + 0.6068 0.0185 0.9218 0.9169 + 0.4859 0.8214 0.7382 0.4102 + 0.8912 0.4447 0.1762 0.8936]; +d = [0.0578 + 0.3528 + 0.8131 + 0.0098 + 0.1388]; +A = [0.2027 0.2721 0.7467 0.4659 + 0.1987 0.1988 0.4450 0.4186 + 0.6037 0.0152 0.9318 0.8462]; +b = [0.5251 + 0.2026 + 0.6721]; +param = list("Iter",300); + +//Error +//lsqlin: Unrecognized parameter name 'Iter'. +//at line 180 of function lsqlin called by : +//[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,[],[],[],[],[],param) + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,[],[],[],[],[],param) + diff --git a/tests/general_tests/lsqlin/lsqlin_x01.sce b/tests/general_tests/lsqlin/lsqlin_x01.sce new file mode 100644 index 0000000..3b0f6f9 --- /dev/null +++ b/tests/general_tests/lsqlin/lsqlin_x01.sce @@ -0,0 +1,54 @@ +// Check for elements in A +C = [0.9501 0.7620 0.6153 0.4057 + 0.2311 0.4564 0.7919 0.9354 + 0.6068 0.0185 0.9218 0.9169 + 0.4859 0.8214 0.7382 0.4102 + 0.8912 0.4447 0.1762 0.8936]; +d = [0.0578 + 0.3528 + 0.8131 + 0.0098 + 0.1388]; +A = [0.2027 0.2721 0.7467 0.4659 + 0.1987 0.1988 0.4450 0.4186 + 0.6037 0.0152 0.9318 0.8462]; +b = [0.5251 + 0.2026 + 0.6721]; +x0 = [0 0 0]; + +//WARNING: lsqlin: Ignoring initial guess of variables as it is not equal to the number of variables + +//Optimal Solution Found. +// lambda = +// +// lower: [0,0,0,0] +// upper: [0,0,0,0] +// eqlin: [0x0 constant] +// ineqlin: [8.697D-11,0.0925859,0.1118582] +// output = +// +// Iterations: 7 +// exitflag = +// +// 0 +// residual = +// +// 0.0126031 +// 0.0208054 +// 0.1295085 +// 0.0057397 +// - 0.0137246 +// resnorm = +// +// 0.0175855 +// xopt = +// +// 0.1298639 +// - 0.5756958 +// 0.4251033 +// 0.2438436 + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,[],[],[],[],x0) + + diff --git a/tests/general_tests/lsqnonneg/lsqnonneg_C.sce b/tests/general_tests/lsqnonneg/lsqnonneg_C.sce new file mode 100644 index 0000000..f792559 --- /dev/null +++ b/tests/general_tests/lsqnonneg/lsqnonneg_C.sce @@ -0,0 +1,20 @@ +// Check for the size of C and d +C = [ + 0.0372 0.2869 + 0.6861 0.7071 + 0.6233 0.6245 + 0.6344 0.6170]; +d = [ + 0.8587 + 0.1781 + 0.0747 + 0.8405 + 0.2356]; + +// Error +//lsqlin: The number of rows in C must be equal the number of elements of d +//at line 106 of function lsqnonneg called by : +// [xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg(C,d) + + [xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg(C,d) + diff --git a/tests/general_tests/lsqnonneg/lsqnonneg_input1.sce b/tests/general_tests/lsqnonneg/lsqnonneg_input1.sce new file mode 100644 index 0000000..eb0aafc --- /dev/null +++ b/tests/general_tests/lsqnonneg/lsqnonneg_input1.sce @@ -0,0 +1,19 @@ +// Check for the input arguments +C = [ + 0.0372 0.2869 + 0.6861 0.7071 + 0.6233 0.6245 + 0.6344 0.6170]; +d = [ + 0.8587 + 0.1781 + 0.0747 + 0.8405]; + +// Error +//lsqlin: Unexpected number of input arguments : 1 provided while should be in the set of [2 3] +//at line 55 of function lsqnonneg called by : +// [xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg(C) + + [xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg(C) + diff --git a/tests/general_tests/lsqnonneg/lsqnonneg_input2.sce b/tests/general_tests/lsqnonneg/lsqnonneg_input2.sce new file mode 100644 index 0000000..2d2e557 --- /dev/null +++ b/tests/general_tests/lsqnonneg/lsqnonneg_input2.sce @@ -0,0 +1,22 @@ +// Check for the input arguments +C = [ + 0.0372 0.2869 + 0.6861 0.7071 + 0.6233 0.6245 + 0.6344 0.6170]; +d = [ + 0.8587 + 0.1781 + 0.0747 + 0.8405]; + +param = list(); +x0 = [0 0]; + +//Error +//lsqnonneg: Unexpected number of input arguments : 4 provided while should be in the set of [2 3] +//at line 55 of function lsqnonneg called by : +//[xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg(C,d,param,x0) + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg(C,d,param,x0) + diff --git a/tests/general_tests/lsqnonneg/lsqnonneg_logical.sce b/tests/general_tests/lsqnonneg/lsqnonneg_logical.sce new file mode 100644 index 0000000..15106f0 --- /dev/null +++ b/tests/general_tests/lsqnonneg/lsqnonneg_logical.sce @@ -0,0 +1,40 @@ +// An example with C and d as input +C = [ + 0.0372 0.2869 + 0.6861 0.7071 + 0.6233 0.6245 + 0.6344 0.6170]; +d = [ + 0.8587 + 0.1781 + 0.0747 + 0.8405]; + +//Output +//Optimal Solution Found. +// lambda = +// +// lower: [0.1506118,1.441D-11] +// upper: [0,0] +// output = +// +// Iterations: 5 +// exitflag = +// +// 0 +// residual = +// +// 0.6598971 +// - 0.3118739 +// - 0.3580375 +// 0.4129595 +// resnorm = +// +// 0.8314560 +// xopt = +// +// 0. +// 0.6929344 + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg(C,d) + diff --git a/tests/general_tests/lsqnonneg/lsqnonneg_param1.sce b/tests/general_tests/lsqnonneg/lsqnonneg_param1.sce new file mode 100644 index 0000000..d91f4b1 --- /dev/null +++ b/tests/general_tests/lsqnonneg/lsqnonneg_param1.sce @@ -0,0 +1,21 @@ +// Check for the parameters to be a list +C = [ + 0.0372 0.2869 + 0.6861 0.7071 + 0.6233 0.6245 + 0.6344 0.6170]; +d = [ + 0.8587 + 0.1781 + 0.0747 + 0.8405]; + +param = 0; + +//Error +//lsqnonneg: param should be a list +//at line 69 of function lsqnonneg called by : +//[xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg(C,d,param) + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg(C,d,param) + diff --git a/tests/general_tests/lsqnonneg/lsqnonneg_param2.sce b/tests/general_tests/lsqnonneg/lsqnonneg_param2.sce new file mode 100644 index 0000000..557a836 --- /dev/null +++ b/tests/general_tests/lsqnonneg/lsqnonneg_param2.sce @@ -0,0 +1,21 @@ +// Check for the size of parameters +C = [ + 0.0372 0.2869 + 0.6861 0.7071 + 0.6233 0.6245 + 0.6344 0.6170]; +d = [ + 0.8587 + 0.1781 + 0.0747 + 0.8405]; + +param = list("MaxIter"); + +//Error +//lsqlin: Size of parameters should be even +//at line 75 of function lsqnonneg called by : +//[xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg(C,d,param) + +[xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg(C,d,param) + diff --git a/tests/general_tests/qpipopt/qpipopt_conMatrix1.sce b/tests/general_tests/qpipopt/qpipopt_A1.sce index 96ee3eb..e78326d 100644 --- a/tests/general_tests/qpipopt/qpipopt_conMatrix1.sce +++ b/tests/general_tests/qpipopt/qpipopt_A1.sce @@ -1,7 +1,7 @@ //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; +A= [1,-1,1,0,3,1; -1,0,-3,-4,5,6; 2,5,3,0,1,0 0,1,0,1,2,-1;]; @@ -9,15 +9,17 @@ 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); +//and minimize 0.5*x'*H*x + f'*x with +f=[1; 2; 3; 4; 5; 6]; H=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) + +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + diff --git a/tests/general_tests/qpipopt/qpipopt_conMatrix2.sce b/tests/general_tests/qpipopt/qpipopt_A2.sce index f5e3106..1392cb1 100644 --- a/tests/general_tests/qpipopt/qpipopt_conMatrix2.sce +++ b/tests/general_tests/qpipopt/qpipopt_A2.sce @@ -1,6 +1,6 @@ //Find x in R^6 such that: //Check for the size of constraints -conMatrix= [-1,1,0,3,1; +A= [-1,1,0,3,1; -1,0,-3,-4,5; 2,5,3,0,1 0,1,0,1,2; @@ -9,15 +9,17 @@ 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); +//and minimize 0.5*x'*H*x + f'*x with +f=[1; 2; 3; 4; 5; 6]; H=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) + +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + diff --git a/tests/general_tests/qpipopt/qpipopt_LB1.sce b/tests/general_tests/qpipopt/qpipopt_LB1.sce index b2b92ce..f87ada4 100644 --- a/tests/general_tests/qpipopt/qpipopt_LB1.sce +++ b/tests/general_tests/qpipopt/qpipopt_LB1.sce @@ -1,6 +1,6 @@ //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; +A= [1,-1,1,0,3,1; -1,0,-3,-4,5,6; 2,5,3,0,1,0 0,1,0,1,2,-1; @@ -9,15 +9,17 @@ 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); +//and minimize 0.5*x'*H*x + f'*x with +f=[1; 2; 3; 4; 5; 6]; H=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) +//at line 236 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + diff --git a/tests/general_tests/qpipopt/qpipopt_LB2.sce b/tests/general_tests/qpipopt/qpipopt_LB2.sce deleted file mode 100644 index e6df705..0000000 --- a/tests/general_tests/qpipopt/qpipopt_LB2.sce +++ /dev/null @@ -1,23 +0,0 @@ -//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 index 06cceea..94e4d7d 100644 --- a/tests/general_tests/qpipopt/qpipopt_Q1.sce +++ b/tests/general_tests/qpipopt/qpipopt_Q1.sce @@ -1,6 +1,6 @@ //Find x in R^6 such that: -// Check for the size of Q matrix -conMatrix= [1,-1,1,0,3,1; +// Check for the size of H matrix +A= [1,-1,1,0,3,1; -1,0,-3,-4,5,6; 2,5,3,0,1,0 0,1,0,1,2,-1; @@ -9,16 +9,18 @@ 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); +//and minimize 0.5*x'*H*x + f'*x with +f=[1; 2; 3; 4; 5; 6]; H=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) +//qpipopt: The Size of H is not equal to the number of variables +//at line 210 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + + diff --git a/tests/general_tests/qpipopt/qpipopt_Q2.sce b/tests/general_tests/qpipopt/qpipopt_Q2.sce index ea23ee4..f10b7c5 100644 --- a/tests/general_tests/qpipopt/qpipopt_Q2.sce +++ b/tests/general_tests/qpipopt/qpipopt_Q2.sce @@ -1,6 +1,6 @@ //Find x in R^6 such that: -// Check for the Q to be a symmetric matrix -conMatrix= [1,-1,1,0,3,1; +// Check for the H to be a symmetric matrix +A= [1,-1,1,0,3,1; -1,0,-3,-4,5,6; 2,5,3,0,1,0 0,1,0,1,2,-1; @@ -9,15 +9,16 @@ 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); +//and minimize 0.5*x'*H*x + f'*x with +f=[1; 2; 3; 4; 5; 6]; H=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) +//qpipopt: H is not a symmetric matrix +//at line 204 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) diff --git a/tests/general_tests/qpipopt/qpipopt_UB1.sce b/tests/general_tests/qpipopt/qpipopt_UB1.sce index 155c695..7422085 100644 --- a/tests/general_tests/qpipopt/qpipopt_UB1.sce +++ b/tests/general_tests/qpipopt/qpipopt_UB1.sce @@ -1,6 +1,6 @@ //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; +// Check if the user gives unequal size of Upper Bound as of the number of variables +A= [1,-1,1,0,3,1; -1,0,-3,-4,5,6; 2,5,3,0,1,0 0,1,0,1,2,-1; @@ -9,15 +9,17 @@ 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); +//and minimize 0.5*x'*H*x + f'*x with +f=[1; 2; 3; 4; 5; 6]; H=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) +//at line 242 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + diff --git a/tests/general_tests/qpipopt/qpipopt_UB2.sce b/tests/general_tests/qpipopt/qpipopt_UB2.sce deleted file mode 100644 index a4f5270..0000000 --- a/tests/general_tests/qpipopt/qpipopt_UB2.sce +++ /dev/null @@ -1,23 +0,0 @@ -//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 index 09105e7..f01a32e 100644 --- a/tests/general_tests/qpipopt/qpipopt_conLB1.sce +++ b/tests/general_tests/qpipopt/qpipopt_conLB1.sce @@ -1,6 +1,6 @@ //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; +A= [1,-1,1,0,3,1; -1,0,-3,-4,5,6; 2,5,3,0,1,0 0,1,0,1,2,-1; @@ -9,15 +9,18 @@ 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); +//and minimize 0.5*x'*H*x + f'*x with +f=[1; 2; 3; 4; 5; 6]; H=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) +//at line 248 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + + diff --git a/tests/general_tests/qpipopt/qpipopt_conLB2.sce b/tests/general_tests/qpipopt/qpipopt_conLB2.sce deleted file mode 100644 index d0236c0..0000000 --- a/tests/general_tests/qpipopt/qpipopt_conLB2.sce +++ /dev/null @@ -1,23 +0,0 @@ -//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_conUB1.sce b/tests/general_tests/qpipopt/qpipopt_conUB1.sce index 2c4bfa6..ab7bfe6 100644 --- a/tests/general_tests/qpipopt/qpipopt_conUB1.sce +++ b/tests/general_tests/qpipopt/qpipopt_conUB1.sce @@ -1,6 +1,6 @@ //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; +A= [1,-1,1,0,3,1; -1,0,-3,-4,5,6; 2,5,3,0,1,0 0,1,0,1,2,-1; @@ -9,15 +9,17 @@ 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); +//and minimize 0.5*x'*H*x + f'*x with +f=[1; 2; 3; 4; 5; 6]; H=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) + +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + diff --git a/tests/general_tests/qpipopt/qpipopt_conUB2.sce b/tests/general_tests/qpipopt/qpipopt_conUB2.sce index 33b3f2d..9aab4a8 100644 --- a/tests/general_tests/qpipopt/qpipopt_conUB2.sce +++ b/tests/general_tests/qpipopt/qpipopt_conUB2.sce @@ -1,6 +1,6 @@ //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; +A= [1,-1,1,0,3,1; -1,0,-3,-4,5,6; 2,5,3,0,1,0 0,1,0,1,2,-1; @@ -9,15 +9,18 @@ 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); +//and minimize 0.5*x'*H*x + f'*x with +f=[1; 2; 3; 4; 5; 6]; f=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) +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + + diff --git a/tests/general_tests/qpipopt/qpipopt_infeasible.sci b/tests/general_tests/qpipopt/qpipopt_infeasible.sci new file mode 100644 index 0000000..49bb233 --- /dev/null +++ b/tests/general_tests/qpipopt/qpipopt_infeasible.sci @@ -0,0 +1,33 @@ +// qpipopt infeasibility test + +H = [2 0;0 8]; +f = [0 -32]; +A = [-1 0; 0, -1; 1 1]; +conUB = [-6 -6 11]; +conLB = -1*[%inf %inf %inf]; +nbVar = 2; +nbCon = 3; +ub = [%inf %inf]; +lb = -1*ub; + +// Output +//Converged to a point of local infeasibility. +// lamda = +// +// lower: [0x0 constant] +// upper: [0x0 constant] +// constraint: [0x0 constant] +// output = +// +// Iterations: 0 +// exitflag = +// +// 5 +// fopt = +// +// 0. +// xopt = +// +// [] + +[xopt,fopt,exitflag,output,lamda] = qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB) diff --git a/tests/general_tests/qpipopt/qpipopt_input.sce b/tests/general_tests/qpipopt/qpipopt_input.sce index 08bd468..520ad97 100644 --- a/tests/general_tests/qpipopt/qpipopt_input.sce +++ b/tests/general_tests/qpipopt/qpipopt_input.sce @@ -1,6 +1,6 @@ //Find x in R^6 such that: // Check for the number of inputs -conMatrix= [1,-1,1,0,3,1; +A= [1,-1,1,0,3,1; -1,0,-3,-4,5,6; 2,5,3,0,1,0 0,1,0,1,2,-1; @@ -9,15 +9,16 @@ 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); +//and minimize 0.5*x'*H*x + f'*x with +f=[1; 2; 3; 4; 5; 6]; H=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) +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB) + +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB) diff --git a/tests/general_tests/qpipopt/qpipopt_input2.sce b/tests/general_tests/qpipopt/qpipopt_input2.sce index decc8a8..70c2e8d 100644 --- a/tests/general_tests/qpipopt/qpipopt_input2.sce +++ b/tests/general_tests/qpipopt/qpipopt_input2.sce @@ -1,6 +1,6 @@ //Find x in R^6 such that: // Check if the number of input is more -conMatrix= [1,-1,1,0,3,1; +A= [1,-1,1,0,3,1; -1,0,-3,-4,5,6; 2,5,3,0,1,0 0,1,0,1,2,-1; @@ -9,15 +9,18 @@ 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); +//and minimize 0.5*x'*H*x + f'*x with +f=[1; 2; 3; 4; 5; 6]; H=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: 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) + +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param,[]) + + diff --git a/tests/general_tests/qpipopt/qpipopt_logical_1.sce b/tests/general_tests/qpipopt/qpipopt_logical_1.sce index 03853a7..52d5493 100644 --- a/tests/general_tests/qpipopt/qpipopt_logical_1.sce +++ b/tests/general_tests/qpipopt/qpipopt_logical_1.sce @@ -1,6 +1,6 @@ //Find x in R^6 such that: // A simple example with constraints -conMatrix= [1,-1,1,0,3,1; +A= [1,-1,1,0,3,1; -1,0,-3,-4,5,6; 2,5,3,0,1,0 0,1,0,1,2,-1; @@ -9,15 +9,12 @@ 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); +//and minimize 0.5*x'*H*x + f'*x with +f=[1; 2; 3; 4; 5; 6]; H=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 // @@ -49,3 +46,9 @@ disp("xopt",xopt,"fopt",fopt,"exitflag",exitflag,"output",output,"lambda",lambda // - 3.1155623 // // xopt + +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param); + +disp("xopt",xopt,"fopt",fopt,"exitflag",exitflag,"output",output,"lambda",lambda) + + diff --git a/tests/general_tests/qpipopt/qpipopt_logical_2.sce b/tests/general_tests/qpipopt/qpipopt_logical_2.sce index 933508b..a61e416 100644 --- a/tests/general_tests/qpipopt/qpipopt_logical_2.sce +++ b/tests/general_tests/qpipopt/qpipopt_logical_2.sce @@ -1,16 +1,14 @@ // A simple example without constraints -conMatrix= []; +A= []; conLB=[]; conUB = []; lb=[]; ub=[]; -p=[2 -35 -47]'; -Q =[5 -2 -1; -2 4 3; -1 3 5]; +f=[2 -35 -47]'; +H =[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 @@ -40,3 +38,8 @@ disp("xopt",xopt,"fopt",fopt,"exitflag",exitflag,"output",output,"lambda",lambda // 7. // // xopt + +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB); +disp("xopt",xopt,"fopt",fopt,"exitflag",exitflag,"output",output,"lambda",lambda); + + diff --git a/tests/general_tests/qpipopt/qpipopt_options1.sce b/tests/general_tests/qpipopt/qpipopt_options1.sce index 6cebc51..23d6b2b 100644 --- a/tests/general_tests/qpipopt/qpipopt_options1.sce +++ b/tests/general_tests/qpipopt/qpipopt_options1.sce @@ -1,6 +1,6 @@ //Find x in R^6 such that: //Check if the user gives uneven number of parameters -conMatrix= [1,-1,1,0,3,1; +A= [1,-1,1,0,3,1; -1,0,-3,-4,5,6; 2,5,3,0,1,0 0,1,0,1,2,-1; @@ -9,15 +9,17 @@ 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); +//and minimize 0.5*x'*H*x + f'*x with +f=[1; 2; 3; 4; 5; 6]; H=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) +//at line 145 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + diff --git a/tests/general_tests/qpipopt/qpipopt_options2.sce b/tests/general_tests/qpipopt/qpipopt_options2.sce index ba5208b..2c07536 100644 --- a/tests/general_tests/qpipopt/qpipopt_options2.sce +++ b/tests/general_tests/qpipopt/qpipopt_options2.sce @@ -1,6 +1,6 @@ //Find x in R^6 such that: // Check if the user gives different parameter other than predefined -conMatrix= [1,-1,1,0,3,1; +A= [1,-1,1,0,3,1; -1,0,-3,-4,5,6; 2,5,3,0,1,0 0,1,0,1,2,-1; @@ -9,15 +9,18 @@ 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); +//and minimize 0.5*x'*H*x + f'*x with +f=[1; 2; 3; 4; 5; 6]; H=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) +//at line 162 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + + diff --git a/tests/general_tests/qpipopt/qpipopt_options3.sce b/tests/general_tests/qpipopt/qpipopt_options3.sce index b267d77..1612c21 100644 --- a/tests/general_tests/qpipopt/qpipopt_options3.sce +++ b/tests/general_tests/qpipopt/qpipopt_options3.sce @@ -1,6 +1,6 @@ //Find x in R^6 such that: // Check if the user for a list for the param -conMatrix= [1,-1,1,0,3,1; +A= [1,-1,1,0,3,1; -1,0,-3,-4,5,6; 2,5,3,0,1,0 0,1,0,1,2,-1; @@ -9,15 +9,17 @@ 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); +//and minimize 0.5*x'*H*x + f'*x with +f=[1; 2; 3; 4; 5; 6]; H=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) +//at line 140 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + diff --git a/tests/general_tests/qpipopt/qpipopt_p1.sce b/tests/general_tests/qpipopt/qpipopt_p1.sce index 2e9ed37..4d05f47 100644 --- a/tests/general_tests/qpipopt/qpipopt_p1.sce +++ b/tests/general_tests/qpipopt/qpipopt_p1.sce @@ -1,6 +1,6 @@ //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; +A= [1,-1,1,0,3,1; -1,0,-3,-4,5,6; 2,5,3,0,1,0 0,1,0,1,2,-1; @@ -9,15 +9,18 @@ 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); +//and minimize 0.5*x'*H*x + f'*x with +f=[1; 2; 3; 4; 5; 6; 7]; H=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) +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + + diff --git a/tests/general_tests/qpipopt/qpipopt_p2.sce b/tests/general_tests/qpipopt/qpipopt_p2.sce index 2e9ed37..2a58870 100644 --- a/tests/general_tests/qpipopt/qpipopt_p2.sce +++ b/tests/general_tests/qpipopt/qpipopt_p2.sce @@ -1,6 +1,6 @@ //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; +// Check if the user gives unequal size of 'f' as of the number of variables +A= [1,-1,1,0,3,1; -1,0,-3,-4,5,6; 2,5,3,0,1,0 0,1,0,1,2,-1; @@ -9,15 +9,18 @@ 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); +//and minimize 0.5*x'*H*x + f'*x with +f=[1; 2; 3; 4; 5]; H=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) +//qpipopt: The Size of f is not equal to the number of variables +//at line 216 of function qpipopt called by : +//[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) + + diff --git a/tests/general_tests/qpipopt/qpipopt_x0.sce b/tests/general_tests/qpipopt/qpipopt_x0.sce deleted file mode 100644 index ef69b3d..0000000 --- a/tests/general_tests/qpipopt/qpipopt_x0.sce +++ /dev/null @@ -1,23 +0,0 @@ -//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 index 6a57269..bb37c50 100644 --- a/tests/general_tests/qpipopt/qpipopt_x01.sce +++ b/tests/general_tests/qpipopt/qpipopt_x01.sce @@ -15,7 +15,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 @@ -41,3 +40,6 @@ param = list("MaxIter", 300, "CpuTime", 100); // - 4.9884023 // 0.6054943 // - 3.1155623 + +[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_x02.sce b/tests/general_tests/qpipopt/qpipopt_x02.sce deleted file mode 100644 index 52b0b89..0000000 --- a/tests/general_tests/qpipopt/qpipopt_x02.sce +++ /dev/null @@ -1,23 +0,0 @@ -//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 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); diff --git a/tests/general_tests/symphony/symphony_conmatrix1.sce b/tests/general_tests/symphony/symphony_A1.sce index 280c973..53f3813 100644 --- a/tests/general_tests/symphony/symphony_conmatrix1.sce +++ b/tests/general_tests/symphony/symphony_A1.sce @@ -1,4 +1,4 @@ -// Check the size for conMatrix +// Check the size for A matrix // A basic case : // Objective function @@ -11,7 +11,7 @@ lb = repmat(0,8,1); ub = [repmat(1,4,1);repmat(%inf,4,1)]; // Constraint Matrix -conMatrix = [5,3,4,6,1,1,1; +A = [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;] @@ -24,10 +24,12 @@ 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) +//[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,conlb,conub,1) + +// Calling Symphony +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,conlb,conub,1) + + diff --git a/tests/general_tests/symphony/symphony_conmatrix2.sce b/tests/general_tests/symphony/symphony_A2.sce index 0091f7d..43a61e7 100644 --- a/tests/general_tests/symphony/symphony_conmatrix2.sce +++ b/tests/general_tests/symphony/symphony_A2.sce @@ -1,4 +1,4 @@ -// Check the size for conMatrix +// Check the size for A // A basic case : // Objective function @@ -11,7 +11,7 @@ lb = repmat(0,8,1); ub = [repmat(1,4,1);repmat(%inf,4,1)]; // Constraint Matrix -conMatrix = [5,3,4,6,1,1,1,1; +A = [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 @@ -23,10 +23,12 @@ 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) +//[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,conlb,conub,1) + +// Calling Symphony +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,conlb,conub,1) + + diff --git a/tests/general_tests/symphony/symphony_c1.sce b/tests/general_tests/symphony/symphony_c1.sce index 7b5b7e9..81c95aa 100644 --- a/tests/general_tests/symphony/symphony_c1.sce +++ b/tests/general_tests/symphony/symphony_c1.sce @@ -11,7 +11,7 @@ lb = repmat(0,8,1); ub = [repmat(1,4,1);repmat(%inf,4,1)]; // Constraint Matrix -conMatrix = [5,3,4,6,1,1,1,1; +A = [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;] @@ -24,10 +24,12 @@ 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) +//[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,conlb,conub,1) + +// Calling Symphony +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,conlb,conub,1) + + diff --git a/tests/general_tests/symphony/symphony_c2.sce b/tests/general_tests/symphony/symphony_c2.sce index 41f9720..83cf860 100644 --- a/tests/general_tests/symphony/symphony_c2.sce +++ b/tests/general_tests/symphony/symphony_c2.sce @@ -1,4 +1,4 @@ -// Check for size of Objective Coefficient +// Check if the user provides a row matrix in Objective Coefficient // A basic case : // Objective function @@ -11,7 +11,7 @@ lb = repmat(0,8,1); ub = [repmat(1,4,1);repmat(%inf,4,1)]; // Constraint Matrix -conMatrix = [5,3,4,6,1,1,1,1; +A = [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;] @@ -24,10 +24,12 @@ 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) +//[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,conlb,conub,1) + +// Calling Symphony +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,conlb,conub,1) + + diff --git a/tests/general_tests/symphony/symphony_conlb1.sce b/tests/general_tests/symphony/symphony_conlb1.sce index fe100e0..2fa595d 100644 --- a/tests/general_tests/symphony/symphony_conlb1.sce +++ b/tests/general_tests/symphony/symphony_conlb1.sce @@ -1,4 +1,4 @@ -// Check for size of conlb +// Check for size of constraint lower bound // A basic case : // Objective function @@ -11,7 +11,7 @@ lb = repmat(0,8,1); ub = [repmat(1,4,1);repmat(%inf,4,1)]; // Constraint Matrix -conMatrix = [5,3,4,6,1,1,1,1; +A = [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;] @@ -24,10 +24,12 @@ 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) +//[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,conlb,conub,1) + +// Calling Symphony +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,conlb,conub,1) + + diff --git a/tests/general_tests/symphony/symphony_conlb2.sce b/tests/general_tests/symphony/symphony_conub1.sce index 74f4af1..50cb53a 100644 --- a/tests/general_tests/symphony/symphony_conlb2.sce +++ b/tests/general_tests/symphony/symphony_conub1.sce @@ -1,4 +1,4 @@ -// Check for size of Objective Coefficient +// Check for size of upper bound of constraints // A basic case : // Objective function @@ -11,7 +11,7 @@ lb = repmat(0,8,1); ub = [repmat(1,4,1);repmat(%inf,4,1)]; // Constraint Matrix -conMatrix = [5,3,4,6,1,1,1,1; +A = [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;] @@ -24,10 +24,12 @@ 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) +//[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,conlb,conub,1) + +// Calling Symphony +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,conlb,conub,1) + + diff --git a/tests/general_tests/symphony/symphony_infeasible.sci b/tests/general_tests/symphony/symphony_infeasible.sce index 04fe76a..f48446e 100644 --- a/tests/general_tests/symphony/symphony_infeasible.sci +++ b/tests/general_tests/symphony/symphony_infeasible.sce @@ -8,4 +8,12 @@ nbCon = 3; isInt = repmat(%f,1,nbVar) LB = -1*[%inf %inf] UB = [%inf %inf] + +// Output +//Problem loaded into environment. +//Note: There is no limit on time. +//This problem is infeasible. + [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 index 4168710..a2b708d 100644 --- a/tests/general_tests/symphony/symphony_input1.sce +++ b/tests/general_tests/symphony/symphony_input1.sce @@ -1,4 +1,4 @@ -// Check for size of Objective Coefficient +// Check if the user provides less number of input arguments // A basic case : // Objective function @@ -11,7 +11,7 @@ lb = repmat(0,8,1); ub = [repmat(1,4,1);repmat(%inf,4,1)]; // Constraint Matrix -conMatrix = [5,3,4,6,1,1,1,1; +A = [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;] @@ -24,10 +24,12 @@ 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) + +// Calling Symphony +[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 index d4fa96b..9171dd9 100644 --- a/tests/general_tests/symphony/symphony_input2.sce +++ b/tests/general_tests/symphony/symphony_input2.sce @@ -1,4 +1,4 @@ -// Check for size of Objective Coefficient +// Check if the user provides more number of input arguments // A basic case : // Objective function @@ -11,7 +11,7 @@ lb = repmat(0,8,1); ub = [repmat(1,4,1);repmat(%inf,4,1)]; // Constraint Matrix -conMatrix = [5,3,4,6,1,1,1,1; +A = [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;] @@ -25,9 +25,9 @@ conub = [ 25; 1.25; 1.25] 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,[],[],[]) +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,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,[],[],[]) +//[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,conlb,conub,1,[],[],[]) diff --git a/tests/general_tests/symphony/symphony_isInt1.sce b/tests/general_tests/symphony/symphony_isInt1.sce index 914ccb2..fc79a3d 100644 --- a/tests/general_tests/symphony/symphony_isInt1.sce +++ b/tests/general_tests/symphony/symphony_isInt1.sce @@ -1,4 +1,4 @@ -// Check for size of Objective Coefficient +// Check for size of isInt // A basic case : // Objective function @@ -11,7 +11,7 @@ lb = repmat(0,8,1); ub = [repmat(1,4,1);repmat(%inf,4,1)]; // Constraint Matrix -conMatrix = [5,3,4,6,1,1,1,1; +A = [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;] @@ -24,10 +24,12 @@ 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) +//[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,conlb,conub,1) + +// Calling Symphony +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,conlb,conub,1) + + diff --git a/tests/general_tests/symphony/symphony_lb1.sce b/tests/general_tests/symphony/symphony_lb1.sce index feef9ff..1116150 100644 --- a/tests/general_tests/symphony/symphony_lb1.sce +++ b/tests/general_tests/symphony/symphony_lb1.sce @@ -5,18 +5,18 @@ c = [350*5,330*3,310*4,280*6,500,450,400,100]'; // Lower Bound of variable -lb = repmat(0,8,1); +lb = repmat(0,6,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; +A = [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;] +conlb = [ 25; 1.25; 1.25] // Upper Bound of constrains conub = [ 25; 1.25; 1.25] @@ -24,10 +24,12 @@ 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)]; +// Error +//Symphony: The Lower Bound is not equal to the number of variables +//at line 262 of function symphony called by : +//[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,conlb,conub,1) + // Calling Symphony -[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,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 index 1f728c8..2f63ed6 100644 --- a/tests/general_tests/symphony/symphony_logical1.sce +++ b/tests/general_tests/symphony/symphony_logical1.sce @@ -1,4 +1,3 @@ -// Check for size of Objective Coefficient // A basic case : // Objective function @@ -24,10 +23,6 @@ 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. // @@ -59,3 +54,9 @@ disp("x",x,"f",f,"status",status,"output",output); // 3.5 // // x + +// 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); + + diff --git a/tests/general_tests/symphony/symphony_logical2.sce b/tests/general_tests/symphony/symphony_logical2.sce index 4666fdc..5d0989f 100644 --- a/tests/general_tests/symphony/symphony_logical2.sce +++ b/tests/general_tests/symphony/symphony_logical2.sce @@ -11,7 +11,7 @@ lb = repmat(0,3,1); ub = repmat(%inf,3,1); // Constraint Matrix -conMatrix = [3,2,5; +A = [3,2,5; 2,1,1; 1,1,3; 5,2,4] @@ -25,9 +25,6 @@ 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. // @@ -54,3 +51,8 @@ disp("x",x,"f",f,"status",status,"output",output); // 1.6 // // x + +// Calling Symphony +[x,f,status,output] = symphony(3,4,c,isInt,lb,ub,A,conlb,conub,-1) +disp("x",x,"f",f,"status",status,"output",output); + diff --git a/tests/general_tests/symphony/symphony_ub1.sce b/tests/general_tests/symphony/symphony_ub1.sce index 74f4af1..75a9f9c 100644 --- a/tests/general_tests/symphony/symphony_ub1.sce +++ b/tests/general_tests/symphony/symphony_ub1.sce @@ -1,4 +1,4 @@ -// Check for size of Objective Coefficient +// Check for size of upper bound // A basic case : // Objective function @@ -8,10 +8,10 @@ c = [350*5,330*3,310*4,280*6,500,450,400,100]'; lb = repmat(0,8,1); // Upper Bound of variables -ub = [repmat(1,4,1);repmat(%inf,4,1)]; +ub = [repmat(1,4,1);repmat(%inf,3,1)]; // Constraint Matrix -conMatrix = [5,3,4,6,1,1,1,1; +A = [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;] @@ -19,15 +19,17 @@ conMatrix = [5,3,4,6,1,1,1,1; conlb = [ 25; 1.25; 1.25] // Upper Bound of constrains -conub = [ 25; 1.25;] +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)]; +// Error +//Symphony: The Upper Bound is not equal to the number of variables +//at line 268 of function symphony called by : +//[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,conlb,conub,1) + // Calling Symphony -[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,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 index 68975c3..26c6ddb 100644 --- a/tests/general_tests/symphonymat/symphonymat_b1.sce +++ b/tests/general_tests/symphonymat/symphonymat_b1.sce @@ -1,4 +1,4 @@ -// Check for size of Objective Coefficients +// Check for size of equality constraint upper bound // Objective function c = [350*5,330*3,310*4,280*6,500,450,400,100]'; @@ -17,10 +17,12 @@ 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) + +// Calling Symphony +[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 index 6b8d5f8..990fcd1 100644 --- a/tests/general_tests/symphonymat/symphonymat_c1.sce +++ b/tests/general_tests/symphonymat/symphonymat_c1.sce @@ -17,10 +17,11 @@ 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) + +// Calling Symphony +[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 index ed393e9..0f73480 100644 --- a/tests/general_tests/symphonymat/symphonymat_infeasible.sce +++ b/tests/general_tests/symphonymat/symphonymat_infeasible.sce @@ -2,4 +2,12 @@ C = -1 * [1 1]' A = [-1 0; 0, -1; 1 1] b = [-6 -6 11] + +//Output +//Problem loaded into environment. +//Note: There is no limit on time. +//This problem is infeasible. + [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 index b5ee515..00f2aa0 100644 --- a/tests/general_tests/symphonymat/symphonymat_input1.sce +++ b/tests/general_tests/symphonymat/symphonymat_input1.sce @@ -17,10 +17,11 @@ 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,[],[]) + +// Calling Symphony +[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 index 4be6d87..ee733d4 100644 --- a/tests/general_tests/symphonymat/symphonymat_input2.sce +++ b/tests/general_tests/symphonymat/symphonymat_input2.sce @@ -17,10 +17,12 @@ 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) + +// Calling Symphony +[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 index 0c24f4c..ded8469 100644 --- a/tests/general_tests/symphonymat/symphonymat_intcon1.sce +++ b/tests/general_tests/symphonymat/symphonymat_intcon1.sce @@ -1,4 +1,4 @@ -// Check for size of Objective Coefficients +// Check if the user provides a value greater than the number of variables in intcon // Objective function c = [350*5,330*3,310*4,280*6,500,450,400,100]'; @@ -17,10 +17,12 @@ beq = [ 25, 1.25, 1.25] intcon = [1 2 3 10]; +//Error +//Symphonymat: The values inside intcon should be less than the number of variables +//at line 238 of function symphonymat called by : +//[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub) + // 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 index 47b7572..9df4d64 100644 --- a/tests/general_tests/symphonymat/symphonymat_intcon2.sce +++ b/tests/general_tests/symphonymat/symphonymat_intcon2.sce @@ -1,4 +1,4 @@ -// Check for size of Objective Coefficients +// Check if the user provides a value less than 0 // Objective function c = [350*5,330*3,310*4,280*6,500,450,400,100]'; @@ -17,10 +17,12 @@ 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) + +// Calling Symphony +[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 index e644967..a7d27ff 100644 --- a/tests/general_tests/symphonymat/symphonymat_intcon3.sce +++ b/tests/general_tests/symphonymat/symphonymat_intcon3.sce @@ -17,10 +17,12 @@ 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) + +// Calling Symphony +[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 index f9a4b29..fee0556 100644 --- a/tests/general_tests/symphonymat/symphonymat_lb1.sce +++ b/tests/general_tests/symphonymat/symphonymat_lb1.sce @@ -17,10 +17,12 @@ 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) + +// Calling Symphony +[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 index 70ad9f8..ced5e26 100644 --- a/tests/general_tests/symphonymat/symphonymat_logical1.sce +++ b/tests/general_tests/symphonymat/symphonymat_logical1.sce @@ -1,3 +1,5 @@ +// An example with equality constraints, variable bounds and options to set + // Objective function c = [350*5,330*3,310*4,280*6,500,450,400,100]'; @@ -18,9 +20,6 @@ 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. @@ -53,3 +52,8 @@ disp("x",x,"f",f,"status",status,"output",output); // 3.5 // // x + +// Calling Symphony +[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub,options) +disp("x",x,"f",f,"status",status,"output",output); + diff --git a/tests/general_tests/symphonymat/symphonymat_logical2.sce b/tests/general_tests/symphonymat/symphonymat_logical2.sce index 6bdd1b3..4f3923f 100644 --- a/tests/general_tests/symphonymat/symphonymat_logical2.sce +++ b/tests/general_tests/symphonymat/symphonymat_logical2.sce @@ -1,4 +1,5 @@ -// Check for size of Objective Coefficient +// An example with equality constraints and variable bounds + // A basic case : // Objective function @@ -22,9 +23,6 @@ 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. // @@ -51,3 +49,8 @@ disp("x",x,"f",f,"status",status,"output",output); // 1.6 // // x + +// Calling Symphony +[x,f,status,output] = symphonymat(c,intcon,A,b,[],[],lb,ub) +disp("x",x,"f",f,"status",status,"output",output); + diff --git a/tests/general_tests/symphonymat/symphonymat_options1.sce b/tests/general_tests/symphonymat/symphonymat_options1.sce index 8da8547..01d293e 100644 --- a/tests/general_tests/symphonymat/symphonymat_options1.sce +++ b/tests/general_tests/symphonymat/symphonymat_options1.sce @@ -19,10 +19,12 @@ 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) + +// Calling Symphony +[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 index 89d3e14..2b7792c 100644 --- a/tests/general_tests/symphonymat/symphonymat_options2.sce +++ b/tests/general_tests/symphonymat/symphonymat_options2.sce @@ -19,10 +19,11 @@ 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) + +// Calling Symphony +[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 index fdf345a..82237f2 100644 --- a/tests/general_tests/symphonymat/symphonymat_ub1.sce +++ b/tests/general_tests/symphonymat/symphonymat_ub1.sce @@ -17,10 +17,12 @@ 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) + +// Calling Symphony +[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub) + + diff --git a/tests/unit_tests/lsqnonneg.dia.ref b/tests/unit_tests/lsqnonneg.dia.ref new file mode 100644 index 0000000..2c7c7d2 --- /dev/null +++ b/tests/unit_tests/lsqnonneg.dia.ref @@ -0,0 +1,72 @@ +// Copyright (C) 2015 - IIT Bombay - FOSSEE +// +// Author: Harpreet Singh +// Organization: FOSSEE, IIT Bombay +// Email: harpreet.mertia@gmail.com +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + +// <-- JVM NOT MANDATORY --> +// <-- ENGLISH IMPOSED --> + + +// +// assert_close -- +// Returns 1 if the two real matrices computed and expected are close, +// i.e. if the relative distance between computed and expected is lesser than epsilon. +// Arguments +// computed, expected : the two matrices to compare +// epsilon : a small number +// +function flag = assert_close ( computed, expected, epsilon ) + if expected==0.0 then + shift = norm(computed-expected); + else + shift = norm(computed-expected)/norm(expected); + end +// if shift < epsilon then +// flag = 1; +// else +// flag = 0; +// end +// if flag <> 1 then pause,end + flag = assert_checktrue ( shift < epsilon ); +endfunction +// +// assert_equal -- +// Returns 1 if the two real matrices computed and expected are equal. +// Arguments +// computed, expected : the two matrices to compare +// epsilon : a small number +// +//function flag = assert_equal ( computed , expected ) +// if computed==expected then +// flag = 1; +// else +// flag = 0; +// end +// if flag <> 1 then pause,end +//endfunction + +// A basic lsqnonneg problem +C = [ + 0.0372 0.2869 + 0.6861 0.7071 + 0.6233 0.6245 + 0.6344 0.6170]; +d = [ + 0.8587 + 0.1781 + 0.0747 + 0.8405]; +[xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg(C,d) + +assert_close ( xopt , [ 0 0.6929344 ]' , 0.0005 ); +assert_close ( residual , [0.6598971 -0.3118739 -0.3580375 0.4129595]' , 0.0005 ); +assert_close ( resnorm , [ 0.8314560] , 0.0005 ); +assert_checkequal( exitflag , int32(0) ); +printf("Test Successful"); diff --git a/tests/unit_tests/lsqnonneg.tst b/tests/unit_tests/lsqnonneg.tst new file mode 100644 index 0000000..2c7c7d2 --- /dev/null +++ b/tests/unit_tests/lsqnonneg.tst @@ -0,0 +1,72 @@ +// Copyright (C) 2015 - IIT Bombay - FOSSEE +// +// Author: Harpreet Singh +// Organization: FOSSEE, IIT Bombay +// Email: harpreet.mertia@gmail.com +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + +// <-- JVM NOT MANDATORY --> +// <-- ENGLISH IMPOSED --> + + +// +// assert_close -- +// Returns 1 if the two real matrices computed and expected are close, +// i.e. if the relative distance between computed and expected is lesser than epsilon. +// Arguments +// computed, expected : the two matrices to compare +// epsilon : a small number +// +function flag = assert_close ( computed, expected, epsilon ) + if expected==0.0 then + shift = norm(computed-expected); + else + shift = norm(computed-expected)/norm(expected); + end +// if shift < epsilon then +// flag = 1; +// else +// flag = 0; +// end +// if flag <> 1 then pause,end + flag = assert_checktrue ( shift < epsilon ); +endfunction +// +// assert_equal -- +// Returns 1 if the two real matrices computed and expected are equal. +// Arguments +// computed, expected : the two matrices to compare +// epsilon : a small number +// +//function flag = assert_equal ( computed , expected ) +// if computed==expected then +// flag = 1; +// else +// flag = 0; +// end +// if flag <> 1 then pause,end +//endfunction + +// A basic lsqnonneg problem +C = [ + 0.0372 0.2869 + 0.6861 0.7071 + 0.6233 0.6245 + 0.6344 0.6170]; +d = [ + 0.8587 + 0.1781 + 0.0747 + 0.8405]; +[xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg(C,d) + +assert_close ( xopt , [ 0 0.6929344 ]' , 0.0005 ); +assert_close ( residual , [0.6598971 -0.3118739 -0.3580375 0.4129595]' , 0.0005 ); +assert_close ( resnorm , [ 0.8314560] , 0.0005 ); +assert_checkequal( exitflag , int32(0) ); +printf("Test Successful"); diff --git a/tests/unit_tests/symphony_base.dia.ref b/tests/unit_tests/symphony_base.dia.ref index 64dfeea..4b653a8 100644 --- a/tests/unit_tests/symphony_base.dia.ref +++ b/tests/unit_tests/symphony_base.dia.ref @@ -53,7 +53,7 @@ endfunction //endfunction // Objective function -c = [350*5,330*3,310*4,280*6,500,450,400,100] +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; // Lower Bound of variable lb = repmat(0,1,8); @@ -81,7 +81,7 @@ isInt = [repmat(%t,1,4) repmat(%f,1,4)]; //In Symphony Library for optimal solution status = 227 status = sym_getStatus(); -assert_close ( x , [1 1 0 1 7.25 0 0.25 3.5] , 1.e-7 ); +assert_close ( x , [1 1 0 1 7.25 0 0.25 3.5]' , 1.e-7 ); assert_close ( f , [ 8495] , 1.e-7 ); assert_checkequal( status , 227 ); printf("Test Successful"); diff --git a/tests/unit_tests/symphony_base.tst b/tests/unit_tests/symphony_base.tst index 5ec76ee..31e7547 100644 --- a/tests/unit_tests/symphony_base.tst +++ b/tests/unit_tests/symphony_base.tst @@ -53,7 +53,7 @@ endfunction //endfunction // Objective function -c = [350*5,330*3,310*4,280*6,500,450,400,100] +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; // Lower Bound of variable lb = repmat(0,1,8); diff --git a/tests/unit_tests/symphonymat_base.dia.ref b/tests/unit_tests/symphonymat_base.dia.ref index 1d26663..d57851a 100644 --- a/tests/unit_tests/symphonymat_base.dia.ref +++ b/tests/unit_tests/symphonymat_base.dia.ref @@ -53,7 +53,7 @@ endfunction //endfunction // Objective function -c = [350*5,330*3,310*4,280*6,500,450,400,100] +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; // Lower Bound of variable lb = repmat(0,1,8); @@ -77,7 +77,7 @@ intcon = [1 2 3 4]; //In Symphony Library for optimal solution status = 227 status = sym_getStatus(); -assert_close ( x , [1 1 0 1 7.25 0 0.25 3.5] , 1.e-7 ); +assert_close ( x , [1 1 0 1 7.25 0 0.25 3.5]' , 1.e-7 ); assert_close ( f , [ 8495] , 1.e-7 ); assert_checkequal( status , 227 ); printf("Test Successful"); diff --git a/tests/unit_tests/symphonymat_base.tst b/tests/unit_tests/symphonymat_base.tst index 9b32e42..37b4c3f 100644 --- a/tests/unit_tests/symphonymat_base.tst +++ b/tests/unit_tests/symphonymat_base.tst @@ -53,7 +53,7 @@ endfunction //endfunction // Objective function -c = [350*5,330*3,310*4,280*6,500,450,400,100] +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; // Lower Bound of variable lb = repmat(0,1,8); |