scip_nlp.h
Go to the documentation of this file.
32/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
60 * If the NLP relaxation is enabled, then SCIP will construct the NLP relaxation when the solving process is about to begin.
80 * This method is typically called by a constraint handler that handles constraints that have a nonlinear representation as nonlinear rows, e.g., cons_nonlinear.
82 * The function should be called before the branch-and-bound process is initialized, e.g., when presolve is exiting.
153/** computes for each variables the number of NLP rows in which the variable appears in the nonlinear part
162 int* nlcount /**< an array of length at least SCIPnlpGetNVars() to store nonlinearity counts of variables */
224 * Reports counts on the current number of linear rows, convex inequalities, nonconvex inequalities, and nonlinear equalities or ranged rows.
225 * - A nonlinear inequality with infinity left-hand-side is accounted as convex if its expression has been marked as convex.
226 * - A nonlinear inequality with infinity right-hand-side is accounted as convex if its expression has been marked as concave.
227 * - Other nonlinear rows are accounted as nonconvex. Note that convexity for a nonlinear row may just not have been detected.
240 int* nnonlineareq /**< buffer to store number of nonlinear equalities or ranged rows in NLP, or NULL */
284 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
294 SCIP_Real* initialguess /**< values of initial guess (corresponding to variables from SCIPgetNLPVarsData), or NULL to use no start point */
299 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
309 SCIP_SOL* sol /**< solution which values should be taken as initial guess, or NULL for LP solution */
322 * SCIP_CALL( SCIPsolveNLPParam(scip, (SCIP_NLPPARAM){ SCIP_NLPPARAM_DEFAULT(scip), .iterlimit = 42 }) );
326 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
339/** solves the current NLP (or diving NLP if in diving mode) with non-default parameters given as optional arguments
350 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
357/* the scip argument has been made part of the variadic arguments, since ISO C99 requires at least one argument for the "..." part and we want to allow leaving all parameters at default
358 * for the same reason, we have the .caller argument, so that macro SCIP_VARARGS_REST will have at least one arg to return
363 (SCIP_NLPPARAM){ SCIP_NLPPARAM_DEFAULT_INITS(SCIP_VARARGS_FIRST((__VA_ARGS__, ignored))), SCIP_VARARGS_REST(__VA_ARGS__, .caller = __FILE__) })
365/* very old MSVC doesn't support C99's designated initializers, so have a version of SCIPsolveNLP() that just ignores given parameters
397 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
435/** gets fractional variables of last NLP solution along with solution values and fractionalities
437 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
448 SCIP_Real** fracvarssol, /**< pointer to store the array of NLP fractional variables solution values, or NULL */
449 SCIP_Real** fracvarsfrac, /**< pointer to store the array of NLP fractional variables fractionalities, or NULL */
451 int* npriofracvars /**< pointer to store the number of NLP fractional variables with maximal branching priority, or NULL */
456 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
471 * @warning With the NLPI and its problem, all methods defined in \ref scip_nlpi.h and \ref pub_nlpi.h can be used.
472 * It needs to be ensured that the full internal state of the NLPI does not change or is recovered completely
473 * after the end of the method that uses the NLPI. In particular, if the NLP or its solution is manipulated
474 * (e.g. by calling one of the SCIPaddNlpi...() or the SCIPsolveNlpi() method), one has to check in advance
475 * whether the NLP is currently solved. If this is the case, one has to make sure that the internal solution
479 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
501 * Makes functions SCIPchgVarObjDiveNLP(), SCIPchgVarBoundsDiveNLP() and SCIPchgVarsBoundsDiveNLP() available.
504 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
518 * Resets changes made by SCIPchgVarObjDiveNLP(), SCIPchgVarBoundsDiveNLP(), and SCIPchgVarsBoundsDiveNLP().
520 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
534 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
550 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
567 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
592 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
617 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
636 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
653 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
669 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
686 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
703 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
720 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
745 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
763 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
785 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
803 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
820 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
836 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
850/** gives the feasibility of a nonlinear row in the last NLP solution: negative value means infeasibility
852 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
868 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
883 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
897/** gives the feasibility of a nonlinear row for the current pseudo solution: negative value means infeasibility
899 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
915 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
930 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
946 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
960/** gives the activity of a nonlinear row for the given primal solution or NLP solution or pseudo solution
962 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
979 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
996 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1014 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPchgVarsBoundsDiveNLP(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_Real *lbs, SCIP_Real *ubs)
Definition: scip_nlp.c:917
SCIP_RETCODE SCIPchgVarBoundsDiveNLP(SCIP *scip, SCIP_VAR *var, SCIP_Real lb, SCIP_Real ub)
Definition: scip_nlp.c:886
SCIP_RETCODE SCIPchgVarObjDiveNLP(SCIP *scip, SCIP_VAR *var, SCIP_Real coef)
Definition: scip_nlp.c:856
SCIP_RETCODE SCIPhasNLPContinuousNonlinearity(SCIP *scip, SCIP_Bool *result)
Definition: scip_nlp.c:125
SCIP_RETCODE SCIPsetNLPInitialGuess(SCIP *scip, SCIP_Real *initialguess)
Definition: scip_nlp.c:474
SCIP_RETCODE SCIPsolveNLPParam(SCIP *scip, SCIP_NLPPARAM param)
Definition: scip_nlp.c:545
SCIP_RETCODE SCIPgetNLPI(SCIP *scip, SCIP_NLPI **nlpi, SCIP_NLPIPROBLEM **nlpiproblem)
Definition: scip_nlp.c:762
SCIP_RETCODE SCIPgetNLPFracVars(SCIP *scip, SCIP_VAR ***fracvars, SCIP_Real **fracvarssol, SCIP_Real **fracvarsfrac, int *nfracvars, int *npriofracvars)
Definition: scip_nlp.c:696
SCIP_RETCODE SCIPsetNLPInitialGuessSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip_nlp.c:501
SCIP_RETCODE SCIPgetNLPVarsNonlinearity(SCIP *scip, int *nlcount)
Definition: scip_nlp.c:223
SCIP_RETCODE SCIPgetNLPNlRowsData(SCIP *scip, SCIP_NLROW ***nlrows, int *nnlrows)
Definition: scip_nlp.c:291
SCIP_RETCODE SCIPgetNLPNlRowsStat(SCIP *scip, int *nlinear, int *nconvexineq, int *nnonconvexineq, int *nnonlineareq)
Definition: scip_nlp.c:369
SCIP_RETCODE SCIPgetNLPVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars)
Definition: scip_nlp.c:149
SCIP_RETCODE SCIPgetNLPStatistics(SCIP *scip, SCIP_NLPSTATISTICS *statistics)
Definition: scip_nlp.c:621
SCIP_RETCODE SCIPsetNlRowExpr(SCIP *scip, SCIP_NLROW *nlrow, SCIP_EXPR *expr)
Definition: scip_nlp.c:1248
SCIP_RETCODE SCIPgetNlRowActivityBounds(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *minactivity, SCIP_Real *maxactivity)
Definition: scip_nlp.c:1577
SCIP_RETCODE SCIPaddLinearCoefToNlRow(SCIP *scip, SCIP_NLROW *nlrow, SCIP_VAR *var, SCIP_Real val)
Definition: scip_nlp.c:1161
SCIP_RETCODE SCIPcaptureNlRow(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip_nlp.c:1035
SCIP_RETCODE SCIPrecalcNlRowNLPActivity(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip_nlp.c:1274
SCIP_RETCODE SCIPcreateEmptyNlRow(SCIP *scip, SCIP_NLROW **nlrow, const char *name, SCIP_Real lhs, SCIP_Real rhs)
Definition: scip_nlp.c:986
SCIP_RETCODE SCIPgetNlRowSolFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_SOL *sol, SCIP_Real *feasibility)
Definition: scip_nlp.c:1542
SCIP_RETCODE SCIPchgNlRowLinearCoef(SCIP *scip, SCIP_NLROW *nlrow, SCIP_VAR *var, SCIP_Real coef)
Definition: scip_nlp.c:1222
SCIP_RETCODE SCIPgetNlRowActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *activity)
Definition: scip_nlp.c:1450
SCIP_RETCODE SCIPgetNlRowNLPFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *feasibility)
Definition: scip_nlp.c:1329
SCIP_RETCODE SCIPgetNlRowPseudoActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *pseudoactivity)
Definition: scip_nlp.c:1378
SCIP_RETCODE SCIPchgNlRowRhs(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real rhs)
Definition: scip_nlp.c:1103
SCIP_RETCODE SCIPreleaseNlRow(SCIP *scip, SCIP_NLROW **nlrow)
Definition: scip_nlp.c:1058
SCIP_RETCODE SCIPgetNlRowFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *feasibility)
Definition: scip_nlp.c:1479
SCIP_RETCODE SCIPchgNlRowConstant(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real constant)
Definition: scip_nlp.c:1126
SCIP_RETCODE SCIPrecalcNlRowActivity(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip_nlp.c:1422
SCIP_RETCODE SCIPchgNlRowLhs(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real lhs)
Definition: scip_nlp.c:1080
SCIP_RETCODE SCIPgetNlRowNLPActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *activity)
Definition: scip_nlp.c:1301
SCIP_RETCODE SCIPgetNlRowPseudoFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *pseudofeasibility)
Definition: scip_nlp.c:1400
SCIP_RETCODE SCIPprintNlRow(SCIP *scip, SCIP_NLROW *nlrow, FILE *file)
Definition: scip_nlp.c:1601
SCIP_RETCODE SCIPgetNlRowSolActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_SOL *sol, SCIP_Real *activity)
Definition: scip_nlp.c:1508
void SCIPsetNlRowCurvature(SCIP *scip, SCIP_NLROW *nlrow, SCIP_EXPRCURV curvature)
Definition: scip_nlp.c:1140
SCIP_RETCODE SCIPcreateNlRowFromRow(SCIP *scip, SCIP_NLROW **nlrow, SCIP_ROW *row)
Definition: scip_nlp.c:1012
SCIP_RETCODE SCIPcreateNlRow(SCIP *scip, SCIP_NLROW **nlrow, const char *name, SCIP_Real constant, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, SCIP_EXPR *expr, SCIP_Real lhs, SCIP_Real rhs, SCIP_EXPRCURV curvature)
Definition: scip_nlp.c:954
SCIP_RETCODE SCIPaddLinearCoefsToNlRow(SCIP *scip, SCIP_NLROW *nlrow, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip_nlp.c:1185
SCIP_RETCODE SCIPrecalcNlRowPseudoActivity(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip_nlp.c:1357
Definition: objbenders.h:44
public methods for NLP management
Definition: struct_expr.h:106
Definition: struct_nlp.h:65
Definition: type_nlpi.h:67
Definition: type_nlpi.h:198
Definition: nlpi_all.c:56
Definition: struct_nlpi.h:47
Definition: struct_lp.h:202
Definition: struct_sol.h:74
Definition: struct_var.h:208
Definition: struct_scip.h:70
type and macro definitions related to algebraic expressions
type definitions for LP management
type definitions for NLP management
type definitions for NLP solver interfaces
type definitions for return codes for SCIP methods
type definitions for SCIP's main datastructure
type definitions for storing primal CIP solutions
type definitions for problem variables