summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarpreet2015-12-16 16:28:46 +0530
committerHarpreet2015-12-16 16:28:46 +0530
commitfd86d04fdabb5719fff776af7dafe8f42dc39141 (patch)
treec8bb276467993592fe61873268eef3462825af13
parent436f0daf6e4f241b8fa582a943bad09ddc091f59 (diff)
downloadFOSSEE-Optimization-toolbox-fd86d04fdabb5719fff776af7dafe8f42dc39141.tar.gz
FOSSEE-Optimization-toolbox-fd86d04fdabb5719fff776af7dafe8f42dc39141.tar.bz2
FOSSEE-Optimization-toolbox-fd86d04fdabb5719fff776af7dafe8f42dc39141.zip
Bugs from lsqlin and lsqnonneg fixed
-rw-r--r--demos/lsqnonneg.dem.sce2
-rw-r--r--jar/scilab_en_US_help.jarbin214010 -> 214010 bytes
-rw-r--r--macros/lsqlin.binbin51108 -> 51508 bytes
-rw-r--r--macros/lsqlin.sci18
-rw-r--r--macros/lsqnonneg.binbin23532 -> 23408 bytes
-rw-r--r--macros/lsqnonneg.sci14
-rw-r--r--macros/qpipoptmat.binbin50868 -> 51224 bytes
-rw-r--r--macros/qpipoptmat.sci6
-rwxr-xr-xsci_gateway/cpp/libFAMOS.sobin122920 -> 122920 bytes
-rw-r--r--sci_gateway/cpp/sci_ipopt.cpp2
10 files changed, 22 insertions, 20 deletions
diff --git a/demos/lsqnonneg.dem.sce b/demos/lsqnonneg.dem.sce
index f9d5d78..b61af0a 100644
--- a/demos/lsqnonneg.dem.sce
+++ b/demos/lsqnonneg.dem.sce
@@ -3,7 +3,7 @@ mode(1)
// Demo of lsqnonneg.sci
//
-A basic lsqnonneg problem
+// A basic lsqnonneg problem
C = [
0.0372 0.2869
0.6861 0.7071
diff --git a/jar/scilab_en_US_help.jar b/jar/scilab_en_US_help.jar
index 1af3f90..3357bbb 100644
--- a/jar/scilab_en_US_help.jar
+++ b/jar/scilab_en_US_help.jar
Binary files differ
diff --git a/macros/lsqlin.bin b/macros/lsqlin.bin
index d86e0e1..801025f 100644
--- a/macros/lsqlin.bin
+++ b/macros/lsqlin.bin
Binary files differ
diff --git a/macros/lsqlin.sci b/macros/lsqlin.sci
index b990c08..4a5fa2d 100644
--- a/macros/lsqlin.sci
+++ b/macros/lsqlin.sci
@@ -320,18 +320,20 @@ function [xopt,resnorm,residual,exitflag,output,lambda] = lsqlin (varargin)
[xopt,fopt,status,iter,Zl,Zu,lmbda] = solveqp(nbVar,nbCon,Q,p,conMatrix,conLB,conUB,LB,UB,x0,options);
xopt = xopt';
- residual = C*xopt-d;
+ residual = -1*(C*xopt-d);
resnorm = residual'*residual;
exitflag = status;
output = struct("Iterations" , []);
output.Iterations = iter;
- lambda = struct("lower" , [], ..
- "upper" , [], ..
- "constraint" , []);
-
- lambda.lower = Zl;
- lambda.upper = Zu;
- lambda.constraint = lmbda;
+ lambda = struct("lower" , [], ..
+ "upper" , [], ..
+ "eqlin" , [], ..
+ "ineqlin" , []);
+
+ lambda.lower = Zl;
+ lambda.upper = Zu;
+ lambda.eqlin = lmbda(1:nbConEq);
+ lambda.ineqlin = lmbda(nbConEq+1:nbCon);
select status
case 0 then
diff --git a/macros/lsqnonneg.bin b/macros/lsqnonneg.bin
index e9e1295..cd8a04a 100644
--- a/macros/lsqnonneg.bin
+++ b/macros/lsqnonneg.bin
Binary files differ
diff --git a/macros/lsqnonneg.sci b/macros/lsqnonneg.sci
index c65b1ba..77e5e44 100644
--- a/macros/lsqnonneg.sci
+++ b/macros/lsqnonneg.sci
@@ -134,18 +134,16 @@ function [xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg (varargin)
[xopt,fopt,status,iter,Zl,Zu,lmbda] = solveqp(nbVar,nbCon,Q,p,conMatrix,conLB,conUB,LB,UB,x0,options);
xopt = xopt';
- residual = C*xopt-d;
+ residual = -1*(C*xopt-d);
resnorm = residual'*residual;
exitflag = status;
output = struct("Iterations" , []);
output.Iterations = iter;
- lambda = struct("lower" , [], ..
- "upper" , [], ..
- "constraint" , []);
-
- lambda.lower = Zl;
- lambda.upper = Zu;
- lambda.constraint = lmbda;
+ lambda = struct("lower" , [], ..
+ "upper" , []);
+
+ lambda.lower = Zl;
+ lambda.upper = Zu;
select status
case 0 then
diff --git a/macros/qpipoptmat.bin b/macros/qpipoptmat.bin
index 98ec979..7a37d9a 100644
--- a/macros/qpipoptmat.bin
+++ b/macros/qpipoptmat.bin
Binary files differ
diff --git a/macros/qpipoptmat.sci b/macros/qpipoptmat.sci
index 4b8e427..3f58e70 100644
--- a/macros/qpipoptmat.sci
+++ b/macros/qpipoptmat.sci
@@ -336,11 +336,13 @@ function [xopt,fopt,exitflag,output,lambda] = qpipoptmat (varargin)
output.Iterations = iter;
lambda = struct("lower" , [], ..
"upper" , [], ..
- "constraint" , []);
+ "eqlin" , [], ..
+ "ineqlin" , []);
lambda.lower = Zl;
lambda.upper = Zu;
- lambda.constraint = lmbda;
+ lambda.eqlin = lmbda(1:nbConEq);
+ lambda.ineqlin = lmbda(nbConEq+1:nbCon);
select status
diff --git a/sci_gateway/cpp/libFAMOS.so b/sci_gateway/cpp/libFAMOS.so
index f973a5b..d4464aa 100755
--- a/sci_gateway/cpp/libFAMOS.so
+++ b/sci_gateway/cpp/libFAMOS.so
Binary files differ
diff --git a/sci_gateway/cpp/sci_ipopt.cpp b/sci_gateway/cpp/sci_ipopt.cpp
index b8e94a4..7094615 100644
--- a/sci_gateway/cpp/sci_ipopt.cpp
+++ b/sci_gateway/cpp/sci_ipopt.cpp
@@ -233,7 +233,7 @@ int sci_solveqp(char *fname)
return 1;
}
- if (returnDoubleMatrixToScilab(7, 1, 1, Lambda))
+ if (returnDoubleMatrixToScilab(7, 1, nCons, Lambda))
{
return 1;
}