65#include "IpoptConfig.h"
67#if defined(__GNUC__) && IPOPT_VERSION_MAJOR == 3 && IPOPT_VERSION_MINOR < 14
68#pragma GCC diagnostic ignored "-Wshadow"
70#include "IpIpoptApplication.hpp"
71#include "IpIpoptCalculatedQuantities.hpp"
72#include "IpSolveStatistics.hpp"
73#include "IpJournalist.hpp"
74#include "IpIpoptData.hpp"
75#include "IpTNLPAdapter.hpp"
76#include "IpOrigIpoptNLP.hpp"
77#include "IpLapack.hpp"
78#if defined(__GNUC__) && IPOPT_VERSION_MAJOR == 3 && IPOPT_VERSION_MINOR < 14
79#pragma GCC diagnostic warning "-Wshadow"
82#if IPOPT_VERSION_MAJOR < 3 || (IPOPT_VERSION_MAJOR == 3 && IPOPT_VERSION_MINOR < 12)
83#error "The Ipopt interface requires at least 3.12.0"
92#if defined(SCIP_THREADSAFE) && __cplusplus >= 201103L && IPOPT_VERSION_MAJOR == 3 && IPOPT_VERSION_MINOR < 14
93#define PROTECT_SOLVE_BY_MUTEX
100#define NLPI_NAME "ipopt"
101#define NLPI_DESC "Ipopt interface"
102#define NLPI_PRIORITY 1000
104#define MAXPERTURB 0.01
105#define FEASTOLFACTOR 0.9
107#define DEFAULT_RANDSEED 71
153 "linear_system_scaling",
154 "nlp_scaling_method",
156 "hessian_approximation"
166 SCIP_Real warm_start_push;
169 explicit SCIP_NlpiData()
170 : optfile(
NULL), print_level(-1), warm_start_push(1
e-9)
215class ScipNLP :
public TNLP
225 int conv_lastrestoiter;
227 unsigned int current_x;
228 unsigned int last_f_eval_x;
229 unsigned int last_g_eval_x;
241 conv_lastrestoiter(-1),
242 current_x(1), last_f_eval_x(0), last_g_eval_x(0),
254 void initializeSolve(
279 bool get_bounds_info(
289 bool get_starting_point(
302 Index get_number_of_nonlinear_variables();
305 bool get_list_of_nonlinear_variables(
311 bool get_var_con_metadata(
389 bool intermediate_callback(
406 void finalize_solution(
422class ScipJournal :
public Ipopt::Journal {
442 Ipopt::EJournalLevel level,
459 Ipopt::EJournalLevel level,
475 void FlushBufferImpl() { }
525 SCIPdebugMsg(
scip,
"Disable warmstart as no primal or dual solution available.\n");
544 warmstart ?
"warm" :
"cold",
549 SCIPdebugMsg(
scip,
"Starting solution for coldstart not available. Making up something by projecting 0 onto variable bounds and adding a random perturbation.\n");
563 for(
int i = 0;
i < n; ++
i )
591 if( nlpidata->print_level < 0 )
596 (
void) nlpiproblem->
ipopt->Options()->SetIntegerValue(
"print_level",
J_ERROR);
613#ifdef SCIP_DISABLED_CODE
616 if( nlpidata->autoiterlim > 0 )
634 for(
int i = 0;
i < n; ++
i )
654 for(
int i = 0;
i < m; ++
i )
723 (
void) nlpiproblem->
ipopt->Options()->SetNumericValue(
"dual_inf_tol", param.
opttol);
724 (
void) nlpiproblem->
ipopt->Options()->SetNumericValue(
"compl_inf_tol", param.
opttol);
728#if IPOPT_VERSION_MAJOR > 3 || IPOPT_VERSION_MINOR > 14 || (IPOPT_VERSION_MINOR == 14 && IPOPT_VERSION_RELEASE >= 2)
729 (
void) nlpiproblem->
ipopt->Options()->UnsetValue(
"tol");
731 (
void) nlpiproblem->
ipopt->Options()->SetNumericValue(
"tol", 1
e-8);
735#if IPOPT_VERSION_MAJOR > 3 || IPOPT_VERSION_MINOR >= 14
744 (
void) nlpiproblem->
ipopt->Options()->SetIntegerValue(
"acceptable_iter", 0);
746#if IPOPT_VERSION_MAJOR > 3 || IPOPT_VERSION_MINOR > 14 || (IPOPT_VERSION_MINOR == 14 && IPOPT_VERSION_RELEASE >= 2)
747 (
void) nlpiproblem->
ipopt->Options()->UnsetValue(
"acceptable_iter");
749 (
void) nlpiproblem->
ipopt->Options()->SetIntegerValue(
"acceptable_iter", 15);
752 (
void) nlpiproblem->
ipopt->Options()->SetStringValue(
"expect_infeasible_problem", param.
expectinfeas ?
"yes" :
"no");
754 if( !nlpiproblem->
ipopt->Options()->SetStringValue(
"warm_start_init_point", param.
warmstart ?
"yes" :
"no") && !param.
warmstart )
757 SCIPerrorMessage(
"Failed to set Ipopt warm_start_init_point option to no.");
764#ifdef COLLECT_SOLVESTATS
790 for(
int i = 0;
i < n; ++
i )
815 for(
int i = 0;
i < m; ++
i )
856 for(
int i = 0;
i < n; ++
i )
871 problem->
ipopt->Options()->GetBoolValue(
"expect_infeasible_problem", expectinfeas,
"");
876 printf(
"IPOPTSTAT status,iter,time,nvars,nnlvars,nvarlb,nvarub,nlincons,nnlcons,objnl,jacnnz,hesnnz,linsys11nz,linsys13nz,linsys11density,linsys13density,expectinfeas\n");
880 printf(
"IPOPTSTAT %d,%d,%g,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%f,%f,%d\n",
881 status, stats->IterationCount(), stats->TotalWallclockTime(),
882 nvars,
nnlvars,
nvarlb,
nvarub,
nlincons,
nnlcons,
objnl,
jacnnz, hesnnz,
linsys11nz,
linsys13nz,
linsys11density,
linsys13density, expectinfeas);
911 if( problem ==
NULL )
942 if( !(*problem)->ipopt->Jnlst()->AddJournal(
jrnl) )
948 (*problem)->nlp =
new ScipNLP(*problem,
scip);
950 catch(
const std::bad_alloc& )
997#if IPOPT_VERSION_MAJOR == 3 && IPOPT_VERSION_MINOR < 14
1001 (
void) (*problem)->ipopt->Options()->SetNumericValue(
"bound_relax_factor", 0.0);
1007 (
void) (*problem)->ipopt->Options()->SetStringValue(
"print_user_options",
"yes");
1009 (
void) (*problem)->ipopt->Options()->SetStringValue(
"sb",
"yes");
1010 (
void) (*problem)->ipopt->Options()->SetStringValueIfUnset(
"mu_strategy",
"adaptive");
1011 (
void) (*problem)->ipopt->Options()->SetIntegerValue(
"max_iter",
INT_MAX);
1012 (
void) (*problem)->ipopt->Options()->SetNumericValue(
"nlp_lower_bound_inf", -
SCIPinfinity(
scip),
false);
1013 (
void) (*problem)->ipopt->Options()->SetNumericValue(
"nlp_upper_bound_inf",
SCIPinfinity(
scip),
false);
1014 (
void) (*problem)->ipopt->Options()->SetNumericValue(
"diverging_iterates_tol",
SCIPinfinity(
scip),
false);
1017 (
void) (*problem)->ipopt->Options()->SetNumericValue(
"warm_start_bound_push", data->warm_start_push);
1018 (
void) (*problem)->ipopt->Options()->SetNumericValue(
"warm_start_bound_frac", data->warm_start_push);
1019 (
void) (*problem)->ipopt->Options()->SetNumericValue(
"warm_start_slack_bound_push", data->warm_start_push);
1020 (
void) (*problem)->ipopt->Options()->SetNumericValue(
"warm_start_slack_bound_frac", data->warm_start_push);
1021 (
void) (*problem)->ipopt->Options()->SetNumericValue(
"warm_start_mult_bound_push", data->warm_start_push);
1027 SCIPerrorMessage(
"Error during initialization of Ipopt using optionfile \"%s\"\n", data->optfile);
1056 if( (*problem)->randnumgen !=
NULL )
1395 if( primalvalues !=
NULL )
1412 SCIPdebugMsg(
scip,
"invalidate initial guess primal values on user-request\n");
1418 if( consdualvalues !=
NULL && varlbdualvalues !=
NULL && varubdualvalues !=
NULL )
1472 if( nlpidata->print_level >=
J_SUMMARY || param.verblevel > 0 )
1480 if( param.timelimit == 0.0 )
1491#ifdef COLLECT_SOLVESTATS
1494 param.iterlimit = 1000;
1505 problem->
nlp->initializeSolve(problem, param);
1512#ifdef PROTECT_SOLVE_BY_MUTEX
1537 SCIPerrorMessage(
"Do not have expression interpreter that can compute function values and gradients. Cannot solve NLP with Ipopt.\n");
1546 (
void) problem->
ipopt->Options()->SetStringValueIfUnset(
"hessian_approximation",
"limited-memory");
1547 problem->
nlp->approxhessian =
true;
1550 problem->
nlp->approxhessian =
false;
1554 problem->
ipopt->Options()->SetStringValue(
"derivative_test", problem->
nlp->approxhessian ?
"first-order" :
"second-order");
1562 problem->
ipopt->Options()->SetStringValue(
"warm_start_same_structure", problem->
samestructure ?
"yes" :
"no");
1580#if IPOPT_VERSION_MAJOR > 3 || IPOPT_VERSION_MINOR >= 14
1598 SCIPdebugMsg(
scip,
"Ipopt failed because of an invalid number in function or derivative value\n");
1618 SCIPerrorMessage(
"Ipopt returned with application return status %d\n", status);
1627 SCIPerrorMessage(
"Ipopt returned with application return status %d\n", status);
1631#if IPOPT_VERSION_MAJOR == 3 && IPOPT_VERSION_MINOR < 14
1636 problem->
lastniter = stats->IterationCount();
1637 problem->
lasttime = stats->TotalWallclockTime();
1639#ifdef COLLECT_SOLVESTATS
1649 problem->
lasttime =
ip_data->TimingStats().OverallAlgorithm().TotalWallclockTime();
1694 if( primalvalues !=
NULL )
1697 if( consdualvalues !=
NULL )
1700 if( varlbdualvalues !=
NULL )
1703 if( varubdualvalues !=
NULL )
1758 &nlpidata->warm_start_push,
FALSE, 1
e-9, 0.0, 1.0,
NULL,
NULL) );
1761 IpoptApplication::RegisterAllIpoptOptions(
reg_options);
1778 std::stringstream
descr;
1783 std::vector<RegisteredOption::string_entry>
validvals =
option->GetValidStrings();
1786 descr <<
" Valid values if not empty:";
1787 for( std::vector<RegisteredOption::string_entry>::iterator val =
validvals.begin(); val !=
validvals.end(); ++val )
1788 descr <<
' ' << val->value_;
1791#if IPOPT_VERSION_MAJOR > 3 || IPOPT_VERSION_MINOR >= 14
1824 std::stringstream
descr;
1826 descr <<
' ' << (
lower-1) <<
" to use NLPI or Ipopt default.";
1828#if IPOPT_VERSION_MAJOR > 3 || IPOPT_VERSION_MINOR >= 14
1851 return "Interior Point Optimizer developed by A. Waechter et.al. (github.com/coin-or/Ipopt)";
1867 return nlpiproblem->
oracle;
1871bool ScipNLP::get_nlp_info(
1894 if( !approxhessian )
1913bool ScipNLP::get_bounds_info(
1937 for(
int i = 0;
i < n; ++
i )
1947 for(
int i = 0;
i < n; ++
i )
1957 for(
int i = 0;
i < m; ++
i )
1968bool ScipNLP::get_starting_point(
1988 assert(nlpiproblem->solprimalvalid);
1995 assert(nlpiproblem->soldualvalid);
2004 assert(nlpiproblem->soldualvalid);
2013Index ScipNLP::get_number_of_nonlinear_variables()
2024 for(
int i = 0;
i < n; ++
i )
2032bool ScipNLP::get_list_of_nonlinear_variables(
2046 for(
int i = 0;
i < n; ++
i )
2061bool ScipNLP::get_var_con_metadata(
2078 if( varnames !=
NULL )
2082 for(
int i = 0;
i < n; ++
i )
2084 if( varnames[
i] !=
NULL )
2099 for(
int i = 0;
i < m; ++
i )
2117bool ScipNLP::eval_f(
2131 last_f_eval_x = current_x;
2137bool ScipNLP::eval_grad_f(
2156 new_x = last_f_eval_x < current_x;
2160 last_f_eval_x = current_x;
2166bool ScipNLP::eval_g(
2181 last_g_eval_x = current_x;
2190bool ScipNLP::eval_jac_g(
2207 if( values ==
NULL )
2223 for(
i = 0;
i < m; ++
i )
2236 new_x = last_g_eval_x < current_x;
2240 last_f_eval_x = current_x;
2253bool ScipNLP::eval_h(
2273 if( values ==
NULL )
2289 for(
i = 0;
i < n; ++
i )
2309 last_f_eval_x = current_x;
2310 last_g_eval_x = current_x;
2324bool ScipNLP::intermediate_callback(
2362 conv_lastrestoiter = -1;
2366 conv_lastrestoiter = iter;
2368 else if( conv_lastrestoiter == iter-1 )
2390 if(
inf_pr <= conv_prtarget[
i] )
2399 else if( iter >= conv_iterlim[
i] )
2402 SCIPdebugMsg(
scip,
"convcheck %d: inf_pr = %e > target %e; inf_du = %e target %e: ",
2409 SCIPdebugPrintf(
"continue, because restoration phase only %d iters ago\n", iter - conv_lastrestoiter);
2414 SCIPdebugPrintf(
"continue, because dual infeas. red. sufficient and only %d iters above limit\n", iter - conv_iterlim[
i]);
2419 if(
inf_pr <= param.feastol )
2435void ScipNLP::finalize_solution(
2479#if IPOPT_VERSION_MAJOR > 3 || IPOPT_VERSION_MINOR >= 14
2535 SCIPerrorMessage(
"Ipopt returned with unknown solution status %d\n", status);
2548 if( nlpiproblem->soldualcons ==
NULL )
2552 if( nlpiproblem->soldualvarlb ==
NULL )
2556 if( nlpiproblem->soldualvarub ==
NULL )
2560 if( nlpiproblem->soldualcons ==
NULL || nlpiproblem->soldualvarlb ==
NULL || nlpiproblem->soldualvarub ==
NULL )
2572 nlpiproblem->solprimalvalid =
true;
2573 nlpiproblem->solprimalgiven =
false;
2574 nlpiproblem->soldualvalid =
true;
2575 nlpiproblem->soldualgiven =
false;
2578#if IPOPT_VERSION_MAJOR == 3 && IPOPT_VERSION_MINOR < 14
2579 nlpiproblem->solboundviol = 0.0;
2583 nlpiproblem->solconsviol = 0.0;
2588 nlpiproblem->solboundviol =
cq->unscaled_curr_orig_bounds_violation(Ipopt::NORM_MAX);
2592 nlpiproblem->solconsviol =
cq->unscaled_curr_nlp_constraint_violation(Ipopt::NORM_MAX);
2598 if(
MAX(nlpiproblem->solconsviol, nlpiproblem->solboundviol) <= param.feastol )
2604 catch(
const IpoptNLP::Eval_Error&
exc )
2606 SCIPdebugMsg(
scip,
"Eval error when checking constraint viol: %s\n",
exc.Message().c_str());
2626 (
void) nlpiproblem->ipopt->Options()->GetNumericValue(
"tol",
tol,
"");
2638 if( lambda[
i] < 0.0 )
2646 SCIPdebugMessage(
"inconsistent dual, lambda = %g, but lhs = %g\n", lambda[
i], side);
2658 SCIPdebugMessage(
"inconsistent dual, lambda = %g, but rhs = %g\n", lambda[
i], side);
2695#if IPOPT_VERSION_MAJOR == 3 && IPOPT_VERSION_MINOR < 14
2703 SCIPerrorMessage(
"There was an error when calling DSYEV. INFO = %d\n", info);
2734#if IPOPT_VERSION_MAJOR == 3 && IPOPT_VERSION_MINOR < 14
2742 SCIPdebugMessage(
"There was an error when calling Dgetrf. INFO = %d\n", info);
2750#if IPOPT_VERSION_MAJOR == 3 && IPOPT_VERSION_MINOR < 14
2805#if IPOPT_VERSION_MAJOR == 3 && IPOPT_VERSION_MINOR < 14
2813 SCIPdebugMessage(
"There was an error when calling Dgetrf. INFO = %d\n", info);
2821#if IPOPT_VERSION_MAJOR == 3 && IPOPT_VERSION_MINOR < 14
#define SCIP_CALL_ABORT(x)
methods to interpret (evaluate) an expression "fast"
int SCIPgetSubscipDepth(SCIP *scip)
SCIP_EXPRINTCAPABILITY SCIPexprintGetCapability(void)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
SCIP_MESSAGEHDLR * SCIPgetMessagehdlr(SCIP *scip)
SCIP_RETCODE SCIPincludeNlpSolverIpopt(SCIP *scip)
SCIP_RETCODE SCIPnlpiOracleEvalObjectiveValue(SCIP *scip, SCIP_NLPIORACLE *oracle, const SCIP_Real *x, SCIP_Real *objval)
SCIP_RETCODE SCIPnlpiOracleChgLinearCoefs(SCIP *scip, SCIP_NLPIORACLE *oracle, int considx, int nentries, const int *varidxs, const SCIP_Real *newcoefs)
SCIP_RETCODE SCIPnlpiOracleChgVarBounds(SCIP *scip, SCIP_NLPIORACLE *oracle, int nvars, const int *indices, const SCIP_Real *lbs, const SCIP_Real *ubs)
SCIP_RETCODE SCIPnlpiOracleAddConstraints(SCIP *scip, SCIP_NLPIORACLE *oracle, int nconss, const SCIP_Real *lhss, const SCIP_Real *rhss, const int *nlininds, int *const *lininds, SCIP_Real *const *linvals, SCIP_EXPR **exprs, const char **consnames)
SCIP_Bool SCIPnlpiOracleIsConstraintNonlinear(SCIP_NLPIORACLE *oracle, int considx)
SCIP_RETCODE SCIPnlpiOracleDelVarSet(SCIP *scip, SCIP_NLPIORACLE *oracle, int *delstats)
SCIP_RETCODE SCIPnlpiOracleEvalConstraintValues(SCIP *scip, SCIP_NLPIORACLE *oracle, const SCIP_Real *x, SCIP_Real *convals)
SCIP_RETCODE SCIPnlpiOracleCreate(SCIP *scip, SCIP_NLPIORACLE **oracle)
SCIP_RETCODE SCIPnlpiOracleGetJacobianSparsity(SCIP *scip, SCIP_NLPIORACLE *oracle, const int **offset, const int **col)
void SCIPnlpiOracleGetVarCounts(SCIP *scip, SCIP_NLPIORACLE *oracle, const int **lincounts, const int **nlcounts)
SCIP_RETCODE SCIPnlpiOracleGetHessianLagSparsity(SCIP *scip, SCIP_NLPIORACLE *oracle, const int **offset, const int **col)
char * SCIPnlpiOracleGetConstraintName(SCIP_NLPIORACLE *oracle, int considx)
SCIP_RETCODE SCIPnlpiOracleEvalObjectiveGradient(SCIP *scip, SCIP_NLPIORACLE *oracle, const SCIP_Real *x, SCIP_Bool isnewx, SCIP_Real *objval, SCIP_Real *objgrad)
SCIP_RETCODE SCIPnlpiOracleResetEvalTime(SCIP *scip, SCIP_NLPIORACLE *oracle)
SCIP_RETCODE SCIPnlpiOracleSetObjective(SCIP *scip, SCIP_NLPIORACLE *oracle, const SCIP_Real constant, int nlin, const int *lininds, const SCIP_Real *linvals, SCIP_EXPR *expr)
SCIP_Real SCIPnlpiOracleGetConstraintRhs(SCIP_NLPIORACLE *oracle, int considx)
SCIP_Real SCIPnlpiOracleGetEvalTime(SCIP *scip, SCIP_NLPIORACLE *oracle)
SCIP_RETCODE SCIPnlpiOracleChgConsSides(SCIP *scip, SCIP_NLPIORACLE *oracle, int nconss, const int *indices, const SCIP_Real *lhss, const SCIP_Real *rhss)
SCIP_Real SCIPnlpiOracleGetConstraintLhs(SCIP_NLPIORACLE *oracle, int considx)
SCIP_RETCODE SCIPnlpiOracleAddVars(SCIP *scip, SCIP_NLPIORACLE *oracle, int nvars, const SCIP_Real *lbs, const SCIP_Real *ubs, const char **varnames)
int SCIPnlpiOracleGetNVars(SCIP_NLPIORACLE *oracle)
int SCIPnlpiOracleGetNConstraints(SCIP_NLPIORACLE *oracle)
SCIP_EXPRINTCAPABILITY SCIPnlpiOracleGetEvalCapability(SCIP *scip, SCIP_NLPIORACLE *oracle)
SCIP_Real SCIPnlpiOracleGetObjectiveConstant(SCIP_NLPIORACLE *oracle)
SCIP_RETCODE SCIPnlpiOracleEvalHessianLag(SCIP *scip, SCIP_NLPIORACLE *oracle, const SCIP_Real *x, SCIP_Bool isnewx_obj, SCIP_Bool isnewx_cons, SCIP_Real objfactor, const SCIP_Real *lambda, SCIP_Real *hessian)
SCIP_Bool SCIPnlpiOracleIsVarNonlinear(SCIP *scip, SCIP_NLPIORACLE *oracle, int varidx)
SCIP_RETCODE SCIPnlpiOracleEvalJacobian(SCIP *scip, SCIP_NLPIORACLE *oracle, const SCIP_Real *x, SCIP_Bool isnewx, SCIP_Real *convals, SCIP_Real *jacobi)
SCIP_RETCODE SCIPnlpiOracleDelConsSet(SCIP *scip, SCIP_NLPIORACLE *oracle, int *delstats)
SCIP_RETCODE SCIPnlpiOracleSetProblemName(SCIP *scip, SCIP_NLPIORACLE *oracle, const char *name)
SCIP_RETCODE SCIPnlpiOracleChgObjConstant(SCIP *scip, SCIP_NLPIORACLE *oracle, SCIP_Real objconstant)
char ** SCIPnlpiOracleGetVarNames(SCIP_NLPIORACLE *oracle)
const SCIP_Real * SCIPnlpiOracleGetVarLbs(SCIP_NLPIORACLE *oracle)
const SCIP_Real * SCIPnlpiOracleGetVarUbs(SCIP_NLPIORACLE *oracle)
SCIP_RETCODE SCIPnlpiOracleFree(SCIP *scip, SCIP_NLPIORACLE **oracle)
const char * SCIPnlpiOracleGetProblemName(SCIP_NLPIORACLE *oracle)
SCIP_RETCODE SCIPnlpiOracleChgExpr(SCIP *scip, SCIP_NLPIORACLE *oracle, int considx, SCIP_EXPR *expr)
const char * SCIPgetSolverNameIpopt(void)
SCIP_RETCODE SCIPcallLapackDsyevIpopt(SCIP_Bool computeeigenvectors, int N, SCIP_Real *a, SCIP_Real *w)
SCIP_RETCODE SCIPsolveLinearEquationsIpopt(int N, SCIP_Real *A, SCIP_Real *b, SCIP_Real *x, SCIP_Bool *success)
void * SCIPgetNlpiOracleIpopt(SCIP_NLPIPROBLEM *nlpiproblem)
SCIP_Bool SCIPisIpoptAvailableIpopt(void)
const char * SCIPgetSolverDescIpopt(void)
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_PARAM * SCIPgetParam(SCIP *scip, const char *name)
SCIP_RETCODE SCIPaddStringParam(SCIP *scip, const char *name, const char *desc, char **valueptr, SCIP_Bool isadvanced, const char *defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPaddRealParam(SCIP *scip, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPincludeExternalCodeInformation(SCIP *scip, const char *name, const char *description)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
SCIP_RETCODE SCIPincludeNlpi(SCIP *scip, const char *name, const char *description, int priority, SCIP_DECL_NLPICOPY((*nlpicopy)), SCIP_DECL_NLPIFREE((*nlpifree)), SCIP_DECL_NLPIGETSOLVERPOINTER((*nlpigetsolverpointer)), SCIP_DECL_NLPICREATEPROBLEM((*nlpicreateproblem)), SCIP_DECL_NLPIFREEPROBLEM((*nlpifreeproblem)), SCIP_DECL_NLPIGETPROBLEMPOINTER((*nlpigetproblempointer)), SCIP_DECL_NLPIADDVARS((*nlpiaddvars)), SCIP_DECL_NLPIADDCONSTRAINTS((*nlpiaddconstraints)), SCIP_DECL_NLPISETOBJECTIVE((*nlpisetobjective)), SCIP_DECL_NLPICHGVARBOUNDS((*nlpichgvarbounds)), SCIP_DECL_NLPICHGCONSSIDES((*nlpichgconssides)), SCIP_DECL_NLPIDELVARSET((*nlpidelvarset)), SCIP_DECL_NLPIDELCONSSET((*nlpidelconsset)), SCIP_DECL_NLPICHGLINEARCOEFS((*nlpichglinearcoefs)), SCIP_DECL_NLPICHGEXPR((*nlpichgexpr)), SCIP_DECL_NLPICHGOBJCONSTANT((*nlpichgobjconstant)), SCIP_DECL_NLPISETINITIALGUESS((*nlpisetinitialguess)), SCIP_DECL_NLPISOLVE((*nlpisolve)), SCIP_DECL_NLPIGETSOLSTAT((*nlpigetsolstat)), SCIP_DECL_NLPIGETTERMSTAT((*nlpigettermstat)), SCIP_DECL_NLPIGETSOLUTION((*nlpigetsolution)), SCIP_DECL_NLPIGETSTATISTICS((*nlpigetstatistics)), SCIP_NLPIDATA *nlpidata)
SCIP_NLPIDATA * SCIPnlpiGetData(SCIP_NLPI *nlpi)
SCIP_Bool SCIPisSolveInterrupted(SCIP *scip)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPrandomGetReal(SCIP_RANDNUMGEN *randnumgen, SCIP_Real minrandval, SCIP_Real maxrandval)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIPfreeRandom(scip, &heurdata->randnumgen)
SCIPcreateRandom(scip, &heurdata->randnumgen, DEFAULT_RANDSEED, TRUE))
assert(minobj< SCIPgetCutoffbound(scip))
static const char * paramname[]
#define BMSduplicateMemoryArray(ptr, source, num)
#define BMSallocMemoryArray(ptr, num)
#define BMSfreeMemoryArray(ptr)
#define BMScopyMemoryArray(ptr, source, num)
void SCIPmessageVPrintError(const char *formatstr, va_list ap)
void SCIPmessageVPrintInfo(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr, va_list ap)
void SCIPmessagePrintErrorHeader(const char *sourcefile, int sourceline)
static const SCIP_Real convcheck_minred[convcheck_nchecks]
static const char * ipopt_int_params[]
integer parameters of Ipopt to make available via SCIP parameters
static const int convcheck_startiter
static const int convcheck_nchecks
static SCIP_RETCODE solveLinearProb3(SCIP_Real *A, SCIP_Real *b, SCIP_Real *x, SCIP_Bool *success)
static SCIP_RETCODE handleNlpParam(SCIP *scip, SCIP_NLPIDATA *nlpidata, SCIP_NLPIPROBLEM *nlpiproblem, const SCIP_NLPPARAM param)
pass NLP solve parameters to Ipopt
static const char * ipopt_string_params[]
string parameters of Ipopt to make available via SCIP parameters
static SCIP_RETCODE ensureStartingPoint(SCIP *scip, SCIP_NLPIPROBLEM *problem, SCIP_Bool &warmstart)
static const int convcheck_maxiter[convcheck_nchecks]
static void invalidateSolved(SCIP_NLPIPROBLEM *problem)
static void invalidateSolution(SCIP_NLPIPROBLEM *problem)
methods to store an NLP and request function, gradient, and Hessian values
char * SCIPparamGetString(SCIP_PARAM *param)
int SCIPparamGetInt(SCIP_PARAM *param)
int SCIPparamGetIntDefault(SCIP_PARAM *param)
public methods for message output
public data structures and miscellaneous methods
public methods for handling parameter settings
public methods for problem copies
public methods for memory management
public methods for message handling
public methods for NLPI solver interfaces
public methods for numerical tolerances
public methods for SCIP parameter handling
public methods for random numbers
SCIP_NLPPARAM_FASTFAIL fastfail
SmartPtr< IpoptApplication > ipopt
SCIP_RANDNUMGEN * randnumgen
SCIP_NLPTERMSTAT termstat
#define SCIP_EXPRINTCAPABILITY_GRADIENT
#define SCIP_EXPRINTCAPABILITY_HESSIAN
#define SCIP_EXPRINTCAPABILITY_FUNCVALUE
unsigned int SCIP_EXPRINTCAPABILITY
#define SCIP_DECL_NLPISOLVE(x)
#define SCIP_DECL_NLPICHGLINEARCOEFS(x)
#define SCIP_DECL_NLPICHGOBJCONSTANT(x)
#define SCIP_NLPPARAM_PRINT(param)
#define SCIP_DECL_NLPIGETSOLUTION(x)
#define SCIP_DECL_NLPISETOBJECTIVE(x)
#define SCIP_DECL_NLPICREATEPROBLEM(x)
#define SCIP_DECL_NLPIGETSTATISTICS(x)
#define SCIP_DECL_NLPIDELCONSSET(x)
#define SCIP_DECL_NLPICHGCONSSIDES(x)
#define SCIP_DECL_NLPIDELVARSET(x)
#define SCIP_DECL_NLPICHGEXPR(x)
#define SCIP_DECL_NLPIADDVARS(x)
@ SCIP_NLPPARAM_FASTFAIL_OFF
@ SCIP_NLPPARAM_FASTFAIL_AGGRESSIVE
enum SCIP_NlpSolStat SCIP_NLPSOLSTAT
#define SCIP_DECL_NLPISETINITIALGUESS(x)
#define SCIP_DECL_NLPIFREEPROBLEM(x)
@ SCIP_NLPTERMSTAT_TIMELIMIT
@ SCIP_NLPTERMSTAT_NUMERICERROR
@ SCIP_NLPTERMSTAT_EVALERROR
@ SCIP_NLPTERMSTAT_LOBJLIMIT
@ SCIP_NLPTERMSTAT_ITERLIMIT
@ SCIP_NLPTERMSTAT_OUTOFMEMORY
@ SCIP_NLPTERMSTAT_INTERRUPT
#define SCIP_DECL_NLPICOPY(x)
#define SCIP_DECL_NLPIGETSOLVERPOINTER(x)
#define SCIP_DECL_NLPIGETSOLSTAT(x)
#define SCIP_DECL_NLPICHGVARBOUNDS(x)
#define SCIP_DECL_NLPIGETPROBLEMPOINTER(x)
#define SCIP_DECL_NLPIFREE(x)
#define SCIP_DECL_NLPIADDCONSTRAINTS(x)
@ SCIP_NLPSOLSTAT_UNBOUNDED
@ SCIP_NLPSOLSTAT_LOCINFEASIBLE
@ SCIP_NLPSOLSTAT_FEASIBLE
@ SCIP_NLPSOLSTAT_UNKNOWN
#define SCIP_DECL_NLPIGETTERMSTAT(x)
enum SCIP_NlpTermStat SCIP_NLPTERMSTAT
struct SCIP_NlpiData SCIP_NLPIDATA
enum SCIP_Retcode SCIP_RETCODE