summaryrefslogtreecommitdiff
path: root/tests/general_tests/lsqlin
diff options
context:
space:
mode:
Diffstat (limited to 'tests/general_tests/lsqlin')
-rw-r--r--tests/general_tests/lsqlin/lsqlin_infeasible1.sce15
-rw-r--r--tests/general_tests/lsqlin/lsqlin_logical1.sce1
-rw-r--r--tests/general_tests/lsqlin/lsqlin_logical2.sce53
-rw-r--r--tests/general_tests/lsqlin/lsqlin_logical3.sce55
-rw-r--r--tests/general_tests/lsqlin/lsqlin_logical4.sce56
-rw-r--r--tests/general_tests/lsqlin/lsqlin_logical5.sce57
-rw-r--r--tests/general_tests/lsqlin/lsqlin_x01.sce1
-rw-r--r--tests/general_tests/lsqlin/lsqlin_zeros.sce1
8 files changed, 233 insertions, 6 deletions
diff --git a/tests/general_tests/lsqlin/lsqlin_infeasible1.sce b/tests/general_tests/lsqlin/lsqlin_infeasible1.sce
index 9509309..414841d 100644
--- a/tests/general_tests/lsqlin/lsqlin_infeasible1.sce
+++ b/tests/general_tests/lsqlin/lsqlin_infeasible1.sce
@@ -17,20 +17,23 @@ beq = [-6 -6 11];
// ineqlin: [0x0 constant]
// output =
//
-// Iterations: 0
+// Iterations: 105
+// ConstrViolation: 0.3333333
// exitflag =
//
// 5
// residual =
//
-// 1.
-// 0.
-// - 1.
+// - 10.333333
+// - 1.021D-13
+// - 12.333333
// resnorm =
//
-// 2.
+// 258.88889
// xopt =
//
-// []
+// 5.6666667
+// 5.6666667
+// 0.
[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,[],[],Aeq,beq)
diff --git a/tests/general_tests/lsqlin/lsqlin_logical1.sce b/tests/general_tests/lsqlin/lsqlin_logical1.sce
index 959cc7c..c9930cf 100644
--- a/tests/general_tests/lsqlin/lsqlin_logical1.sce
+++ b/tests/general_tests/lsqlin/lsqlin_logical1.sce
@@ -21,6 +21,7 @@ b = [4
// output =
//
// Iterations: 13
+// ConstrViolation: 0
// exitflag =
//
// 0
diff --git a/tests/general_tests/lsqlin/lsqlin_logical2.sce b/tests/general_tests/lsqlin/lsqlin_logical2.sce
new file mode 100644
index 0000000..33cdc79
--- /dev/null
+++ b/tests/general_tests/lsqlin/lsqlin_logical2.sce
@@ -0,0 +1,53 @@
+// An example with inequality constraints
+C = [1 1 1;
+ 1 1 0;
+ 0 1 1;
+ 1 0 0;
+ 0 0 1]
+d = [89;
+ 67;
+ 53;
+ 35;
+ 20;]
+A = [3 2 1;
+ 2 3 4;
+ 1 2 3];
+b = [191
+ 209
+ 162];
+Aeq = [1 2 1];
+beq = 10;
+
+//Output
+//Optimal Solution Found.
+// lambda =
+//
+// lower: [0,0,0]
+// upper: [0,0,0]
+// eqlin: 73.833333
+// ineqlin: [2.571D-10,2.732D-10,2.571D-10]
+// output =
+//
+// Iterations: 7
+// ConstrViolation: 0
+// exitflag =
+//
+// 0
+// residual =
+//
+// 37.666667
+// 54.75
+// 55.25
+// - 18.583333
+// - 19.083333
+// resnorm =
+//
+// 8178.4167
+// xopt =
+//
+// 53.583333
+// - 41.333333
+// 39.083333
+
+[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,Aeq,beq)
+
diff --git a/tests/general_tests/lsqlin/lsqlin_logical3.sce b/tests/general_tests/lsqlin/lsqlin_logical3.sce
new file mode 100644
index 0000000..f6a44d6
--- /dev/null
+++ b/tests/general_tests/lsqlin/lsqlin_logical3.sce
@@ -0,0 +1,55 @@
+// An example with inequality constraints
+C = [1 1 1;
+ 1 1 0;
+ 0 1 1;
+ 1 0 0;
+ 0 0 1]
+d = [89;
+ 67;
+ 53;
+ 35;
+ 20;]
+A = [3 2 1;
+ 2 3 4;
+ 1 2 3];
+b = [191
+ 209
+ 162];
+Aeq = [1 2 1];
+beq = 10;
+lb = repmat(0.1,3,1);
+ub = repmat(4,3,1);
+
+//Output
+//Optimal Solution Found.
+// lambda =
+//
+// lower: [5.357D-12,2.334D-11,5.356D-12]
+// upper: [78,6.963D-12,49]
+// eqlin: 95
+// ineqlin: [1.206D-13,1.146D-13,1.449D-13]
+// output =
+//
+// Iterations: 8
+// ConstrViolation: 8.000D-08
+// exitflag =
+//
+// 0
+// residual =
+//
+// 80.
+// 62.
+// 48.
+// 31.
+// 16.
+// resnorm =
+//
+// 13765.
+// xopt =
+//
+// 4.
+// 1.0000000
+// 4.
+
+[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,Aeq,beq,lb,ub)
+
diff --git a/tests/general_tests/lsqlin/lsqlin_logical4.sce b/tests/general_tests/lsqlin/lsqlin_logical4.sce
new file mode 100644
index 0000000..231fe02
--- /dev/null
+++ b/tests/general_tests/lsqlin/lsqlin_logical4.sce
@@ -0,0 +1,56 @@
+// An example with inequality constraints
+C = [1 1 1;
+ 1 1 0;
+ 0 1 1;
+ 1 0 0;
+ 0 0 1]
+d = [89;
+ 67;
+ 53;
+ 35;
+ 20;]
+A = [3 2 1;
+ 2 3 4;
+ 1 2 3];
+b = [191
+ 209
+ 162];
+Aeq = [1 2 1];
+beq = 10;
+lb = repmat(0.1,3,1);
+ub = repmat(4,3,1);
+x0 = repmat(0,3,1);
+
+//Output
+//Optimal Solution Found.
+// lambda =
+//
+// lower: [5.357D-12,2.334D-11,5.356D-12]
+// upper: [78,6.963D-12,49]
+// eqlin: 95
+// ineqlin: [1.206D-13,1.146D-13,1.449D-13]
+// output =
+//
+// Iterations: 8
+// ConstrViolation: 8.000D-08
+// exitflag =
+//
+// 0
+// residual =
+//
+// 80.
+// 62.
+// 48.
+// 31.
+// 16.
+// resnorm =
+//
+// 13765.
+// xopt =
+//
+// 4.
+// 1.0000000
+// 4.
+
+[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,Aeq,beq,lb,ub,x0)
+
diff --git a/tests/general_tests/lsqlin/lsqlin_logical5.sce b/tests/general_tests/lsqlin/lsqlin_logical5.sce
new file mode 100644
index 0000000..0802609
--- /dev/null
+++ b/tests/general_tests/lsqlin/lsqlin_logical5.sce
@@ -0,0 +1,57 @@
+// An example with inequality constraints
+C = [1 1 1;
+ 1 1 0;
+ 0 1 1;
+ 1 0 0;
+ 0 0 1]
+d = [89;
+ 67;
+ 53;
+ 35;
+ 20;]
+A = [3 2 1;
+ 2 3 4;
+ 1 2 3];
+b = [191
+ 209
+ 162];
+Aeq = [1 2 1];
+beq = 10;
+lb = repmat(0.1,3,1);
+ub = repmat(4,3,1);
+x0 = repmat(0,3,1);
+options = list("MaxIter", 300);
+
+//Output
+//Optimal Solution Found.
+// lambda =
+//
+// lower: [5.357D-12,2.334D-11,5.356D-12]
+// upper: [78,6.963D-12,49]
+// eqlin: 95
+// ineqlin: [1.206D-13,1.146D-13,1.449D-13]
+// output =
+//
+// Iterations: 8
+// ConstrViolation: 8.000D-08
+// exitflag =
+//
+// 0
+// residual =
+//
+// 80.
+// 62.
+// 48.
+// 31.
+// 16.
+// resnorm =
+//
+// 13765.
+// xopt =
+//
+// 4.
+// 1.0000000
+// 4.
+
+[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,Aeq,beq,lb,ub,x0,options)
+
diff --git a/tests/general_tests/lsqlin/lsqlin_x01.sce b/tests/general_tests/lsqlin/lsqlin_x01.sce
index d014443..c50c359 100644
--- a/tests/general_tests/lsqlin/lsqlin_x01.sce
+++ b/tests/general_tests/lsqlin/lsqlin_x01.sce
@@ -23,6 +23,7 @@ x0 = [0 0 0];
// output =
//
// Iterations: 13
+// ConstrViolation: 0
// exitflag =
//
// 0
diff --git a/tests/general_tests/lsqlin/lsqlin_zeros.sce b/tests/general_tests/lsqlin/lsqlin_zeros.sce
index 2695ff1..309b35f 100644
--- a/tests/general_tests/lsqlin/lsqlin_zeros.sce
+++ b/tests/general_tests/lsqlin/lsqlin_zeros.sce
@@ -14,6 +14,7 @@ b = [0];
// output =
//
// Iterations: 2
+// ConstrViolation: 0
// exitflag =
//
// 0