summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
Diffstat (limited to 'demos')
-rw-r--r--demos/lsqlin.dem.sce4
-rw-r--r--demos/lsqnonneg.dem.sce2
-rw-r--r--demos/qpipopt.dem.sce3
-rw-r--r--demos/qpipoptmat.dem.sce36
-rw-r--r--demos/symphony.dem.sce5
-rw-r--r--demos/symphonymat.dem.sce3
6 files changed, 22 insertions, 31 deletions
diff --git a/demos/lsqlin.dem.sce b/demos/lsqlin.dem.sce
index d417bf0..fb4bad9 100644
--- a/demos/lsqlin.dem.sce
+++ b/demos/lsqlin.dem.sce
@@ -21,8 +21,10 @@ b = [0.5251
0.2026
0.6721];
[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b)
+// Press ENTER to continue
halt() // Press return to continue
+//A basic example for equality, inequality and bounds
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
@@ -44,6 +46,4 @@ beq = 4;
lb = -0.1*ones(4,1);
ub = 2*ones(4,1);
[xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,Aeq,beq,lb,ub)
-halt() // Press return to continue
-
//========= E N D === O F === D E M O =========//
diff --git a/demos/lsqnonneg.dem.sce b/demos/lsqnonneg.dem.sce
index b61af0a..73fa6df 100644
--- a/demos/lsqnonneg.dem.sce
+++ b/demos/lsqnonneg.dem.sce
@@ -15,6 +15,4 @@ d = [
0.0747
0.8405];
[xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg(C,d)
-halt() // Press return to continue
-
//========= E N D === O F === D E M O =========//
diff --git a/demos/qpipopt.dem.sce b/demos/qpipopt.dem.sce
index d929a5c..41b8314 100644
--- a/demos/qpipopt.dem.sce
+++ b/demos/qpipopt.dem.sce
@@ -20,6 +20,7 @@ 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)
+// Press ENTER to continue
halt() // Press return to continue
//Find the value of x that minimize following function
@@ -39,6 +40,4 @@ ub = [%inf; %inf];
nbVar = 2;
nbCon = 3;
[xopt,fopt,exitflag,output,lambda] = qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB)
-halt() // Press return to continue
-
//========= E N D === O F === D E M O =========//
diff --git a/demos/qpipoptmat.dem.sce b/demos/qpipoptmat.dem.sce
index 61263a8..bbaa42c 100644
--- a/demos/qpipoptmat.dem.sce
+++ b/demos/qpipoptmat.dem.sce
@@ -3,26 +3,6 @@ mode(1)
// Demo of qpipoptmat.sci
//
-//Find x in R^6 such that:
-halt() // Press return to continue
-
-Aeq= [1,-1,1,0,3,1;
--1,0,-3,-4,5,6;
-2,5,3,0,1,0];
-beq=[1; 2; 3];
-A= [0,1,0,1,2,-1;
--1,0,2,1,1,0];
-b = [-1; 2.5];
-lb=[-1000; -10000; 0; -1000; -1000; -1000];
-ub=[10000; 100; 1.5; 100; 100; 1000];
-x0 = repmat(0,6,1);
-param = list("MaxIter", 300, "CpuTime", 100);
-//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)
-clear H f A b Aeq beq lb ub;
-halt() // Press return to continue
-
//Find the value of x that minimize following function
// f(x) = 0.5*x1^2 + x2^2 - x1*x2 - 2*x1 - 6*x2
// Subject to:
@@ -37,6 +17,22 @@ b = [2; 2; 3];
lb = [0; 0];
ub = [%inf; %inf];
[xopt,fopt,exitflag,output,lambda] = qpipoptmat(H,f,A,b,[],[],lb,ub)
+// Press ENTER to continue
halt() // Press return to continue
+//Find x in R^6 such that:
+Aeq= [1,-1,1,0,3,1;
+-1,0,-3,-4,5,6;
+2,5,3,0,1,0];
+beq=[1; 2; 3];
+A= [0,1,0,1,2,-1;
+-1,0,2,1,1,0];
+b = [-1; 2.5];
+lb=[-1000; -10000; 0; -1000; -1000; -1000];
+ub=[10000; 100; 1.5; 100; 100; 1000];
+x0 = repmat(0,6,1);
+param = list("MaxIter", 300, "CpuTime", 100);
+//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)
//========= E N D === O F === D E M O =========//
diff --git a/demos/symphony.dem.sce b/demos/symphony.dem.sce
index c17c14d..0449b3a 100644
--- a/demos/symphony.dem.sce
+++ b/demos/symphony.dem.sce
@@ -24,6 +24,7 @@ xopt = [1 1 0 1 7.25 0 0.25 3.5]
fopt = [8495]
// Calling Symphony
[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1)
+// Press ENTER to continue
halt() // Press return to continue
// An advanced case where we set some options in symphony
@@ -107,7 +108,5 @@ xopt = [0 1 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 1 0 1 1 0 1 ..
// Optimal value
fopt = [ 24381 ]
// Calling Symphony
-[x,f,status,output] = symphony(nbVar,nbCon,p,isInt,lb,ub,conMatrix,conLB,conUB,-1,options)
-halt() // Press return to continue
-
+[x,f,status,output] = symphony(nbVar,nbCon,p,isInt,lb,ub,conMatrix,conLB,conUB,-1,options);
//========= E N D === O F === D E M O =========//
diff --git a/demos/symphonymat.dem.sce b/demos/symphonymat.dem.sce
index 0c968a7..9467e78 100644
--- a/demos/symphonymat.dem.sce
+++ b/demos/symphonymat.dem.sce
@@ -17,6 +17,7 @@ beq = [ 25, 1.25, 1.25]
intcon = [1 2 3 4];
// Calling Symphony
[x,f,status,output] = symphonymat(c,intcon,[],[],Aeq,beq,lb,ub)
+// Press ENTER to continue
halt() // Press return to continue
// An advanced case where we set some options in symphony
@@ -99,6 +100,4 @@ xopt = [0 1 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 1 0 1 1 0 1 ..
fopt = [ 24381 ]
// Calling Symphony
[x,f,status,output] = symphonymat(objCoef,intcon,conMatrix,conUB,[],[],lb,ub,options);
-halt() // Press return to continue
-
//========= E N D === O F === D E M O =========//