From f7c5cbc61d5b52c749824298cfa39a95db2d879c Mon Sep 17 00:00:00 2001 From: Harpreet Date: Fri, 29 Jan 2016 16:38:03 +0530 Subject: linprog general tests added --- DevDoc.md | 2 +- README.md | 2 +- builder.sce | 10 +- demos/fgoalattain.dem.sce | 14 +- demos/fminbnd.dem.sce | 2 + demos/fmincon.dem.sce | 3 + demos/fminimax.dem.sce | 12 +- demos/fminunc.dem.sce | 2 + demos/linprog.dem.sce | 2 +- ...sci_FOSSEE_Optimization_Toolbox.dem.gateway.sce | 16 +++ demos/sci_symphony.dem.gateway.sce | 16 --- etc/FOSSEE_Optimization_Toolbox.quit | 36 +++++ etc/FOSSEE_Optimization_Toolbox.start | 87 ++++++++++++ etc/Symphony.quit | 36 ----- etc/Symphony.start | 92 ------------ help/builder_help.sce | 5 +- help/en_US/fgoalattain.xml | 85 ++++++----- help/en_US/fminbnd.xml | 2 + help/en_US/fmincon.xml | 3 + help/en_US/fminimax.xml | 86 ++++++------ help/en_US/fminunc.xml | 2 + help/en_US/linprog.xml | 23 +-- help/en_US/lsqlin.xml | 10 ++ help/en_US/lsqnonneg.xml | 10 ++ help/en_US/master_help.xml | 6 +- help/en_US/qpipopt.xml | 10 ++ help/en_US/qpipoptmat.xml | 12 +- help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS | Bin 8587 -> 8644 bytes .../scilab_en_US_help/JavaHelpSearch/DOCS.TAB | Bin 961 -> 959 bytes .../en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS | Bin 303 -> 304 bytes .../scilab_en_US_help/JavaHelpSearch/POSITIONS | Bin 46716 -> 47502 bytes help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA | 2 +- help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP | Bin 18432 -> 18432 bytes help/en_US/scilab_en_US_help/fgoalattain.html | 94 ++++++------- help/en_US/scilab_en_US_help/fminbnd.html | 12 +- help/en_US/scilab_en_US_help/fmincon.html | 15 +- help/en_US/scilab_en_US_help/fminimax.html | 92 ++++++------ help/en_US/scilab_en_US_help/fminunc.html | 12 +- help/en_US/scilab_en_US_help/index.html | 6 +- help/en_US/scilab_en_US_help/jhelpset.hs | 2 +- help/en_US/scilab_en_US_help/jhelptoc.xml | 4 +- help/en_US/scilab_en_US_help/linprog.html | 27 ++-- help/en_US/scilab_en_US_help/lsqlin.html | 12 +- help/en_US/scilab_en_US_help/lsqnonneg.html | 12 +- help/en_US/scilab_en_US_help/qpipopt.html | 12 +- help/en_US/scilab_en_US_help/qpipoptmat.html | 14 +- .../section_19f4f1e5726c01d683e8b82be0a7e910.html | 8 +- .../section_508f0b211d17ea6769714cc144e6b731.html | 6 +- help/en_US/scilab_en_US_help/sym_addConstr.html | 2 +- help/en_US/scilab_en_US_help/sym_addVar.html | 2 +- help/en_US/scilab_en_US_help/sym_close.html | 2 +- .../en_US/scilab_en_US_help/sym_deleteConstrs.html | 2 +- help/en_US/scilab_en_US_help/sym_deleteVars.html | 2 +- .../scilab_en_US_help/sym_getConstrActivity.html | 2 +- .../scilab_en_US_help/sym_getConstrLower.html | 2 +- .../scilab_en_US_help/sym_getConstrRange.html | 2 +- .../scilab_en_US_help/sym_getConstrSense.html | 2 +- .../scilab_en_US_help/sym_getConstrUpper.html | 2 +- help/en_US/scilab_en_US_help/sym_getDblParam.html | 2 +- help/en_US/scilab_en_US_help/sym_getInfinity.html | 2 +- help/en_US/scilab_en_US_help/sym_getIntParam.html | 2 +- help/en_US/scilab_en_US_help/sym_getIterCount.html | 2 +- help/en_US/scilab_en_US_help/sym_getMatrix.html | 2 +- help/en_US/scilab_en_US_help/sym_getNumConstr.html | 2 +- .../scilab_en_US_help/sym_getNumElements.html | 2 +- help/en_US/scilab_en_US_help/sym_getNumVar.html | 2 +- help/en_US/scilab_en_US_help/sym_getObjCoeff.html | 2 +- help/en_US/scilab_en_US_help/sym_getObjSense.html | 2 +- help/en_US/scilab_en_US_help/sym_getObjVal.html | 2 +- .../scilab_en_US_help/sym_getPrimalBound.html | 2 +- help/en_US/scilab_en_US_help/sym_getRhs.html | 2 +- help/en_US/scilab_en_US_help/sym_getStatus.html | 2 +- help/en_US/scilab_en_US_help/sym_getStrParam.html | 2 +- help/en_US/scilab_en_US_help/sym_getVarLower.html | 2 +- help/en_US/scilab_en_US_help/sym_getVarSoln.html | 2 +- help/en_US/scilab_en_US_help/sym_getVarUpper.html | 2 +- help/en_US/scilab_en_US_help/sym_isAbandoned.html | 2 +- help/en_US/scilab_en_US_help/sym_isBinary.html | 2 +- help/en_US/scilab_en_US_help/sym_isContinuous.html | 2 +- help/en_US/scilab_en_US_help/sym_isEnvActive.html | 2 +- help/en_US/scilab_en_US_help/sym_isInfeasible.html | 2 +- help/en_US/scilab_en_US_help/sym_isInteger.html | 2 +- .../scilab_en_US_help/sym_isIterLimitReached.html | 2 +- help/en_US/scilab_en_US_help/sym_isOptimal.html | 2 +- .../scilab_en_US_help/sym_isTargetGapAchieved.html | 2 +- .../scilab_en_US_help/sym_isTimeLimitReached.html | 2 +- help/en_US/scilab_en_US_help/sym_loadMPS.html | 2 +- help/en_US/scilab_en_US_help/sym_loadProblem.html | 2 +- .../scilab_en_US_help/sym_loadProblemBasic.html | 2 +- help/en_US/scilab_en_US_help/sym_open.html | 2 +- help/en_US/scilab_en_US_help/sym_resetParams.html | 2 +- .../scilab_en_US_help/sym_setConstrLower.html | 2 +- .../en_US/scilab_en_US_help/sym_setConstrType.html | 2 +- .../scilab_en_US_help/sym_setConstrUpper.html | 2 +- .../en_US/scilab_en_US_help/sym_setContinuous.html | 2 +- help/en_US/scilab_en_US_help/sym_setDblParam.html | 2 +- help/en_US/scilab_en_US_help/sym_setIntParam.html | 2 +- help/en_US/scilab_en_US_help/sym_setInteger.html | 2 +- help/en_US/scilab_en_US_help/sym_setObjCoeff.html | 2 +- help/en_US/scilab_en_US_help/sym_setObjSense.html | 2 +- .../scilab_en_US_help/sym_setPrimalBound.html | 2 +- help/en_US/scilab_en_US_help/sym_setStrParam.html | 2 +- help/en_US/scilab_en_US_help/sym_setVarLower.html | 2 +- help/en_US/scilab_en_US_help/sym_setVarSoln.html | 2 +- help/en_US/scilab_en_US_help/sym_setVarUpper.html | 2 +- help/en_US/scilab_en_US_help/sym_solve.html | 2 +- help/en_US/scilab_en_US_help/symphony.html | 6 +- help/en_US/scilab_en_US_help/symphonymat.html | 6 +- jar/scilab_en_US_help.jar | Bin 267265 -> 270331 bytes loader.sce | 2 +- macros/Checkdims.bin | Bin 0 -> 8188 bytes macros/Checklhs.bin | Bin 0 -> 10312 bytes macros/Checkrhs.bin | Bin 0 -> 12852 bytes macros/Checktype.bin | Bin 0 -> 9156 bytes macros/Checkvector.bin | Bin 0 -> 9696 bytes macros/buildmacros.sce | 2 +- macros/fgoalattain.bin | Bin 0 -> 76912 bytes macros/fgoalattain.sci | 139 +++++------------- macros/fminbnd.bin | Bin 53664 -> 54876 bytes macros/fminbnd.sci | 8 +- macros/fmincon.bin | Bin 149444 -> 149512 bytes macros/fmincon.sci | 14 +- macros/fminimax.bin | Bin 0 -> 86512 bytes macros/fminimax.sci | 102 +++++--------- macros/fminunc.bin | Bin 60828 -> 60896 bytes macros/fminunc.sci | 10 +- macros/lib | Bin 864 -> 840 bytes macros/linprog.bin | Bin 28828 -> 29644 bytes macros/linprog.sci | 15 +- macros/lsqlin.bin | Bin 59776 -> 64528 bytes macros/lsqlin.sci | 31 +++- macros/lsqnonneg.bin | Bin 30692 -> 33808 bytes macros/lsqnonneg.sci | 20 ++- macros/matrix_linprog.bin | Bin 30556 -> 31128 bytes macros/matrix_linprog.sci | 50 +++---- macros/mps_linprog.bin | Bin 9028 -> 10064 bytes macros/mps_linprog.sci | 16 ++- macros/names | 11 +- macros/qpipopt.bin | Bin 58352 -> 63432 bytes macros/qpipopt.sci | 44 ++++-- macros/qpipoptmat.bin | Bin 61536 -> 66084 bytes macros/qpipoptmat.sci | 39 ++++-- macros/symphony.bin | Bin 59692 -> 62044 bytes macros/symphony.sci | 11 ++ macros/symphonymat.bin | Bin 63268 -> 65436 bytes macros/symphonymat.sci | 10 ++ sci_gateway/builder_gateway.sce | 6 +- sci_gateway/cpp/builder_gateway_cpp.sce | 10 +- sci_gateway/cpp/cleaner.sce | 8 +- sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.c | 156 +++++++++++++++++++++ sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.so | Bin 0 -> 199050 bytes sci_gateway/cpp/loader.sce | 8 +- tests/general_tests/linprog/linprog_A1.sce | 18 +++ tests/general_tests/linprog/linprog_Aeq1.sce | 18 +++ tests/general_tests/linprog/linprog_b1.sce | 17 +++ tests/general_tests/linprog/linprog_beq1.sce | 17 +++ .../linprog/linprog_dual_infeasible1.sce | 31 ++++ tests/general_tests/linprog/linprog_input1.sce | 17 +++ tests/general_tests/linprog/linprog_input2.sce | 17 +++ tests/general_tests/linprog/linprog_logical1.sce | 36 +++++ tests/general_tests/linprog/linprog_logical2.sce | 32 +++++ tests/general_tests/linprog/linprog_logical3.sce | 32 +++++ tests/general_tests/linprog/linprog_logical4.sce | 33 +++++ tests/general_tests/linprog/linprog_maxiter.sce | 32 +++++ tests/general_tests/linprog/linprog_null1.sce | 17 +++ tests/general_tests/linprog/linprog_param1.sce | 19 +++ tests/general_tests/linprog/linprog_param2.sce | 19 +++ tests/general_tests/linprog/linprog_param3.sce | 21 +++ .../linprog/linprog_primal_infeasible1.sce | 34 +++++ tests/general_tests/linprog/linprog_zeros1.sce | 30 ++++ tests/general_tests/lsqlin/lsqlin_param3.sce | 2 +- tests/unit_tests/fgoalattain.dia.ref | 74 ++++++++++ tests/unit_tests/fgoalattain.tst | 74 ++++++++++ tests/unit_tests/fminbnd.dia.ref | 71 ++++++++++ tests/unit_tests/fminbnd.tst | 71 ++++++++++ tests/unit_tests/fmincon.dia.ref | 98 +++++++++++++ tests/unit_tests/fmincon.tst | 98 +++++++++++++ tests/unit_tests/fminimax.dia.ref | 105 ++++++++++++++ tests/unit_tests/fminimax.tst | 105 ++++++++++++++ tests/unit_tests/fminunc.dia.ref | 79 +++++++++++ tests/unit_tests/fminunc.tst | 79 +++++++++++ tests/unit_tests/linprog.dia.ref | 68 +++++++++ tests/unit_tests/linprog.tst | 68 +++++++++ tests/unit_tests/qpipopt_base.dia.ref | 4 +- tests/unit_tests/qpipopt_base.tst | 4 +- tests/unit_tests/qpipoptmat_base.dia.ref | 2 +- tests/unit_tests/qpipoptmat_base.tst | 2 +- unloader.sce | 2 +- 188 files changed, 2428 insertions(+), 774 deletions(-) create mode 100644 demos/sci_FOSSEE_Optimization_Toolbox.dem.gateway.sce delete mode 100644 demos/sci_symphony.dem.gateway.sce create mode 100644 etc/FOSSEE_Optimization_Toolbox.quit create mode 100644 etc/FOSSEE_Optimization_Toolbox.start delete mode 100644 etc/Symphony.quit delete mode 100644 etc/Symphony.start create mode 100644 macros/Checkdims.bin create mode 100644 macros/Checklhs.bin create mode 100644 macros/Checkrhs.bin create mode 100644 macros/Checktype.bin create mode 100644 macros/Checkvector.bin create mode 100644 macros/fgoalattain.bin create mode 100644 macros/fminimax.bin create mode 100644 sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.c create mode 100755 sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.so create mode 100644 tests/general_tests/linprog/linprog_A1.sce create mode 100644 tests/general_tests/linprog/linprog_Aeq1.sce create mode 100644 tests/general_tests/linprog/linprog_b1.sce create mode 100644 tests/general_tests/linprog/linprog_beq1.sce create mode 100644 tests/general_tests/linprog/linprog_dual_infeasible1.sce create mode 100644 tests/general_tests/linprog/linprog_input1.sce create mode 100644 tests/general_tests/linprog/linprog_input2.sce create mode 100644 tests/general_tests/linprog/linprog_logical1.sce create mode 100644 tests/general_tests/linprog/linprog_logical2.sce create mode 100644 tests/general_tests/linprog/linprog_logical3.sce create mode 100644 tests/general_tests/linprog/linprog_logical4.sce create mode 100644 tests/general_tests/linprog/linprog_maxiter.sce create mode 100644 tests/general_tests/linprog/linprog_null1.sce create mode 100644 tests/general_tests/linprog/linprog_param1.sce create mode 100644 tests/general_tests/linprog/linprog_param2.sce create mode 100644 tests/general_tests/linprog/linprog_param3.sce create mode 100644 tests/general_tests/linprog/linprog_primal_infeasible1.sce create mode 100644 tests/general_tests/linprog/linprog_zeros1.sce create mode 100644 tests/unit_tests/fgoalattain.dia.ref create mode 100644 tests/unit_tests/fgoalattain.tst create mode 100644 tests/unit_tests/fminbnd.dia.ref create mode 100644 tests/unit_tests/fminbnd.tst create mode 100644 tests/unit_tests/fmincon.dia.ref create mode 100644 tests/unit_tests/fmincon.tst create mode 100644 tests/unit_tests/fminimax.dia.ref create mode 100644 tests/unit_tests/fminimax.tst create mode 100644 tests/unit_tests/fminunc.dia.ref create mode 100644 tests/unit_tests/fminunc.tst create mode 100644 tests/unit_tests/linprog.dia.ref create mode 100644 tests/unit_tests/linprog.tst diff --git a/DevDoc.md b/DevDoc.md index 94f6ab8..c4be943 100644 --- a/DevDoc.md +++ b/DevDoc.md @@ -1,4 +1,4 @@ -# Symphony Toolbox for Scilab +# FOSSEE Optimization Toolbox for Scilab A toolbox that provides mixed integer linear programming, quadratic programming and non linear programming tools in Scilab through the Symphony and Ipopt libraries. diff --git a/README.md b/README.md index a22a508..281be0c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Symphony Toolbox for Scilab +# FOSSEE Optimization Toolbox for Scilab A toolbox that provides mixed integer linear programming, quadratic programming and non linear programming tools in Scilab through the Symphony and Ipopt libraries. diff --git a/builder.sce b/builder.sce index a8dcbba..df239c6 100644 --- a/builder.sce +++ b/builder.sce @@ -2,14 +2,14 @@ mode(-1); // 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 +// Author: Harpreet Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in lines(0); try @@ -27,8 +27,8 @@ if getos()=="Windows" then error(msprintf(gettext("Module is not availabe on Windows."))); end // ==================================================================== -TOOLBOX_NAME = "Symphony"; -TOOLBOX_TITLE = "Symphony Toolbox"; +TOOLBOX_NAME = "FOSSEE_Optimization_Toolbox"; +TOOLBOX_TITLE = "FOSSEE Optimization Toolbox"; // ==================================================================== diff --git a/demos/fgoalattain.dem.sce b/demos/fgoalattain.dem.sce index 89a5957..345509b 100644 --- a/demos/fgoalattain.dem.sce +++ b/demos/fgoalattain.dem.sce @@ -3,7 +3,7 @@ mode(1) // Demo of fgoalattain.sci // -function f1 = fun(x) +function f1 = gattainObjfun(x) f1(1)=2*x(1)*x(1)+x(2)*x(2)-48*x(1)-40*x(2)+304 f1(2)=-x(1)*x(1)-3*x(2)*x(2) f1(3)=x(1)+3*x(2)-18 @@ -11,16 +11,10 @@ f1(4)=-x(1)-x(2) f1(5)=x(1)+x(2)-8 endfunction x0=[-1,1]; -halt() // Press return to continue - goal=[-5,-3,-2,-1,-4]; weight=abs(goal) -//xopt = [-0.0000011 -63.999998 -2.0000002 -8 3.485D-08] -//fval = [4 3.99] -halt() // Press return to continue - +//gval =[- 0.0000011 -63.999998 -2.0000002 -8 3.485D-08] +//z = [4 3.99] //Run fgoalattain -[xopt,fval,attainfactor,exitflag,output,lambda]=fgoalattain(fun,x0,goal,weight) -halt() // Press return to continue - +[x,fval,attainfactor,exitflag,output,lambda]=fgoalattain(gattainObjfun,x0,goal,weight) //========= E N D === O F === D E M O =========// diff --git a/demos/fminbnd.dem.sce b/demos/fminbnd.dem.sce index a9b4865..7d83057 100644 --- a/demos/fminbnd.dem.sce +++ b/demos/fminbnd.dem.sce @@ -20,6 +20,7 @@ x2 = [2, 2, 2, 2, 2, 2]; options=list("MaxIter",[1500],"CpuTime", [100],"TolX",[1e-6]) //Calling Ipopt [x,fval] =fminbnd(f, x1, x2, options) +// Press ENTER to continue halt() // Press return to continue //Find x in R such that it minimizes: @@ -34,6 +35,7 @@ x1 = [0]; x2 = [1000]; //Calling Ipopt [x,fval,exitflag,output,lambda] =fminbnd(f, x1, x2) +// Press ENTER to continue halt() // Press return to continue //The below problem is an unbounded problem: diff --git a/demos/fmincon.dem.sce b/demos/fmincon.dem.sce index 790c67f..dc6aa39 100644 --- a/demos/fmincon.dem.sce +++ b/demos/fmincon.dem.sce @@ -38,6 +38,7 @@ endfunction options=list("GradObj", fGrad, "Hessian", lHess); //Calling Ipopt [x,fval,exitflag,output,lambda,grad,hessian] =fmincon(f, x0,A,b,Aeq,beq,lb,ub,nlc,options) +// Press ENTER to continue halt() // Press return to continue //Find x in R^3 such that it minimizes: @@ -79,6 +80,7 @@ endfunction options=list("MaxIter", [1500], "CpuTime", [500], "GradObj", fGrad, "Hessian", lHess,"GradCon", cGrad); //Calling Ipopt [x,fval,exitflag,output] =fmincon(f, x0,A,b,Aeq,beq,lb,ub,nlc,options) +// Press ENTER to continue halt() // Press return to continue //The below problem is an unbounded problem: @@ -104,6 +106,7 @@ ub=[0,0,0]; options=list("MaxIter", [1500], "CpuTime", [500]); //Calling Ipopt [x,fval,exitflag,output,lambda,grad,hessian] =fmincon(f, x0,A,b,Aeq,beq,lb,ub,[],options) +// Press ENTER to continue halt() // Press return to continue //The below problem is an infeasible problem: diff --git a/demos/fminimax.dem.sce b/demos/fminimax.dem.sce index 404af00..d8c462c 100644 --- a/demos/fminimax.dem.sce +++ b/demos/fminimax.dem.sce @@ -16,11 +16,11 @@ endfunction // The initial guess x0 = [0.1,0.1]; // The expected solution : only 4 digits are guaranteed -//xopt = [4 4] -//fopt = [0 -64 -2 -8 0] +xopt = [4 4] +fopt = [0 -64 -2 -8 0] maxfopt = 0 // Run fminimax -[xopt,fopt,maxfval,exitflag,output,lambda] = fminimax(myfun, x0) +[x,fval,maxfval,exitflag,output,lambda] = fminimax(myfun, x0) // Press ENTER to continue halt() // Press return to continue @@ -65,9 +65,9 @@ minimaxOptions = list("GradObj",myfungrad,"GradCon",cgrad); // The initial guess x0 = [0,10]; // The expected solution : only 4 digits are guaranteed -//xopt = [0.92791 7.93551] -//fopt = [6.73443 -189.778 6.73443 -8.86342 0.86342] +xopt = [0.92791 7.93551] +fopt = [6.73443 -189.778 6.73443 -8.86342 0.86342] maxfopt = 6.73443 // Run fminimax -[xopt,fopt,maxfval,exitflag,output] = fminimax(myfun,x0,[],[],[],[],[],[], confun, minimaxOptions) +[x,fval,maxfval,exitflag,output] = fminimax(myfun,x0,[],[],[],[],[],[], confun, minimaxOptions) //========= E N D === O F === D E M O =========// diff --git a/demos/fminunc.dem.sce b/demos/fminunc.dem.sce index 80eed72..a43603e 100644 --- a/demos/fminunc.dem.sce +++ b/demos/fminunc.dem.sce @@ -23,6 +23,7 @@ endfunction options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", fGrad, "Hessian", fHess); //Calling Ipopt [xopt,fopt,exitflag,output,gradient,hessian]=fminunc(f,x0,options) +// Press ENTER to continue halt() // Press return to continue //Find x in R^2 such that the below function is minimum @@ -35,6 +36,7 @@ endfunction x0=[2,1]; //Calling Ipopt [xopt,fopt]=fminunc(f,x0) +// Press ENTER to continue halt() // Press return to continue //The below problem is an unbounded problem: diff --git a/demos/linprog.dem.sce b/demos/linprog.dem.sce index 337a5dc..074cf61 100755 --- a/demos/linprog.dem.sce +++ b/demos/linprog.dem.sce @@ -60,5 +60,5 @@ halt() // Press return to continue filepath = get_absolute_file_path('linprog.dem.sce'); filepath = filepath + "exmip1.mps" -[xopt,fopt,exitflag,output,lambda] =linprog(filepath); +[xopt,fopt,exitflag,output,lambda] =linprog(filepath) //========= E N D === O F === D E M O =========// diff --git a/demos/sci_FOSSEE_Optimization_Toolbox.dem.gateway.sce b/demos/sci_FOSSEE_Optimization_Toolbox.dem.gateway.sce new file mode 100644 index 0000000..739ad2c --- /dev/null +++ b/demos/sci_FOSSEE_Optimization_Toolbox.dem.gateway.sce @@ -0,0 +1,16 @@ +// Copyright (C) 2015 - IIT Bombay - FOSSEE +// +// 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 +// Author: Harpreet Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +demopath = get_absolute_file_path("sci_FOSSEE_Optimization_Toolbox.dem.gateway.sce"); + +subdemolist = ["Linprog","linprog.dem.sce";"Symphony", "symphony.dem.sce"; "SymphonyMat", "symphonymat.dem.sce"; "Qpipopt", "qpipopt.dem.sce"; "QpipoptMat", "qpipoptmat.dem.sce";"Lsqlin","lsqlin.dem.sce";"Lsqnonneg","lsqnonneg.dem.sce";"Fminunc","fminunc.dem.sce";"Fminbnd","fminbnd.dem.sce";"Fmincon","fmincon.dem.sce"]; + +subdemolist(:,2) = demopath + subdemolist(:,2); diff --git a/demos/sci_symphony.dem.gateway.sce b/demos/sci_symphony.dem.gateway.sce deleted file mode 100644 index b3c52f4..0000000 --- a/demos/sci_symphony.dem.gateway.sce +++ /dev/null @@ -1,16 +0,0 @@ -// 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 - -demopath = get_absolute_file_path("sci_symphony.dem.gateway.sce"); - -subdemolist = ["Symphony", "symphony.dem.sce"; "SymphonyMat", "symphonymat.dem.sce"; "Qpipopt", "qpipopt.dem.sce"; "QpipoptMat", "qpipoptmat.dem.sce";]; - -subdemolist(:,2) = demopath + subdemolist(:,2); diff --git a/etc/FOSSEE_Optimization_Toolbox.quit b/etc/FOSSEE_Optimization_Toolbox.quit new file mode 100644 index 0000000..8e6aa18 --- /dev/null +++ b/etc/FOSSEE_Optimization_Toolbox.quit @@ -0,0 +1,36 @@ +// Copyright (C) 2015 - IIT Bombay - FOSSEE +// +// 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 +// Author: Harpreet Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + + +function quitModule() + + etc_tlbx = get_absolute_file_path("FOSSEE_Optimization_Toolbox.quit"); + etc_tlbx = getshortpathname(etc_tlbx); + root_tlbx = strncpy( etc_tlbx, length(etc_tlbx)-length("\etc\") ); + + //unlink libraries + [bOK, ilib] = c_link('FOSSEE_Optimization_Toolbox'); + if bOK then + ulink(ilib); + end + + // Remove Preferences GUI + // ============================================================================= + if getscilabmode() == "STD" then + removeModulePreferences(root_tlbx); + end + +endfunction + + +quitModule(); +clear quitModule; + diff --git a/etc/FOSSEE_Optimization_Toolbox.start b/etc/FOSSEE_Optimization_Toolbox.start new file mode 100644 index 0000000..894d577 --- /dev/null +++ b/etc/FOSSEE_Optimization_Toolbox.start @@ -0,0 +1,87 @@ +// Copyright (C) 2015 - IIT Bombay - FOSSEE +// +// 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 +// Author: Harpreet Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +mprintf("Start FOSSEE Optimization Toolbox\n"); + +if ( isdef("sym_open") ) then + warning("Library is already loaded"); + return; +end + +etc_tlbx = get_absolute_file_path("FOSSEE_Optimization_Toolbox.start"); +etc_tlbx = getshortpathname(etc_tlbx); +root_tlbx = strncpy( etc_tlbx, length(etc_tlbx)-length("\etc\") ); + +//Load functions library +// ============================================================================= +mprintf("\tLoad macros\n"); +pathmacros = pathconvert( root_tlbx ) + "macros" + filesep(); +symphony_lib = lib(pathmacros); +clear pathmacros; + +// load gateways +// ============================================================================= + +mprintf("\tLoad gateways\n"); +[a, opt] = getversion(); +Version = opt(2); +ilib_verbose(0); +if getos()=="Windows" then + error(msprintf(gettext("Module is not for Windows."))); +else + lib_path = root_tlbx + "/thirdparty/linux/lib/" + Version; + link(lib_path + "/libCoinUtils.so"); + link(lib_path + "/libClp.so"); + link(lib_path + "/libClpSolver.so"); + link(lib_path + "/libOsi.so"); + link(lib_path + "/libOsiCommonTests.so"); + link(lib_path + "/libOsiClp.so"); + link(lib_path + "/libCgl.so"); + link(lib_path + "/libSym.so"); + link(lib_path + "/libOsiSym.so"); + link(lib_path + "/libcoinblas.so"); + link(lib_path + "/libcoinlapack.so"); + link(lib_path + "/libcoinmumps.so"); + link(lib_path + "/libipopt.so"); +end +exec(pathconvert(root_tlbx + filesep() + "sci_gateway" + filesep() + "loader_gateway.sce",%f)); + +// Load and add help chapter +// ============================================================================= +if ( %t ) then +if or(getscilabmode() == ["NW";"STD"]) then + mprintf("\tLoad help\n"); + path_addchapter = pathconvert(root_tlbx+"/jar"); + if ( isdir(path_addchapter) <> [] ) then + add_help_chapter("FOSSEE_Optimization_Toolbox", path_addchapter, %F); + clear add_help_chapter; + end + clear path_addchapter; +end +end + +// add demos +// ============================================================================= + +if ( %t ) then +if or(getscilabmode() == ["NW";"STD"]) then + mprintf("\tLoad demos\n"); + pathdemos = pathconvert(root_tlbx+"/demos/sci_FOSSEE_Optimization_Toolbox.dem.gateway.sce",%f,%t); + add_demo("FOSSEE_Optimization_Toolbox",pathdemos); + clear pathdemos ; +end +end + +// ============================================================================= + +clear root_tlbx; +clear etc_tlbx; + diff --git a/etc/Symphony.quit b/etc/Symphony.quit deleted file mode 100644 index 1eabef8..0000000 --- a/etc/Symphony.quit +++ /dev/null @@ -1,36 +0,0 @@ -// 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 - - -function quitModule() - - etc_tlbx = get_absolute_file_path("Symphony.quit"); - etc_tlbx = getshortpathname(etc_tlbx); - root_tlbx = strncpy( etc_tlbx, length(etc_tlbx)-length("\etc\") ); - - //unlink libraries - [bOK, ilib] = c_link('FAMOS'); - if bOK then - ulink(ilib); - end - - // Remove Preferences GUI - // ============================================================================= - if getscilabmode() == "STD" then - removeModulePreferences(root_tlbx); - end - -endfunction - - -quitModule(); -clear quitModule; - diff --git a/etc/Symphony.start b/etc/Symphony.start deleted file mode 100644 index 328357a..0000000 --- a/etc/Symphony.start +++ /dev/null @@ -1,92 +0,0 @@ -// 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 - -mprintf("Start FAMOS\n"); - -if ( isdef("sym_open") ) then - warning("Library is already loaded"); - return; -end - -etc_tlbx = get_absolute_file_path("Symphony.start"); -etc_tlbx = getshortpathname(etc_tlbx); -root_tlbx = strncpy( etc_tlbx, length(etc_tlbx)-length("\etc\") ); - -//Load functions library -// ============================================================================= -mprintf("\tLoad macros\n"); -pathmacros = pathconvert( root_tlbx ) + "macros" + filesep(); -symphony_lib = lib(pathmacros); -clear pathmacros; - -// load gateways -// ============================================================================= - -mprintf("\tLoad gateways\n"); -[a, opt] = getversion(); -Version = opt(2); -ilib_verbose(0); -if getos()=="Windows" then - error(msprintf(gettext("Module is not for Windows."))); -else - lib_path = root_tlbx + "/thirdparty/linux/lib/" + Version; - link(lib_path + "/libCoinUtils.so"); - link(lib_path + "/libClp.so"); - link(lib_path + "/libClpSolver.so"); - link(lib_path + "/libOsi.so"); - link(lib_path + "/libOsiCommonTests.so"); - link(lib_path + "/libOsiClp.so"); - link(lib_path + "/libCgl.so"); - link(lib_path + "/libSym.so"); - link(lib_path + "/libOsiSym.so"); - link(lib_path + "/libcoinblas.so"); - link(lib_path + "/libcoinlapack.so"); - link(lib_path + "/libcoinmumps.so"); - link(lib_path + "/libipopt.so"); - - -end -exec(pathconvert(root_tlbx + filesep() + "sci_gateway" + filesep() + "loader_gateway.sce",%f)); - - - - -// Load and add help chapter -// ============================================================================= -if ( %t ) then -if or(getscilabmode() == ["NW";"STD"]) then - mprintf("\tLoad help\n"); - path_addchapter = pathconvert(root_tlbx+"/jar"); - if ( isdir(path_addchapter) <> [] ) then - add_help_chapter("Symphony", path_addchapter, %F); - clear add_help_chapter; - end - clear path_addchapter; -end -end - -// add demos -// ============================================================================= - -if ( %t ) then -if or(getscilabmode() == ["NW";"STD"]) then - mprintf("\tLoad demos\n"); - pathdemos = pathconvert(root_tlbx+"/demos/sci_symphony.dem.gateway.sce",%f,%t); - add_demo("Symphony",pathdemos); - clear pathdemos ; -end -end - -// ============================================================================= - -clear root_tlbx; -clear etc_tlbx; - diff --git a/help/builder_help.sce b/help/builder_help.sce index 7761745..ebff2b3 100644 --- a/help/builder_help.sce +++ b/help/builder_help.sce @@ -12,10 +12,7 @@ mode(-1) lines(0) -//Symphony toolbox help builder -//By Keyur Joshi, Sai Kiran and Iswarya - -toolbox_title = "Symphony" +toolbox_title = "FOSSEE_Optimization_Toolbox" help_dir = get_absolute_file_path('builder_help.sce'); diff --git a/help/en_US/fgoalattain.xml b/help/en_US/fgoalattain.xml index 29a9923..3e69265 100644 --- a/help/en_US/fgoalattain.xml +++ b/help/en_US/fgoalattain.xml @@ -24,17 +24,17 @@ Calling Sequence - x = fgoalattain(fun,x0,goal,weight) - x = fgoalattain(fun,x0,goal,weight,A,b) - x = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq) - x = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq,lb,ub) - x = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq,lb,ub,nonlcon) - x = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq,lb,ub,nonlcon,options) - [x,fval] = fgoalattain(...) - [x,fval,attainfactor] = fgoalattain(...) - [x,fval,attainfactor,exitflag] = fgoalattain(...) - [x,fval,attainfactor,exitflag,output] = fgoalattain(...) - [x,fval,attainfactor,exitflag,output,lambda] = fgoalattain(...) + xopt = fgoalattain(fun,x0,goal,weight) + xopt = fgoalattain(fun,x0,goal,weight,A,b) + xopt = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq) + xopt = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq,lb,ub) + xopt = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq,lb,ub,nonlcon) + xopt = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq,lb,ub,nonlcon,options) + [xopt,fval] = fgoalattain(...) + [xopt,fval,attainfactor] = fgoalattain(...) + [xopt,fval,attainfactor,exitflag] = fgoalattain(...) + [xopt,fval,attainfactor,exitflag,output] = fgoalattain(...) + [xopt,fval,attainfactor,exitflag,output,lambda] = fgoalattain(...) @@ -44,36 +44,36 @@ fun: a function that accepts a vector x and returns a vector F - x0: - a nx1 or 1xn matrix of double, where n is the number of variables. - A: - a nil x n matrix of double, where n is the number of variables and - b: - a nil x 1 matrix of double, where nil is the number of linear - Aeq: - a nel x n matrix of double, where n is the number of variables - beq: - a nel x 1 matrix of double, where nel is the number of linear - lb: - a nx1 or 1xn matrix of double, where n is the number of variables. - ub: - a nx1 or 1xn matrix of double, where n is the number of variables. + x0 : + a vector of double, contains initial guess of variables. + A : + a matrix of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b. + b : + a vector of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b. + Aeq : + a matrix of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq. + beq : + a vector of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq. + lb : + a vector of double, contains lower bounds of the variables. + ub : + a vector of double, contains upper bounds of the variables. nonlcon: a function, the nonlinear constraints options : a list, containing the option for user to specify. See below for details. - x: - a nx1 matrix of double, the computed solution of the optimization problem - fval: - a vector of double, the value of functions at x + xopt : + a vector of double, the computed solution of the optimization problem. + fopt : + a double, the value of the function at x. attainfactor: The amount of over- or underachievement of the goals,γ at the solution. - exitflag: - a 1x1 matrix of floating point integers, the exit status - output: - a struct, the details of the optimization process - lambda: - a struct, the Lagrange multipliers at optimum + exitflag : + The exit status. See below for details. + output : + The structure consist of statistics about the optimization. See below for details. + lambda : + The structure consist of the Lagrange multipliers at the solution of problem. See below for details. @@ -119,7 +119,7 @@ It should be defined as type "list" and contains the following fields. -By default, the gradient options for fminimax are turned off and and fmincon does the gradient opproximation of minmaxObjfun. In case the GradObj option is off and GradConstr option is on, fminimax approximates minmaxObjfun gradient using numderivative toolbox. +By default, the gradient options for fminimax are turned off and and fmincon does the gradient opproximation of gattainObjfun. In case the GradObj option is off and GradConstr option is on, fminimax approximates gattainObjfun gradient using numderivative toolbox. If we can provide exact gradients, we should do so since it improves the convergence speed of the optimization algorithm. @@ -136,7 +136,7 @@ The constraint function must have header : [c, ceq] = confun(x) -where x is a n x 1 matrix of dominmaxUbles, c is a 1 x nni matrix of doubles and ceq is a 1 x nne matrix of doubles (nni : number of nonlinear inequality constraints, nne : number of nonlinear equality constraints). +where x is a n x 1 matrix of doubles, c is a 1 x nni matrix of doubles and ceq is a 1 x nne matrix of doubles (nni : number of nonlinear inequality constraints, nne : number of nonlinear equality constraints). On input, the variable x contains the current point and, on output, the variable c must contain the nonlinear inequality constraints and ceq must contain the nonlinear equality constraints. @@ -203,7 +203,7 @@ It has type "struct" and contains the following fields. Examples diff --git a/help/en_US/fminbnd.xml b/help/en_US/fminbnd.xml index baf2f34..54f5abb 100644 --- a/help/en_US/fminbnd.xml +++ b/help/en_US/fminbnd.xml @@ -144,6 +144,7 @@ x2 = [2, 2, 2, 2, 2, 2]; options=list("MaxIter",[1500],"CpuTime", [100],"TolX",[1e-6]) //Calling Ipopt [x,fval] =fminbnd(f, x1, x2, options) +// Press ENTER to continue ]]> @@ -163,6 +164,7 @@ x1 = [0]; x2 = [1000]; //Calling Ipopt [x,fval,exitflag,output,lambda] =fminbnd(f, x1, x2) +// Press ENTER to continue ]]> diff --git a/help/en_US/fmincon.xml b/help/en_US/fmincon.xml index d8a7c4b..c4a70a7 100644 --- a/help/en_US/fmincon.xml +++ b/help/en_US/fmincon.xml @@ -193,6 +193,7 @@ endfunction options=list("GradObj", fGrad, "Hessian", lHess); //Calling Ipopt [x,fval,exitflag,output,lambda,grad,hessian] =fmincon(f, x0,A,b,Aeq,beq,lb,ub,nlc,options) +// Press ENTER to continue ]]> @@ -239,6 +240,7 @@ endfunction options=list("MaxIter", [1500], "CpuTime", [500], "GradObj", fGrad, "Hessian", lHess,"GradCon", cGrad); //Calling Ipopt [x,fval,exitflag,output] =fmincon(f, x0,A,b,Aeq,beq,lb,ub,nlc,options) +// Press ENTER to continue ]]> @@ -269,6 +271,7 @@ ub=[0,0,0]; options=list("MaxIter", [1500], "CpuTime", [500]); //Calling Ipopt [x,fval,exitflag,output,lambda,grad,hessian] =fmincon(f, x0,A,b,Aeq,beq,lb,ub,[],options) +// Press ENTER to continue ]]> diff --git a/help/en_US/fminimax.xml b/help/en_US/fminimax.xml index ddab078..efe4812 100644 --- a/help/en_US/fminimax.xml +++ b/help/en_US/fminimax.xml @@ -24,17 +24,17 @@ Calling Sequence - x = fminimax(fun,x0) - x = fminimax(fun,x0,A,b) - x = fminimax(fun,x0,A,b,Aeq,beq) - x = fminimax(fun,x0,A,b,Aeq,beq,lb,ub) - x = fminimax(fun,x0,A,b,Aeq,beq,lb,ub,nonlinfun) - x = fminimax(fun,x0,A,b,Aeq,beq,lb,ub,nonlinfun,options) - [x, fval] = fmincon(.....) - [x, fval, maxfval]= fmincon(.....) - [x, fval, maxfval, exitflag]= fmincon(.....) - [x, fval, maxfval, exitflag, output]= fmincon(.....) - [x, fval, maxfval, exitflag, output, lambda]= fmincon(.....) + xopt = fminimax(fun,x0) + xopt = fminimax(fun,x0,A,b) + xopt = fminimax(fun,x0,A,b,Aeq,beq) + xopt = fminimax(fun,x0,A,b,Aeq,beq,lb,ub) + xopt = fminimax(fun,x0,A,b,Aeq,beq,lb,ub,nonlinfun) + xopt = fminimax(fun,x0,A,b,Aeq,beq,lb,ub,nonlinfun,options) + [xopt, fval] = fmincon(.....) + [xopt, fval, maxfval]= fmincon(.....) + [xopt, fval, maxfval, exitflag]= fmincon(.....) + [xopt, fval, maxfval, exitflag, output]= fmincon(.....) + [xopt, fval, maxfval, exitflag, output, lambda]= fmincon(.....) @@ -44,36 +44,34 @@ fun: The function to be minimized. fun is a function that accepts a vector x and returns a vector F, the objective functions evaluated at x. - x0: - a nx1 or 1xn matrix of doubles, where n is the number of variables, the initial guess for the optimization algorithm - A: - a nil x n matrix of doubles, where n is the number of variables and nil is the number of linear inequalities. If A==[] and b==[], it is assumed that there is no linear inequality constraints. If (A==[] & b<>[]), fminimax generates an error (the same happens if (A<>[] & b==[])) - b: - a nil x 1 matrix of doubles, where nil is the number of linear inequalities - Aeq: - a nel x n matrix of doubles, where n is the number of variables and nel is the number of linear equalities. If Aeq==[] and beq==[], it is assumed that there is no linear equality constraints. If (Aeq==[] & beq<>[]), fminimax generates an error (the same happens if (Aeq<>[] & beq==[])) - beq: - a nel x 1 matrix of doubles, where nel is the number of linear equalities - lb: - a nx1 or 1xn matrix of doubles, where n is the number of variables. The lower bound for x. If lb==[], then the lower bound is automatically set to -inf - ub: - a nx1 or 1xn matrix of doubles, where n is the number of variables. The upper bound for x. If ub==[], then the upper bound is automatically set to +inf + x0 : + a vector of double, contains initial guess of variables. + A : + a matrix of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b. + b : + a vector of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b. + Aeq : + a matrix of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq. + beq : + a vector of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq. + lb : + a vector of double, contains lower bounds of the variables. + ub : + a vector of double, contains upper bounds of the variables. nonlinfun: - function that computes the nonlinear inequality constraints c(x) <= 0 and nonlinear equality constraints ceq(x) = 0. - x: - a nx1 matrix of doubles, the computed solution of the optimization problem - fval: - a vector of doubles, the value of fun at x + function that computes the nonlinear inequality constraints c⋅x ≤ 0 and nonlinear equality constraints c⋅x = 0. + xopt : + a vector of double, the computed solution of the optimization problem. + fopt : + a double, the value of the function at x. maxfval: a 1x1 matrix of doubles, the maximum value in vector fval - exitflag: - a 1x1 matrix of floating point integers, the exit status - output: - a struct, the details of the optimization process - lambda: - a struct, the Lagrange multipliers at optimum - options: - a list, containing the option for user to specify. See below for details. + exitflag : + The exit status. See below for details. + output : + The structure consist of statistics about the optimization. See below for details. + lambda : + The structure consist of the Lagrange multipliers at the solution of problem. See below for details. @@ -222,11 +220,11 @@ endfunction // The initial guess x0 = [0.1,0.1]; // The expected solution : only 4 digits are guaranteed -//xopt = [4 4] -//fopt = [0 -64 -2 -8 0] +xopt = [4 4] +fopt = [0 -64 -2 -8 0] maxfopt = 0 // Run fminimax -[xopt,fopt,maxfval,exitflag,output,lambda] = fminimax(myfun, x0) +[x,fval,maxfval,exitflag,output,lambda] = fminimax(myfun, x0) // Press ENTER to continue ]]> @@ -276,11 +274,11 @@ minimaxOptions = list("GradObj",myfungrad,"GradCon",cgrad); // The initial guess x0 = [0,10]; // The expected solution : only 4 digits are guaranteed -//xopt = [0.92791 7.93551] -//fopt = [6.73443 -189.778 6.73443 -8.86342 0.86342] +xopt = [0.92791 7.93551] +fopt = [6.73443 -189.778 6.73443 -8.86342 0.86342] maxfopt = 6.73443 // Run fminimax -[xopt,fopt,maxfval,exitflag,output] = fminimax(myfun,x0,[],[],[],[],[],[], confun, minimaxOptions) +[x,fval,maxfval,exitflag,output] = fminimax(myfun,x0,[],[],[],[],[],[], confun, minimaxOptions) ]]> diff --git a/help/en_US/fminunc.xml b/help/en_US/fminunc.xml index a28a82a..fe12831 100644 --- a/help/en_US/fminunc.xml +++ b/help/en_US/fminunc.xml @@ -139,6 +139,7 @@ endfunction options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", fGrad, "Hessian", fHess); //Calling Ipopt [xopt,fopt,exitflag,output,gradient,hessian]=fminunc(f,x0,options) +// Press ENTER to continue ]]> @@ -156,6 +157,7 @@ endfunction x0=[2,1]; //Calling Ipopt [xopt,fopt]=fminunc(f,x0) +// Press ENTER to continue ]]> diff --git a/help/en_US/linprog.xml b/help/en_US/linprog.xml index 1aa6e7c..47dd715 100755 --- a/help/en_US/linprog.xml +++ b/help/en_US/linprog.xml @@ -28,7 +28,8 @@ xopt = linprog(c,A,b,Aeq,beq) xopt = linprog(c,A,b,Aeq,beq,lb,ub) xopt = linprog(c,A,b,Aeq,beq,lb,ub,param) - [xopt, fopt, exitflag, output, lambda] = linprog(file) + xopt = linprog(file) + xopt = linprog(file,param) [xopt,fopt,exitflag,output,lambda] = linprog( ... ) @@ -84,10 +85,21 @@ Search the minimum of a constrained linear programming problem specified by : & & lb \leq x \leq ub \\ \end{eqnarray} + + The routine calls Clp for solving the linear programming problem, Clp is a library written in C++. -The exitflag allows to know the status of the optimization which is given back by Ipopt. +The options allows the user to set various parameters of the Optimization problem. +It should be defined as type "list" and contains the following fields. In the current version it only contains maxiter. + +Syntax : options= list("MaxIter", [---]); +MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take. +Default Values : options = list("MaxIter", [3000]); + + + +The exitflag allows to know the status of the optimization which is given back by CLP. exitflag=0 : Optimal Solution Found exitflag=1 : Primal Infeasible @@ -99,9 +111,6 @@ The exitflag allows to know the status of the optimization which is given back b -For more details on exitflag see the ipopt documentation, go to http://www.coin-or.org/Ipopt/documentation/ - - The output data structure contains detailed informations about the optimization process. It has type "struct" and contains the following fields. @@ -114,8 +123,6 @@ The lambda data structure contains the Lagrange multipliers at the end of optimization. In the current version the values are returned only when the the solution is optimal. It has type "struct" and contains the following fields. -lambda.lower: The Lagrange multipliers for the lower bound constraints. -lambda.upper: The Lagrange multipliers for the upper bound constraints. lambda.eqlin: The Lagrange multipliers for the linear equality constraints. lambda.ineqlin: The Lagrange multipliers for the linear inequality constraints. @@ -209,7 +216,7 @@ ub=[%inf,%inf,%inf] diff --git a/help/en_US/lsqlin.xml b/help/en_US/lsqlin.xml index 8887f30..466c1cf 100644 --- a/help/en_US/lsqlin.xml +++ b/help/en_US/lsqlin.xml @@ -92,6 +92,16 @@ Search the minimum of a constrained linear least square problem specified by : The routine calls Ipopt for solving the linear least square problem, Ipopt is a library written in C++. +The options allows the user to set various parameters of the Optimization problem. +It should be defined as type "list" and contains the following fields. + +Syntax : options= list("MaxIter", [---], "CpuTime", [---]); +MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take. +CpuTime : a Scalar, containing the Maximum amount of CPU Time that the solver should take. +Default Values : options = list("MaxIter", [3000], "CpuTime", [600]); + + + The exitflag allows to know the status of the optimization which is given back by Ipopt. exitflag=0 : Optimal Solution Found diff --git a/help/en_US/lsqnonneg.xml b/help/en_US/lsqnonneg.xml index 07cf7e6..a8d7a00 100644 --- a/help/en_US/lsqnonneg.xml +++ b/help/en_US/lsqnonneg.xml @@ -71,6 +71,16 @@ Solves nonnegative least-squares curve fitting problems specified by : The routine calls Ipopt for solving the nonnegative least-squares curve fitting problems, Ipopt is a library written in C++. +The options allows the user to set various parameters of the Optimization problem. +It should be defined as type "list" and contains the following fields. + +Syntax : options= list("MaxIter", [---], "CpuTime", [---]); +MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take. +CpuTime : a Scalar, containing the Maximum amount of CPU Time that the solver should take. +Default Values : options = list("MaxIter", [3000], "CpuTime", [600]); + + + The exitflag allows to know the status of the optimization which is given back by Ipopt. exitflag=0 : Optimal Solution Found diff --git a/help/en_US/master_help.xml b/help/en_US/master_help.xml index cf1946c..73ec952 100644 --- a/help/en_US/master_help.xml +++ b/help/en_US/master_help.xml @@ -81,12 +81,12 @@ xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:db="http://docbook.org/ns/docbook"> - - Symphony Toolbox + + FOSSEE Optimization Toolbox -Symphony Toolbox +FOSSEE Optimization Toolbox &a745e19a6383796e6f5680cdcc44cfcce; &a2b24cb19de46f878f11e6be9eb411170; &a52664d077cac340a0384efe1ac107088; diff --git a/help/en_US/qpipopt.xml b/help/en_US/qpipopt.xml index a309a94..bf8be2a 100644 --- a/help/en_US/qpipopt.xml +++ b/help/en_US/qpipopt.xml @@ -89,6 +89,16 @@ Search the minimum of a constrained linear quadratic optimization problem specif The routine calls Ipopt for solving the quadratic problem, Ipopt is a library written in C++. +The options allows the user to set various parameters of the Optimization problem. +It should be defined as type "list" and contains the following fields. + +Syntax : options= list("MaxIter", [---], "CpuTime", [---]); +MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take. +CpuTime : a Scalar, containing the Maximum amount of CPU Time that the solver should take. +Default Values : options = list("MaxIter", [3000], "CpuTime", [600]); + + + The exitflag allows to know the status of the optimization which is given back by Ipopt. exitflag=0 : Optimal Solution Found diff --git a/help/en_US/qpipoptmat.xml b/help/en_US/qpipoptmat.xml index 642971d..d8a9ac3 100644 --- a/help/en_US/qpipoptmat.xml +++ b/help/en_US/qpipoptmat.xml @@ -62,8 +62,6 @@ a vector of double, the computed solution of the optimization problem. fopt : a double, the value of the function at x. - residual : - a vector of double, solution residuals returned as the vector d-C*x. exitflag : The exit status. See below for details. output : @@ -93,6 +91,16 @@ Search the minimum of a constrained linear quadratic optimization problem specif The routine calls Ipopt for solving the quadratic problem, Ipopt is a library written in C++. +The options allows the user to set various parameters of the Optimization problem. +It should be defined as type "list" and contains the following fields. + +Syntax : options= list("MaxIter", [---], "CpuTime", [---]); +MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take. +CpuTime : a Scalar, containing the Maximum amount of CPU Time that the solver should take. +Default Values : options = list("MaxIter", [3000], "CpuTime", [600]); + + + The exitflag allows to know the status of the optimization which is given back by Ipopt. exitflag=0 : Optimal Solution Found diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS index 4ae0096..8d14e4f 100644 Binary files a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS and b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS differ diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB index 5ea5806..9642809 100644 Binary files a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB and b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB differ diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS b/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS index deb246c..070a255 100644 Binary files a/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS and b/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS differ diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS b/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS index 88014cd..2019f3f 100644 Binary files a/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS and b/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS differ diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA b/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA index 8dc6ddf..86fa674 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA @@ -1,2 +1,2 @@ JavaSearch 1.0 -TMAP bs=2048 rt=1 fl=-1 id1=1535 id2=1 +TMAP bs=2048 rt=1 fl=-1 id1=1532 id2=1 diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP b/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP index d8580ce..d43293f 100644 Binary files a/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP and b/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP differ diff --git a/help/en_US/scilab_en_US_help/fgoalattain.html b/help/en_US/scilab_en_US_help/fgoalattain.html index 0f7fdc9..2981e47 100644 --- a/help/en_US/scilab_en_US_help/fgoalattain.html +++ b/help/en_US/scilab_en_US_help/fgoalattain.html @@ -12,11 +12,11 @@
- << Symphony Toolbox + << FOSSEE Optimization Toolbox - Symphony Toolbox + FOSSEE Optimization Toolbox @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > fgoalattain + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > fgoalattain

