All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nlpi_ipopt.cpp File Reference Detailed DescriptionIpopt NLP interface. This file can only be compiled if Ipopt is available. Otherwise, to resolve public functions, use nlpi_ipopt_dummy.c. Since the dummy code is C instead of C++, it has been moved into a separate file. Definition in file nlpi_ipopt.cpp. #include "nlpi/nlpi_ipopt.h" #include "nlpi/nlpi.h" #include "nlpi/nlpioracle.h" #include "nlpi/exprinterpret.h" #include "scip/interrupt.h" #include "scip/pub_misc.h" #include <new> #include <sstream> #include "IpoptConfig.h" #include "IpIpoptApplication.hpp" #include "IpIpoptCalculatedQuantities.hpp" #include "IpSolveStatistics.hpp" #include "IpJournalist.hpp" #include "IpIpoptData.hpp" #include "IpTNLPAdapter.hpp" #include "IpOrigIpoptNLP.hpp" #include "IpLapack.hpp" Go to the source code of this file.
Macro Definition Documentation
short concise name of solver Definition at line 59 of file nlpi_ipopt.cpp. Referenced by SCIPcreateNlpSolverIpopt().
description of solver Definition at line 60 of file nlpi_ipopt.cpp. Referenced by SCIPcreateNlpSolverIpopt().
default print level of Ipopt Definition at line 66 of file nlpi_ipopt.cpp. Referenced by SCIP_DECL_NLPICREATEPROBLEM().
default iteration limit for Ipopt Definition at line 68 of file nlpi_ipopt.cpp. Referenced by SCIP_DECL_NLPICREATEPROBLEM().
maximal perturbation of bounds in starting point heuristic Definition at line 70 of file nlpi_ipopt.cpp.
factor for user-given feasibility tolerance to get feasibility tolerance that is actually passed to Ipopt Definition at line 71 of file nlpi_ipopt.cpp. Referenced by setFeastol(). Function Documentation
clears the last solution arrays and sets the solstat and termstat to unknown and other, resp.
Definition at line 411 of file nlpi_ipopt.cpp. References BMSfreeMemoryArrayNull, SCIP_NlpiProblem::lastsoldualcons, SCIP_NlpiProblem::lastsoldualvarlb, SCIP_NlpiProblem::lastsoldualvarub, SCIP_NlpiProblem::lastsolinfeas, SCIP_NlpiProblem::lastsolprimals, SCIP_NlpiProblem::lastsolstat, SCIP_NlpiProblem::lasttermstat, NULL, SCIP_INVALID, SCIP_NLPSOLSTAT_UNKNOWN, and SCIP_NLPTERMSTAT_OTHER. Referenced by SCIP_DECL_NLPIADDCONSTRAINTS(), SCIP_DECL_NLPIADDVARS(), SCIP_DECL_NLPICHGCONSSIDES(), SCIP_DECL_NLPICHGEXPRTREE(), SCIP_DECL_NLPICHGLINEARCOEFS(), SCIP_DECL_NLPICHGNONLINCOEF(), SCIP_DECL_NLPICHGQUADCOEFS(), SCIP_DECL_NLPICHGVARBOUNDS(), SCIP_DECL_NLPIDELCONSSET(), SCIP_DECL_NLPIDELVARSET(), SCIP_DECL_NLPISETOBJECTIVE(), and SCIP_DECL_NLPISOLVE().
sets feasibility tolerance parameters in Ipopt Sets tol and constr_viol_tol to FEASTOLFACTOR*feastol and acceptable_tol and acceptable_viol_tol to feastol. Since the users and Ipopts conception of feasibility may differ, we let Ipopt try to compute solutions that are more accurate (w.r.t. constraint violation) than requested by the user. Only if Ipopt has problems to achieve this accuracy, we also accept solutions that are accurate w.r.t. feastol only. The additional effort for computing a more accurate solution should be small if one can assume fast convergence when close to a local minimizer. Definition at line 435 of file nlpi_ipopt.cpp. References FEASTOLFACTOR, and SCIP_NlpiProblem::ipopt. Referenced by SCIP_DECL_NLPICREATEPROBLEM(), and SCIP_DECL_NLPISETREALPAR().
copy method of NLP interface (called when SCIP copies plugins) input:
Definition at line 462 of file nlpi_ipopt.cpp. References NULL, SCIP_CALL, SCIP_NLPPAR_INFINITY, SCIP_OKAY, SCIPcreateNlpSolverIpopt(), SCIPnlpiGetData(), SCIPnlpiSetMessageHdlr(), and SCIPnlpiSetRealPar().
destructor of NLP interface to free nlpi data input:
Definition at line 493 of file nlpi_ipopt.cpp. References NULL, SCIP_OKAY, and SCIPnlpiGetData().
gets pointer for NLP solver to do dirty stuff input:
return: void pointer to solver Definition at line 517 of file nlpi_ipopt.cpp. References NULL.
creates a problem instance input:
Definition at line 532 of file nlpi_ipopt.cpp. References DEFAULT_MAXITER, DEFAULT_PRINTLEVEL, NULL, SCIP_CALL, SCIP_DEFAULT_FEASTOL, SCIP_ERROR, SCIP_NOMEMORY, SCIP_OKAY, SCIPerrorMessage, SCIPnlpiGetData(), SCIPnlpiOracleCreate(), SCIPnlpiOracleSetInfinity(), SCIPnlpiOracleSetProblemName(), and setFeastol().
free a problem instance input:
Definition at line 625 of file nlpi_ipopt.cpp. References BMSfreeMemoryArrayNull, NULL, SCIP_CALL, SCIP_OKAY, and SCIPnlpiOracleFree().
gets pointer to solver-internal problem instance to do dirty stuff input:
return: void pointer to problem instance Definition at line 658 of file nlpi_ipopt.cpp. References NULL.
add variables input:
Definition at line 677 of file nlpi_ipopt.cpp. References BMSfreeMemoryArrayNull, invalidateSolution(), NULL, SCIP_CALL, SCIP_OKAY, SCIPnlpiOracleAddVars(), and TRUE.
add constraints quadratic coefficiens: row oriented matrix for each constraint input:
Definition at line 721 of file nlpi_ipopt.cpp. References invalidateSolution(), NULL, SCIP_CALL, SCIP_OKAY, SCIPnlpiOracleAddConstraints(), and TRUE.
sets or overwrites objective, a minimization problem is expected May change sparsity pattern. input:
Definition at line 760 of file nlpi_ipopt.cpp. References invalidateSolution(), NULL, SCIP_CALL, SCIP_OKAY, SCIPnlpiOracleSetObjective(), and TRUE.
change variable bounds input:
Definition at line 788 of file nlpi_ipopt.cpp. References invalidateSolution(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPnlpiOracleChgVarBounds().
change constraint bounds input:
Definition at line 812 of file nlpi_ipopt.cpp. References invalidateSolution(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPnlpiOracleChgConsSides().
delete a set of variables input:
output:
Definition at line 837 of file nlpi_ipopt.cpp. References BMSfreeMemoryArrayNull, invalidateSolution(), NULL, SCIP_CALL, SCIP_OKAY, SCIPnlpiOracleDelVarSet(), and TRUE.
delete a set of constraints input:
output:
Definition at line 864 of file nlpi_ipopt.cpp. References invalidateSolution(), NULL, SCIP_CALL, SCIP_OKAY, SCIPnlpiOracleDelConsSet(), and TRUE.
change one linear coefficient in a constraint or objective input:
return: Error if coefficient did not exist before Definition at line 892 of file nlpi_ipopt.cpp. References invalidateSolution(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPnlpiOracleChgLinearCoefs().
change one coefficient in the quadratic part of a constraint or objective input:
return: Error if coefficient did not exist before Definition at line 916 of file nlpi_ipopt.cpp. References invalidateSolution(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPnlpiOracleChgQuadCoefs().
replaces the expression tree of a constraint or objective input:
Definition at line 937 of file nlpi_ipopt.cpp. References invalidateSolution(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPnlpiOracleChgExprtree().
change the value of one parameter in the nonlinear part input:
return: Error if parameter does not exist Definition at line 961 of file nlpi_ipopt.cpp. References invalidateSolution(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPnlpiOracleChgExprParam().
change the constant offset in the objective input:
Definition at line 981 of file nlpi_ipopt.cpp. References NULL, SCIP_CALL, SCIP_OKAY, and SCIPnlpiOracleChgObjConstant().
sets initial guess for primal variables input:
Definition at line 1003 of file nlpi_ipopt.cpp. References BMScopyMemoryArray, BMSduplicateMemoryArray, BMSfreeMemoryArrayNull, NULL, SCIP_NOMEMORY, SCIP_OKAY, and SCIPnlpiOracleGetNVars().
tries to solve NLP input:
Definition at line 1036 of file nlpi_ipopt.cpp. References FALSE, invalidateSolution(), NULL, SCIP_ERROR, SCIP_EXPRINTCAPABILITY_FUNCVALUE, SCIP_EXPRINTCAPABILITY_GRADIENT, SCIP_EXPRINTCAPABILITY_HESSIAN, SCIP_INVALID, SCIP_NLPSOLSTAT_UNKNOWN, SCIP_NLPTERMSTAT_EVALERR, SCIP_NLPTERMSTAT_OTHER, SCIP_NOMEMORY, SCIP_OKAY, SCIPdebugMessage, SCIPerrorMessage, SCIPexprintGetCapability(), and SCIPnlpiOracleGetMaxDegree().
gives solution status input:
return: Solution Status Definition at line 1144 of file nlpi_ipopt.cpp. References NULL.
gives termination reason input:
return: Termination Status Definition at line 1161 of file nlpi_ipopt.cpp. References NULL.
gives primal and dual solution values input:
Definition at line 1180 of file nlpi_ipopt.cpp.
gives solve statistics input:
output:
Definition at line 1211 of file nlpi_ipopt.cpp. References NULL, SCIP_OKAY, SCIPnlpStatisticsSetNIterations(), and SCIPnlpStatisticsSetTotalTime().
gives required size of a buffer to store a warmstart object input:
output:
Definition at line 1233 of file nlpi_ipopt.cpp. References SCIP_ERROR, and SCIPerrorMessage.
stores warmstart information in buffer required size of buffer should have been obtained by SCIPnlpiGetWarmstartSize before input:
output:
Definition at line 1252 of file nlpi_ipopt.cpp. References SCIP_ERROR, and SCIPerrorMessage.
sets warmstart information in solver write warmstart to buffer input:
Definition at line 1268 of file nlpi_ipopt.cpp. References SCIP_OKAY, SCIPABORT, and SCIPerrorMessage.
gets integer parameter of NLP input:
output:
Definition at line 1287 of file nlpi_ipopt.cpp. References NULL, SCIP_NLPPAR_FASTFAIL, SCIP_NLPPAR_FEASTOL, SCIP_NLPPAR_FROMSCRATCH, SCIP_NLPPAR_INFINITY, SCIP_NLPPAR_ITLIM, SCIP_NLPPAR_LOBJLIM, SCIP_NLPPAR_OPTFILE, SCIP_NLPPAR_RELOBJTOL, SCIP_NLPPAR_TILIM, SCIP_NLPPAR_VERBLEVEL, SCIP_OKAY, SCIP_PARAMETERUNKNOWN, SCIP_PARAMETERWRONGTYPE, and SCIPerrorMessage.
sets integer parameter of NLP input:
Definition at line 1383 of file nlpi_ipopt.cpp. References MIN, NULL, SCIP_NLPPAR_FASTFAIL, SCIP_NLPPAR_FEASTOL, SCIP_NLPPAR_FROMSCRATCH, SCIP_NLPPAR_INFINITY, SCIP_NLPPAR_ITLIM, SCIP_NLPPAR_LOBJLIM, SCIP_NLPPAR_OPTFILE, SCIP_NLPPAR_RELOBJTOL, SCIP_NLPPAR_TILIM, SCIP_NLPPAR_VERBLEVEL, SCIP_OKAY, SCIP_PARAMETERUNKNOWN, SCIP_PARAMETERWRONGTYPE, SCIP_PARAMETERWRONGVAL, SCIPerrorMessage, SCIPmessagePrintWarning(), and SCIPnlpiGetData().
gets floating point parameter of NLP input:
output:
Definition at line 1525 of file nlpi_ipopt.cpp. References NULL, SCIP_NLPPAR_FASTFAIL, SCIP_NLPPAR_FEASTOL, SCIP_NLPPAR_FROMSCRATCH, SCIP_NLPPAR_INFINITY, SCIP_NLPPAR_ITLIM, SCIP_NLPPAR_LOBJLIM, SCIP_NLPPAR_OPTFILE, SCIP_NLPPAR_RELOBJTOL, SCIP_NLPPAR_TILIM, SCIP_NLPPAR_VERBLEVEL, SCIP_OKAY, SCIP_PARAMETERUNKNOWN, SCIP_PARAMETERWRONGTYPE, SCIPerrorMessage, SCIPnlpiGetData(), and SCIPnlpiOracleGetInfinity().
sets floating point parameter of NLP input:
Definition at line 1622 of file nlpi_ipopt.cpp. References NULL, SCIP_NLPPAR_FASTFAIL, SCIP_NLPPAR_FEASTOL, SCIP_NLPPAR_FROMSCRATCH, SCIP_NLPPAR_INFINITY, SCIP_NLPPAR_ITLIM, SCIP_NLPPAR_LOBJLIM, SCIP_NLPPAR_OPTFILE, SCIP_NLPPAR_RELOBJTOL, SCIP_NLPPAR_TILIM, SCIP_NLPPAR_VERBLEVEL, SCIP_OKAY, SCIP_PARAMETERUNKNOWN, SCIP_PARAMETERWRONGTYPE, SCIP_PARAMETERWRONGVAL, SCIPerrorMessage, SCIPmessagePrintWarning(), SCIPnlpiGetData(), SCIPnlpiOracleSetInfinity(), and setFeastol().
gets string parameter of NLP input:
output:
Definition at line 1755 of file nlpi_ipopt.cpp. References NULL, SCIP_NLPPAR_FASTFAIL, SCIP_NLPPAR_FEASTOL, SCIP_NLPPAR_FROMSCRATCH, SCIP_NLPPAR_INFINITY, SCIP_NLPPAR_ITLIM, SCIP_NLPPAR_LOBJLIM, SCIP_NLPPAR_OPTFILE, SCIP_NLPPAR_RELOBJTOL, SCIP_NLPPAR_TILIM, SCIP_NLPPAR_VERBLEVEL, SCIP_OKAY, SCIP_PARAMETERUNKNOWN, SCIP_PARAMETERWRONGTYPE, and SCIPerrorMessage.
sets string parameter of NLP input:
Definition at line 1844 of file nlpi_ipopt.cpp. References NULL, SCIP_ERROR, SCIP_NLPPAR_FASTFAIL, SCIP_NLPPAR_FEASTOL, SCIP_NLPPAR_FROMSCRATCH, SCIP_NLPPAR_INFINITY, SCIP_NLPPAR_ITLIM, SCIP_NLPPAR_LOBJLIM, SCIP_NLPPAR_OPTFILE, SCIP_NLPPAR_RELOBJTOL, SCIP_NLPPAR_TILIM, SCIP_NLPPAR_VERBLEVEL, SCIP_OKAY, SCIP_PARAMETERUNKNOWN, SCIP_PARAMETERWRONGTYPE, SCIPerrorMessage, and TRUE.
sets message handler for message output input:
Definition at line 1940 of file nlpi_ipopt.cpp. References NULL, SCIP_OKAY, and SCIPnlpiGetData().
create solver interface for Ipopt solver
Definition at line 1955 of file nlpi_ipopt.cpp. Referenced by SCIP_DECL_NLPICOPY(), and SCIPincludeDefaultPlugins().
gets string that identifies Ipopt (version number) Definition at line 1985 of file nlpi_ipopt.cpp. Referenced by SCIPincludeDefaultPlugins().
gets string that describes Ipopt (version number) Definition at line 1991 of file nlpi_ipopt.cpp. Referenced by SCIPincludeDefaultPlugins().
returns whether Ipopt is available, i.e., whether it has been linked in Definition at line 1997 of file nlpi_ipopt.cpp. Referenced by checkCurvature(), checkFactorable(), and SCIP_DECL_CONSINITSOL().
gives a pointer to the IpoptApplication object stored in Ipopt-NLPI's NLPI problem data structure
Definition at line 2003 of file nlpi_ipopt.cpp.
gives a pointer to the NLPIORACLE object stored in Ipopt-NLPI's NLPI problem data structure
Definition at line 2013 of file nlpi_ipopt.cpp.
sets modified default settings that are used when setting up an Ipopt problem Do not forget to add a newline after the last option in optionsstring.
Definition at line 2026 of file nlpi_ipopt.cpp.
Calls Lapacks Dsyev routine to compute eigenvalues and eigenvectors of a dense matrix. It's here, because we use Ipopt's interface to Lapack.
Definition at line 2792 of file nlpi_ipopt.cpp. Referenced by checkCurvature(), and checkFactorable(). Variable Documentation
number of convergence checks Definition at line 98 of file nlpi_ipopt.cpp.
iteration where to start convergence checking Definition at line 99 of file nlpi_ipopt.cpp.
maximal number of iterations to achieve each convergence check Definition at line 100 of file nlpi_ipopt.cpp.
minimal required infeasibility reduction in each convergence check Definition at line 101 of file nlpi_ipopt.cpp. |