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 60 of file nlpi_ipopt.cpp. Referenced by SCIPcreateNlpSolverIpopt().
description of solver Definition at line 61 of file nlpi_ipopt.cpp. Referenced by SCIPcreateNlpSolverIpopt().
default print level of Ipopt Definition at line 67 of file nlpi_ipopt.cpp. Referenced by SCIP_DECL_NLPICREATEPROBLEM().
default iteration limit for Ipopt Definition at line 69 of file nlpi_ipopt.cpp. Referenced by SCIP_DECL_NLPICREATEPROBLEM().
maximal perturbation of bounds in starting point heuristic Definition at line 71 of file nlpi_ipopt.cpp. Referenced by SCIPsetModifiedDefaultSettingsIpopt().
factor for user-given feasibility tolerance to get feasibility tolerance that is actually passed to Ipopt Definition at line 72 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 515 of file nlpi_ipopt.cpp. References NULL.
creates a problem instance input:
Definition at line 530 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 627 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 722 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 762 of file nlpi_ipopt.cpp. References invalidateSolution(), NULL, SCIP_CALL, SCIP_OKAY, SCIPnlpiOracleSetObjective(), and TRUE.
change variable bounds input:
Definition at line 790 of file nlpi_ipopt.cpp. References invalidateSolution(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPnlpiOracleChgVarBounds().
change constraint bounds input:
Definition at line 814 of file nlpi_ipopt.cpp. References invalidateSolution(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPnlpiOracleChgConsSides().
delete a set of variables input:
output:
Definition at line 839 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 866 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 894 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 918 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 939 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 963 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 983 of file nlpi_ipopt.cpp. References NULL, SCIP_CALL, SCIP_OKAY, and SCIPnlpiOracleChgObjConstant().
sets initial guess for primal variables input:
Definition at line 1005 of file nlpi_ipopt.cpp. References BMScopyMemoryArray, BMSduplicateMemoryArray, BMSfreeMemoryArrayNull, NULL, SCIP_NOMEMORY, SCIP_OKAY, and SCIPnlpiOracleGetNVars().
tries to solve NLP input:
Definition at line 1038 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(), SCIPnlpiOracleGetEvalCapability(), and SCIPnlpiOracleGetMaxDegree().
gives solution status input:
return: Solution Status Definition at line 1150 of file nlpi_ipopt.cpp. References NULL.
gives termination reason input:
return: Termination Status Definition at line 1167 of file nlpi_ipopt.cpp. References NULL.
gives primal and dual solution values input:
Definition at line 1186 of file nlpi_ipopt.cpp.
gives solve statistics input:
output:
Definition at line 1217 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 1239 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 1258 of file nlpi_ipopt.cpp. References SCIP_ERROR, and SCIPerrorMessage.
sets warmstart information in solver Write warmstart to buffer. input:
Definition at line 1274 of file nlpi_ipopt.cpp. References SCIP_OKAY, SCIPABORT, and SCIPerrorMessage.
gets integer parameter of NLP input:
output:
Definition at line 1293 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 1389 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 1531 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 1628 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 1761 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 1850 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 1946 of file nlpi_ipopt.cpp. References NULL, SCIP_OKAY, and SCIPnlpiGetData().
create solver interface for Ipopt solver
Definition at line 1961 of file nlpi_ipopt.cpp. Referenced by SCIP_DECL_NLPICOPY(), and SCIPincludeDefaultPlugins().
gets string that identifies Ipopt (version number) Definition at line 1991 of file nlpi_ipopt.cpp. Referenced by SCIPincludeDefaultPlugins().
gets string that describes Ipopt (version number) Definition at line 1997 of file nlpi_ipopt.cpp. Referenced by SCIPincludeDefaultPlugins().
returns whether Ipopt is available, i.e., whether it has been linked in Definition at line 2003 of file nlpi_ipopt.cpp. Referenced by checkCurvature(), checkFactorable(), SCIP_DECL_CONSINITSOL(), and SCIP_DECL_QUADCONSUPGD().
gives a pointer to the IpoptApplication object stored in Ipopt-NLPI's NLPI problem data structure
Definition at line 2009 of file nlpi_ipopt.cpp.
gives a pointer to the NLPIORACLE object stored in Ipopt-NLPI's NLPI problem data structure
Definition at line 2019 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 2032 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 2797 of file nlpi_ipopt.cpp. Referenced by checkCurvature(), checkFactorable(), SCIP_DECL_QUADCONSUPGD(), and SCIPsolveLinearProb().
solves a linear problem of the form Ax = b for a regular matrix 3*3 A
Definition at line 2819 of file nlpi_ipopt.cpp. References BMScopyMemoryArray, FALSE, NULL, SCIP_OKAY, SCIP_Real, SCIPerrorMessage, and TRUE. Referenced by SCIPsolveLinearProb().
solves a linear problem of the form Ax = b for a regular matrix A Calls Lapacks IpLapackDgetrf routine to calculate a LU factorization and uses this factorization to solve the linear problem Ax = b. It's here, because Ipopt is linked against Lapack.
Definition at line 2865 of file nlpi_ipopt.cpp. Referenced by SCIPcomputeHyperplaneThreePoints(). Variable Documentation
number of convergence checks Definition at line 99 of file nlpi_ipopt.cpp. Referenced by SCIP_NlpiProblem::SCIP_NlpiProblem(), and SCIPsetModifiedDefaultSettingsIpopt().
iteration where to start convergence checking Definition at line 100 of file nlpi_ipopt.cpp. Referenced by SCIPsetModifiedDefaultSettingsIpopt().
maximal number of iterations to achieve each convergence check Definition at line 101 of file nlpi_ipopt.cpp. Referenced by SCIPsetModifiedDefaultSettingsIpopt().
minimal required infeasibility reduction in each convergence check Definition at line 102 of file nlpi_ipopt.cpp. Referenced by SCIPsetModifiedDefaultSettingsIpopt(). |