fgoalattain

@@ -37,51 +37,51 @@

Calling Sequence

-
x = fgoalattain(fun,x0,goal,weight)
-x = fgoalattain(fun,x0,goal,weight,A,b)
-x = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq)
-x = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq,lb,ub)
-x = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq,lb,ub,nonlcon)
-x = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq,lb,ub,nonlcon,options)
-[x,fval] = fgoalattain(...)
-[x,fval,attainfactor] = fgoalattain(...)
-[x,fval,attainfactor,exitflag] = fgoalattain(...)
-[x,fval,attainfactor,exitflag,output] = fgoalattain(...)
-[x,fval,attainfactor,exitflag,output,lambda] = fgoalattain(...)
+
xopt = fgoalattain(fun,x0,goal,weight)
+xopt = fgoalattain(fun,x0,goal,weight,A,b)
+xopt = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq)
+xopt = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq,lb,ub)
+xopt = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq,lb,ub,nonlcon)
+xopt = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq,lb,ub,nonlcon,options)
+[xopt,fval] = fgoalattain(...)
+[xopt,fval,attainfactor] = fgoalattain(...)
+[xopt,fval,attainfactor,exitflag] = fgoalattain(...)
+[xopt,fval,attainfactor,exitflag,output] = fgoalattain(...)
+[xopt,fval,attainfactor,exitflag,output,lambda] = fgoalattain(...)

