|
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 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.
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 623 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 654 of file nlpi_ipopt.cpp. References NULL.
add variables input:
Definition at line 673 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 718 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 758 of file nlpi_ipopt.cpp. References invalidateSolution(), NULL, SCIP_CALL, SCIP_OKAY, SCIPnlpiOracleSetObjective(), and TRUE.
change variable bounds input:
Definition at line 786 of file nlpi_ipopt.cpp. References invalidateSolution(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPnlpiOracleChgVarBounds().
change constraint bounds input:
Definition at line 810 of file nlpi_ipopt.cpp. References invalidateSolution(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPnlpiOracleChgConsSides().
delete a set of variables input:
output:
Definition at line 835 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 862 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 890 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 914 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 935 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 959 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 979 of file nlpi_ipopt.cpp. References NULL, SCIP_CALL, SCIP_OKAY, and SCIPnlpiOracleChgObjConstant().
sets initial guess for primal variables input:
Definition at line 1001 of file nlpi_ipopt.cpp. References BMScopyMemoryArray, BMSduplicateMemoryArray, BMSfreeMemoryArrayNull, NULL, SCIP_NOMEMORY, SCIP_OKAY, and SCIPnlpiOracleGetNVars().
tries to solve NLP input:
Definition at line 1034 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 1146 of file nlpi_ipopt.cpp. References NULL.
gives termination reason input:
return: Termination Status Definition at line 1163 of file nlpi_ipopt.cpp. References NULL.
gives primal and dual solution values input:
Definition at line 1182 of file nlpi_ipopt.cpp.
gives solve statistics input:
output:
Definition at line 1213 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 1235 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 1254 of file nlpi_ipopt.cpp. References SCIP_ERROR, and SCIPerrorMessage.
sets warmstart information in solver Write warmstart to buffer. input:
Definition at line 1270 of file nlpi_ipopt.cpp. References SCIP_OKAY, SCIPABORT, and SCIPerrorMessage.
gets integer parameter of NLP input:
output:
Definition at line 1289 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 1385 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 1527 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 1624 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 1757 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 1846 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 1942 of file nlpi_ipopt.cpp. References NULL, SCIP_OKAY, and SCIPnlpiGetData().
create solver interface for Ipopt solver
Definition at line 1957 of file nlpi_ipopt.cpp. Referenced by SCIP_DECL_NLPICOPY(), and SCIPincludeDefaultPlugins().
gets string that identifies Ipopt (version number) Definition at line 1987 of file nlpi_ipopt.cpp. Referenced by SCIPincludeDefaultPlugins().
gets string that describes Ipopt (version number) Definition at line 1993 of file nlpi_ipopt.cpp. Referenced by SCIPincludeDefaultPlugins().
returns whether Ipopt is available, i.e., whether it has been linked in Definition at line 1999 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 2005 of file nlpi_ipopt.cpp.
gives a pointer to the NLPIORACLE object stored in Ipopt-NLPI's NLPI problem data structure
Definition at line 2015 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 2028 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 2793 of file nlpi_ipopt.cpp. Referenced by checkCurvature(), checkFactorable(), and SCIP_DECL_QUADCONSUPGD().
solves a linear problem of the form Ax = b 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 2819 of file nlpi_ipopt.cpp. Variable Documentation
number of convergence checks Definition at line 99 of file nlpi_ipopt.cpp.
iteration where to start convergence checking Definition at line 100 of file nlpi_ipopt.cpp.
maximal number of iterations to achieve each convergence check Definition at line 101 of file nlpi_ipopt.cpp.
minimal required infeasibility reduction in each convergence check Definition at line 102 of file nlpi_ipopt.cpp. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||