methods for the nonlinear relaxation
Topics | |
Nonlinear Rows | |
methods for the creation and interaction with rows of the NLP relaxation | |
NLP Diving | |
methods to initiate and conduct NLP Diving |
Macros | |
#define | SCIPsolveNLP(...) |
#define SCIPsolveNLP | ( | ... | ) |
solves the current NLP (or diving NLP if in diving mode) with non-default parameters given as optional arguments
Typical use is
SCIP_CALL( SCIPsolveNLP(scip) );
to solve with default parameters. Additionally, one or several values of SCIP_NLPPARAM can be set:
SCIP_CALL( SCIPsolveNLP(scip, .iterlimit = 42, .verblevel = 1) ); //lint !e666
Definition at line 361 of file scip_nlp.h.
Referenced by computeFixingrate(), getFixingValue(), SCIP_DECL_HEUREXEC(), SCIPapplyHeurDualval(), and solveSubNLP().
returns whether the NLP relaxation has been enabled
If the NLP relaxation is enabled, then SCIP will construct the NLP relaxation when the solving process is about to begin. To check whether an NLP is existing, use SCIPisNLPConstructed().
scip | SCIP data structure |
Definition at line 74 of file scip_nlp.c.
References FALSE, SCIP_Bool, SCIP_CALL_ABORT, SCIPcheckStage(), and TRUE.
Referenced by SCIP_DECL_PRESOLEXEC(), SCIP_DECL_PRESOLEXEC(), SCIP_DECL_PRESOLEXEC(), SCIP_DECL_PRESOLEXEC(), SCIP_DECL_PRESOLEXEC(), and setupAndSolve().
void SCIPenableNLP | ( | SCIP * | scip | ) |
notifies SCIP that the NLP relaxation should be initialized in INITSOLVE
This method is typically called by a constraint handler that handles constraints that have a nonlinear representation as nonlinear rows, e.g., cons_nonlinear.
The function should be called before the branch-and-bound process is initialized, e.g., when presolve is exiting.
scip | SCIP data structure |
Definition at line 95 of file scip_nlp.c.
References FALSE, SCIP_CALL_ABORT, SCIPcheckStage(), and TRUE.
Referenced by SCIP_DECL_CONSEXITPRE().
returns, whether an NLP has been constructed
scip | SCIP data structure |
Definition at line 110 of file scip_nlp.c.
References FALSE, NULL, SCIP_Bool, SCIP_CALL_ABORT, SCIPcheckStage(), and TRUE.
Referenced by addNlrow(), addNlrow(), addNlrow(), addNlrow(), addNlrow(), addNlrow(), addNlrow(), computeFixingrate(), computeStandardNLPFeasibilityCut(), computeStandardNLPOptimalityCut(), countNonlinearities(), createSubSCIP(), generateAndApplyBendersCuts(), getFixingValue(), initBounds(), initSolve(), isRestartApplicable(), runHeuristic(), SCIP_DECL_BENDERSCUTEXEC(), SCIP_DECL_BENDERSCUTEXEC(), SCIP_DECL_BENDERSCUTEXEC(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSINITSOL(), SCIP_DECL_CONSINITSOL(), SCIP_DECL_CONSINITSOL(), SCIP_DECL_CONSINITSOL(), SCIP_DECL_CONSINITSOL(), SCIP_DECL_CONSINITSOL(), SCIP_DECL_CONSINITSOL(), SCIP_DECL_CONSINITSOL(), SCIP_DECL_CONSINITSOL(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_HEUREXEC(), SCIP_DECL_HEUREXEC(), SCIP_DECL_HEUREXEC(), SCIP_DECL_HEUREXEC(), SCIP_DECL_PROPEXEC(), SCIP_DECL_PROPEXEC(), SCIP_DECL_RELAXEXEC(), SCIP_DECL_SEPAEXECLP(), SCIP_DECL_SEPAEXECLP(), SCIP_DECL_SEPAEXECLP(), SCIPapplyHeurDualval(), SCIPapplyUndercover(), SCIPbendersComputeSubproblemLowerbound(), SCIPbendersSolSlackVarsActive(), SCIPbendersSolveSubproblemLP(), SCIPcreateNLPSol(), SCIPgenerateAndApplyBendersOptCut(), solveLp(), and solveSubNLP().
SCIP_RETCODE SCIPhasNLPContinuousNonlinearity | ( | SCIP * | scip, |
SCIP_Bool * | result ) |
checks whether the NLP has a continuous variable in a nonlinear term
scip | SCIP data structure |
result | buffer to store result |
Definition at line 125 of file scip_nlp.c.
References FALSE, NULL, result, SCIP_Bool, SCIP_CALL, SCIP_ERROR, SCIP_OKAY, SCIPcheckStage(), SCIPerrorMessage, SCIPnlpHasContinuousNonlinearity(), and TRUE.
Referenced by runHeuristic().
SCIP_RETCODE SCIPgetNLPVarsData | ( | SCIP * | scip, |
SCIP_VAR *** | vars, | ||
int * | nvars ) |
gets current NLP variables along with the current number of NLP variables
scip | SCIP data structure |
vars | pointer to store the array of NLP variables, or NULL |
nvars | pointer to store the number of NLP variables, or NULL |
Definition at line 149 of file scip_nlp.c.
References FALSE, NULL, nvars, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIPcheckStage(), SCIPerrorMessage, SCIPnlpGetNVars(), SCIPnlpGetVars(), TRUE, and vars.
gets array with variables of the NLP
scip | SCIP data structure |
Definition at line 179 of file scip_nlp.c.
References FALSE, NULL, SCIP_CALL_ABORT, SCIPABORT, SCIPcheckStage(), SCIPerrorMessage, SCIPnlpGetVars(), and TRUE.
Referenced by computeStandardNLPOptimalityCut(), SCIPapplyHeurDualval(), separateCuts(), and solveSubNLP().
int SCIPgetNNLPVars | ( | SCIP * | scip | ) |
gets current number of variables in NLP
scip | SCIP data structure |
Definition at line 201 of file scip_nlp.c.
References FALSE, NULL, SCIP_CALL_ABORT, SCIPABORT, SCIPcheckStage(), SCIPerrorMessage, SCIPnlpGetNVars(), and TRUE.
Referenced by computeStandardNLPOptimalityCut(), countNonlinearities(), initBounds(), SCIPapplyHeurDualval(), separateCuts(), and solveSubNLP().
SCIP_RETCODE SCIPgetNLPVarsNonlinearity | ( | SCIP * | scip, |
int * | nlcount ) |
computes for each variables the number of NLP rows in which the variable appears in the nonlinear part
scip | SCIP data structure |
nlcount | an array of length at least SCIPnlpGetNVars() to store nonlinearity counts of variables |
Definition at line 223 of file scip_nlp.c.
References FALSE, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIPcheckStage(), SCIPerrorMessage, SCIPnlpGetVarsNonlinearity(), and TRUE.
Referenced by countNonlinearities(), and initBounds().
returns dual solution values associated with lower bounds of NLP variables
scip | SCIP data structure |
Definition at line 247 of file scip_nlp.c.
References FALSE, NULL, SCIP_CALL_ABORT, SCIP_Real, SCIPABORT, SCIPcheckStage(), SCIPerrorMessage, SCIPnlpGetVarsLbDualsol(), and TRUE.
returns dual solution values associated with upper bounds of NLP variables
scip | SCIP data structure |
Definition at line 269 of file scip_nlp.c.
References FALSE, NULL, SCIP_CALL_ABORT, SCIP_Real, SCIPABORT, SCIPcheckStage(), SCIPerrorMessage, SCIPnlpGetVarsUbDualsol(), and TRUE.
SCIP_RETCODE SCIPgetNLPNlRowsData | ( | SCIP * | scip, |
SCIP_NLROW *** | nlrows, | ||
int * | nnlrows ) |
gets current NLP nonlinear rows along with the current number of NLP nonlinear rows
scip | SCIP data structure |
nlrows | pointer to store the array of NLP nonlinear rows, or NULL |
nnlrows | pointer to store the number of NLP nonlinear rows, or NULL |
Definition at line 291 of file scip_nlp.c.
References FALSE, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIPcheckStage(), SCIPerrorMessage, SCIPnlpGetNlRows(), SCIPnlpGetNNlRows(), and TRUE.
SCIP_NLROW ** SCIPgetNLPNlRows | ( | SCIP * | scip | ) |
gets array with nonlinear rows of the NLP
scip | SCIP data structure |
Definition at line 319 of file scip_nlp.c.
References FALSE, NULL, SCIP_CALL_ABORT, SCIPABORT, SCIPcheckStage(), SCIPerrorMessage, SCIPnlpGetNlRows(), and TRUE.
Referenced by applyHeur(), applyNlobbt(), computeInteriorPoint(), computeStandardNLPFeasibilityCut(), computeStandardNLPOptimalityCut(), createAuxiliaryNonlinearSubproblem(), createNLP(), heurExec(), isNlobbtApplicable(), SCIP_DECL_HEUREXEC(), SCIP_DECL_RELAXEXEC(), SCIP_DECL_SEPAEXECLP(), SCIP_DECL_SEPAEXECLP(), and SCIP_DECL_SEPAEXECLP().
int SCIPgetNNLPNlRows | ( | SCIP * | scip | ) |
gets current number of nonlinear rows in NLP
scip | SCIP data structure |
Definition at line 341 of file scip_nlp.c.
References FALSE, NULL, SCIP_CALL_ABORT, SCIPABORT, SCIPcheckStage(), SCIPerrorMessage, SCIPnlpGetNNlRows(), and TRUE.
Referenced by addRegularScholtes(), applyHeur(), applyNlobbt(), computeInteriorPoint(), computeStandardNLPFeasibilityCut(), computeStandardNLPOptimalityCut(), createAuxiliaryNonlinearSubproblem(), createNLP(), heurExec(), isNlobbtApplicable(), SCIP_DECL_HEUREXEC(), SCIP_DECL_RELAXEXEC(), SCIP_DECL_SEPAEXECLP(), SCIP_DECL_SEPAEXECLP(), and SCIP_DECL_SEPAEXECLP().
SCIP_RETCODE SCIPgetNLPNlRowsStat | ( | SCIP * | scip, |
int * | nlinear, | ||
int * | nconvexineq, | ||
int * | nnonconvexineq, | ||
int * | nnonlineareq ) |
gets statistics on convexity of rows in NLP
Reports counts on the current number of linear rows, convex inequalities, nonconvex inequalities, and nonlinear equalities or ranged rows.
scip | SCIP data structure |
nlinear | buffer to store number of linear rows in NLP, or NULL |
nconvexineq | buffer to store number of convex inequalities in NLP, or NULL |
nnonconvexineq | buffer to store number of nonconvex inequalities in NLP, or NULL |
nnonlineareq | buffer to store number of nonlinear equalities or ranged rows in NLP, or NULL |
Definition at line 369 of file scip_nlp.c.
References FALSE, NULL, SCIP_CALL, SCIP_ERROR, SCIP_OKAY, SCIPcheckStage(), SCIPerrorMessage, SCIPnlpGetNlRowsStat(), and TRUE.
Referenced by SCIPprintNLPStatistics().
SCIP_RETCODE SCIPaddNlRow | ( | SCIP * | scip, |
SCIP_NLROW * | nlrow ) |
adds a nonlinear row to the NLP. This row is captured by the NLP.
scip | SCIP data structure |
nlrow | nonlinear row to add to NLP |
Definition at line 396 of file scip_nlp.c.
References FALSE, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIPblkmem(), SCIPcheckStage(), SCIPerrorMessage, SCIPnlpAddNlRow(), and TRUE.
Referenced by addKnapsackConstraints(), addLinearConstraints(), addLogicOrConstraints(), addNlrow(), addNlrow(), addNlrow(), addNlrow(), addNlrow(), addNlrow(), addNlrow(), addSetppcConstraints(), addVarboundConstraints(), initSolve(), SCIP_DECL_CONSINITSOL(), and SCIP_DECL_CONSINITSOL().
SCIP_RETCODE SCIPdelNlRow | ( | SCIP * | scip, |
SCIP_NLROW * | nlrow ) |
removes a nonlinear row from the NLP
This row is released in the NLP.
scip | SCIP data structure |
nlrow | nonlinear row to add to NLP |
Definition at line 424 of file scip_nlp.c.
References FALSE, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIPblkmem(), SCIPcheckStage(), SCIPerrorMessage, SCIPnlpDelNlRow(), and TRUE.
Referenced by deinitSolve(), SCIP_DECL_CONSDEACTIVE(), SCIP_DECL_CONSDEACTIVE(), SCIP_DECL_CONSDEACTIVE(), SCIP_DECL_CONSDEACTIVE(), SCIP_DECL_CONSDEACTIVE(), SCIP_DECL_CONSDEACTIVE(), and SCIP_DECL_CONSDEACTIVE().
SCIP_RETCODE SCIPflushNLP | ( | SCIP * | scip | ) |
makes sure that the NLP of the current node is flushed
scip | SCIP data structure |
Definition at line 448 of file scip_nlp.c.
References FALSE, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIPcheckStage(), SCIPerrorMessage, SCIPnlpFlush(), and TRUE.
SCIP_RETCODE SCIPsetNLPInitialGuess | ( | SCIP * | scip, |
SCIP_Real * | initialguess ) |
sets or clears initial primal guess for NLP solution (start point for NLP solver)
scip | SCIP data structure |
initialguess | values of initial guess (corresponding to variables from SCIPgetNLPVarsData), or NULL to use no start point |
Definition at line 474 of file scip_nlp.c.
References FALSE, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIP_Real, SCIPblkmem(), SCIPcheckStage(), SCIPerrorMessage, SCIPnlpSetInitialGuess(), and TRUE.
Referenced by SCIPapplyHeurDualval(), and solveSubNLP().
SCIP_RETCODE SCIPsetNLPInitialGuessSol | ( | SCIP * | scip, |
SCIP_SOL * | sol ) |
sets initial primal guess for NLP solution (start point for NLP solver)
scip | SCIP data structure |
sol | solution which values should be taken as initial guess, or NULL for LP solution |
Definition at line 501 of file scip_nlp.c.
References FALSE, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPblkmem(), SCIPcheckStage(), SCIPerrorMessage, SCIPfreeBufferArray, SCIPgetSolVals(), SCIPnlpGetNVars(), SCIPnlpGetVars(), SCIPnlpSetInitialGuess(), sol, and TRUE.
Referenced by computeFixingrate(), getFixingValue(), and SCIP_DECL_HEUREXEC().
SCIP_RETCODE SCIPsolveNLPParam | ( | SCIP * | scip, |
SCIP_NLPPARAM | param ) |
solves the current NLP (or diving NLP if in diving mode) with given parameters
Typical use is
SCIP_NLPPARAM nlparam = { SCIP_NLPPARAM_DEFAULT(scip); } nlpparam.iterlimit = 42; SCIP_CALL( SCIPsolveNLPParam(scip, nlpparam) );
or, in one line:
SCIP_CALL( SCIPsolveNLPParam(scip, (SCIP_NLPPARAM){ SCIP_NLPPARAM_DEFAULT(scip), .iterlimit = 42 }) );
To get the latter, also SCIPsolveNLP can be used.
scip | SCIP data structure |
param | NLP solve parameters |
Definition at line 545 of file scip_nlp.c.
References FALSE, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIPblkmem(), SCIPcheckStage(), SCIPerrorMessage, SCIPnlpSolve(), and TRUE.
Referenced by resolveNLPWithTighterFeastol(), SCIPbendersComputeSubproblemLowerbound(), and SCIPbendersSolveSubproblemLP().
SCIP_NLPSOLSTAT SCIPgetNLPSolstat | ( | SCIP * | scip | ) |
gets solution status of current NLP
scip | SCIP data structure |
Definition at line 574 of file scip_nlp.c.
References FALSE, NULL, SCIP_CALL_ABORT, SCIP_NLPSOLSTAT_UNKNOWN, SCIPABORT, SCIPcheckStage(), SCIPerrorMessage, SCIPnlpGetSolstat(), and TRUE.
Referenced by computeFixingrate(), computeStandardNLPFeasibilityCut(), computeStandardNLPOptimalityCut(), getFixingValue(), resolveNLPWithTighterFeastol(), SCIP_DECL_BENDERSCUTEXEC(), SCIP_DECL_BENDERSCUTEXEC(), SCIP_DECL_BENDERSCUTEXEC(), SCIP_DECL_HEUREXEC(), SCIPapplyHeurDualval(), SCIPbendersComputeSubproblemLowerbound(), SCIPbendersSolveSubproblemLP(), solveSubNLP(), and storeSolution().
SCIP_NLPTERMSTAT SCIPgetNLPTermstat | ( | SCIP * | scip | ) |
gets termination status of last NLP solve
scip | SCIP data structure |
Definition at line 596 of file scip_nlp.c.
References FALSE, NULL, SCIP_CALL_ABORT, SCIP_NLPTERMSTAT_OTHER, SCIPABORT, SCIPcheckStage(), SCIPerrorMessage, SCIPnlpGetTermstat(), and TRUE.
Referenced by resolveNLPWithTighterFeastol(), SCIP_DECL_HEUREXEC(), SCIPbendersComputeSubproblemLowerbound(), SCIPbendersSolveSubproblemLP(), and solveSubNLP().
SCIP_RETCODE SCIPgetNLPStatistics | ( | SCIP * | scip, |
SCIP_NLPSTATISTICS * | statistics ) |
gives statistics (number of iterations, solving time, ...) of last NLP solve
scip | SCIP data structure |
statistics | pointer to store statistics |
Definition at line 621 of file scip_nlp.c.
References FALSE, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIPcheckStage(), SCIPerrorMessage, SCIPnlpGetStatistics(), and TRUE.
Referenced by SCIP_DECL_HEUREXEC(), and solveSubNLP().
gets objective value of current NLP
scip | SCIP data structure |
Definition at line 645 of file scip_nlp.c.
References FALSE, NULL, SCIP_CALL_ABORT, SCIP_INVALID, SCIP_Real, SCIPcheckStage(), SCIPerrorMessage, SCIPnlpGetObjval(), and TRUE.
Referenced by processNLPSol(), SCIP_DECL_HEUREXEC(), SCIPbendersComputeSubproblemLowerbound(), SCIPbendersSolveSubproblemLP(), separateCuts(), and solveSubNLP().
indicates whether a solution for the current NLP is available
The solution may be optimal, feasible, or infeasible. Thus, returns whether the NLP solution status is at most SCIP_NLPSOLSTAT_LOCINFEASIBLE.
scip | SCIP data structure |
Definition at line 671 of file scip_nlp.c.
References FALSE, NULL, SCIP_Bool, SCIP_CALL_ABORT, SCIPABORT, SCIPcheckStage(), SCIPerrorMessage, SCIPnlpHasSolution(), and TRUE.
Referenced by computeStandardNLPOptimalityCut(), createSolFromNLP(), and processNLPSol().
SCIP_RETCODE SCIPgetNLPFracVars | ( | SCIP * | scip, |
SCIP_VAR *** | fracvars, | ||
SCIP_Real ** | fracvarssol, | ||
SCIP_Real ** | fracvarsfrac, | ||
int * | nfracvars, | ||
int * | npriofracvars ) |
gets fractional variables of last NLP solution along with solution values and fractionalities
scip | SCIP data structure |
fracvars | pointer to store the array of NLP fractional variables, or NULL |
fracvarssol | pointer to store the array of NLP fractional variables solution values, or NULL |
fracvarsfrac | pointer to store the array of NLP fractional variables fractionalities, or NULL |
nfracvars | pointer to store the number of NLP fractional variables , or NULL |
npriofracvars | pointer to store the number of NLP fractional variables with maximal branching priority, or NULL |
Definition at line 696 of file scip_nlp.c.
References FALSE, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIP_Real, SCIPblkmem(), SCIPcheckStage(), SCIPerrorMessage, SCIPnlpGetFracVars(), and TRUE.
Referenced by getNLPFracVars().
SCIP_RETCODE SCIPwriteNLP | ( | SCIP * | scip, |
const char * | filename ) |
writes current NLP to a file
scip | SCIP data structure |
filename | file name |
Definition at line 727 of file scip_nlp.c.
References FALSE, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIPcheckStage(), SCIPerrorMessage, SCIPnlpWrite(), and TRUE.
Referenced by SCIP_DECL_DIALOGEXEC().
SCIP_RETCODE SCIPgetNLPI | ( | SCIP * | scip, |
SCIP_NLPI ** | nlpi, | ||
SCIP_NLPIPROBLEM ** | nlpiproblem ) |
gets the NLP interface and problem used by the SCIP NLP
scip | SCIP data structure |
nlpi | pointer to store the NLP solver interface |
nlpiproblem | pointer to store the NLP solver interface problem |
Definition at line 762 of file scip_nlp.c.
References assert(), FALSE, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIPcheckStage(), SCIPerrorMessage, SCIPnlpGetNLPI(), SCIPnlpGetNLPIProblem(), and TRUE.