Parameters

fun:

a function that accepts a vector x and returns a vector F

-
x0: -

a nx1 or 1xn matrix of double, where n is the number of variables.

-
A: -

a nil x n matrix of double, where n is the number of variables and

-
b: -

a nil x 1 matrix of double, where nil is the number of linear

-
Aeq: -

a nel x n matrix of double, where n is the number of variables

-
beq: -

a nel x 1 matrix of double, where nel is the number of linear

-
lb: -

a nx1 or 1xn matrix of double, where n is the number of variables.

-
ub: -

a nx1 or 1xn matrix of double, where n is the number of variables.

+
x0 : +

a vector of double, contains initial guess of variables.

+
A : +

a matrix of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.

+
b : +

a vector of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.

+
Aeq : +

a matrix of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.

+
beq : +

a vector of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.

+
lb : +

a vector of double, contains lower bounds of the variables.

+
ub : +

a vector of double, contains upper bounds of the variables.

nonlcon:

a function, the nonlinear constraints

options :

a list, containing the option for user to specify. See below for details.

-
x: -

a nx1 matrix of double, the computed solution of the optimization problem

-
fval: -

a vector of double, the value of functions at x

+
xopt : +

a vector of double, the computed solution of the optimization problem.

+
fopt : +

a double, the value of the function at x.

attainfactor:

The amount of over- or underachievement of the goals,γ at the solution.

-
exitflag: -

a 1x1 matrix of floating point integers, the exit status

-
output: -

a struct, the details of the optimization process

-
lambda: -

a struct, the Lagrange multipliers at optimum

+
exitflag : +

The exit status. See below for details.

+
output : +

The structure consist of statistics about the optimization. See below for details.

+
lambda : +

The structure consist of the Lagrange multipliers at the solution of problem. See below for details.

Description

fgoalattain solves the goal attainment problem, which is one formulation for minimizing a multiobjective optimization problem. @@ -102,14 +102,14 @@ It should be defined as type "list" and contains the following field

  • GradObj : a function, representing the gradient function of the Objective in Vector Form.
  • GradCon : a function, representing the gradient of the Non-Linear Constraints (both Equality and Inequality) of the problem. It is declared in such a way that gradient of non-linear inequality constraints are defined first as a separate Matrix (cg of size m2 X n or as an empty), followed by gradient of non-linear equality constraints as a separate Matrix (ceqg of size m2 X n or as an empty) where m2 & m3 are number of non-linear inequality and equality constraints respectively.
  • Default Values : options = list("MaxIter", [3000], "CpuTime", [600]);
  • -

    By default, the gradient options for fminimax are turned off and and fmincon does the gradient opproximation of minmaxObjfun. In case the GradObj option is off and GradConstr option is on, fminimax approximates minmaxObjfun gradient using numderivative toolbox.

    +

    By default, the gradient options for fminimax are turned off and and fmincon does the gradient opproximation of gattainObjfun. In case the GradObj option is off and GradConstr option is on, fminimax approximates gattainObjfun gradient using numderivative toolbox.

    If we can provide exact gradients, we should do so since it improves the convergence speed of the optimization algorithm.

    Furthermore, we must enable the "GradObj" option with the statement :

    minimaxOptions = list("GradObj",fGrad);
    This will let fminimax know that the exact gradient of the objective function is known, so that it can change the calling sequence to the objective function. Note that, fGrad should be mentioned in the form of N x n where n is the number of variables, N is the number of functions in objective function.

    The constraint function must have header :

    [c, ceq] = confun(x)
    -where x is a n x 1 matrix of dominmaxUbles, c is a 1 x nni matrix of doubles and ceq is a 1 x nne matrix of doubles (nni : number of nonlinear inequality constraints, nne : number of nonlinear equality constraints). +where x is a n x 1 matrix of doubles, c is a 1 x nni matrix of doubles and ceq is a 1 x nne matrix of doubles (nni : number of nonlinear inequality constraints, nne : number of nonlinear equality constraints). On input, the variable x contains the current point and, on output, the variable c must contain the nonlinear inequality constraints and ceq must contain the nonlinear equality constraints.

    By default, the gradient options for fminimax are turned off and and fmincon does the gradient opproximation of confun. In case the GradObj option is on and GradCons option is off, fminimax approximates confun gradient using numderivative toolbox.

    If we can provide exact gradients, we should do so since it improves the convergence speed of the optimization algorithm.

    @@ -145,7 +145,7 @@ It has type "struct" and contains the following fields.

    Examples

    -
    function f1=fun(x)
    +   
    function f1=gattainObjfun(x)
     f1(1)=2*x(1)*x(1)+x(2)*x(2)-48*x(1)-40*x(2)+304
     f1(2)=-x(1)*x(1)-3*x(2)*x(2)
     f1(3)=x(1)+3*x(2)-18
    @@ -153,14 +153,12 @@ It has type "struct" and contains the following fields.
     f1(5)=x(1)+x(2)-8
     endfunction
     x0=[-1,1];
    -
     goal=[-5,-3,-2,-1,-4];
     weight=abs(goal)
    -//xopt  = [-0.0000011 -63.999998 -2.0000002 -8 3.485D-08]
    -//fval  = [4 3.99]
    -
    +//gval  =[- 0.0000011 -63.999998 -2.0000002 -8 3.485D-08]
    +//z  = [4 3.99]
     //Run fgoalattain
    -[xopt,fval,attainfactor,exitflag,output,lambda]=fgoalattain(fun,x0,goal,weight)
    +[x,fval,attainfactor,exitflag,output,lambda]=fgoalattain(gattainObjfun,x0,goal,weight)

    Authors

    • Prajwala TM, Sheetal Shalini , 2015
    @@ -171,11 +169,11 @@ It has type "struct" and contains the following fields.
    Report an issue
    - << Symphony Toolbox + << FOSSEE Optimization Toolbox - Symphony Toolbox + FOSSEE Optimization Toolbox diff --git a/help/en_US/scilab_en_US_help/fminbnd.html b/help/en_US/scilab_en_US_help/fminbnd.html index 9b64d03..46755f8 100644 --- a/help/en_US/scilab_en_US_help/fminbnd.html +++ b/help/en_US/scilab_en_US_help/fminbnd.html @@ -16,7 +16,7 @@ - Symphony Toolbox + FOSSEE Optimization Toolbox @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > fminbnd + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > fminbnd

    fminbnd

    @@ -114,7 +114,8 @@ It has type "struct" and contains the following fields. //Options options=list("MaxIter",[1500],"CpuTime", [100],"TolX",[1e-6]) //Calling Ipopt -[x,fval] =fminbnd(f, x1, x2, options)
    +[x,fval] =fminbnd(f, x1, x2, options) +// Press ENTER to continue

    Examples

    //Find x in R such that it minimizes:
    @@ -128,7 +129,8 @@ It has type "struct" and contains the following fields.
     x1 = [0];
     x2 = [1000];
     //Calling Ipopt
    -[x,fval,exitflag,output,lambda] =fminbnd(f, x1, x2)
    +[x,fval,exitflag,output,lambda] =fminbnd(f, x1, x2) +// Press ENTER to continue

    Examples

    //The below problem is an unbounded problem:
    @@ -160,7 +162,7 @@ It has type "struct" and contains the following fields.
     
           
    - Symphony Toolbox + FOSSEE Optimization Toolbox diff --git a/help/en_US/scilab_en_US_help/fmincon.html b/help/en_US/scilab_en_US_help/fmincon.html index b2b5ca4..ea3077f 100644 --- a/help/en_US/scilab_en_US_help/fmincon.html +++ b/help/en_US/scilab_en_US_help/fmincon.html @@ -16,7 +16,7 @@ - Symphony Toolbox + FOSSEE Optimization Toolbox @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > fmincon + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > fmincon

    fmincon

    @@ -159,7 +159,8 @@ It has type "struct" and contains the following fields. //Options options=list("GradObj", fGrad, "Hessian", lHess); //Calling Ipopt -[x,fval,exitflag,output,lambda,grad,hessian] =fmincon(f, x0,A,b,Aeq,beq,lb,ub,nlc,options)
    +[x,fval,exitflag,output,lambda,grad,hessian] =fmincon(f, x0,A,b,Aeq,beq,lb,ub,nlc,options) +// Press ENTER to continue

    Examples

    //Find x in R^3 such that it minimizes:
    @@ -200,7 +201,8 @@ It has type "struct" and contains the following fields.
     //Options
     options=list("MaxIter", [1500], "CpuTime", [500], "GradObj", fGrad, "Hessian", lHess,"GradCon", cGrad);
     //Calling Ipopt
    -[x,fval,exitflag,output] =fmincon(f, x0,A,b,Aeq,beq,lb,ub,nlc,options)
    +[x,fval,exitflag,output] =fmincon(f, x0,A,b,Aeq,beq,lb,ub,nlc,options) +// Press ENTER to continue

    Examples

    //The below problem is an unbounded problem:
    @@ -225,7 +227,8 @@ It has type "struct" and contains the following fields.
     //Options
     options=list("MaxIter", [1500], "CpuTime", [500]);
     //Calling Ipopt
    -[x,fval,exitflag,output,lambda,grad,hessian] =fmincon(f, x0,A,b,Aeq,beq,lb,ub,[],options)
    +[x,fval,exitflag,output,lambda,grad,hessian] =fmincon(f, x0,A,b,Aeq,beq,lb,ub,[],options) +// Press ENTER to continue

    Examples

    //The below problem is an infeasible problem:
    @@ -288,7 +291,7 @@ It has type "struct" and contains the following fields.
     
           
    - Symphony Toolbox + FOSSEE Optimization Toolbox diff --git a/help/en_US/scilab_en_US_help/fminimax.html b/help/en_US/scilab_en_US_help/fminimax.html index 2d086ff..a701aa7 100644 --- a/help/en_US/scilab_en_US_help/fminimax.html +++ b/help/en_US/scilab_en_US_help/fminimax.html @@ -16,7 +16,7 @@ - Symphony Toolbox + FOSSEE Optimization Toolbox @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > fminimax + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > fminimax

    fminimax

    @@ -37,51 +37,49 @@

    Calling Sequence

    -
    x = fminimax(fun,x0)
    -x = fminimax(fun,x0,A,b)
    -x = fminimax(fun,x0,A,b,Aeq,beq)
    -x = fminimax(fun,x0,A,b,Aeq,beq,lb,ub)
    -x = fminimax(fun,x0,A,b,Aeq,beq,lb,ub,nonlinfun)
    -x = fminimax(fun,x0,A,b,Aeq,beq,lb,ub,nonlinfun,options)
    -[x, fval] = fmincon(.....)
    -[x, fval, maxfval]= fmincon(.....)
    -[x, fval, maxfval, exitflag]= fmincon(.....)
    -[x, fval, maxfval, exitflag, output]= fmincon(.....)
    -[x, fval, maxfval, exitflag, output, lambda]= fmincon(.....)
    +
    xopt = fminimax(fun,x0)
    +xopt = fminimax(fun,x0,A,b)
    +xopt = fminimax(fun,x0,A,b,Aeq,beq)
    +xopt = fminimax(fun,x0,A,b,Aeq,beq,lb,ub)
    +xopt = fminimax(fun,x0,A,b,Aeq,beq,lb,ub,nonlinfun)
    +xopt = fminimax(fun,x0,A,b,Aeq,beq,lb,ub,nonlinfun,options)
    +[xopt, fval] = fmincon(.....)
    +[xopt, fval, maxfval]= fmincon(.....)
    +[xopt, fval, maxfval, exitflag]= fmincon(.....)
    +[xopt, fval, maxfval, exitflag, output]= fmincon(.....)
    +[xopt, fval, maxfval, exitflag, output, lambda]= fmincon(.....)

    Parameters

    fun:

    The function to be minimized. fun is a function that accepts a vector x and returns a vector F, the objective functions evaluated at x.

    -
    x0: -

    a nx1 or 1xn matrix of doubles, where n is the number of variables, the initial guess for the optimization algorithm

    -
    A: -

    a nil x n matrix of doubles, where n is the number of variables and nil is the number of linear inequalities. If A==[] and b==[], it is assumed that there is no linear inequality constraints. If (A==[] & b<>[]), fminimax generates an error (the same happens if (A<>[] & b==[]))

    -
    b: -

    a nil x 1 matrix of doubles, where nil is the number of linear inequalities

    -
    Aeq: -

    a nel x n matrix of doubles, where n is the number of variables and nel is the number of linear equalities. If Aeq==[] and beq==[], it is assumed that there is no linear equality constraints. If (Aeq==[] & beq<>[]), fminimax generates an error (the same happens if (Aeq<>[] & beq==[]))

    -
    beq: -

    a nel x 1 matrix of doubles, where nel is the number of linear equalities

    -
    lb: -

    a nx1 or 1xn matrix of doubles, where n is the number of variables. The lower bound for x. If lb==[], then the lower bound is automatically set to -inf

    -
    ub: -

    a nx1 or 1xn matrix of doubles, where n is the number of variables. The upper bound for x. If ub==[], then the upper bound is automatically set to +inf

    +
    x0 : +

    a vector of double, contains initial guess of variables.

    +
    A : +

    a matrix of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.

    +
    b : +

    a vector of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.

    +
    Aeq : +

    a matrix of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.

    +
    beq : +

    a vector of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.

    +
    lb : +

    a vector of double, contains lower bounds of the variables.

    +
    ub : +

    a vector of double, contains upper bounds of the variables.

    nonlinfun: -

    function that computes the nonlinear inequality constraints c(x) <= 0 and nonlinear equality constraints ceq(x) = 0.

    -
    x: -

    a nx1 matrix of doubles, the computed solution of the optimization problem

    -
    fval: -

    a vector of doubles, the value of fun at x

    +

    function that computes the nonlinear inequality constraints c⋅x ≤ 0 and nonlinear equality constraints c⋅x = 0.

    +
    xopt : +

    a vector of double, the computed solution of the optimization problem.

    +
    fopt : +

    a double, the value of the function at x.

    maxfval:

    a 1x1 matrix of doubles, the maximum value in vector fval

    -
    exitflag: -

    a 1x1 matrix of floating point integers, the exit status

    -
    output: -

    a struct, the details of the optimization process

    -
    lambda: -

    a struct, the Lagrange multipliers at optimum

    -
    options: -

    a list, containing the option for user to specify. See below for details.

    +
    exitflag : +

    The exit status. See below for details.

    +
    output : +

    The structure consist of statistics about the optimization. See below for details.

    +
    lambda : +

    The structure consist of the Lagrange multipliers at the solution of problem. See below for details.

    Description

    fminimax minimizes the worst-case (largest) value of a set of multivariable functions, starting at an initial estimate. This is generally referred to as the minimax problem.

    @@ -157,11 +155,11 @@ It has type "struct" and contains the following fields. // The initial guess x0 = [0.1,0.1]; // The expected solution : only 4 digits are guaranteed -//xopt = [4 4] -//fopt = [0 -64 -2 -8 0] +xopt = [4 4] +fopt = [0 -64 -2 -8 0] maxfopt = 0 // Run fminimax -[xopt,fopt,maxfval,exitflag,output,lambda] = fminimax(myfun, x0) +[x,fval,maxfval,exitflag,output,lambda] = fminimax(myfun, x0) // Press ENTER to continue

    Examples

    @@ -206,11 +204,11 @@ It has type "struct" and contains the following fields. // The initial guess x0 = [0,10]; // The expected solution : only 4 digits are guaranteed -//xopt = [0.92791 7.93551] -//fopt = [6.73443 -189.778 6.73443 -8.86342 0.86342] +xopt = [0.92791 7.93551] +fopt = [6.73443 -189.778 6.73443 -8.86342 0.86342] maxfopt = 6.73443 // Run fminimax -[xopt,fopt,maxfval,exitflag,output] = fminimax(myfun,x0,[],[],[],[],[],[], confun, minimaxOptions)
    +[x,fval,maxfval,exitflag,output] = fminimax(myfun,x0,[],[],[],[],[],[], confun, minimaxOptions)

    Authors

    • Animesh Baranawal
    @@ -225,7 +223,7 @@ It has type "struct" and contains the following fields. - Symphony Toolbox + FOSSEE Optimization Toolbox diff --git a/help/en_US/scilab_en_US_help/fminunc.html b/help/en_US/scilab_en_US_help/fminunc.html index 7271567..636ea68 100644 --- a/help/en_US/scilab_en_US_help/fminunc.html +++ b/help/en_US/scilab_en_US_help/fminunc.html @@ -16,7 +16,7 @@ - Symphony Toolbox + FOSSEE Optimization Toolbox @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > fminunc + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > fminunc

    fminunc

    @@ -114,7 +114,8 @@ It has type "struct" and contains the following fields. //Options options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", fGrad, "Hessian", fHess); //Calling Ipopt -[xopt,fopt,exitflag,output,gradient,hessian]=fminunc(f,x0,options)
    +[xopt,fopt,exitflag,output,gradient,hessian]=fminunc(f,x0,options) +// Press ENTER to continue

    Examples

    //Find x in R^2 such that the below function is minimum
    @@ -126,7 +127,8 @@ It has type "struct" and contains the following fields.
     //Starting point
     x0=[2,1];
     //Calling Ipopt
    -[xopt,fopt]=fminunc(f,x0)
    +[xopt,fopt]=fminunc(f,x0) +// Press ENTER to continue

    Examples

    //The below problem is an unbounded problem:
    @@ -164,7 +166,7 @@ It has type "struct" and contains the following fields.
     
           
    - Symphony Toolbox + FOSSEE Optimization Toolbox diff --git a/help/en_US/scilab_en_US_help/index.html b/help/en_US/scilab_en_US_help/index.html index 07b853a..7bbe95e 100644 --- a/help/en_US/scilab_en_US_help/index.html +++ b/help/en_US/scilab_en_US_help/index.html @@ -28,10 +28,10 @@

    -

    Symphony Toolbox

    -
      +

      FOSSEE Optimization Toolbox

      +
        -
      • Symphony Toolbox +
      • FOSSEE Optimization Toolbox
        • fgoalattainSolves a multiobjective goal attainment problem
        • diff --git a/help/en_US/scilab_en_US_help/jhelpset.hs b/help/en_US/scilab_en_US_help/jhelpset.hs index 94c2e7e..373577e 100644 --- a/help/en_US/scilab_en_US_help/jhelpset.hs +++ b/help/en_US/scilab_en_US_help/jhelpset.hs @@ -2,7 +2,7 @@ -Symphony Toolbox +FOSSEE Optimization Toolbox top diff --git a/help/en_US/scilab_en_US_help/jhelptoc.xml b/help/en_US/scilab_en_US_help/jhelptoc.xml index 4422b0b..c4d5a12 100644 --- a/help/en_US/scilab_en_US_help/jhelptoc.xml +++ b/help/en_US/scilab_en_US_help/jhelptoc.xml @@ -1,8 +1,8 @@ - - + + diff --git a/help/en_US/scilab_en_US_help/linprog.html b/help/en_US/scilab_en_US_help/linprog.html index 260b8b3..c47e448 100644 --- a/help/en_US/scilab_en_US_help/linprog.html +++ b/help/en_US/scilab_en_US_help/linprog.html @@ -16,7 +16,7 @@
    - Symphony Toolbox + FOSSEE Optimization Toolbox @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > linprog + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > linprog

    linprog

    @@ -41,7 +41,8 @@ xopt = linprog(c,A,b,Aeq,beq) xopt = linprog(c,A,b,Aeq,beq,lb,ub) xopt = linprog(c,A,b,Aeq,beq,lb,ub,param) -[xopt, fopt, exitflag, output, lambda] = linprog(file) +xopt = linprog(file) +xopt = linprog(file,param) [xopt,fopt,exitflag,output,lambda] = linprog( ... )

    Parameters

    @@ -77,9 +78,14 @@

    Description

    OSI-CLP is used for solving the linear programming problems, OSI-CLP is a library written in C++. Search the minimum of a constrained linear programming problem specified by :

    -

    -The routine calls Clp for solving the linear programming problem, Clp is a library written in C++.

    -

    The exitflag allows to know the status of the optimization which is given back by Ipopt. +

    +

    The routine calls Clp for solving the linear programming problem, Clp is a library written in C++.

    +

    The options allows the user to set various parameters of the Optimization problem. +It should be defined as type "list" and contains the following fields. In the current version it only contains maxiter. +

    • Syntax : options= list("MaxIter", [---]);
    • +
    • MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take.
    • +
    • Default Values : options = list("MaxIter", [3000]);

    +

    The exitflag allows to know the status of the optimization which is given back by CLP.

    • exitflag=0 : Optimal Solution Found
    • exitflag=1 : Primal Infeasible
    • exitflag=2 : Dual Infeasible
    • @@ -87,7 +93,6 @@ The routine calls Clp for solving the linear programming problem, Clp is a libra
    • exitflag=4 : Solution Abandoned
    • exitflag=5 : Primal objective limit reached.
    • exitflag=6 : Dual objective limit reached.

    -

    For more details on exitflag see the ipopt documentation, go to http://www.coin-or.org/Ipopt/documentation/

    The output data structure contains detailed informations about the optimization process. It has type "struct" and contains the following fields.

    • output.iterations: The number of iterations performed during the search
    • @@ -95,9 +100,7 @@ It has type "struct" and contains the following fields.

      The lambda data structure contains the Lagrange multipliers at the end of optimization. In the current version the values are returned only when the the solution is optimal. It has type "struct" and contains the following fields. -

      • lambda.lower: The Lagrange multipliers for the lower bound constraints.
      • -
      • lambda.upper: The Lagrange multipliers for the upper bound constraints.
      • -
      • lambda.eqlin: The Lagrange multipliers for the linear equality constraints.
      • +
        • lambda.eqlin: The Lagrange multipliers for the linear equality constraints.
        • lambda.ineqlin: The Lagrange multipliers for the linear inequality constraints.

    @@ -159,7 +162,7 @@ It has type "struct" and contains the following fields.

    Examples

    filepath = get_absolute_file_path('linprog.dem.sce');
     filepath = filepath + "exmip1.mps"
    -[xopt,fopt,exitflag,output,lambda] =linprog(filepath);
    +[xopt,fopt,exitflag,output,lambda] =linprog(filepath)

    Authors

    • Bhanu Priya Sayal, Guru Pradeep Reddy
    @@ -174,7 +177,7 @@ It has type "struct" and contains the following fields. - Symphony Toolbox + FOSSEE Optimization Toolbox diff --git a/help/en_US/scilab_en_US_help/lsqlin.html b/help/en_US/scilab_en_US_help/lsqlin.html index eb1b38d..1343385 100644 --- a/help/en_US/scilab_en_US_help/lsqlin.html +++ b/help/en_US/scilab_en_US_help/lsqlin.html @@ -16,7 +16,7 @@ - Symphony Toolbox + FOSSEE Optimization Toolbox @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > lsqlin + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > lsqlin

    lsqlin

    @@ -82,6 +82,12 @@

    Search the minimum of a constrained linear least square problem specified by :

    The routine calls Ipopt for solving the linear least square problem, Ipopt is a library written in C++.

    +

    The options allows the user to set various parameters of the Optimization problem. +It should be defined as type "list" and contains the following fields. +

    • Syntax : options= list("MaxIter", [---], "CpuTime", [---]);
    • +
    • MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take.
    • +
    • CpuTime : a Scalar, containing the Maximum amount of CPU Time that the solver should take.
    • +
    • Default Values : options = list("MaxIter", [3000], "CpuTime", [600]);

    The exitflag allows to know the status of the optimization which is given back by Ipopt.

    • exitflag=0 : Optimal Solution Found
    • exitflag=1 : Maximum Number of Iterations Exceeded. Output may not be optimal.
    • @@ -155,7 +161,7 @@ It has type "struct" and contains the following fields. - Symphony Toolbox + FOSSEE Optimization Toolbox diff --git a/help/en_US/scilab_en_US_help/lsqnonneg.html b/help/en_US/scilab_en_US_help/lsqnonneg.html index 8de3559..a095226 100644 --- a/help/en_US/scilab_en_US_help/lsqnonneg.html +++ b/help/en_US/scilab_en_US_help/lsqnonneg.html @@ -16,7 +16,7 @@ - Symphony Toolbox + FOSSEE Optimization Toolbox @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > lsqnonneg + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > lsqnonneg

      lsqnonneg

      @@ -63,6 +63,12 @@

      Solves nonnegative least-squares curve fitting problems specified by :

      The routine calls Ipopt for solving the nonnegative least-squares curve fitting problems, Ipopt is a library written in C++.

      +

      The options allows the user to set various parameters of the Optimization problem. +It should be defined as type "list" and contains the following fields. +

      • Syntax : options= list("MaxIter", [---], "CpuTime", [---]);
      • +
      • MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take.
      • +
      • CpuTime : a Scalar, containing the Maximum amount of CPU Time that the solver should take.
      • +
      • Default Values : options = list("MaxIter", [3000], "CpuTime", [600]);

      The exitflag allows to know the status of the optimization which is given back by Ipopt.

      • exitflag=0 : Optimal Solution Found
      • exitflag=1 : Maximum Number of Iterations Exceeded. Output may not be optimal.
      • @@ -109,7 +115,7 @@ It has type "struct" and contains the following fields. - Symphony Toolbox + FOSSEE Optimization Toolbox diff --git a/help/en_US/scilab_en_US_help/qpipopt.html b/help/en_US/scilab_en_US_help/qpipopt.html index 19b4e44..1a6911b 100644 --- a/help/en_US/scilab_en_US_help/qpipopt.html +++ b/help/en_US/scilab_en_US_help/qpipopt.html @@ -16,7 +16,7 @@ - Symphony Toolbox + FOSSEE Optimization Toolbox @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > qpipopt + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > qpipopt

        qpipopt

        @@ -80,6 +80,12 @@

        Search the minimum of a constrained linear quadratic optimization problem specified by :

        The routine calls Ipopt for solving the quadratic problem, Ipopt is a library written in C++.

        +

        The options allows the user to set various parameters of the Optimization problem. +It should be defined as type "list" and contains the following fields. +

        • Syntax : options= list("MaxIter", [---], "CpuTime", [---]);
        • +
        • MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take.
        • +
        • CpuTime : a Scalar, containing the Maximum amount of CPU Time that the solver should take.
        • +
        • Default Values : options = list("MaxIter", [3000], "CpuTime", [600]);

        The exitflag allows to know the status of the optimization which is given back by Ipopt.

        • exitflag=0 : Optimal Solution Found
        • exitflag=1 : Maximum Number of Iterations Exceeded. Output may not be optimal.
        • @@ -155,7 +161,7 @@ It has type "struct" and contains the following fields. - Symphony Toolbox + FOSSEE Optimization Toolbox diff --git a/help/en_US/scilab_en_US_help/qpipoptmat.html b/help/en_US/scilab_en_US_help/qpipoptmat.html index 5a6a5b6..f5498bf 100644 --- a/help/en_US/scilab_en_US_help/qpipoptmat.html +++ b/help/en_US/scilab_en_US_help/qpipoptmat.html @@ -16,7 +16,7 @@ - Symphony Toolbox + FOSSEE Optimization Toolbox @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > qpipoptmat + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > qpipoptmat

          qpipoptmat

          @@ -70,8 +70,6 @@

          a vector of double, the computed solution of the optimization problem.

          fopt :

          a double, the value of the function at x.

          -
          residual : -

          a vector of double, solution residuals returned as the vector d-C*x.

          exitflag :

          The exit status. See below for details.

          output : @@ -83,6 +81,12 @@

          Search the minimum of a constrained linear quadratic optimization problem specified by :

          The routine calls Ipopt for solving the quadratic problem, Ipopt is a library written in C++.

          +

          The options allows the user to set various parameters of the Optimization problem. +It should be defined as type "list" and contains the following fields. +

          • Syntax : options= list("MaxIter", [---], "CpuTime", [---]);
          • +
          • MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take.
          • +
          • CpuTime : a Scalar, containing the Maximum amount of CPU Time that the solver should take.
          • +
          • Default Values : options = list("MaxIter", [3000], "CpuTime", [600]);

          The exitflag allows to know the status of the optimization which is given back by Ipopt.

          • exitflag=0 : Optimal Solution Found
          • exitflag=1 : Maximum Number of Iterations Exceeded. Output may not be optimal.
          • @@ -153,7 +157,7 @@ It has type "struct" and contains the following fields. - Symphony Toolbox + FOSSEE Optimization Toolbox diff --git a/help/en_US/scilab_en_US_help/section_19f4f1e5726c01d683e8b82be0a7e910.html b/help/en_US/scilab_en_US_help/section_19f4f1e5726c01d683e8b82be0a7e910.html index 93c9617..b34093f 100644 --- a/help/en_US/scilab_en_US_help/section_19f4f1e5726c01d683e8b82be0a7e910.html +++ b/help/en_US/scilab_en_US_help/section_19f4f1e5726c01d683e8b82be0a7e910.html @@ -15,7 +15,7 @@ - Symphony Toolbox + FOSSEE Optimization Toolbox @@ -27,10 +27,10 @@ - Symphony Toolbox >> Symphony Toolbox + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox

            -

            Symphony Toolbox

            +

            FOSSEE Optimization Toolbox

            • fgoalattainSolves a multiobjective goal attainment problem
            • @@ -339,7 +339,7 @@ - Symphony Toolbox + FOSSEE Optimization Toolbox diff --git a/help/en_US/scilab_en_US_help/section_508f0b211d17ea6769714cc144e6b731.html b/help/en_US/scilab_en_US_help/section_508f0b211d17ea6769714cc144e6b731.html index cf8c746..b3b3135 100644 --- a/help/en_US/scilab_en_US_help/section_508f0b211d17ea6769714cc144e6b731.html +++ b/help/en_US/scilab_en_US_help/section_508f0b211d17ea6769714cc144e6b731.html @@ -16,7 +16,7 @@ - Symphony Toolbox + FOSSEE Optimization Toolbox @@ -28,7 +28,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions

              Symphony Native Functions

              @@ -272,7 +272,7 @@ - Symphony Toolbox + FOSSEE Optimization Toolbox diff --git a/help/en_US/scilab_en_US_help/sym_addConstr.html b/help/en_US/scilab_en_US_help/sym_addConstr.html index 1c9685e..230d2f8 100644 --- a/help/en_US/scilab_en_US_help/sym_addConstr.html +++ b/help/en_US/scilab_en_US_help/sym_addConstr.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_addConstr + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_addConstr

              sym_addConstr

              diff --git a/help/en_US/scilab_en_US_help/sym_addVar.html b/help/en_US/scilab_en_US_help/sym_addVar.html index 898f5e5..29cb8c6 100644 --- a/help/en_US/scilab_en_US_help/sym_addVar.html +++ b/help/en_US/scilab_en_US_help/sym_addVar.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_addVar + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_addVar

              sym_addVar

              diff --git a/help/en_US/scilab_en_US_help/sym_close.html b/help/en_US/scilab_en_US_help/sym_close.html index e1c6ce4..c78dd36 100644 --- a/help/en_US/scilab_en_US_help/sym_close.html +++ b/help/en_US/scilab_en_US_help/sym_close.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_close + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_close

              sym_close

              diff --git a/help/en_US/scilab_en_US_help/sym_deleteConstrs.html b/help/en_US/scilab_en_US_help/sym_deleteConstrs.html index 771d24e..6f269ef 100644 --- a/help/en_US/scilab_en_US_help/sym_deleteConstrs.html +++ b/help/en_US/scilab_en_US_help/sym_deleteConstrs.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_deleteConstrs + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_deleteConstrs

              sym_deleteConstrs

              diff --git a/help/en_US/scilab_en_US_help/sym_deleteVars.html b/help/en_US/scilab_en_US_help/sym_deleteVars.html index 2798f8a..37d9dcb 100644 --- a/help/en_US/scilab_en_US_help/sym_deleteVars.html +++ b/help/en_US/scilab_en_US_help/sym_deleteVars.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_deleteVars + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_deleteVars

              sym_deleteVars

              diff --git a/help/en_US/scilab_en_US_help/sym_getConstrActivity.html b/help/en_US/scilab_en_US_help/sym_getConstrActivity.html index 58af6a5..01f5b1e 100644 --- a/help/en_US/scilab_en_US_help/sym_getConstrActivity.html +++ b/help/en_US/scilab_en_US_help/sym_getConstrActivity.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getConstrActivity + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getConstrActivity

              sym_getConstrActivity

              diff --git a/help/en_US/scilab_en_US_help/sym_getConstrLower.html b/help/en_US/scilab_en_US_help/sym_getConstrLower.html index a15684c..12e89e0 100644 --- a/help/en_US/scilab_en_US_help/sym_getConstrLower.html +++ b/help/en_US/scilab_en_US_help/sym_getConstrLower.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getConstrLower + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getConstrLower

              sym_getConstrLower

              diff --git a/help/en_US/scilab_en_US_help/sym_getConstrRange.html b/help/en_US/scilab_en_US_help/sym_getConstrRange.html index 4c9781c..214e500 100644 --- a/help/en_US/scilab_en_US_help/sym_getConstrRange.html +++ b/help/en_US/scilab_en_US_help/sym_getConstrRange.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getConstrRange + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getConstrRange

              sym_getConstrRange

              diff --git a/help/en_US/scilab_en_US_help/sym_getConstrSense.html b/help/en_US/scilab_en_US_help/sym_getConstrSense.html index 2310e7d..e0802be 100644 --- a/help/en_US/scilab_en_US_help/sym_getConstrSense.html +++ b/help/en_US/scilab_en_US_help/sym_getConstrSense.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getConstrSense + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getConstrSense

              sym_getConstrSense

              diff --git a/help/en_US/scilab_en_US_help/sym_getConstrUpper.html b/help/en_US/scilab_en_US_help/sym_getConstrUpper.html index f716bd9..df3f2eb 100644 --- a/help/en_US/scilab_en_US_help/sym_getConstrUpper.html +++ b/help/en_US/scilab_en_US_help/sym_getConstrUpper.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getConstrUpper + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getConstrUpper

              sym_getConstrUpper

              diff --git a/help/en_US/scilab_en_US_help/sym_getDblParam.html b/help/en_US/scilab_en_US_help/sym_getDblParam.html index dca6ed2..39c59e2 100644 --- a/help/en_US/scilab_en_US_help/sym_getDblParam.html +++ b/help/en_US/scilab_en_US_help/sym_getDblParam.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getDblParam + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getDblParam

              sym_getDblParam

              diff --git a/help/en_US/scilab_en_US_help/sym_getInfinity.html b/help/en_US/scilab_en_US_help/sym_getInfinity.html index 8df08ac..29696da 100644 --- a/help/en_US/scilab_en_US_help/sym_getInfinity.html +++ b/help/en_US/scilab_en_US_help/sym_getInfinity.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getInfinity + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getInfinity

              sym_getInfinity

              diff --git a/help/en_US/scilab_en_US_help/sym_getIntParam.html b/help/en_US/scilab_en_US_help/sym_getIntParam.html index 702a151..55dc0eb 100644 --- a/help/en_US/scilab_en_US_help/sym_getIntParam.html +++ b/help/en_US/scilab_en_US_help/sym_getIntParam.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getIntParam + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getIntParam

              sym_getIntParam

              diff --git a/help/en_US/scilab_en_US_help/sym_getIterCount.html b/help/en_US/scilab_en_US_help/sym_getIterCount.html index 5da0077..ee3757b 100644 --- a/help/en_US/scilab_en_US_help/sym_getIterCount.html +++ b/help/en_US/scilab_en_US_help/sym_getIterCount.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getIterCount + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getIterCount

              sym_getIterCount

              diff --git a/help/en_US/scilab_en_US_help/sym_getMatrix.html b/help/en_US/scilab_en_US_help/sym_getMatrix.html index 7e863df..9f0f608 100644 --- a/help/en_US/scilab_en_US_help/sym_getMatrix.html +++ b/help/en_US/scilab_en_US_help/sym_getMatrix.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getMatrix + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getMatrix

              sym_getMatrix

              diff --git a/help/en_US/scilab_en_US_help/sym_getNumConstr.html b/help/en_US/scilab_en_US_help/sym_getNumConstr.html index 8941d3d..7b54f83 100644 --- a/help/en_US/scilab_en_US_help/sym_getNumConstr.html +++ b/help/en_US/scilab_en_US_help/sym_getNumConstr.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getNumConstr + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getNumConstr

              sym_getNumConstr

              diff --git a/help/en_US/scilab_en_US_help/sym_getNumElements.html b/help/en_US/scilab_en_US_help/sym_getNumElements.html index 8682a37..8f59387 100644 --- a/help/en_US/scilab_en_US_help/sym_getNumElements.html +++ b/help/en_US/scilab_en_US_help/sym_getNumElements.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getNumElements + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getNumElements

              sym_getNumElements

              diff --git a/help/en_US/scilab_en_US_help/sym_getNumVar.html b/help/en_US/scilab_en_US_help/sym_getNumVar.html index 205303c..f5ba3f6 100644 --- a/help/en_US/scilab_en_US_help/sym_getNumVar.html +++ b/help/en_US/scilab_en_US_help/sym_getNumVar.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getNumVar + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getNumVar

              sym_getNumVar

              diff --git a/help/en_US/scilab_en_US_help/sym_getObjCoeff.html b/help/en_US/scilab_en_US_help/sym_getObjCoeff.html index 22d196a..2178b5d 100644 --- a/help/en_US/scilab_en_US_help/sym_getObjCoeff.html +++ b/help/en_US/scilab_en_US_help/sym_getObjCoeff.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getObjCoeff + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getObjCoeff

              sym_getObjCoeff

              diff --git a/help/en_US/scilab_en_US_help/sym_getObjSense.html b/help/en_US/scilab_en_US_help/sym_getObjSense.html index 3e5e3b0..9137bdc 100644 --- a/help/en_US/scilab_en_US_help/sym_getObjSense.html +++ b/help/en_US/scilab_en_US_help/sym_getObjSense.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getObjSense + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getObjSense

              sym_getObjSense

              diff --git a/help/en_US/scilab_en_US_help/sym_getObjVal.html b/help/en_US/scilab_en_US_help/sym_getObjVal.html index 9022bdf..712c695 100644 --- a/help/en_US/scilab_en_US_help/sym_getObjVal.html +++ b/help/en_US/scilab_en_US_help/sym_getObjVal.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getObjVal + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getObjVal

              sym_getObjVal

              diff --git a/help/en_US/scilab_en_US_help/sym_getPrimalBound.html b/help/en_US/scilab_en_US_help/sym_getPrimalBound.html index d7cbaf9..eef1de0 100644 --- a/help/en_US/scilab_en_US_help/sym_getPrimalBound.html +++ b/help/en_US/scilab_en_US_help/sym_getPrimalBound.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getPrimalBound + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getPrimalBound

              sym_getPrimalBound

              diff --git a/help/en_US/scilab_en_US_help/sym_getRhs.html b/help/en_US/scilab_en_US_help/sym_getRhs.html index 03d2422..3b4eb7f 100644 --- a/help/en_US/scilab_en_US_help/sym_getRhs.html +++ b/help/en_US/scilab_en_US_help/sym_getRhs.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getRhs + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getRhs

              sym_getRhs

              diff --git a/help/en_US/scilab_en_US_help/sym_getStatus.html b/help/en_US/scilab_en_US_help/sym_getStatus.html index 18e9ad2..8880566 100644 --- a/help/en_US/scilab_en_US_help/sym_getStatus.html +++ b/help/en_US/scilab_en_US_help/sym_getStatus.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getStatus + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getStatus

              sym_getStatus

              diff --git a/help/en_US/scilab_en_US_help/sym_getStrParam.html b/help/en_US/scilab_en_US_help/sym_getStrParam.html index b0e3d76..f3d3671 100644 --- a/help/en_US/scilab_en_US_help/sym_getStrParam.html +++ b/help/en_US/scilab_en_US_help/sym_getStrParam.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getStrParam + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getStrParam

              sym_getStrParam

              diff --git a/help/en_US/scilab_en_US_help/sym_getVarLower.html b/help/en_US/scilab_en_US_help/sym_getVarLower.html index c52377e..7804681 100644 --- a/help/en_US/scilab_en_US_help/sym_getVarLower.html +++ b/help/en_US/scilab_en_US_help/sym_getVarLower.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getVarLower + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getVarLower

              sym_getVarLower

              diff --git a/help/en_US/scilab_en_US_help/sym_getVarSoln.html b/help/en_US/scilab_en_US_help/sym_getVarSoln.html index e1b998a..3b6b932 100644 --- a/help/en_US/scilab_en_US_help/sym_getVarSoln.html +++ b/help/en_US/scilab_en_US_help/sym_getVarSoln.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getVarSoln + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getVarSoln

              sym_getVarSoln

              diff --git a/help/en_US/scilab_en_US_help/sym_getVarUpper.html b/help/en_US/scilab_en_US_help/sym_getVarUpper.html index 9736a93..bc8d0ca 100644 --- a/help/en_US/scilab_en_US_help/sym_getVarUpper.html +++ b/help/en_US/scilab_en_US_help/sym_getVarUpper.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_getVarUpper + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_getVarUpper

              sym_getVarUpper

              diff --git a/help/en_US/scilab_en_US_help/sym_isAbandoned.html b/help/en_US/scilab_en_US_help/sym_isAbandoned.html index bd4d72f..7f22d84 100644 --- a/help/en_US/scilab_en_US_help/sym_isAbandoned.html +++ b/help/en_US/scilab_en_US_help/sym_isAbandoned.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_isAbandoned + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_isAbandoned

              sym_isAbandoned

              diff --git a/help/en_US/scilab_en_US_help/sym_isBinary.html b/help/en_US/scilab_en_US_help/sym_isBinary.html index b9a1262..904c383 100644 --- a/help/en_US/scilab_en_US_help/sym_isBinary.html +++ b/help/en_US/scilab_en_US_help/sym_isBinary.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_isBinary + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_isBinary

              sym_isBinary

              diff --git a/help/en_US/scilab_en_US_help/sym_isContinuous.html b/help/en_US/scilab_en_US_help/sym_isContinuous.html index de47460..22d6f4d 100644 --- a/help/en_US/scilab_en_US_help/sym_isContinuous.html +++ b/help/en_US/scilab_en_US_help/sym_isContinuous.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_isContinuous + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_isContinuous

              sym_isContinuous

              diff --git a/help/en_US/scilab_en_US_help/sym_isEnvActive.html b/help/en_US/scilab_en_US_help/sym_isEnvActive.html index 29b593d..4997879 100644 --- a/help/en_US/scilab_en_US_help/sym_isEnvActive.html +++ b/help/en_US/scilab_en_US_help/sym_isEnvActive.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_isEnvActive + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_isEnvActive

              sym_isEnvActive

              diff --git a/help/en_US/scilab_en_US_help/sym_isInfeasible.html b/help/en_US/scilab_en_US_help/sym_isInfeasible.html index c057383..2ea8048 100644 --- a/help/en_US/scilab_en_US_help/sym_isInfeasible.html +++ b/help/en_US/scilab_en_US_help/sym_isInfeasible.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_isInfeasible + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_isInfeasible

              sym_isInfeasible

              diff --git a/help/en_US/scilab_en_US_help/sym_isInteger.html b/help/en_US/scilab_en_US_help/sym_isInteger.html index 95610a8..3843b5b 100644 --- a/help/en_US/scilab_en_US_help/sym_isInteger.html +++ b/help/en_US/scilab_en_US_help/sym_isInteger.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_isInteger + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_isInteger

              sym_isInteger

              diff --git a/help/en_US/scilab_en_US_help/sym_isIterLimitReached.html b/help/en_US/scilab_en_US_help/sym_isIterLimitReached.html index cc47319..7081962 100644 --- a/help/en_US/scilab_en_US_help/sym_isIterLimitReached.html +++ b/help/en_US/scilab_en_US_help/sym_isIterLimitReached.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_isIterLimitReached + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_isIterLimitReached

              sym_isIterLimitReached

              diff --git a/help/en_US/scilab_en_US_help/sym_isOptimal.html b/help/en_US/scilab_en_US_help/sym_isOptimal.html index da4cda7..929b01b 100644 --- a/help/en_US/scilab_en_US_help/sym_isOptimal.html +++ b/help/en_US/scilab_en_US_help/sym_isOptimal.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_isOptimal + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_isOptimal

              sym_isOptimal

              diff --git a/help/en_US/scilab_en_US_help/sym_isTargetGapAchieved.html b/help/en_US/scilab_en_US_help/sym_isTargetGapAchieved.html index b27aa57..91d5a7f 100644 --- a/help/en_US/scilab_en_US_help/sym_isTargetGapAchieved.html +++ b/help/en_US/scilab_en_US_help/sym_isTargetGapAchieved.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_isTargetGapAchieved + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_isTargetGapAchieved

              sym_isTargetGapAchieved

              diff --git a/help/en_US/scilab_en_US_help/sym_isTimeLimitReached.html b/help/en_US/scilab_en_US_help/sym_isTimeLimitReached.html index f3175ad..ce96eae 100644 --- a/help/en_US/scilab_en_US_help/sym_isTimeLimitReached.html +++ b/help/en_US/scilab_en_US_help/sym_isTimeLimitReached.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_isTimeLimitReached + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_isTimeLimitReached

              sym_isTimeLimitReached

              diff --git a/help/en_US/scilab_en_US_help/sym_loadMPS.html b/help/en_US/scilab_en_US_help/sym_loadMPS.html index bb8497f..4046026 100644 --- a/help/en_US/scilab_en_US_help/sym_loadMPS.html +++ b/help/en_US/scilab_en_US_help/sym_loadMPS.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_loadMPS + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_loadMPS

              sym_loadMPS

              diff --git a/help/en_US/scilab_en_US_help/sym_loadProblem.html b/help/en_US/scilab_en_US_help/sym_loadProblem.html index f395f22..7e29c9b 100644 --- a/help/en_US/scilab_en_US_help/sym_loadProblem.html +++ b/help/en_US/scilab_en_US_help/sym_loadProblem.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_loadProblem + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_loadProblem

              sym_loadProblem

              diff --git a/help/en_US/scilab_en_US_help/sym_loadProblemBasic.html b/help/en_US/scilab_en_US_help/sym_loadProblemBasic.html index 72e495d..23f690e 100644 --- a/help/en_US/scilab_en_US_help/sym_loadProblemBasic.html +++ b/help/en_US/scilab_en_US_help/sym_loadProblemBasic.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_loadProblemBasic + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_loadProblemBasic

              sym_loadProblemBasic

              diff --git a/help/en_US/scilab_en_US_help/sym_open.html b/help/en_US/scilab_en_US_help/sym_open.html index f52e3cb..7347781 100644 --- a/help/en_US/scilab_en_US_help/sym_open.html +++ b/help/en_US/scilab_en_US_help/sym_open.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_open + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_open

              sym_open

              diff --git a/help/en_US/scilab_en_US_help/sym_resetParams.html b/help/en_US/scilab_en_US_help/sym_resetParams.html index 58f6187..a28d629 100644 --- a/help/en_US/scilab_en_US_help/sym_resetParams.html +++ b/help/en_US/scilab_en_US_help/sym_resetParams.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_resetParams + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_resetParams

              sym_resetParams

              diff --git a/help/en_US/scilab_en_US_help/sym_setConstrLower.html b/help/en_US/scilab_en_US_help/sym_setConstrLower.html index 1331449..937983f 100644 --- a/help/en_US/scilab_en_US_help/sym_setConstrLower.html +++ b/help/en_US/scilab_en_US_help/sym_setConstrLower.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_setConstrLower + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_setConstrLower

              sym_setConstrLower

              diff --git a/help/en_US/scilab_en_US_help/sym_setConstrType.html b/help/en_US/scilab_en_US_help/sym_setConstrType.html index 604bfa7..3ad6e86 100644 --- a/help/en_US/scilab_en_US_help/sym_setConstrType.html +++ b/help/en_US/scilab_en_US_help/sym_setConstrType.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_setConstrType + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_setConstrType

              sym_setConstrType

              diff --git a/help/en_US/scilab_en_US_help/sym_setConstrUpper.html b/help/en_US/scilab_en_US_help/sym_setConstrUpper.html index 1248e32..11086a0 100644 --- a/help/en_US/scilab_en_US_help/sym_setConstrUpper.html +++ b/help/en_US/scilab_en_US_help/sym_setConstrUpper.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_setConstrUpper + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_setConstrUpper

              sym_setConstrUpper

              diff --git a/help/en_US/scilab_en_US_help/sym_setContinuous.html b/help/en_US/scilab_en_US_help/sym_setContinuous.html index ea43c30..d794b27 100644 --- a/help/en_US/scilab_en_US_help/sym_setContinuous.html +++ b/help/en_US/scilab_en_US_help/sym_setContinuous.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_setContinuous + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_setContinuous

              sym_setContinuous

              diff --git a/help/en_US/scilab_en_US_help/sym_setDblParam.html b/help/en_US/scilab_en_US_help/sym_setDblParam.html index 56e51a2..e35cb84 100644 --- a/help/en_US/scilab_en_US_help/sym_setDblParam.html +++ b/help/en_US/scilab_en_US_help/sym_setDblParam.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_setDblParam + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_setDblParam

              sym_setDblParam

              diff --git a/help/en_US/scilab_en_US_help/sym_setIntParam.html b/help/en_US/scilab_en_US_help/sym_setIntParam.html index 6a40ca0..0f9b8ce 100644 --- a/help/en_US/scilab_en_US_help/sym_setIntParam.html +++ b/help/en_US/scilab_en_US_help/sym_setIntParam.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_setIntParam + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_setIntParam

              sym_setIntParam

              diff --git a/help/en_US/scilab_en_US_help/sym_setInteger.html b/help/en_US/scilab_en_US_help/sym_setInteger.html index 394afc2..4402005 100644 --- a/help/en_US/scilab_en_US_help/sym_setInteger.html +++ b/help/en_US/scilab_en_US_help/sym_setInteger.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_setInteger + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_setInteger

              sym_setInteger

              diff --git a/help/en_US/scilab_en_US_help/sym_setObjCoeff.html b/help/en_US/scilab_en_US_help/sym_setObjCoeff.html index f3fabeb..b8fa629 100644 --- a/help/en_US/scilab_en_US_help/sym_setObjCoeff.html +++ b/help/en_US/scilab_en_US_help/sym_setObjCoeff.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_setObjCoeff + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_setObjCoeff

              sym_setObjCoeff

              diff --git a/help/en_US/scilab_en_US_help/sym_setObjSense.html b/help/en_US/scilab_en_US_help/sym_setObjSense.html index f54ac5d..69b7093 100644 --- a/help/en_US/scilab_en_US_help/sym_setObjSense.html +++ b/help/en_US/scilab_en_US_help/sym_setObjSense.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_setObjSense + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_setObjSense

              sym_setObjSense

              diff --git a/help/en_US/scilab_en_US_help/sym_setPrimalBound.html b/help/en_US/scilab_en_US_help/sym_setPrimalBound.html index 2ecab9d..3040f55 100644 --- a/help/en_US/scilab_en_US_help/sym_setPrimalBound.html +++ b/help/en_US/scilab_en_US_help/sym_setPrimalBound.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_setPrimalBound + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_setPrimalBound

              sym_setPrimalBound

              diff --git a/help/en_US/scilab_en_US_help/sym_setStrParam.html b/help/en_US/scilab_en_US_help/sym_setStrParam.html index d134cfe..2fa67ca 100644 --- a/help/en_US/scilab_en_US_help/sym_setStrParam.html +++ b/help/en_US/scilab_en_US_help/sym_setStrParam.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_setStrParam + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_setStrParam

              sym_setStrParam

              diff --git a/help/en_US/scilab_en_US_help/sym_setVarLower.html b/help/en_US/scilab_en_US_help/sym_setVarLower.html index 2562455..2b977d2 100644 --- a/help/en_US/scilab_en_US_help/sym_setVarLower.html +++ b/help/en_US/scilab_en_US_help/sym_setVarLower.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_setVarLower + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_setVarLower

              sym_setVarLower

              diff --git a/help/en_US/scilab_en_US_help/sym_setVarSoln.html b/help/en_US/scilab_en_US_help/sym_setVarSoln.html index 53b2c6b..f8c73c7 100644 --- a/help/en_US/scilab_en_US_help/sym_setVarSoln.html +++ b/help/en_US/scilab_en_US_help/sym_setVarSoln.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_setVarSoln + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_setVarSoln

              sym_setVarSoln

              diff --git a/help/en_US/scilab_en_US_help/sym_setVarUpper.html b/help/en_US/scilab_en_US_help/sym_setVarUpper.html index e03e7f6..16659ce 100644 --- a/help/en_US/scilab_en_US_help/sym_setVarUpper.html +++ b/help/en_US/scilab_en_US_help/sym_setVarUpper.html @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_setVarUpper + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_setVarUpper

              sym_setVarUpper

              diff --git a/help/en_US/scilab_en_US_help/sym_solve.html b/help/en_US/scilab_en_US_help/sym_solve.html index cf1f40b..67e43f5 100644 --- a/help/en_US/scilab_en_US_help/sym_solve.html +++ b/help/en_US/scilab_en_US_help/sym_solve.html @@ -28,7 +28,7 @@ - Symphony Toolbox >> Symphony Toolbox > Symphony Native Functions > sym_solve + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > Symphony Native Functions > sym_solve

              sym_solve

              diff --git a/help/en_US/scilab_en_US_help/symphony.html b/help/en_US/scilab_en_US_help/symphony.html index 63c1db3..a27f8e8 100644 --- a/help/en_US/scilab_en_US_help/symphony.html +++ b/help/en_US/scilab_en_US_help/symphony.html @@ -16,7 +16,7 @@ - Symphony Toolbox + FOSSEE Optimization Toolbox @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > symphony + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > symphony

              symphony

              @@ -210,7 +210,7 @@ It has type "struct" and contains the following fields. - Symphony Toolbox + FOSSEE Optimization Toolbox diff --git a/help/en_US/scilab_en_US_help/symphonymat.html b/help/en_US/scilab_en_US_help/symphonymat.html index 1f6af60..75edb56 100644 --- a/help/en_US/scilab_en_US_help/symphonymat.html +++ b/help/en_US/scilab_en_US_help/symphonymat.html @@ -16,7 +16,7 @@ - Symphony Toolbox + FOSSEE Optimization Toolbox @@ -29,7 +29,7 @@ - Symphony Toolbox >> Symphony Toolbox > symphonymat + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > symphonymat

              symphonymat

              @@ -199,7 +199,7 @@ It has type "struct" and contains the following fields. - Symphony Toolbox + FOSSEE Optimization Toolbox diff --git a/jar/scilab_en_US_help.jar b/jar/scilab_en_US_help.jar index f91daa1..88b99f5 100644 Binary files a/jar/scilab_en_US_help.jar and b/jar/scilab_en_US_help.jar differ diff --git a/loader.sce b/loader.sce index 01a4c5f..573167b 100644 --- a/loader.sce +++ b/loader.sce @@ -7,4 +7,4 @@ catch error("Scilab 5.0 or more is required."); end; -exec(get_absolute_file_path("loader.sce")+"etc/"+"Symphony.start"); +exec(get_absolute_file_path("loader.sce")+"etc/"+"FOSSEE_Optimization_Toolbox.start"); diff --git a/macros/Checkdims.bin b/macros/Checkdims.bin new file mode 100644 index 0000000..40e385a Binary files /dev/null and b/macros/Checkdims.bin differ diff --git a/macros/Checklhs.bin b/macros/Checklhs.bin new file mode 100644 index 0000000..7156107 Binary files /dev/null and b/macros/Checklhs.bin differ diff --git a/macros/Checkrhs.bin b/macros/Checkrhs.bin new file mode 100644 index 0000000..2c45876 Binary files /dev/null and b/macros/Checkrhs.bin differ diff --git a/macros/Checktype.bin b/macros/Checktype.bin new file mode 100644 index 0000000..bbe1585 Binary files /dev/null and b/macros/Checktype.bin differ diff --git a/macros/Checkvector.bin b/macros/Checkvector.bin new file mode 100644 index 0000000..dfe03ab Binary files /dev/null and b/macros/Checkvector.bin differ diff --git a/macros/buildmacros.sce b/macros/buildmacros.sce index fe6a619..284bc1c 100644 --- a/macros/buildmacros.sce +++ b/macros/buildmacros.sce @@ -9,7 +9,7 @@ // Organization: FOSSEE, IIT Bombay // Email: toolbox@scilab.in -tbx_build_macros("Symphony", get_absolute_file_path("buildmacros.sce")); +tbx_build_macros("FOSSEE_Optimization_Toolbox", get_absolute_file_path("buildmacros.sce")); clear tbx_build_macros; diff --git a/macros/fgoalattain.bin b/macros/fgoalattain.bin new file mode 100644 index 0000000..4889336 Binary files /dev/null and b/macros/fgoalattain.bin differ diff --git a/macros/fgoalattain.sci b/macros/fgoalattain.sci index d6bec24..41c0fcc 100644 --- a/macros/fgoalattain.sci +++ b/macros/fgoalattain.sci @@ -1,58 +1,47 @@ -// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab // Copyright (C) 2015 - IIT Bombay - FOSSEE // -// Authors: Prajwala TM,Sheetal Shalini -// Organization: FOSSEE, IIT Bombay -// Email: prajwala.tm@gmail.com,sheetalsh456@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 +// Authors: Prajwala TM,Sheetal Shalini +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in function [x,fval,attainfactor,exitflag,output,lambda] = fgoalattain(varargin) // Solves a multiobjective goal attainment problem // // Calling Sequence - // x = fgoalattain(fun,x0,goal,weight) - // x = fgoalattain(fun,x0,goal,weight,A,b) - // x = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq) - // x = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq,lb,ub) - // x = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq,lb,ub,nonlcon) - // x = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq,lb,ub,nonlcon,options) - // [x,fval] = fgoalattain(...) - // [x,fval,attainfactor] = fgoalattain(...) - // [x,fval,attainfactor,exitflag] = fgoalattain(...) - // [x,fval,attainfactor,exitflag,output] = fgoalattain(...) - // [x,fval,attainfactor,exitflag,output,lambda] = fgoalattain(...) + // xopt = fgoalattain(fun,x0,goal,weight) + // xopt = fgoalattain(fun,x0,goal,weight,A,b) + // xopt = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq) + // xopt = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq,lb,ub) + // xopt = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq,lb,ub,nonlcon) + // xopt = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq,lb,ub,nonlcon,options) + // [xopt,fval] = fgoalattain(...) + // [xopt,fval,attainfactor] = fgoalattain(...) + // [xopt,fval,attainfactor,exitflag] = fgoalattain(...) + // [xopt,fval,attainfactor,exitflag,output] = fgoalattain(...) + // [xopt,fval,attainfactor,exitflag,output,lambda] = fgoalattain(...) // // Parameters // fun: a function that accepts a vector x and returns a vector F - // x0: a nx1 or 1xn matrix of double, where n is the number of variables. - // The initial guess for the optimization algorithm - // A: a nil x n matrix of double, where n is the number of variables and - // nil is the number of linear inequalities. - // - // b: a nil x 1 matrix of double, where nil is the number of linear - // inequalities - // Aeq: a nel x n matrix of double, where n is the number of variables - // and nel is the number of linear equalities. - // beq: a nel x 1 matrix of double, where nel is the number of linear - // equalities - // lb: a nx1 or 1xn matrix of double, where n is the number of variables. - // The lower bound for x. If lb==[], then the lower bound is - // automatically set to -inf - // ub: a nx1 or 1xn matrix of double, where n is the number of variables. - // The upper bound for x. If ub==[], then the upper bound is - // automatically set to +inf - // nonlcon: a function, the nonlinear constraints - // options : a list, containing the option for user to specify. See below for details. - // x: a nx1 matrix of double, the computed solution of the optimization problem - // fval: a vector of double, the value of functions at x - // attainfactor: The amount of over- or underachievement of the goals,γ at the solution. - // exitflag: a 1x1 matrix of floating point integers, the exit status - // output: a struct, the details of the optimization process - // lambda: a struct, the Lagrange multipliers at optimum + // x0 : a vector of double, contains initial guess of variables. + // A : a matrix of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b. + // b : a vector of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b. + // Aeq : a matrix of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq. + // beq : a vector of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq. + // lb : a vector of double, contains lower bounds of the variables. + // ub : a vector of double, contains upper bounds of the variables. + // nonlcon: a function, the nonlinear constraints + // options : a list, containing the option for user to specify. See below for details. + // xopt : a vector of double, the computed solution of the optimization problem. + // fopt : a double, the value of the function at x. + // attainfactor: The amount of over- or underachievement of the goals,γ at the solution. + // exitflag : The exit status. See below for details. + // output : The structure consist of statistics about the optimization. See below for details. + // lambda : The structure consist of the Lagrange multipliers at the solution of problem. See below for details. // // Description // fgoalattain solves the goal attainment problem, which is one formulation for minimizing a multiobjective optimization problem. @@ -164,21 +153,12 @@ function [x,fval,attainfactor,exitflag,output,lambda] = fgoalattain(varargin) // f1(5)=x(1)+x(2)-8 // endfunction // x0=[-1,1]; - // // goal=[-5,-3,-2,-1,-4]; // weight=abs(goal) - // gval = - // [- 0.0000011 - // - 63.999998 - // - 2.0000002 - // - 8. - // 3.485D-08] - // z = - // [4. 3.99] - // - // Run fgoalattain - // [x,fval,attainfactor,exitflag,output,lambda]=fgoalattain(gattainObjfun,x0,goal,weight) - // + // //gval =[- 0.0000011 -63.999998 -2.0000002 -8 3.485D-08] + // //z = [4 3.99] + // //Run fgoalattain + // [x,fval,attainfactor,exitflag,output,lambda]=fgoalattain(gattainObjfun,x0,goal,weight) // Authors // Prajwala TM, Sheetal Shalini , 2015 @@ -311,14 +291,14 @@ function [x,fval,attainfactor,exitflag,output,lambda] = fgoalattain(varargin) //To check the User Entry for Options and storing it for i = 1:(size(gattainUserOptions))/2 - select gattainUserOptions(2*i-1) - case "MaxIter" then + select convstr(gattainUserOptions(2*i-1),'l') + case "maxiter" then fgaMaxIter = gattainUserOptions(2*i); //Setting the Maximum Iteration as per user entry - case "CpuTime" then + case "cputime" then fgaCPU = gattainUserOptions(2*i); //Setting the Maximum CPU Time as per user entry - case "GradObj" then + case "gradobj" then if (type(gattainUserOptions(2*i))==10) then if (convstr(gattainUserOptions(2*i))=="off") then flag1 = 0; @@ -331,7 +311,7 @@ function [x,fval,attainfactor,exitflag,output,lambda] = fgoalattain(varargin) gattainFGrad = gattainUserOptions(2*i); end - case "GradCon" then + case "gradcon" then if (type(gattainUserOptions(2*i))==10) then if (convstr(gattainUserOptions(2*i))=="off") then flag2 = 0; @@ -479,49 +459,6 @@ function [x,fval,attainfactor,exitflag,output,lambda] = fgoalattain(varargin) end endfunction - - // disp(gattainStartpoint) - // disp(gattainObjfun(gattainStartpoint)) - // disp(newObjfun(gattainStartpoint)) - // disp(goal) - // disp(weight) - // - // disp(gattainA) - // disp(gattainB) - // disp(gattainAeq) - // disp(gattainBeq) - // disp(gattainLb) - // disp(gattainUb) - // - // [f,g] = gattainNonlinfun(gattainStartpoint) - // disp(f) - // disp(g) - // [f,g] = newNonlinfun(gattainStartpoint) - // disp(f) - // disp(g) - // - // // function foo = CgattainC(z) - // // [foo,tmp1] = newNonlinfun(z) - // // endfunction - // // - // // function foo = CgattainCEQ(z) - // // [tmp1,foo] = newNonlinfun(z) - // // endfunction - // // - // // // function handle defining gattainNonlinfun derivative using numderivative - // // function [dc,dceq] = derrNonlinApp(z) - // // dc = numderivative(CgattainC,z) - // // dceq = numderivative(CgattainCEQ,z) - // // endfunction - // - // // [f,g] = derrNonlinApp(gattainStartpoint) - // // disp(f) - // // disp(g) - // - // [f,g] = newCGrad(gattainStartpoint) - // disp(f) - // disp(g) - //to be passed as options to fmincon if (flag1 == 1 | flag2 == 1) then gattainPassOptions = list("MaxIter", fgaMaxIter, "CpuTime", fgaCPU, "GradCon", newCGrad) diff --git a/macros/fminbnd.bin b/macros/fminbnd.bin index df44ca0..97b00fc 100644 Binary files a/macros/fminbnd.bin and b/macros/fminbnd.bin differ diff --git a/macros/fminbnd.sci b/macros/fminbnd.sci index c9bf4cc..2c29b03 100644 --- a/macros/fminbnd.sci +++ b/macros/fminbnd.sci @@ -253,12 +253,12 @@ function [xopt,fopt,exitflag,output,lambda] = fminbnd (varargin) //To check the user entry for options and storing it for i = 1:(size(param))/2 - select param(2*i-1) - case "MaxIter" then + select convstr(param(2*i-1),'l') + case "maxiter" then options(2*i) = param(2*i); - case "CpuTime" then + case "cputime" then options(2*i) = param(2*i); - case "TolX" then + case "tolx" then options(2*i) = param(2*i); else errmsg = msprintf(gettext("%s: Unrecognized parameter name %s."), "fminbnd", param(2*i-1)); diff --git a/macros/fmincon.bin b/macros/fmincon.bin index 2e93c02..e1785a4 100644 Binary files a/macros/fmincon.bin and b/macros/fmincon.bin differ diff --git a/macros/fmincon.sci b/macros/fmincon.sci index 6e2d064..49adec5 100644 --- a/macros/fmincon.sci +++ b/macros/fmincon.sci @@ -673,22 +673,22 @@ function [xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (varargin //To check the user entry for options and storing it for i = 1:(size(param))/2 - select param(2*i-1) - case "MaxIter" then + select convstr(param(2*i-1),'l') + case "maxiter" then options(2*i) = param(2*i); //Setting the maximum number of iterations as per user entry - case "CpuTime" then + case "cputime" then options(2*i) = param(2*i); //Setting the maximum CPU time as per user entry - case "GradObj" then + case "gradobj" then flag1=1; fGrad=param(2*i); - case "Hessian" then + case "hessian" then flag2=1; lHess=param(2*i); - case "GradCon" then + case "gradcon" then flag3=1; cGrad=param(2*i); else - errmsg = msprintf(gettext("%s: Unrecognized parameter name %s."), "fminbnd", param(2*i-1)); + errmsg = msprintf(gettext("%s: Unrecognized parameter name %s."), "fmincon", param(2*i-1)); error(errmsg); end end diff --git a/macros/fminimax.bin b/macros/fminimax.bin new file mode 100644 index 0000000..8a8a8a4 Binary files /dev/null and b/macros/fminimax.bin differ diff --git a/macros/fminimax.sci b/macros/fminimax.sci index 04d0af6..c775b1b 100644 --- a/macros/fminimax.sci +++ b/macros/fminimax.sci @@ -1,49 +1,47 @@ -// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab // Copyright (C) 2015 - IIT Bombay - FOSSEE // -// Authors: Animesh Baranawal -// Organization: FOSSEE, IIT Bombay -// Email: animeshbaranawal@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 +// Authors: Animesh Baranawal +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in function [x,fval,maxfval,exitflag,output,lambda] = fminimax(varargin) // Solves minimax constraint problem // // Calling Sequence - // x = fminimax(fun,x0) - // x = fminimax(fun,x0,A,b) - // x = fminimax(fun,x0,A,b,Aeq,beq) - // x = fminimax(fun,x0,A,b,Aeq,beq,lb,ub) - // x = fminimax(fun,x0,A,b,Aeq,beq,lb,ub,nonlinfun) - // x = fminimax(fun,x0,A,b,Aeq,beq,lb,ub,nonlinfun,options) - // [x, fval] = fmincon(.....) - // [x, fval, maxfval]= fmincon(.....) - // [x, fval, maxfval, exitflag]= fmincon(.....) - // [x, fval, maxfval, exitflag, output]= fmincon(.....) - // [x, fval, maxfval, exitflag, output, lambda]= fmincon(.....) + // xopt = fminimax(fun,x0) + // xopt = fminimax(fun,x0,A,b) + // xopt = fminimax(fun,x0,A,b,Aeq,beq) + // xopt = fminimax(fun,x0,A,b,Aeq,beq,lb,ub) + // xopt = fminimax(fun,x0,A,b,Aeq,beq,lb,ub,nonlinfun) + // xopt = fminimax(fun,x0,A,b,Aeq,beq,lb,ub,nonlinfun,options) + // [xopt, fval] = fmincon(.....) + // [xopt, fval, maxfval]= fmincon(.....) + // [xopt, fval, maxfval, exitflag]= fmincon(.....) + // [xopt, fval, maxfval, exitflag, output]= fmincon(.....) + // [xopt, fval, maxfval, exitflag, output, lambda]= fmincon(.....) // // Parameters // fun: The function to be minimized. fun is a function that accepts a vector x and returns a vector F, the objective functions evaluated at x. - // x0: a nx1 or 1xn matrix of doubles, where n is the number of variables, the initial guess for the optimization algorithm - // A: a nil x n matrix of doubles, where n is the number of variables and nil is the number of linear inequalities. If A==[] and b==[], it is assumed that there is no linear inequality constraints. If (A==[] & b<>[]), fminimax generates an error (the same happens if (A<>[] & b==[])) - // b: a nil x 1 matrix of doubles, where nil is the number of linear inequalities - // Aeq: a nel x n matrix of doubles, where n is the number of variables and nel is the number of linear equalities. If Aeq==[] and beq==[], it is assumed that there is no linear equality constraints. If (Aeq==[] & beq<>[]), fminimax generates an error (the same happens if (Aeq<>[] & beq==[])) - // beq: a nel x 1 matrix of doubles, where nel is the number of linear equalities - // lb: a nx1 or 1xn matrix of doubles, where n is the number of variables. The lower bound for x. If lb==[], then the lower bound is automatically set to -inf - // ub: a nx1 or 1xn matrix of doubles, where n is the number of variables. The upper bound for x. If ub==[], then the upper bound is automatically set to +inf - // nonlinfun: function that computes the nonlinear inequality constraints c(x) <= 0 and nonlinear equality constraints ceq(x) = 0. - // x: a nx1 matrix of doubles, the computed solution of the optimization problem - // fval: a vector of doubles, the value of fun at x - // maxfval: a 1x1 matrix of doubles, the maximum value in vector fval - // exitflag: a 1x1 matrix of floating point integers, the exit status - // output: a struct, the details of the optimization process - // lambda: a struct, the Lagrange multipliers at optimum - // options: a list, containing the option for user to specify. See below for details. - // + // x0 : a vector of double, contains initial guess of variables. + // A : a matrix of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b. + // b : a vector of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b. + // Aeq : a matrix of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq. + // beq : a vector of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq. + // lb : a vector of double, contains lower bounds of the variables. + // ub : a vector of double, contains upper bounds of the variables. + // nonlinfun: function that computes the nonlinear inequality constraints c⋅x ≤ 0 and nonlinear equality constraints c⋅x = 0. + // xopt : a vector of double, the computed solution of the optimization problem. + // fopt : a double, the value of the function at x. + // maxfval: a 1x1 matrix of doubles, the maximum value in vector fval + // exitflag : The exit status. See below for details. + // output : The structure consist of statistics about the optimization. See below for details. + // lambda : The structure consist of the Lagrange multipliers at the solution of problem. See below for details. + // // Description // fminimax minimizes the worst-case (largest) value of a set of multivariable functions, starting at an initial estimate. This is generally referred to as the minimax problem. // @@ -160,7 +158,6 @@ function [x,fval,maxfval,exitflag,output,lambda] = fminimax(varargin) // f(4)= -x(1) - x(2); // f(5)= x(1) + x(2) - 8; // endfunction - // // // The initial guess // x0 = [0.1,0.1]; // // The expected solution : only 4 digits are guaranteed @@ -169,6 +166,7 @@ function [x,fval,maxfval,exitflag,output,lambda] = fminimax(varargin) // maxfopt = 0 // // Run fminimax // [x,fval,maxfval,exitflag,output,lambda] = fminimax(myfun, x0) + // // Press ENTER to continue // // Examples // // A case where we provide the gradient of the objective @@ -181,14 +179,11 @@ function [x,fval,maxfval,exitflag,output,lambda] = fminimax(varargin) // f(4)= -x(1) - x(2); // f(5)= x(1) + x(2) - 8; // endfunction - // // // Defining gradient of myfun // function G = myfungrad(x) // G = [ 4*x(1) - 48, -2*x(1), 1, -1, 1; // 2*x(2) - 40, -6*x(2), 3, -1, 1; ]' // endfunction - // - // // // The nonlinear constraints and the Jacobian // // matrix of the constraints // function [c,ceq] = confun(x) @@ -197,8 +192,6 @@ function [x,fval,maxfval,exitflag,output,lambda] = fminimax(varargin) // // No nonlinear equality constraints // ceq=[] // endfunction - // - // // // Defining gradient of confungrad // function [DC,DCeq] = cgrad(x) // // DC(:,i) = gradient of the i-th constraint @@ -212,7 +205,6 @@ function [x,fval,maxfval,exitflag,output,lambda] = fminimax(varargin) // ]' // DCeq = []' // endfunction - // // // Test with both gradient of objective and gradient of constraints // minimaxOptions = list("GradObj",myfungrad,"GradCon",cgrad); // // The initial guess @@ -223,8 +215,6 @@ function [x,fval,maxfval,exitflag,output,lambda] = fminimax(varargin) // maxfopt = 6.73443 // // Run fminimax // [x,fval,maxfval,exitflag,output] = fminimax(myfun,x0,[],[],[],[],[],[], confun, minimaxOptions) - // - // // Authors // Animesh Baranawal // @@ -377,14 +367,14 @@ function [x,fval,maxfval,exitflag,output,lambda] = fminimax(varargin) //To check the User Entry for Options and storing it for i = 1:(size(minmaxUserOptions))/2 - select minmaxUserOptions(2*i-1) - case "MaxIter" then + select convstr(minmaxUserOptions(2*i-1),'l') + case "maxiter" then minmaxIter = minmaxUserOptions(2*i); //Setting the Maximum Iteration as per user entry - case "CpuTime" then + case "cputime" then minmaxCPU = minmaxUserOptions(2*i); //Setting the Maximum CPU Time as per user entry - case "GradObj" then + case "gradobj" then if (type(minmaxUserOptions(2*i))==10) then if (convstr(minmaxUserOptions(2*i))=="off") then flag1 = 0; @@ -397,7 +387,7 @@ function [x,fval,maxfval,exitflag,output,lambda] = fminimax(varargin) minmaxFGrad = minmaxUserOptions(2*i); end - case "GradCon" then + case "gradcon" then if (type(minmaxUserOptions(2*i))==10) then if (convstr(minmaxUserOptions(2*i))=="off") then flag2 = 0; @@ -515,27 +505,6 @@ function [x,fval,maxfval,exitflag,output,lambda] = fminimax(varargin) end endfunction - // disp(minmaxStartpoint) - // a = minmaxObjfun(minmaxStartpoint) - // disp(a) - // disp(newObjfun(minmaxStartpoint)) - // disp(minmaxA) - // disp(minmaxB) - // disp(minmaxAeq) - // disp(minmaxBeq) - // disp(minmaxLb) - // disp(minmaxUb) - // [a,b] = minmaxNonlinfun(minmaxStartpoint) - // disp(a) - // disp(b) - // [a,b] = newNonlinfun(minmaxStartpoint) - // disp(a) - // disp(b) - // [a,b] = newCGrad(minmaxStartpoint) - // disp(a) - // disp(b) - // disp(newFGrad(minmaxStartpoint)) - // to be passed as minimaxOptions to fmincon if(flag1 == 1 | flag2 == 1) then minmaxPassOptions = list("MaxIter", minmaxMaxIter, "CpuTime", minmaxCPU, "GradCon", newCGrad) @@ -555,5 +524,4 @@ function [x,fval,maxfval,exitflag,output,lambda] = fminimax(varargin) maxfval = max(fval) end - endfunction diff --git a/macros/fminunc.bin b/macros/fminunc.bin index 4d67d1b..aa82fc3 100644 Binary files a/macros/fminunc.bin and b/macros/fminunc.bin differ diff --git a/macros/fminunc.sci b/macros/fminunc.sci index f39c312..a936aa1 100644 --- a/macros/fminunc.sci +++ b/macros/fminunc.sci @@ -264,15 +264,15 @@ function [xopt,fopt,exitflag,output,gradient,hessian] = fminunc (varargin) //To check the user entry for options and store it for i = 1:(size(param))/2 - select param(2*i-1) - case "MaxIter" then + select convstr(param(2*i-1),'l') + case "maxiter" then options(2*i) = param(2*i); //Setting the maximum number of iterations as per user entry - case "CpuTime" then + case "cputime" then options(2*i) = param(2*i); //Setting the maximum CPU time as per user entry - case "Gradient" then + case "gradient" then flag1 = 1; fGrad = param(2*i); - case "Hessian" then + case "hessian" then flag2 = 1; fHess = param(2*i); else diff --git a/macros/lib b/macros/lib index b034ee7..f7602af 100644 Binary files a/macros/lib and b/macros/lib differ diff --git a/macros/linprog.bin b/macros/linprog.bin index 82e3310..12a9f7d 100644 Binary files a/macros/linprog.bin and b/macros/linprog.bin differ diff --git a/macros/linprog.sci b/macros/linprog.sci index e3e2c71..5b12241 100644 --- a/macros/linprog.sci +++ b/macros/linprog.sci @@ -51,9 +51,18 @@ function [xopt,fopt,exitflag,output,lambda] = linprog (varargin) // & & lb \leq x \leq ub \\ // \end{eqnarray} // + // // The routine calls Clp for solving the linear programming problem, Clp is a library written in C++. // - // The exitflag allows to know the status of the optimization which is given back by Ipopt. + // The options allows the user to set various parameters of the Optimization problem. + // It should be defined as type "list" and contains the following fields. In the current version it only contains maxiter. + // + // Syntax : options= list("MaxIter", [---]); + // MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take. + // Default Values : options = list("MaxIter", [3000]); + // + // + // The exitflag allows to know the status of the optimization which is given back by CLP. // // exitflag=0 : Optimal Solution Found // exitflag=1 : Primal Infeasible @@ -64,8 +73,6 @@ function [xopt,fopt,exitflag,output,lambda] = linprog (varargin) // exitflag=6 : Dual objective limit reached. // // - // For more details on exitflag see the ipopt documentation, go to http://www.coin-or.org/Ipopt/documentation/ - // // The output data structure contains detailed informations about the optimization process. // It has type "struct" and contains the following fields. // @@ -77,8 +84,6 @@ function [xopt,fopt,exitflag,output,lambda] = linprog (varargin) // of optimization. In the current version the values are returned only when the the solution is optimal. // It has type "struct" and contains the following fields. // - // lambda.lower: The Lagrange multipliers for the lower bound constraints. - // lambda.upper: The Lagrange multipliers for the upper bound constraints. // lambda.eqlin: The Lagrange multipliers for the linear equality constraints. // lambda.ineqlin: The Lagrange multipliers for the linear inequality constraints. // diff --git a/macros/lsqlin.bin b/macros/lsqlin.bin index 7018f4a..7baf7be 100644 Binary files a/macros/lsqlin.bin and b/macros/lsqlin.bin differ diff --git a/macros/lsqlin.sci b/macros/lsqlin.sci index 97aaae6..f236c0d 100644 --- a/macros/lsqlin.sci +++ b/macros/lsqlin.sci @@ -9,7 +9,6 @@ // Organization: FOSSEE, IIT Bombay // Email: toolbox@scilab.in - function [xopt,resnorm,residual,exitflag,output,lambda] = lsqlin (varargin) // Solves a linear quadratic problem. // @@ -54,6 +53,15 @@ function [xopt,resnorm,residual,exitflag,output,lambda] = lsqlin (varargin) // // The routine calls Ipopt for solving the linear least square problem, Ipopt is a library written in C++. // + // The options allows the user to set various parameters of the Optimization problem. + // It should be defined as type "list" and contains the following fields. + // + // Syntax : options= list("MaxIter", [---], "CpuTime", [---]); + // MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take. + // CpuTime : a Scalar, containing the Maximum amount of CPU Time that the solver should take. + // Default Values : options = list("MaxIter", [3000], "CpuTime", [600]); + // + // // The exitflag allows to know the status of the optimization which is given back by Ipopt. // // exitflag=0 : Optimal Solution Found @@ -198,22 +206,32 @@ function [xopt,resnorm,residual,exitflag,output,lambda] = lsqlin (varargin) error(errmsg); end + //Check type of variables + Checktype("lsqlin", C, "C", 1, "constant") + Checktype("lsqlin", d, "d", 2, "constant") + Checktype("lsqlin", A, "A", 3, "constant") + Checktype("lsqlin", b, "b", 4, "constant") + Checktype("lsqlin", Aeq, "Aeq", 5, "constant") + Checktype("lsqlin", beq, "beq", 6, "constant") + Checktype("lsqlin", lb, "lb", 7, "constant") + Checktype("lsqlin", ub, "ub", 8, "constant") + Checktype("lsqlin", x0, "x0", 9, "constant") if (modulo(size(param),2)) then errmsg = msprintf(gettext("%s: Size of parameters should be even"), "lsqlin"); error(errmsg); end - options = list( "MaxIter" , [3000], ... + options = list( "MaxIter" , [3000], ... "CpuTime" , [600] ... - ); + ); for i = 1:(size(param))/2 - select param(2*i-1) - case "MaxIter" then + select convstr(param(2*i-1),'l') + case "maxiter" then options(2*i) = param(2*i); - case "CpuTime" then + case "cputime" then options(2*i) = param(2*i); else errmsg = msprintf(gettext("%s: Unrecognized parameter name ''%s''."), "lsqlin", param(2*i-1)); @@ -227,7 +245,6 @@ function [xopt,resnorm,residual,exitflag,output,lambda] = lsqlin (varargin) // Check if the user gives row vector // and Changing it to a column matrix - if (size(d,2)== [nbVar]) then d=d'; end diff --git a/macros/lsqnonneg.bin b/macros/lsqnonneg.bin index 39c553b..32620d0 100644 Binary files a/macros/lsqnonneg.bin and b/macros/lsqnonneg.bin differ diff --git a/macros/lsqnonneg.sci b/macros/lsqnonneg.sci index 3e5ea81..a60d417 100644 --- a/macros/lsqnonneg.sci +++ b/macros/lsqnonneg.sci @@ -41,6 +41,15 @@ function [xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg (varargin) // // The routine calls Ipopt for solving the nonnegative least-squares curve fitting problems, Ipopt is a library written in C++. // + // The options allows the user to set various parameters of the Optimization problem. + // It should be defined as type "list" and contains the following fields. + // + // Syntax : options= list("MaxIter", [---], "CpuTime", [---]); + // MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take. + // CpuTime : a Scalar, containing the Maximum amount of CPU Time that the solver should take. + // Default Values : options = list("MaxIter", [3000], "CpuTime", [600]); + // + // // The exitflag allows to know the status of the optimization which is given back by Ipopt. // // exitflag=0 : Optimal Solution Found @@ -114,6 +123,9 @@ function [xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg (varargin) error(errmsg); end + //Check type of variables + Checktype("lsqnonneg", C, "C", 1, "constant") + Checktype("lsqnonneg", d, "d", 2, "constant") if (modulo(size(param),2)) then errmsg = msprintf(gettext("%s: Size of parameters should be even"), "lsqnonneg"); @@ -126,13 +138,13 @@ function [xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg (varargin) for i = 1:(size(param))/2 - select param(2*i-1) - case "MaxIter" then + select convstr(param(2*i-1),'l') + case "maxiter" then options(2*i) = param(2*i); - case "CpuTime" then + case "cputime" then options(2*i) = param(2*i); else - errmsg = msprintf(gettext("%s: Unrecognized parameter name ''%s''."), "lsqnonneg", param(2*i-1)); + errmsg = msprintf(gettext("%s: Unrecognized parameter name ''%s''."), "lsqlin", param(2*i-1)); error(errmsg) end end diff --git a/macros/matrix_linprog.bin b/macros/matrix_linprog.bin index 21e525c..ac4d8d9 100644 Binary files a/macros/matrix_linprog.bin and b/macros/matrix_linprog.bin differ diff --git a/macros/matrix_linprog.sci b/macros/matrix_linprog.sci index 1f6a6bf..c1f53a0 100755 --- a/macros/matrix_linprog.sci +++ b/macros/matrix_linprog.sci @@ -31,16 +31,16 @@ function [xopt,fopt,exitflag,output,lambda] = matrix_linprog (varargin) c = varargin(1); - if (size(c,2)~=1) then - errmsg = msprintf(gettext("%s: Objective Coefficients should be a column matrix"), "linprog"); - error(errmsg); - end - if(size(c,2) == 0) then errmsg = msprintf(gettext("%s: Cannot determine the number of variables because input objective coefficients is empty"), "linprog"); error(errmsg); end + if (size(c,2)~=1) then + errmsg = msprintf(gettext("%s: Objective Coefficients should be a column matrix"), "linprog"); + error(errmsg); + end + nbVar = size(c,1); A = varargin(2); b = varargin(3); @@ -67,25 +67,22 @@ function [xopt,fopt,exitflag,output,lambda] = matrix_linprog (varargin) param =varargin(8); end + //Check type of variables + Checktype("linprog", c, "c", 1, "constant") + Checktype("linprog", A, "A", 2, "constant") + Checktype("linprog", b, "b", 3, "constant") + Checktype("linprog", Aeq, "Aeq", 4, "constant") + Checktype("linprog", beq, "beq", 5, "constant") + Checktype("linprog", lb, "lb", 6, "constant") + Checktype("linprog", ub, "ub", 7, "constant") + nbConInEq = size(A,1); nbConEq = size(Aeq,1); - if (size(lb,2)== [nbVar]) then - lb = lb'; - end - - if (size(ub,2)== [nbVar]) then - ub = ub'; - end - - if (size(b,2)== [nbConInEq]) then - b = b'; - end - - if (size(beq,2)== [nbConEq]) then - beq = beq'; - end - + lb = lb(:); + ub = ub(:) + b = b(:); + beq = beq(:); if (size(lb,2)==0) then lb = repmat(-%inf,nbVar,1); @@ -110,11 +107,11 @@ function [xopt,fopt,exitflag,output,lambda] = matrix_linprog (varargin) for i = 1:(size(param))/2 - select param(2*i-1) - case "MaxIter" then + select convstr(param(2*i-1),'l') + case "maxiter" then options(2*i) = param(2*i); else - errmsg = msprintf(gettext("%s: Unrecognized parameter name ''%s''."), "qpipoptmat", param(2*i-1)); + errmsg = msprintf(gettext("%s: Unrecognized parameter name ''%s''."), "linprog", param(2*i-1)); error(errmsg) end end @@ -155,7 +152,6 @@ function [xopt,fopt,exitflag,output,lambda] = matrix_linprog (varargin) end //Check if the user gives a matrix instead of a vector - if (size(lb,1)~=1)& (size(lb,2)~=1) then errmsg = msprintf(gettext("%s: Lower Bound should be a vector"), "linprog"); error(errmsg); @@ -194,10 +190,6 @@ function [xopt,fopt,exitflag,output,lambda] = matrix_linprog (varargin) end end - lb = lb(:); - ub = ub(:) - b = b(:); - beq = beq(:); nbVar = size(c,1); c = c'; conMatrix = [Aeq;A]; diff --git a/macros/mps_linprog.bin b/macros/mps_linprog.bin index ee7d822..c0d2e3e 100644 Binary files a/macros/mps_linprog.bin and b/macros/mps_linprog.bin differ diff --git a/macros/mps_linprog.sci b/macros/mps_linprog.sci index 55f3edf..aa61d02 100644 --- a/macros/mps_linprog.sci +++ b/macros/mps_linprog.sci @@ -35,21 +35,27 @@ function [xopt,fopt,exitflag,output,lambda] =mps_linprog(varargin) end if (type(param) ~= 15) then - errmsg = msprintf(gettext("%s: options should be a list "), "mps_linprog"); + errmsg = msprintf(gettext("%s: options should be a list "), "linprog"); error(errmsg); end + //Check type of variables + Checktype("linprog", mpsFile, "mpsFile", 1, "string") + if (modulo(size(param),2)) then - errmsg = msprintf(gettext("%s: Size of parameters should be even"), "mps_linprog"); + errmsg = msprintf(gettext("%s: Size of parameters should be even"), "linprog"); error(errmsg); end options = list("MaxIter" , [3000],); for i = 1:(size(param))/2 - select param(2*i-1) - case "MaxIter" then + select convstr(param(2*i-1),'l') + case "maxiter" then options(2*i) = param(2*i); - end + else + errmsg = msprintf(gettext("%s: Unrecognized parameter name ''%s''."), "linprog", param(2*i-1)); + error(errmsg) + end end //Calling the function by passing the required parameters diff --git a/macros/names b/macros/names index 1055c2a..bff51fe 100644 --- a/macros/names +++ b/macros/names @@ -1,13 +1,12 @@ +Checkdims +Checklhs +Checkrhs +Checktype +Checkvector fgoalattain -fgoalattainFunctions fminbnd fmincon fminimax -fminimaxCheckdims -fminimaxChecklhs -fminimaxCheckrhs -fminimaxChecktype -fminimaxCheckvector fminunc linprog lsqlin diff --git a/macros/qpipopt.bin b/macros/qpipopt.bin index d5e2bd1..e2ba3de 100644 Binary files a/macros/qpipopt.bin and b/macros/qpipopt.bin differ diff --git a/macros/qpipopt.sci b/macros/qpipopt.sci index 25e7c07..c900f0c 100644 --- a/macros/qpipopt.sci +++ b/macros/qpipopt.sci @@ -51,6 +51,15 @@ function [xopt,fopt,exitflag,output,lambda] = qpipopt (varargin) // // The routine calls Ipopt for solving the quadratic problem, Ipopt is a library written in C++. // + // The options allows the user to set various parameters of the Optimization problem. + // It should be defined as type "list" and contains the following fields. + // + // Syntax : options= list("MaxIter", [---], "CpuTime", [---]); + // MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take. + // CpuTime : a Scalar, containing the Maximum amount of CPU Time that the solver should take. + // Default Values : options = list("MaxIter", [3000], "CpuTime", [600]); + // + // // The exitflag allows to know the status of the optimization which is given back by Ipopt. // // exitflag=0 : Optimal Solution Found @@ -187,23 +196,36 @@ function [xopt,fopt,exitflag,output,lambda] = qpipopt (varargin) error(errmsg); end + //Check type of variables + Checktype("qpipopt", nbVar, "nbVar", 1, "constant") + Checktype("qpipopt", nbCon, "nbCon", 2, "constant") + Checktype("qpipopt", H, "H", 3, "constant") + Checktype("qpipopt", f, "f", 4, "constant") + Checktype("qpipopt", lb, "lb", 5, "constant") + Checktype("qpipopt", ub, "lb", 6, "constant") + Checktype("qpipopt", A, "A", 7, "constant") + Checktype("qpipopt", conLB, "conlb", 8, "constant") + Checktype("qpipopt", conUB, "conub", 9, "constant") + Checktype("qpipopt", x0, "x0", 10, "constant") + options = list(.. "MaxIter" , [3000], ... "CpuTime" , [600] ... ); - for i = 1:(size(param))/2 - select param(2*i-1) - case "MaxIter" then - options(2*i) = param(2*i); - case "CpuTime" then - options(2*i) = param(2*i); - else - errmsg = msprintf(gettext("%s: Unrecognized parameter name ''%s''."), "qpipopt", param(2*i-1)); - error(errmsg) - end - end + for i = 1:(size(param))/2 + + select convstr(param(2*i-1),'l') + case "maxiter" then + options(2*i) = param(2*i); + case "cputime" then + options(2*i) = param(2*i); + else + errmsg = msprintf(gettext("%s: Unrecognized parameter name ''%s''."), "lsqlin", param(2*i-1)); + error(errmsg) + end + end // Check if the user gives row vector // and Changing it to a column matrix diff --git a/macros/qpipoptmat.bin b/macros/qpipoptmat.bin index 58424ec..057fa29 100644 Binary files a/macros/qpipoptmat.bin and b/macros/qpipoptmat.bin differ diff --git a/macros/qpipoptmat.sci b/macros/qpipoptmat.sci index ca32f8e..e64a83a 100644 --- a/macros/qpipoptmat.sci +++ b/macros/qpipoptmat.sci @@ -35,7 +35,6 @@ function [xopt,fopt,exitflag,output,lambda] = qpipoptmat (varargin) // param : a list containing the parameters to be set. // xopt : a vector of double, the computed solution of the optimization problem. // fopt : a double, the value of the function at x. - // residual : a vector of double, solution residuals returned as the vector d-C*x. // exitflag : The exit status. See below for details. // output : The structure consist of statistics about the optimization. See below for details. // lambda : The structure consist of the Lagrange multipliers at the solution of problem. See below for details. @@ -55,6 +54,15 @@ function [xopt,fopt,exitflag,output,lambda] = qpipoptmat (varargin) // // The routine calls Ipopt for solving the quadratic problem, Ipopt is a library written in C++. // + // The options allows the user to set various parameters of the Optimization problem. + // It should be defined as type "list" and contains the following fields. + // + // Syntax : options= list("MaxIter", [---], "CpuTime", [---]); + // MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take. + // CpuTime : a Scalar, containing the Maximum amount of CPU Time that the solver should take. + // Default Values : options = list("MaxIter", [3000], "CpuTime", [600]); + // + // // The exitflag allows to know the status of the optimization which is given back by Ipopt. // // exitflag=0 : Optimal Solution Found @@ -208,21 +216,32 @@ function [xopt,fopt,exitflag,output,lambda] = qpipoptmat (varargin) error(errmsg); end + //Check type of variables + Checktype("qpipoptmat", H, "H", 1, "constant") + Checktype("qpipoptmat", f, "f", 2, "constant") + Checktype("qpipoptmat", A, "A", 3, "constant") + Checktype("qpipoptmat", b, "b", 4, "constant") + Checktype("qpipoptmat", Aeq, "Aeq", 5, "constant") + Checktype("qpipoptmat", beq, "beq", 6, "constant") + Checktype("qpipoptmat", lb, "lb", 7, "constant") + Checktype("qpipoptmat", ub, "ub", 8, "constant") + Checktype("qpipoptmat", x0, "x0", 9, "constant") + options = list(.. "MaxIter" , [3000], ... "CpuTime" , [600] ... ); for i = 1:(size(param))/2 - - select param(2*i-1) - case "MaxIter" then - options(2*i) = param(2*i); - case "CpuTime" then - options(2*i) = param(2*i); - else - errmsg = msprintf(gettext("%s: Unrecognized parameter name ''%s''."), "qpipoptmat", param(2*i-1)); - error(errmsg) + + select convstr(param(2*i-1),'l') + case "maxiter" then + options(2*i) = param(2*i); + case "cputime" then + options(2*i) = param(2*i); + else + errmsg = msprintf(gettext("%s: Unrecognized parameter name ''%s''."), "lsqlin", param(2*i-1)); + error(errmsg) end end diff --git a/macros/symphony.bin b/macros/symphony.bin index b98094e..2c3a43a 100644 Binary files a/macros/symphony.bin and b/macros/symphony.bin differ diff --git a/macros/symphony.sci b/macros/symphony.sci index 81b24fb..111f84c 100644 --- a/macros/symphony.sci +++ b/macros/symphony.sci @@ -219,6 +219,17 @@ function [xopt,fopt,status,output] = symphony (varargin) options = varargin(11); end + //Check type of variables + Checktype("symphony", nbVar, "nbVar", 1, "constant") + Checktype("symphony", nbCon, "nbCon", 2, "constant") + Checktype("symphony", c, "c", 3, "constant") + Checktype("symphony", isInt, "isInt", 4, "boolean") + Checktype("symphony", lb, "lb", 5, "constant") + Checktype("symphony", ub, "lb", 6, "constant") + Checktype("symphony", A, "A", 7, "constant") + Checktype("symphony", conLB, "conlb", 8, "constant") + Checktype("symphony", conUB, "conub", 9, "constant") + // Check if the user gives empty matrix if (size(lb,2)==0) then lb = repmat(-%inf,nbVar,1); diff --git a/macros/symphonymat.bin b/macros/symphonymat.bin index a5e68ab..7dffa2f 100644 Binary files a/macros/symphonymat.bin and b/macros/symphonymat.bin differ diff --git a/macros/symphonymat.sci b/macros/symphonymat.sci index 3848850..2016f00 100644 --- a/macros/symphonymat.sci +++ b/macros/symphonymat.sci @@ -227,6 +227,16 @@ function [xopt,fopt,status,iter] = symphonymat (varargin) options = varargin(9); end + //Check type of variables + Checktype("symphonymat", c, "c", 1, "constant") + Checktype("symphonymat", intcon, "intcon", 2, "constant") + Checktype("symphonymat", A, "A", 3, "constant") + Checktype("symphonymat", b, "b", 4, "constant") + Checktype("symphonymat", Aeq, "Aeq", 5, "constant") + Checktype("symphonymat", beq, "beq", 6, "constant") + Checktype("symphonymat", lb, "lb", 7, "constant") + Checktype("symphonymat", ub, "ub", 8, "constant") + // Check if the user gives empty matrix if (size(lb,2)==0) then lb = repmat(-%inf,nbVar,1); diff --git a/sci_gateway/builder_gateway.sce b/sci_gateway/builder_gateway.sce index 514d206..de09d9c 100644 --- a/sci_gateway/builder_gateway.sce +++ b/sci_gateway/builder_gateway.sce @@ -1,13 +1,13 @@ // 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 +// Author: Harpreet Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in sci_gateway_dir = get_absolute_file_path('builder_gateway.sce'); diff --git a/sci_gateway/cpp/builder_gateway_cpp.sce b/sci_gateway/cpp/builder_gateway_cpp.sce index 3503996..c92bd7f 100644 --- a/sci_gateway/cpp/builder_gateway_cpp.sce +++ b/sci_gateway/cpp/builder_gateway_cpp.sce @@ -1,22 +1,24 @@ // Copyright (C) 2015 - IIT Bombay - FOSSEE // -// Author: Keyur Joshi, Sai Kiran, Iswarya and 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 +// Author: Harpreet Singh +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in mode(-1) lines(0) -toolbox_title = "FAMOS"; +toolbox_title = "FOSSEE_Optimization_Toolbox"; [a, opt] = getversion(); Version = opt(2); +Build_64Bits = %f; + path_builder = get_absolute_file_path('builder_gateway_cpp.sce'); tools_path = path_builder + "../../thirdparty/linux/"; diff --git a/sci_gateway/cpp/cleaner.sce b/sci_gateway/cpp/cleaner.sce index 27b5409..333775c 100644 --- a/sci_gateway/cpp/cleaner.sce +++ b/sci_gateway/cpp/cleaner.sce @@ -10,12 +10,12 @@ if fileinfo('loader.sce') <> [] then mdelete('loader.sce'); end // ------------------------------------------------------ -if fileinfo('libFAMOS.so') <> [] then - mdelete('libFAMOS.so'); +if fileinfo('libFOSSEE_Optimization_Toolbox.so') <> [] then + mdelete('libFOSSEE_Optimization_Toolbox.so'); end // ------------------------------------------------------ -if fileinfo('libFAMOS.c') <> [] then - mdelete('libFAMOS.c'); +if fileinfo('libFOSSEE_Optimization_Toolbox.c') <> [] then + mdelete('libFOSSEE_Optimization_Toolbox.c'); end // ------------------------------------------------------ chdir(curdir); diff --git a/sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.c b/sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.c new file mode 100644 index 0000000..cd53066 --- /dev/null +++ b/sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.c @@ -0,0 +1,156 @@ +#ifdef __cplusplus +extern "C" { +#endif +#include +#include +#include +#include +static int direct_gateway(char *fname,void F(void)) { F();return 0;}; +extern Gatefunc sci_sym_open; +extern Gatefunc sci_sym_close; +extern Gatefunc sci_sym_isEnvActive; +extern Gatefunc sci_sym_set_defaults; +extern Gatefunc sci_sym_set_int_param; +extern Gatefunc sci_sym_get_int_param; +extern Gatefunc sci_sym_set_dbl_param; +extern Gatefunc sci_sym_get_dbl_param; +extern Gatefunc sci_sym_set_str_param; +extern Gatefunc sci_sym_get_str_param; +extern Gatefunc sci_sym_getInfinity; +extern Gatefunc sci_sym_loadProblemBasic; +extern Gatefunc sci_sym_loadProblem; +extern Gatefunc sci_sym_load_mps; +extern Gatefunc sci_sym_get_num_int; +extern Gatefunc sci_sym_get_num_int; +extern Gatefunc sci_sym_get_num_int; +extern Gatefunc sci_sym_isContinuous; +extern Gatefunc sci_sym_isBinary; +extern Gatefunc sci_sym_isInteger; +extern Gatefunc sci_sym_set_continuous; +extern Gatefunc sci_sym_set_integer; +extern Gatefunc sci_sym_get_dbl_arr; +extern Gatefunc sci_sym_get_dbl_arr; +extern Gatefunc sci_sym_setVarBound; +extern Gatefunc sci_sym_setVarBound; +extern Gatefunc sci_sym_get_dbl_arr; +extern Gatefunc sci_sym_setObjCoeff; +extern Gatefunc sci_sym_getObjSense; +extern Gatefunc sci_sym_setObjSense; +extern Gatefunc sci_sym_get_dbl_arr; +extern Gatefunc sci_sym_get_dbl_arr; +extern Gatefunc sci_sym_get_dbl_arr; +extern Gatefunc sci_sym_get_dbl_arr; +extern Gatefunc sci_sym_setConstrBound; +extern Gatefunc sci_sym_setConstrBound; +extern Gatefunc sci_sym_setConstrType; +extern Gatefunc sci_sym_get_matrix; +extern Gatefunc sci_sym_get_row_sense; +extern Gatefunc sci_sym_addConstr; +extern Gatefunc sci_sym_addVar; +extern Gatefunc sci_sym_delete_cols; +extern Gatefunc sci_sym_delete_rows; +extern Gatefunc sci_sym_getPrimalBound; +extern Gatefunc sci_sym_setPrimalBound; +extern Gatefunc sci_sym_setColSoln; +extern Gatefunc sci_sym_solve; +extern Gatefunc sci_sym_get_status; +extern Gatefunc sci_sym_get_solver_status; +extern Gatefunc sci_sym_get_solver_status; +extern Gatefunc sci_sym_get_solver_status; +extern Gatefunc sci_sym_get_solver_status; +extern Gatefunc sci_sym_get_solver_status; +extern Gatefunc sci_sym_get_solver_status; +extern Gatefunc sci_sym_getVarSoln; +extern Gatefunc sci_sym_getObjVal; +extern Gatefunc sci_sym_get_iteration_count; +extern Gatefunc sci_sym_getRowActivity; +extern Gatefunc sci_linearprog; +extern Gatefunc sci_rmps; +extern Gatefunc sci_solveqp; +extern Gatefunc sci_solveminuncp; +extern Gatefunc sci_solveminbndp; +extern Gatefunc sci_solveminconp; +static GenericTable Tab[]={ + {(Myinterfun)sci_gateway,sci_sym_open,"sym_open"}, + {(Myinterfun)sci_gateway,sci_sym_close,"sym_close"}, + {(Myinterfun)sci_gateway,sci_sym_isEnvActive,"sym_isEnvActive"}, + {(Myinterfun)sci_gateway,sci_sym_set_defaults,"sym_resetParams"}, + {(Myinterfun)sci_gateway,sci_sym_set_int_param,"sym_setIntParam"}, + {(Myinterfun)sci_gateway,sci_sym_get_int_param,"sym_getIntParam"}, + {(Myinterfun)sci_gateway,sci_sym_set_dbl_param,"sym_setDblParam"}, + {(Myinterfun)sci_gateway,sci_sym_get_dbl_param,"sym_getDblParam"}, + {(Myinterfun)sci_gateway,sci_sym_set_str_param,"sym_setStrParam"}, + {(Myinterfun)sci_gateway,sci_sym_get_str_param,"sym_getStrParam"}, + {(Myinterfun)sci_gateway,sci_sym_getInfinity,"sym_getInfinity"}, + {(Myinterfun)sci_gateway,sci_sym_loadProblemBasic,"sym_loadProblemBasic"}, + {(Myinterfun)sci_gateway,sci_sym_loadProblem,"sym_loadProblem"}, + {(Myinterfun)sci_gateway,sci_sym_load_mps,"sym_loadMPS"}, + {(Myinterfun)sci_gateway,sci_sym_get_num_int,"sym_getNumConstr"}, + {(Myinterfun)sci_gateway,sci_sym_get_num_int,"sym_getNumVar"}, + {(Myinterfun)sci_gateway,sci_sym_get_num_int,"sym_getNumElements"}, + {(Myinterfun)sci_gateway,sci_sym_isContinuous,"sym_isContinuous"}, + {(Myinterfun)sci_gateway,sci_sym_isBinary,"sym_isBinary"}, + {(Myinterfun)sci_gateway,sci_sym_isInteger,"sym_isInteger"}, + {(Myinterfun)sci_gateway,sci_sym_set_continuous,"sym_setContinuous"}, + {(Myinterfun)sci_gateway,sci_sym_set_integer,"sym_setInteger"}, + {(Myinterfun)sci_gateway,sci_sym_get_dbl_arr,"sym_getVarLower"}, + {(Myinterfun)sci_gateway,sci_sym_get_dbl_arr,"sym_getVarUpper"}, + {(Myinterfun)sci_gateway,sci_sym_setVarBound,"sym_setVarLower"}, + {(Myinterfun)sci_gateway,sci_sym_setVarBound,"sym_setVarUpper"}, + {(Myinterfun)sci_gateway,sci_sym_get_dbl_arr,"sym_getObjCoeff"}, + {(Myinterfun)sci_gateway,sci_sym_setObjCoeff,"sym_setObjCoeff"}, + {(Myinterfun)sci_gateway,sci_sym_getObjSense,"sym_getObjSense"}, + {(Myinterfun)sci_gateway,sci_sym_setObjSense,"sym_setObjSense"}, + {(Myinterfun)sci_gateway,sci_sym_get_dbl_arr,"sym_getRhs"}, + {(Myinterfun)sci_gateway,sci_sym_get_dbl_arr,"sym_getConstrRange"}, + {(Myinterfun)sci_gateway,sci_sym_get_dbl_arr,"sym_getConstrLower"}, + {(Myinterfun)sci_gateway,sci_sym_get_dbl_arr,"sym_getConstrUpper"}, + {(Myinterfun)sci_gateway,sci_sym_setConstrBound,"sym_setConstrLower"}, + {(Myinterfun)sci_gateway,sci_sym_setConstrBound,"sym_setConstrUpper"}, + {(Myinterfun)sci_gateway,sci_sym_setConstrType,"sym_setConstrType"}, + {(Myinterfun)sci_gateway,sci_sym_get_matrix,"sym_getMatrix"}, + {(Myinterfun)sci_gateway,sci_sym_get_row_sense,"sym_getConstrSense"}, + {(Myinterfun)sci_gateway,sci_sym_addConstr,"sym_addConstr"}, + {(Myinterfun)sci_gateway,sci_sym_addVar,"sym_addVar"}, + {(Myinterfun)sci_gateway,sci_sym_delete_cols,"sym_deleteVars"}, + {(Myinterfun)sci_gateway,sci_sym_delete_rows,"sym_deleteConstrs"}, + {(Myinterfun)sci_gateway,sci_sym_getPrimalBound,"sym_getPrimalBound"}, + {(Myinterfun)sci_gateway,sci_sym_setPrimalBound,"sym_setPrimalBound"}, + {(Myinterfun)sci_gateway,sci_sym_setColSoln,"sym_setVarSoln"}, + {(Myinterfun)sci_gateway,sci_sym_solve,"sym_solve"}, + {(Myinterfun)sci_gateway,sci_sym_get_status,"sym_getStatus"}, + {(Myinterfun)sci_gateway,sci_sym_get_solver_status,"sym_isOptimal"}, + {(Myinterfun)sci_gateway,sci_sym_get_solver_status,"sym_isInfeasible"}, + {(Myinterfun)sci_gateway,sci_sym_get_solver_status,"sym_isAbandoned"}, + {(Myinterfun)sci_gateway,sci_sym_get_solver_status,"sym_isIterLimitReached"}, + {(Myinterfun)sci_gateway,sci_sym_get_solver_status,"sym_isTimeLimitReached"}, + {(Myinterfun)sci_gateway,sci_sym_get_solver_status,"sym_isTargetGapAchieved"}, + {(Myinterfun)sci_gateway,sci_sym_getVarSoln,"sym_getVarSoln"}, + {(Myinterfun)sci_gateway,sci_sym_getObjVal,"sym_getObjVal"}, + {(Myinterfun)sci_gateway,sci_sym_get_iteration_count,"sym_getIterCount"}, + {(Myinterfun)sci_gateway,sci_sym_getRowActivity,"sym_getConstrActivity"}, + {(Myinterfun)sci_gateway,sci_linearprog,"linearprog"}, + {(Myinterfun)sci_gateway,sci_rmps,"rmps"}, + {(Myinterfun)sci_gateway,sci_solveqp,"solveqp"}, + {(Myinterfun)sci_gateway,sci_solveminuncp,"solveminuncp"}, + {(Myinterfun)sci_gateway,sci_solveminbndp,"solveminbndp"}, + {(Myinterfun)sci_gateway,sci_solveminconp,"solveminconp"}, +}; + +int C2F(libFOSSEE_Optimization_Toolbox)() +{ + Rhs = Max(0, Rhs); + if (*(Tab[Fin-1].f) != NULL) + { + if(pvApiCtx == NULL) + { + pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx)); + } + pvApiCtx->pstName = (char*)Tab[Fin-1].name; + (*(Tab[Fin-1].f))(Tab[Fin-1].name,Tab[Fin-1].F); + } + return 0; +} +#ifdef __cplusplus +} +#endif diff --git a/sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.so b/sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.so new file mode 100755 index 0000000..1f7e424 Binary files /dev/null and b/sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.so differ diff --git a/sci_gateway/cpp/loader.sce b/sci_gateway/cpp/loader.sce index 37305c7..1ec953f 100644 --- a/sci_gateway/cpp/loader.sce +++ b/sci_gateway/cpp/loader.sce @@ -2,10 +2,10 @@ // Generated by builder.sce : Please, do not edit this file // ---------------------------------------------------------------------------- // -libFAMOS_path = get_absolute_file_path('loader.sce'); +libFOSSEE_Optimizat_path = get_absolute_file_path('loader.sce'); // // ulink previous function with same name -[bOK, ilib] = c_link('libFAMOS'); +[bOK, ilib] = c_link('libFOSSEE_Optimization_Toolbox'); if bOK then ulink(ilib); end @@ -75,9 +75,9 @@ list_functions = [ 'sym_open'; 'solveminbndp'; 'solveminconp'; ]; -addinter(libFAMOS_path + filesep() + 'libFAMOS' + getdynlibext(), 'libFAMOS', list_functions); +addinter(libFOSSEE_Optimizat_path + filesep() + 'libFOSSEE_Optimization_Toolbox' + getdynlibext(), 'libFOSSEE_Optimization_Toolbox', list_functions); // remove temp. variables on stack -clear libFAMOS_path; +clear libFOSSEE_Optimizat_path; clear bOK; clear ilib; clear list_functions; diff --git a/tests/general_tests/linprog/linprog_A1.sce b/tests/general_tests/linprog/linprog_A1.sce new file mode 100644 index 0000000..bb3a00a --- /dev/null +++ b/tests/general_tests/linprog/linprog_A1.sce @@ -0,0 +1,18 @@ +// Check for elements in A +c=[-1,-1/3]' +A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1] +b=[2,1,2,1,-1,2] +Aeq=[1,1/4] +beq=[1/2] + +//Error +//linprog: The number of columns in A must be the same as the number of elements of c +//at line 113 of function matrix_linprog called by : +//at line 169 of function linprog called by : +//[xopt,fopt,exitflag,output,lambda]=linprog(c, b, b, Aeq, beq) +//at line 30 of exec file called by : +//exec linprog_A1.sce + +[xopt,fopt,exitflag,output,lambda]=linprog(c, b, b, Aeq, beq) + + diff --git a/tests/general_tests/linprog/linprog_Aeq1.sce b/tests/general_tests/linprog/linprog_Aeq1.sce new file mode 100644 index 0000000..6f1ca6e --- /dev/null +++ b/tests/general_tests/linprog/linprog_Aeq1.sce @@ -0,0 +1,18 @@ +// Check for elements in Aeq +c=[-1,-1/3]' +A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1] +b=[2,1,2,1,-1,2] +Aeq=[1,1/4] +beq=[1/2] + +//Error +//linprog: The number of columns in Aeq must be the same as the number of elements of c +//at line 119 of function matrix_linprog called by : +//at line 169 of function linprog called by : +//[xopt,fopt,exitflag,output,lambda]=linprog(c, A, b, beq, beq) +//at line 16 of exec file called by : +//exec linprog_Aeq1.sce + +[xopt,fopt,exitflag,output,lambda]=linprog(c, A, b, beq, beq) + + diff --git a/tests/general_tests/linprog/linprog_b1.sce b/tests/general_tests/linprog/linprog_b1.sce new file mode 100644 index 0000000..6b8ecd8 --- /dev/null +++ b/tests/general_tests/linprog/linprog_b1.sce @@ -0,0 +1,17 @@ +// Check for elements in b +c=[-1,-1/3]' +A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1] +b=[2,1,2,1,-1,2] +Aeq=[1,1/4] +beq=[1/2] + +//Error +//linprog: The number of rows in A must be the same as the number of elements of b +//at line 133 of function matrix_linprog called by : +//at line 169 of function linprog called by : +//[xopt,fopt,exitflag,output,lambda]=linprog(c, A, beq, Aeq, beq) +//at line 16 of exec file called by : +//exec linprog_b1.sce + +[xopt,fopt,exitflag,output,lambda]=linprog(c, A, beq, Aeq, beq) + diff --git a/tests/general_tests/linprog/linprog_beq1.sce b/tests/general_tests/linprog/linprog_beq1.sce new file mode 100644 index 0000000..870d05f --- /dev/null +++ b/tests/general_tests/linprog/linprog_beq1.sce @@ -0,0 +1,17 @@ +// Check for elements in beq +c=[-1,-1/3]' +A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1] +b=[2,1,2,1,-1,2] +Aeq=[1,1/4] +beq=[1/2] + +//Error +//linprog: The number of columns in Aeq must be the same as the number of elements of c +//at line 119 of function matrix_linprog called by : +//at line 169 of function linprog called by : +//[xopt,fopt,exitflag,output,lambda]=linprog(c, A, b, beq, beq) +//at line 16 of exec file called by : +//exec linprog_Aeq1.sce + +[xopt,fopt,exitflag,output,lambda]=linprog(c, A, b, Aeq, Aeq) + diff --git a/tests/general_tests/linprog/linprog_dual_infeasible1.sce b/tests/general_tests/linprog/linprog_dual_infeasible1.sce new file mode 100644 index 0000000..9b910f4 --- /dev/null +++ b/tests/general_tests/linprog/linprog_dual_infeasible1.sce @@ -0,0 +1,31 @@ + //Dual Infeasible Problem + c=[3,5,-7]' + A=[-1,-1,4;1,1,4] + b=[-8,5] + Aeq=[] + beq=[] + lb=[-%inf,-%inf,-%inf] + ub=[%inf,%inf,%inf] + //Output + // Dual Infeasible. + // lambda = + // + // reduced_cost: [0,2,0] + // ineqlin: [-2.375,0.625] + // eqlin: [0x0 constant] + // output = + // + // Iterations: 2 + // constrviolation: 0 + // exitflag = + // + // 2. + // fopt = + // + // 22.125 + // xopt = + // + // 6.5 + // 0. + // - 0.375 + [xopt,fopt,exitflag,output,lambda]= linprog(c,A,b,Aeq,beq,lb,ub) diff --git a/tests/general_tests/linprog/linprog_input1.sce b/tests/general_tests/linprog/linprog_input1.sce new file mode 100644 index 0000000..9921fe9 --- /dev/null +++ b/tests/general_tests/linprog/linprog_input1.sce @@ -0,0 +1,17 @@ +// An example with inequality and equality constraints +c=[-1,-1/3]' +A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1] +b=[2,1,2,1,-1,2] +Aeq=[1,1/4] +beq=[1/2] + +//Error +//linprog: Unexpected number of input arguments : 2 provided while should be in the set of [3 5 7 8] +//at line 141 of function linprog called by : +//[xopt,fopt,exitflag,output,lambda]=linprog(c, A) +//at line 30 of exec file called by : +//exec linprog_input1.sce + +[xopt,fopt,exitflag,output,lambda]=linprog(c, A) + + diff --git a/tests/general_tests/linprog/linprog_input2.sce b/tests/general_tests/linprog/linprog_input2.sce new file mode 100644 index 0000000..a755efa --- /dev/null +++ b/tests/general_tests/linprog/linprog_input2.sce @@ -0,0 +1,17 @@ +// An example with inequality and equality constraints +c=[-1,-1/3]' +A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1] +b=[2,1,2,1,-1,2] +Aeq=[1,1/4] +beq=[1/2] + +//Error +//linprog: Unexpected number of input arguments : 9 provided while should be in the set of [3 5 7 8] +//at line 141 of function linprog called by : +//[xopt,fopt,exitflag,output,lambda]=linprog(c, A, b, Aeq, beq,[],[],[],[]) +//at line 15 of exec file called by : +//exec linprog_input2.sce + +[xopt,fopt,exitflag,output,lambda]=linprog(c, A, b, Aeq, beq,[],[],[],[]) + + diff --git a/tests/general_tests/linprog/linprog_logical1.sce b/tests/general_tests/linprog/linprog_logical1.sce new file mode 100644 index 0000000..5dcc011 --- /dev/null +++ b/tests/general_tests/linprog/linprog_logical1.sce @@ -0,0 +1,36 @@ +// An example with inequality constraints +c=[-1,-1/3]' +A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1] +b=[2,1,2,1,-1,2] + +//Output +//Optimal Solution Found. +// lambda = +// +// lower: [0,0] +// upper: [0,0] +// eqlin: [0x0 constant] +// ineqlin: [0.0000422,0.0000089] +// output = +// +// Iterations: 13 +// ConstrViolation: 0 +// exitflag = +// +// 0 +// residual = +// +// 0.3335021 +// 0.6666002 +// - 0.3332976 +// resnorm = +// +// 0.6666667 +// xopt = +// +// 0.3332490 +// - 0.3333512 + +[xopt,fopt,exitflag,output,lambda]=linprog(c, A, b) + + diff --git a/tests/general_tests/linprog/linprog_logical2.sce b/tests/general_tests/linprog/linprog_logical2.sce new file mode 100644 index 0000000..a8f99a7 --- /dev/null +++ b/tests/general_tests/linprog/linprog_logical2.sce @@ -0,0 +1,32 @@ +// An example with inequality and equality constraints +c=[-1,-1/3]' +A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1] +b=[2,1,2,1,-1,2] +Aeq=[1,1/4] +beq=[1/2] + +//Output +//Optimal Solution. +// lambda = +// +// reduced_cost: [0,0] +// ineqlin: [-0.1111111,0,0,0,0,0] +// eqlin: -0.8888889 +// output = +// +// Iterations: 0 +// constrviolation: 0 +// exitflag = +// +// 0. +// fopt = +// +// - 0.6666667 +// xopt = +// +// 0. +// 2. + +[xopt,fopt,exitflag,output,lambda]=linprog(c, A, b, Aeq, beq) + + diff --git a/tests/general_tests/linprog/linprog_logical3.sce b/tests/general_tests/linprog/linprog_logical3.sce new file mode 100644 index 0000000..a5b0bb7 --- /dev/null +++ b/tests/general_tests/linprog/linprog_logical3.sce @@ -0,0 +1,32 @@ +// An example with variable bounds, inequality and equality constraints +c=[-1,-1/3]' +A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1] +b=[2,1,2,1,-1,2] +Aeq=[1,1/4] +beq=[1/2] +lb=[-1,-0.5] +ub=[1.5,1.25] + +//Output +//Optimal Solution. +// lambda = +// +// reduced_cost: [0,-0.0833333] +// ineqlin: [0,0,0,0,0,0] +// eqlin: -1 +// output = +// +// Iterations: 0 +// constrviolation: 0 +// exitflag = +// +// 0. +// fopt = +// +// - 0.6041667 +// xopt = +// +// 0.1875 +// 1.25 + +[xopt,fopt,exitflag,output,lambda]=linprog(c, A, b, Aeq, beq, lb, ub) diff --git a/tests/general_tests/linprog/linprog_logical4.sce b/tests/general_tests/linprog/linprog_logical4.sce new file mode 100644 index 0000000..7b765fa --- /dev/null +++ b/tests/general_tests/linprog/linprog_logical4.sce @@ -0,0 +1,33 @@ +// An example with inequality constraints +c=[-1,-1/3]' +A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1] +b=[2,1,2,1,-1,2] +Aeq=[1,1/4] +beq=[1/2] +lb=[-1,-0.5] +ub=[1.5,1.25] +params = list("maxiter",20) + +//Output +//Optimal Solution. +// lambda = +// +// reduced_cost: [0,-0.0833333] +// ineqlin: [0,0,0,0,0,0] +// eqlin: -1 +// output = +// +// Iterations: 0 +// constrviolation: 0 +// exitflag = +// +// 0. +// fopt = +// +// - 0.6041667 +// xopt = +// +// 0.1875 +// 1.25 + +[xopt,fopt,exitflag,output,lambda]=linprog(c, A, b, Aeq, beq, lb, ub,params) diff --git a/tests/general_tests/linprog/linprog_maxiter.sce b/tests/general_tests/linprog/linprog_maxiter.sce new file mode 100644 index 0000000..0796f17 --- /dev/null +++ b/tests/general_tests/linprog/linprog_maxiter.sce @@ -0,0 +1,32 @@ +// An example with inequality constraints +c=[-1,-1/3]' +A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1] +b=[2,1,2,1,-1,2] + +param = list("maxiter",3) + +//Output +//Iteration limit reached. +// lambda = +// +// reduced_cost: [0,0] +// ineqlin: [0,0,0,0,0.6666667,0.3333333] +// eqlin: [0x0 constant] +// output = +// +// Iterations: 3 +// constrviolation: 0.7999992 +// exitflag = +// +// 3. +// fopt = +// +// - 1.1999995 +// xopt = +// +// 0.3999996 +// 2.3999996 + +[xopt,fopt,exitflag,output,lambda]=linprog(c, A, b,[],[],[],[],param) + + diff --git a/tests/general_tests/linprog/linprog_null1.sce b/tests/general_tests/linprog/linprog_null1.sce new file mode 100644 index 0000000..7a8b053 --- /dev/null +++ b/tests/general_tests/linprog/linprog_null1.sce @@ -0,0 +1,17 @@ +// Check for null elements +c=[-1,-1/3]' +A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1] +b=[2,1,2,1,-1,2] +Aeq=[1,1/4] +beq=[1/2] + +//Error +//linprog: Cannot determine the number of variables because input objective coefficients is empty +//at line 24 of function matrix_linprog called by : +//at line 169 of function linprog called by : +//[xopt,fopt,exitflag,output,lambda]=linprog([],[],[]) +//at line 29 of exec file called by : +//exec linprog_null1.sce + +[xopt,fopt,exitflag,output,lambda]=linprog([],[],[]) + diff --git a/tests/general_tests/linprog/linprog_param1.sce b/tests/general_tests/linprog/linprog_param1.sce new file mode 100644 index 0000000..6dcd8c6 --- /dev/null +++ b/tests/general_tests/linprog/linprog_param1.sce @@ -0,0 +1,19 @@ +// Check for the param to be a list +c=[-1,-1/3]' +A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1] +b=[2,1,2,1,-1,2] +Aeq=[1,1/4] +beq=[1/2] +lb=[-1,-0.5] +ub=[1.5,1.25] +params = 0 + +//Error +//linprog: options should be a list +//at line 85 of function matrix_linprog called by : +//at line 169 of function linprog called by : +//[xopt,fopt,exitflag,output,lambda]=linprog(c, A, b, Aeq, beq, lb, ub,params) +//at line 33 of exec file called by : +//exec lsqlin_param1.sce + +[xopt,fopt,exitflag,output,lambda]=linprog(c, A, b, Aeq, beq, lb, ub,params) diff --git a/tests/general_tests/linprog/linprog_param2.sce b/tests/general_tests/linprog/linprog_param2.sce new file mode 100644 index 0000000..5b956b5 --- /dev/null +++ b/tests/general_tests/linprog/linprog_param2.sce @@ -0,0 +1,19 @@ +// Check for the param to be even in number +c=[-1,-1/3]' +A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1] +b=[2,1,2,1,-1,2] +Aeq=[1,1/4] +beq=[1/2] +lb=[-1,-0.5] +ub=[1.5,1.25] +params = list("maxiter") + +//Error +//linprog: Size of parameters should be even +//at line 91 of function matrix_linprog called by : +//at line 169 of function linprog called by : +//[xopt,fopt,exitflag,output,lambda]=linprog(c, A, b, Aeq, beq, lb, ub,params) +//at line 13 of exec file called by : +//exec lsqlin_param2.sce + +[xopt,fopt,exitflag,output,lambda]=linprog(c, A, b, Aeq, beq, lb, ub,params) diff --git a/tests/general_tests/linprog/linprog_param3.sce b/tests/general_tests/linprog/linprog_param3.sce new file mode 100644 index 0000000..42dbf13 --- /dev/null +++ b/tests/general_tests/linprog/linprog_param3.sce @@ -0,0 +1,21 @@ +// Check for the correct name of param +// An example with inequality constraints +c=[-1,-1/3]' +A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1] +b=[2,1,2,1,-1,2] +Aeq=[1,1/4] +beq=[1/2] +lb=[-1,-0.5] +ub=[1.5,1.25] +params = list("iter",20) + +//Error +//linprog: Unrecognized parameter name 'iter'. +//at line 103 of function matrix_linprog called by : +//at line 169 of function linprog called by : +//[xopt,fopt,exitflag,output,lambda]=linprog(c, A, b, Aeq, beq, lb, ub,params) +//at line 34 of exec file called by : +//exec lsqlin_param3.sce + +[xopt,fopt,exitflag,output,lambda]=linprog(c, A, b, Aeq, beq, lb, ub,params) + diff --git a/tests/general_tests/linprog/linprog_primal_infeasible1.sce b/tests/general_tests/linprog/linprog_primal_infeasible1.sce new file mode 100644 index 0000000..e267e13 --- /dev/null +++ b/tests/general_tests/linprog/linprog_primal_infeasible1.sce @@ -0,0 +1,34 @@ +//Primal Infeasible Problem +c=[-1,-1,-1]' +A=[1,2,-1] +b=[-4] +Aeq=[1,5,3;1,1,0] +beq=[10,100] +lb=[0,0,0] +ub=[%inf,%inf,%inf] + +//Output +//Primal Infeasible. +// lambda = +// +// reduced_cost: [0,2.5,0] +// ineqlin: -0.5 +// eqlin: [-0.5,0] +// output = +// +// Iterations: 2 +// constrviolation: 100.5 +// exitflag = +// +// 1. +// fopt = +// +// - 3. +// xopt = +// +// - 0.5 +// 0. +// 3.5 + +[xopt,fopt,exitflag,output,lambda]= linprog(c,A,b,Aeq,beq,lb,ub) + diff --git a/tests/general_tests/linprog/linprog_zeros1.sce b/tests/general_tests/linprog/linprog_zeros1.sce new file mode 100644 index 0000000..fffc6b5 --- /dev/null +++ b/tests/general_tests/linprog/linprog_zeros1.sce @@ -0,0 +1,30 @@ +// Check for elements all zeros +c=[-1,-1/3]' +A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1] +b=[2,1,2,1,-1,2] +Aeq=[1,1/4] +beq=[1/2] + +//Output +//Optimal Solution. +// lambda = +// +// reduced_cost: 0 +// ineqlin: 0 +// eqlin: [0x0 constant] +// output = +// +// Iterations: 4 +// constrviolation: 0 +// exitflag = +// +// 0. +// fopt = +// +// 0. +// xopt = +// +// 0. + +[xopt,fopt,exitflag,output,lambda]=linprog(0,0,0) + diff --git a/tests/general_tests/lsqlin/lsqlin_param3.sce b/tests/general_tests/lsqlin/lsqlin_param3.sce index 283c6e2..be8012b 100644 --- a/tests/general_tests/lsqlin/lsqlin_param3.sce +++ b/tests/general_tests/lsqlin/lsqlin_param3.sce @@ -1,4 +1,4 @@ -// Check for the param to be even in number +// Check for the correct name of param C = [2 0; -1 1; 0 2] diff --git a/tests/unit_tests/fgoalattain.dia.ref b/tests/unit_tests/fgoalattain.dia.ref new file mode 100644 index 0000000..3587dd3 --- /dev/null +++ b/tests/unit_tests/fgoalattain.dia.ref @@ -0,0 +1,74 @@ +// Copyright (C) 2015 - IIT Bombay - FOSSEE +// +// Author: Prajwala TM,Sheetal Shalini +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// +// 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 + + +function f1 = fun(x) +f1(1)=2*x(1)*x(1)+x(2)*x(2)-48*x(1)-40*x(2)+304 +f1(2)=-x(1)*x(1)-3*x(2)*x(2) +f1(3)=x(1)+3*x(2)-18 +f1(4)=-x(1)-x(2) +f1(5)=x(1)+x(2)-8 +endfunction +x0=[-1,1]; +goal=[-5,-3,-2,-1,-4]; +weight=abs(goal) +//xopt = [-0.0000011 -63.999998 -2.0000002 -8 3.485D-08] +//fval = [4 3.99] +//Run fgoalattain +[xopt,fval,attainfactor,exitflag,output,lambda]=fgoalattain(fun,x0,goal,weight) + +assert_close ( xopt , [ 4 4 ]' , 0.0005 ); +assert_close ( fval , [ -0.0000011 -63.999998 -2.0000002 -8. 0 ]' , 0.0005 ); +assert_checkequal( exitflag , int32(0) ); +printf("Test Successful"); diff --git a/tests/unit_tests/fgoalattain.tst b/tests/unit_tests/fgoalattain.tst new file mode 100644 index 0000000..3587dd3 --- /dev/null +++ b/tests/unit_tests/fgoalattain.tst @@ -0,0 +1,74 @@ +// Copyright (C) 2015 - IIT Bombay - FOSSEE +// +// Author: Prajwala TM,Sheetal Shalini +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// +// 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 + + +function f1 = fun(x) +f1(1)=2*x(1)*x(1)+x(2)*x(2)-48*x(1)-40*x(2)+304 +f1(2)=-x(1)*x(1)-3*x(2)*x(2) +f1(3)=x(1)+3*x(2)-18 +f1(4)=-x(1)-x(2) +f1(5)=x(1)+x(2)-8 +endfunction +x0=[-1,1]; +goal=[-5,-3,-2,-1,-4]; +weight=abs(goal) +//xopt = [-0.0000011 -63.999998 -2.0000002 -8 3.485D-08] +//fval = [4 3.99] +//Run fgoalattain +[xopt,fval,attainfactor,exitflag,output,lambda]=fgoalattain(fun,x0,goal,weight) + +assert_close ( xopt , [ 4 4 ]' , 0.0005 ); +assert_close ( fval , [ -0.0000011 -63.999998 -2.0000002 -8. 0 ]' , 0.0005 ); +assert_checkequal( exitflag , int32(0) ); +printf("Test Successful"); diff --git a/tests/unit_tests/fminbnd.dia.ref b/tests/unit_tests/fminbnd.dia.ref new file mode 100644 index 0000000..bed9eae --- /dev/null +++ b/tests/unit_tests/fminbnd.dia.ref @@ -0,0 +1,71 @@ +// Copyright (C) 2015 - IIT Bombay - FOSSEE +// +// Author: R.Vidyadhar & Vignesh Kannan +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// +// 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 + +//Find x in R such that it minimizes: +//f(x)= 1/x^2 +//0 <= x <= 1000 +//Objective function to be minimised +function y=f(x) +y=1/x^2 +endfunction +//Variable bounds +x1 = [0]; +x2 = [1000]; +//Calling Ipopt +[xopt,fval,exitflag,output,lambda] =fminbnd(f, x1, x2) + +assert_close ( xopt , [ 32.27955 ]' , 0.0005 ); +assert_close ( fval , [ 0.0009597 ]' , 0.0005 ); +assert_checkequal( exitflag , int32(0) ); +printf("Test Successful"); diff --git a/tests/unit_tests/fminbnd.tst b/tests/unit_tests/fminbnd.tst new file mode 100644 index 0000000..bed9eae --- /dev/null +++ b/tests/unit_tests/fminbnd.tst @@ -0,0 +1,71 @@ +// Copyright (C) 2015 - IIT Bombay - FOSSEE +// +// Author: R.Vidyadhar & Vignesh Kannan +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// +// 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 + +//Find x in R such that it minimizes: +//f(x)= 1/x^2 +//0 <= x <= 1000 +//Objective function to be minimised +function y=f(x) +y=1/x^2 +endfunction +//Variable bounds +x1 = [0]; +x2 = [1000]; +//Calling Ipopt +[xopt,fval,exitflag,output,lambda] =fminbnd(f, x1, x2) + +assert_close ( xopt , [ 32.27955 ]' , 0.0005 ); +assert_close ( fval , [ 0.0009597 ]' , 0.0005 ); +assert_checkequal( exitflag , int32(0) ); +printf("Test Successful"); diff --git a/tests/unit_tests/fmincon.dia.ref b/tests/unit_tests/fmincon.dia.ref new file mode 100644 index 0000000..26d29ea --- /dev/null +++ b/tests/unit_tests/fmincon.dia.ref @@ -0,0 +1,98 @@ +// Copyright (C) 2015 - IIT Bombay - FOSSEE +// +// Author: R.Vidyadhar & Vignesh Kannan +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// +// 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 + +//Find x in R^3 such that it minimizes: +//f(x)= x1*x2 + x2*x3 +//x0=[0.1 , 0.1 , 0.1] +//constraint-1 (c1): x1^2 - x2^2 + x3^2 <= 2 +//constraint-2 (c2): x1^2 + x2^2 + x3^2 <= 10 +//Objective function to be minimised +function y=f(x) +y=x(1)*x(2)+x(2)*x(3); +endfunction +//Starting point, linear constraints and variable bounds +x0=[0.1 , 0.1 , 0.1]; +A=[]; +b=[]; +Aeq=[]; +beq=[]; +lb=[]; +ub=[]; +//Nonlinear constraints +function [c,ceq]=nlc(x) +c = [x(1)^2 - x(2)^2 + x(3)^2 - 2 , x(1)^2 + x(2)^2 + x(3)^2 - 10]; +ceq = []; +endfunction +//Gradient of objective function +function y= fGrad(x) +y= [x(2),x(1)+x(3),x(2)]; +endfunction +//Hessian of the Lagrange Function +function y= lHess(x,obj,lambda) +y= obj*[0,1,0;1,0,1;0,1,0] + lambda(1)*[2,0,0;0,-2,0;0,0,2] + lambda(2)*[2,0,0;0,2,0;0,0,2] +endfunction +//Gradient of Non-Linear Constraints +function [cg,ceqg] = cGrad(x) +cg=[2*x(1) , -2*x(2) , 2*x(3) ; 2*x(1) , 2*x(2) , 2*x(3)]; +ceqg=[]; +endfunction +//Options +options=list("MaxIter", [1500], "CpuTime", [500], "GradObj", fGrad, "Hessian", lHess,"GradCon", cGrad); +//Calling Ipopt +[xopt,fval,exitflag,output] =fmincon(f, x0,A,b,Aeq,beq,lb,ub,nlc,options) + +assert_close ( xopt , [ -1.5811388 2.236068 -1.5811388 ]' , 0.0005 ); +assert_close ( fval , [-7.0710678 ]' , 0.0005 ); +assert_checkequal( exitflag , int32(0) ); +printf("Test Successful"); diff --git a/tests/unit_tests/fmincon.tst b/tests/unit_tests/fmincon.tst new file mode 100644 index 0000000..26d29ea --- /dev/null +++ b/tests/unit_tests/fmincon.tst @@ -0,0 +1,98 @@ +// Copyright (C) 2015 - IIT Bombay - FOSSEE +// +// Author: R.Vidyadhar & Vignesh Kannan +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// +// 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 + +//Find x in R^3 such that it minimizes: +//f(x)= x1*x2 + x2*x3 +//x0=[0.1 , 0.1 , 0.1] +//constraint-1 (c1): x1^2 - x2^2 + x3^2 <= 2 +//constraint-2 (c2): x1^2 + x2^2 + x3^2 <= 10 +//Objective function to be minimised +function y=f(x) +y=x(1)*x(2)+x(2)*x(3); +endfunction +//Starting point, linear constraints and variable bounds +x0=[0.1 , 0.1 , 0.1]; +A=[]; +b=[]; +Aeq=[]; +beq=[]; +lb=[]; +ub=[]; +//Nonlinear constraints +function [c,ceq]=nlc(x) +c = [x(1)^2 - x(2)^2 + x(3)^2 - 2 , x(1)^2 + x(2)^2 + x(3)^2 - 10]; +ceq = []; +endfunction +//Gradient of objective function +function y= fGrad(x) +y= [x(2),x(1)+x(3),x(2)]; +endfunction +//Hessian of the Lagrange Function +function y= lHess(x,obj,lambda) +y= obj*[0,1,0;1,0,1;0,1,0] + lambda(1)*[2,0,0;0,-2,0;0,0,2] + lambda(2)*[2,0,0;0,2,0;0,0,2] +endfunction +//Gradient of Non-Linear Constraints +function [cg,ceqg] = cGrad(x) +cg=[2*x(1) , -2*x(2) , 2*x(3) ; 2*x(1) , 2*x(2) , 2*x(3)]; +ceqg=[]; +endfunction +//Options +options=list("MaxIter", [1500], "CpuTime", [500], "GradObj", fGrad, "Hessian", lHess,"GradCon", cGrad); +//Calling Ipopt +[xopt,fval,exitflag,output] =fmincon(f, x0,A,b,Aeq,beq,lb,ub,nlc,options) + +assert_close ( xopt , [ -1.5811388 2.236068 -1.5811388 ]' , 0.0005 ); +assert_close ( fval , [-7.0710678 ]' , 0.0005 ); +assert_checkequal( exitflag , int32(0) ); +printf("Test Successful"); diff --git a/tests/unit_tests/fminimax.dia.ref b/tests/unit_tests/fminimax.dia.ref new file mode 100644 index 0000000..e887a38 --- /dev/null +++ b/tests/unit_tests/fminimax.dia.ref @@ -0,0 +1,105 @@ +// Copyright (C) 2015 - IIT Bombay - FOSSEE +// +// Author: Animesh Baranawal +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// +// 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 case where we provide the gradient of the objective +// functions and the Jacobian matrix of the constraints. +// The objective function and its gradient +function f = myfun(x) +f(1)= 2*x(1)^2 + x(2)^2 - 48*x(1) - 40*x(2) + 304; +f(2)= -x(1)^2 - 3*x(2)^2; +f(3)= x(1) + 3*x(2) -18; +f(4)= -x(1) - x(2); +f(5)= x(1) + x(2) - 8; +endfunction +// Defining gradient of myfun +function G = myfungrad(x) +G = [ 4*x(1) - 48, -2*x(1), 1, -1, 1; +2*x(2) - 40, -6*x(2), 3, -1, 1; ]' +endfunction +// The nonlinear constraints and the Jacobian +// matrix of the constraints +function [c,ceq] = confun(x) +// Inequality constraints +c = [1.5 + x(1)*x(2) - x(1) - x(2), -x(1)*x(2) - 10] +// No nonlinear equality constraints +ceq=[] +endfunction +// Defining gradient of confungrad +function [DC,DCeq] = cgrad(x) +// DC(:,i) = gradient of the i-th constraint +// DC = [ +// Dc1/Dx1 Dc1/Dx2 +// Dc2/Dx1 Dc2/Dx2 +// ] +DC= [ +x(2)-1, -x(2) +x(1)-1, -x(1) +]' +DCeq = []' +endfunction +// Test with both gradient of objective and gradient of constraints +minimaxOptions = list("GradObj",myfungrad,"GradCon",cgrad); +// The initial guess +x0 = [0,10]; +// The expected solution : only 4 digits are guaranteed +//xopt = [0.92791 7.93551] +//fopt = [6.73443 -189.778 6.73443 -8.86342 0.86342] +maxfopt = 6.73443 +// Run fminimax +[xopt,fopt,maxfval,exitflag,output] = fminimax(myfun,x0,[],[],[],[],[],[], confun, minimaxOptions) + +assert_close ( xopt , [ 8.6737161 0.9348425 ]' , 0.0005 ); +assert_close ( fopt , [ 1.6085585 -77.855143 -6.5217563 -9.6085587 1.6085587 ]' , 0.0005 ); +assert_checkequal( exitflag , int32(0) ); +printf("Test Successful"); diff --git a/tests/unit_tests/fminimax.tst b/tests/unit_tests/fminimax.tst new file mode 100644 index 0000000..e887a38 --- /dev/null +++ b/tests/unit_tests/fminimax.tst @@ -0,0 +1,105 @@ +// Copyright (C) 2015 - IIT Bombay - FOSSEE +// +// Author: Animesh Baranawal +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// +// 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 case where we provide the gradient of the objective +// functions and the Jacobian matrix of the constraints. +// The objective function and its gradient +function f = myfun(x) +f(1)= 2*x(1)^2 + x(2)^2 - 48*x(1) - 40*x(2) + 304; +f(2)= -x(1)^2 - 3*x(2)^2; +f(3)= x(1) + 3*x(2) -18; +f(4)= -x(1) - x(2); +f(5)= x(1) + x(2) - 8; +endfunction +// Defining gradient of myfun +function G = myfungrad(x) +G = [ 4*x(1) - 48, -2*x(1), 1, -1, 1; +2*x(2) - 40, -6*x(2), 3, -1, 1; ]' +endfunction +// The nonlinear constraints and the Jacobian +// matrix of the constraints +function [c,ceq] = confun(x) +// Inequality constraints +c = [1.5 + x(1)*x(2) - x(1) - x(2), -x(1)*x(2) - 10] +// No nonlinear equality constraints +ceq=[] +endfunction +// Defining gradient of confungrad +function [DC,DCeq] = cgrad(x) +// DC(:,i) = gradient of the i-th constraint +// DC = [ +// Dc1/Dx1 Dc1/Dx2 +// Dc2/Dx1 Dc2/Dx2 +// ] +DC= [ +x(2)-1, -x(2) +x(1)-1, -x(1) +]' +DCeq = []' +endfunction +// Test with both gradient of objective and gradient of constraints +minimaxOptions = list("GradObj",myfungrad,"GradCon",cgrad); +// The initial guess +x0 = [0,10]; +// The expected solution : only 4 digits are guaranteed +//xopt = [0.92791 7.93551] +//fopt = [6.73443 -189.778 6.73443 -8.86342 0.86342] +maxfopt = 6.73443 +// Run fminimax +[xopt,fopt,maxfval,exitflag,output] = fminimax(myfun,x0,[],[],[],[],[],[], confun, minimaxOptions) + +assert_close ( xopt , [ 8.6737161 0.9348425 ]' , 0.0005 ); +assert_close ( fopt , [ 1.6085585 -77.855143 -6.5217563 -9.6085587 1.6085587 ]' , 0.0005 ); +assert_checkequal( exitflag , int32(0) ); +printf("Test Successful"); diff --git a/tests/unit_tests/fminunc.dia.ref b/tests/unit_tests/fminunc.dia.ref new file mode 100644 index 0000000..d8cc387 --- /dev/null +++ b/tests/unit_tests/fminunc.dia.ref @@ -0,0 +1,79 @@ +// Copyright (C) 2015 - IIT Bombay - FOSSEE +// +// Author: R.Vidyadhar & Vignesh Kannan +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// +// 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 + +//Find x in R^2 such that it minimizes the Rosenbrock function +//f = 100*(x2 - x1^2)^2 + (1-x1)^2 +//Objective function to be minimised +function y= f(x) +y= 100*(x(2) - x(1)^2)^2 + (1-x(1))^2; +endfunction +//Starting point +x0=[-1,2]; +//Gradient of objective function +function y= fGrad(x) +y= [-400*x(1)*x(2) + 400*x(1)^3 + 2*x(1)-2, 200*(x(2)-x(1)^2)]; +endfunction +//Hessian of Objective Function +function y= fHess(x) +y= [1200*x(1)^2- 400*x(2) + 2, -400*x(1);-400*x(1), 200 ]; +endfunction +//Options +options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", fGrad, "Hessian", fHess); +//Calling Ipopt +[xopt,fopt,exitflag,output,gradient,hessian]=fminunc(f,x0,options) + +assert_close ( xopt , [ 1 1 ]' , 0.0005 ); +assert_close ( fopt , [0] , 0.0005 ); +assert_checkequal( exitflag , int32(0) ); +printf("Test Successful"); diff --git a/tests/unit_tests/fminunc.tst b/tests/unit_tests/fminunc.tst new file mode 100644 index 0000000..d8cc387 --- /dev/null +++ b/tests/unit_tests/fminunc.tst @@ -0,0 +1,79 @@ +// Copyright (C) 2015 - IIT Bombay - FOSSEE +// +// Author: R.Vidyadhar & Vignesh Kannan +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// +// 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 + +//Find x in R^2 such that it minimizes the Rosenbrock function +//f = 100*(x2 - x1^2)^2 + (1-x1)^2 +//Objective function to be minimised +function y= f(x) +y= 100*(x(2) - x(1)^2)^2 + (1-x(1))^2; +endfunction +//Starting point +x0=[-1,2]; +//Gradient of objective function +function y= fGrad(x) +y= [-400*x(1)*x(2) + 400*x(1)^3 + 2*x(1)-2, 200*(x(2)-x(1)^2)]; +endfunction +//Hessian of Objective Function +function y= fHess(x) +y= [1200*x(1)^2- 400*x(2) + 2, -400*x(1);-400*x(1), 200 ]; +endfunction +//Options +options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", fGrad, "Hessian", fHess); +//Calling Ipopt +[xopt,fopt,exitflag,output,gradient,hessian]=fminunc(f,x0,options) + +assert_close ( xopt , [ 1 1 ]' , 0.0005 ); +assert_close ( fopt , [0] , 0.0005 ); +assert_checkequal( exitflag , int32(0) ); +printf("Test Successful"); diff --git a/tests/unit_tests/linprog.dia.ref b/tests/unit_tests/linprog.dia.ref new file mode 100644 index 0000000..5c3d629 --- /dev/null +++ b/tests/unit_tests/linprog.dia.ref @@ -0,0 +1,68 @@ +// Copyright (C) 2015 - IIT Bombay - FOSSEE +// +// Author: Guru Pradeep Reddy, Bhanu Priya Sayal +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// +// 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 + +//Linear program with all constraint types +c=[-1,-1/3]' +A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1] +b=[2,1,2,1,-1,2] +Aeq=[1,1/4] +beq=[1/2] +lb=[-1,-0.5] +ub=[1.5,1.25] +[xopt,fopt,exitflag,output,lambda]=linprog(c, A, b, Aeq, beq, lb, ub) + +assert_close ( xopt , [ 0.1875 1.25 ]' , 0.0005 ); +assert_close ( fopt , [ -0.6041667 ]' , 0.0005 ); +assert_checkequal( exitflag , 0 ); +printf("Test Successful"); diff --git a/tests/unit_tests/linprog.tst b/tests/unit_tests/linprog.tst new file mode 100644 index 0000000..5c3d629 --- /dev/null +++ b/tests/unit_tests/linprog.tst @@ -0,0 +1,68 @@ +// Copyright (C) 2015 - IIT Bombay - FOSSEE +// +// Author: Guru Pradeep Reddy, Bhanu Priya Sayal +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// +// 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 + +//Linear program with all constraint types +c=[-1,-1/3]' +A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1] +b=[2,1,2,1,-1,2] +Aeq=[1,1/4] +beq=[1/2] +lb=[-1,-0.5] +ub=[1.5,1.25] +[xopt,fopt,exitflag,output,lambda]=linprog(c, A, b, Aeq, beq, lb, ub) + +assert_close ( xopt , [ 0.1875 1.25 ]' , 0.0005 ); +assert_close ( fopt , [ -0.6041667 ]' , 0.0005 ); +assert_checkequal( exitflag , 0 ); +printf("Test Successful"); diff --git a/tests/unit_tests/qpipopt_base.dia.ref b/tests/unit_tests/qpipopt_base.dia.ref index 25b440f..d85ed3e 100644 --- a/tests/unit_tests/qpipopt_base.dia.ref +++ b/tests/unit_tests/qpipopt_base.dia.ref @@ -68,9 +68,9 @@ 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) +[xopt,fopt,exitflag,output,lambda] = qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) -assert_close ( xopt , [1.7975426 -0.3381487 0.1633880 - 4.9884023 0.6054943 -3.1155623]' , 1.e-7 ); +assert_close ( xopt , [1.7975426 -0.3381487 0.1633880 -4.9884023 0.6054943 -3.1155623]' , 1.e-7 ); assert_close ( fopt , [ -14.843248] , 1.e-7 ); assert_checkequal( exitflag , int32(0) ); printf("Test Successful"); diff --git a/tests/unit_tests/qpipopt_base.tst b/tests/unit_tests/qpipopt_base.tst index 25b440f..d85ed3e 100644 --- a/tests/unit_tests/qpipopt_base.tst +++ b/tests/unit_tests/qpipopt_base.tst @@ -68,9 +68,9 @@ 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) +[xopt,fopt,exitflag,output,lambda] = qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) -assert_close ( xopt , [1.7975426 -0.3381487 0.1633880 - 4.9884023 0.6054943 -3.1155623]' , 1.e-7 ); +assert_close ( xopt , [1.7975426 -0.3381487 0.1633880 -4.9884023 0.6054943 -3.1155623]' , 1.e-7 ); assert_close ( fopt , [ -14.843248] , 1.e-7 ); assert_checkequal( exitflag , int32(0) ); printf("Test Successful"); diff --git a/tests/unit_tests/qpipoptmat_base.dia.ref b/tests/unit_tests/qpipoptmat_base.dia.ref index fbebe58..fdc2293 100644 --- a/tests/unit_tests/qpipoptmat_base.dia.ref +++ b/tests/unit_tests/qpipoptmat_base.dia.ref @@ -67,7 +67,7 @@ param = list("MaxIter", 300, "CpuTime",100); 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); -assert_close ( xopt , [1.7975426 -0.3381487 0.1633880 - 4.9884023 0.6054943 -3.1155623]' , 1.e-7 ); +assert_close ( xopt , [1.7975426 -0.3381487 0.1633880 -4.9884023 0.6054943 -3.1155623]' , 1.e-7 ); assert_close ( fopt , [ -14.843248] , 1.e-7 ); assert_checkequal( exitflag , int32(0) ); printf("Test Successful"); diff --git a/tests/unit_tests/qpipoptmat_base.tst b/tests/unit_tests/qpipoptmat_base.tst index fbebe58..fdc2293 100644 --- a/tests/unit_tests/qpipoptmat_base.tst +++ b/tests/unit_tests/qpipoptmat_base.tst @@ -67,7 +67,7 @@ param = list("MaxIter", 300, "CpuTime",100); 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); -assert_close ( xopt , [1.7975426 -0.3381487 0.1633880 - 4.9884023 0.6054943 -3.1155623]' , 1.e-7 ); +assert_close ( xopt , [1.7975426 -0.3381487 0.1633880 -4.9884023 0.6054943 -3.1155623]' , 1.e-7 ); assert_close ( fopt , [ -14.843248] , 1.e-7 ); assert_checkequal( exitflag , int32(0) ); printf("Test Successful"); diff --git a/unloader.sce b/unloader.sce index 2ccfbbd..8b09ac1 100644 --- a/unloader.sce +++ b/unloader.sce @@ -7,7 +7,7 @@ catch error("Scilab 5.4 or more is required."); end; -fileQuit = get_absolute_file_path("unloader.sce") + "etc/" + "Symphony.quit"; +fileQuit = get_absolute_file_path("unloader.sce") + "etc/" + "FOSSEE_Optimization_Toolbox.quit"; if isfile(fileQuit) then exec(fileQuit); end -- cgit