Detailed Description
constraint handler for nonlinear constraints specified by algebraic expressions
Definition in file cons_nonlinear.c.
#include <assert.h>
#include <ctype.h>
#include "scip/cons_nonlinear.h"
#include "scip/nlhdlr.h"
#include "scip/expr_var.h"
#include "scip/expr_sum.h"
#include "scip/expr_value.h"
#include "scip/expr_pow.h"
#include "scip/nlhdlr_convex.h"
#include "scip/cons_linear.h"
#include "scip/cons_varbound.h"
#include "scip/cons_and.h"
#include "scip/cons_bounddisjunction.h"
#include "scip/heur_subnlp.h"
#include "scip/heur_trysol.h"
#include "scip/nlpi_ipopt.h"
#include "scip/debug.h"
#include "scip/dialog_default.h"
Go to the source code of this file.
Data Structures | |
struct | EXPRENFO |
struct | CONSUPGRADE |
struct | BRANCHCAND |
Macro Definition Documentation
◆ CONSHDLR_NAME
#define CONSHDLR_NAME "nonlinear" |
Definition at line 67 of file cons_nonlinear.c.
Referenced by SCIP_DECL_CONSCOPY(), SCIP_DECL_CONSEXITSOL(), SCIP_DECL_CONSHDLRCOPY(), SCIP_DECL_CONSINITSOL(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_TABLEOUTPUT(), SCIPaddExprNonlinear(), SCIPaddLinearVarNonlinear(), SCIPcheckQuadraticNonlinear(), SCIPchgExprNonlinear(), SCIPchgLhsNonlinear(), SCIPchgRhsNonlinear(), SCIPcreateConsNonlinear(), SCIPcreateConsQuadraticNonlinear(), SCIPgetCurvatureNonlinear(), SCIPgetExprNonlinear(), SCIPgetLhsNonlinear(), SCIPgetNlRowNonlinear(), SCIPgetRhsNonlinear(), SCIPincludeConshdlrNonlinear(), SCIPincludeConsUpgradeNonlinear(), and SCIPincludeNlhdlrNonlinear().
◆ CONSHDLR_DESC
#define CONSHDLR_DESC "handler for nonlinear constraints specified by algebraic expressions" |
Definition at line 68 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ CONSHDLR_ENFOPRIORITY
#define CONSHDLR_ENFOPRIORITY -60 |
priority of the constraint handler for constraint enforcing
Definition at line 69 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ CONSHDLR_CHECKPRIORITY
#define CONSHDLR_CHECKPRIORITY -4000010 |
priority of the constraint handler for checking feasibility
Definition at line 70 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ CONSHDLR_EAGERFREQ
#define CONSHDLR_EAGERFREQ 100 |
frequency for using all instead of only the useful constraints in separation, propagation and enforcement, -1 for no eager evaluations, 0 for first only
Definition at line 71 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ CONSHDLR_NEEDSCONS
#define CONSHDLR_NEEDSCONS TRUE |
should the constraint handler be skipped, if no constraints are available?
Definition at line 74 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ CONSHDLR_SEPAPRIORITY
#define CONSHDLR_SEPAPRIORITY 10 |
priority of the constraint handler for separation
Definition at line 77 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ CONSHDLR_SEPAFREQ
#define CONSHDLR_SEPAFREQ 1 |
frequency for separating cuts; zero means to separate only in the root node
Definition at line 78 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ CONSHDLR_DELAYSEPA
#define CONSHDLR_DELAYSEPA FALSE |
should separation method be delayed, if other separators found cuts?
Definition at line 79 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ CONSHDLR_PROPFREQ
#define CONSHDLR_PROPFREQ 1 |
frequency for propagating domains; zero means only preprocessing propagation
Definition at line 81 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ CONSHDLR_DELAYPROP
#define CONSHDLR_DELAYPROP FALSE |
should propagation method be delayed, if other propagators found reductions?
Definition at line 82 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ CONSHDLR_PROP_TIMING
#define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP |
propagation timing mask of the constraint handler
Definition at line 83 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ CONSHDLR_PRESOLTIMING
#define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_ALWAYS |
presolving timing of the constraint handler (fast, medium, or exhaustive)
Definition at line 85 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ CONSHDLR_MAXPREROUNDS
#define CONSHDLR_MAXPREROUNDS -1 |
maximal number of presolving rounds the constraint handler participates in (-1: no limit)
Definition at line 86 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ TABLE_NAME_NONLINEAR
#define TABLE_NAME_NONLINEAR "cons_nonlinear" |
Definition at line 89 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ TABLE_DESC_NONLINEAR
#define TABLE_DESC_NONLINEAR "nonlinear constraint handler statistics" |
Definition at line 90 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ TABLE_POSITION_NONLINEAR
#define TABLE_POSITION_NONLINEAR 14600 |
the position of the statistics table
Definition at line 91 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ TABLE_EARLIEST_STAGE_NONLINEAR
#define TABLE_EARLIEST_STAGE_NONLINEAR SCIP_STAGE_TRANSFORMED |
output of the statistics table is only printed from this stage onwards
Definition at line 92 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ TABLE_NAME_NLHDLR
#define TABLE_NAME_NLHDLR "nlhdlr" |
Definition at line 95 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ TABLE_DESC_NLHDLR
#define TABLE_DESC_NLHDLR "nonlinear handler statistics" |
Definition at line 96 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ TABLE_POSITION_NLHDLR
#define TABLE_POSITION_NLHDLR 14601 |
the position of the statistics table
Definition at line 97 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ TABLE_EARLIEST_STAGE_NLHDLR
#define TABLE_EARLIEST_STAGE_NLHDLR SCIP_STAGE_PRESOLVING |
output of the statistics table is only printed from this stage onwards
Definition at line 98 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ DIALOG_NAME
#define DIALOG_NAME "nlhdlrs" |
Definition at line 100 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ DIALOG_DESC
#define DIALOG_DESC "display nonlinear handlers" |
Definition at line 101 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ DIALOG_ISSUBMENU
#define DIALOG_ISSUBMENU FALSE |
Definition at line 102 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ VERTEXPOLY_MAXPERTURBATION
#define VERTEXPOLY_MAXPERTURBATION 1e-3 |
maximum perturbation
Definition at line 104 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ VERTEXPOLY_USEDUALSIMPLEX
#define VERTEXPOLY_USEDUALSIMPLEX TRUE |
use dual or primal simplex algorithm?
Definition at line 105 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ VERTEXPOLY_RANDNUMINITSEED
#define VERTEXPOLY_RANDNUMINITSEED 20181029 |
seed for random number generator, which is used to move points away from the boundary
Definition at line 106 of file cons_nonlinear.c.
Referenced by computeVertexPolyhedralFacetLP().
◆ VERTEXPOLY_ADJUSTFACETFACTOR
#define VERTEXPOLY_ADJUSTFACETFACTOR 1e1 |
adjust resulting facets in checkRikun() up to a violation of this value times lpfeastol
Definition at line 107 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ BRANCH_RANDNUMINITSEED
#define BRANCH_RANDNUMINITSEED 20191229 |
seed for random number generator, which is used to select from several similar good branching candidates
Definition at line 109 of file cons_nonlinear.c.
Referenced by branching().
◆ BILIN_MAXNAUXEXPRS
#define BILIN_MAXNAUXEXPRS 10 |
maximal number of auxiliary expressions per bilinear term
Definition at line 111 of file cons_nonlinear.c.
Referenced by SCIPincludeConshdlrNonlinear().
◆ infty2infty
#define infty2infty | ( | infty1, | |
infty2, | |||
val | |||
) | ((val) >= (infty1) ? (infty2) : (val)) |
translate from one value of infinity to another
if val is ≥ infty1, then give infty2, else give val
Definition at line 117 of file cons_nonlinear.c.
Referenced by SCIP_DECL_EXPR_INTEVALVAR().
◆ POWEROFTWO
#define POWEROFTWO | ( | x | ) | (0x1u << (x)) |
translates x to 2^x for non-negative integer x
Definition at line 120 of file cons_nonlinear.c.
Referenced by buildVertexPolyhedralSeparationLP(), computeVertexPolyhedralFacetLP(), computeVertexPolyhedralMaxFacetError(), and SCIPcomputeFacetVertexPolyhedralNonlinear().
◆ ENFOLOG
#define ENFOLOG | ( | x | ) |
Definition at line 126 of file cons_nonlinear.c.
Referenced by addTightEstimatorCut(), addTightEstimatorCuts(), analyzeViolation(), branching(), collectBranchingCandidates(), consEnfo(), consSepa(), enforceConstraint(), enforceConstraints(), enforceExpr(), enforceExprNlhdlr(), registerBranchingCandidates(), SCIP_DECL_CONSEXIT(), SCIP_DECL_CONSINIT(), SCIPprocessRowprepNonlinear(), and scoreBranchingCandidates().
◆ consInitpreNonlinear
#define consInitpreNonlinear NULL |
presolving initialization method of constraint handler (called when presolving is about to begin)
Definition at line 9678 of file cons_nonlinear.c.
Referenced by SCIP_DECL_CONSEXIT(), and SCIPincludeConshdlrNonlinear().
◆ consRespropNonlinear
#define consRespropNonlinear NULL |
propagation conflict resolving method of constraint handler
Definition at line 10238 of file cons_nonlinear.c.
Referenced by SCIP_DECL_CONSPRESOL(), and SCIPincludeConshdlrNonlinear().
◆ consDelvarsNonlinear
#define consDelvarsNonlinear NULL |
variable deletion of constraint handler
Definition at line 10459 of file cons_nonlinear.c.
Referenced by SCIP_DECL_CONSDISABLE(), and SCIPincludeConshdlrNonlinear().
◆ consGetDiveBdChgsNonlinear
#define consGetDiveBdChgsNonlinear NULL |
constraint handler method to suggest dive bound changes during the generic diving algorithm
Definition at line 10733 of file cons_nonlinear.c.
Referenced by SCIP_DECL_CONSGETNVARS(), and SCIPincludeConshdlrNonlinear().
Function Documentation
◆ forwardPropExpr()
|
static |
propagate bounds of the expressions in a given expression tree (that is, updates activity intervals) and tries to tighten the bounds of the auxiliary variables accordingly
- Parameters
-
scip SCIP data structure conshdlr constraint handler rootexpr expression tightenauxvars should the bounds of auxiliary variables be tightened? infeasible buffer to store whether the problem is infeasible (NULL if not needed) ntightenings buffer to store the number of auxiliary variable tightenings (NULL if not needed)
Definition at line 2279 of file cons_nonlinear.c.
References FALSE, SCIP_Interval::inf, isIntervalBetter(), NULL, SCIP_Bool, SCIP_CALL, SCIP_EXPRITER_DFS, SCIP_EXPRITER_LEAVEEXPR, SCIP_EXPRITER_VISITINGCHILD, SCIP_INTERVAL_INFINITY, SCIP_NLHDLR_METHOD_ACTIVITY, SCIP_OKAY, SCIPABORT, SCIPceil(), SCIPconshdlrGetData(), SCIPcreateExpriter(), SCIPdebugMsg, SCIPdebugMsgPrint, SCIPepsilon(), SCIPerrorMessage, SCIPexprGetActivity(), SCIPexprGetActivityTag(), SCIPexprGetHdlr(), SCIPexprGetNChildren(), SCIPexprGetOwnerData(), SCIPexprhdlrGetName(), SCIPexprIsIntegral(), SCIPexpriterGetChildExprDFS(), SCIPexpriterGetCurrent(), SCIPexpriterGetNext(), SCIPexpriterGetStageDFS(), SCIPexpriterInit(), SCIPexpriterIsEnd(), SCIPexpriterSetStagesDFS(), SCIPexpriterSkipDFS(), SCIPexprSetActivity(), SCIPfloor(), SCIPfreeExpriter(), SCIPgetVarExprVar(), SCIPintervalIntersectEps(), SCIPintervalIsEmpty(), SCIPintervalSetEmpty(), SCIPintervalSetEntire(), SCIPisExprVar(), SCIPisInfinity(), SCIPisRelEQ(), SCIPnlhdlrGetName(), SCIPnlhdlrHasIntEval(), SCIPprintExpr(), SCIPvarGetName(), SCIP_Interval::sup, tightenAuxVarBounds(), and TRUE.
Referenced by enforceConstraint(), presolveRedundantConss(), propConss(), SCIP_DECL_EXPR_OWNEREVALACTIVITY(), and tightenAuxVarBounds().
◆ freeAuxVar()
|
static |
frees auxiliary variables of expression, if any
- Parameters
-
scip SCIP data structure expr expression which auxvar to free, if any
Definition at line 367 of file cons_nonlinear.c.
References freeEnfoData(), NULL, SCIP_CALL, SCIP_OKAY, SCIPaddVarLocks(), SCIPdebugMsg, SCIPexprGetOwnerData(), SCIPreleaseVar(), and SCIPvarGetName().
Referenced by freeEnfoData().
◆ freeEnfoData()
|
static |
frees data used for enforcement of expression, that is, nonlinear handlers
can also clear indicators whether expr needs enforcement methods, that is, free an associated auxiliary variable and reset the nactivityuses counts
- Parameters
-
scip SCIP data structure expr expression whose enforcement data will be released freeauxvar whether aux var should be released and activity usage counts be reset
Definition at line 403 of file cons_nonlinear.c.
References FALSE, freeAuxVar(), NULL, SCIP_CALL, SCIP_DECL_EXPR_OWNERFREE(), SCIP_OKAY, SCIPexprGetOwnerData(), SCIPfreeBlockMemory, and SCIPfreeBlockMemoryArrayNull.
Referenced by deinitSolve(), detectNlhdlrs(), freeAuxVar(), SCIP_DECL_EXPR_OWNERFREE(), and SCIPregisterExprUsageNonlinear().
◆ SCIP_DECL_EXPR_OWNERFREE()
|
static |
callback that frees data that this conshdlr stored in an expression
Definition at line 466 of file cons_nonlinear.c.
References freeEnfoData(), NULL, SCIP_CALL, SCIP_DECL_EXPR_OWNERPRINT(), SCIP_OKAY, SCIPconshdlrGetData(), SCIPfreeBlockMemory, SCIPfreeBlockMemoryArrayNull, SCIPgetVarExprVar(), SCIPhashmapGetImage(), SCIPhashmapRemove(), SCIPisExprVar(), and TRUE.
Referenced by freeEnfoData().
◆ SCIP_DECL_EXPR_OWNERPRINT()
|
static |
Definition at line 518 of file cons_nonlinear.c.
References NULL, SCIP_DECL_EXPR_OWNEREVALACTIVITY(), SCIP_NLHDLR_METHOD_ACTIVITY, SCIP_NLHDLR_METHOD_SEPAABOVE, SCIP_NLHDLR_METHOD_SEPABELOW, SCIP_OKAY, SCIPinfoMessage(), SCIPnlhdlrGetName(), SCIPvarGetLbLocal(), SCIPvarGetName(), and SCIPvarGetUbLocal().
Referenced by SCIP_DECL_EXPR_OWNERFREE().
◆ SCIP_DECL_EXPR_OWNEREVALACTIVITY()
|
static |
possibly reevaluates and then returns the activity of the expression
Reevaluate activity if currently stored is not up to date (some bound was changed since last evaluation).
Definition at line 559 of file cons_nonlinear.c.
References FALSE, forwardPropExpr(), NULL, SCIP_CALL, SCIP_DECL_EXPR_OWNERCREATE(), SCIP_OKAY, SCIPconshdlrGetData(), and SCIPexprGetActivityTag().
Referenced by SCIP_DECL_EXPR_OWNERPRINT().
◆ SCIP_DECL_EXPR_OWNERCREATE()
|
static |
callback that creates data that this conshdlr wants to store in an expression
Definition at line 583 of file cons_nonlinear.c.
References createExprVar(), NULL, SCIP_CALL, SCIP_OKAY, SCIPallocClearBlockMemory, SCIPconshdlrGetData(), SCIPgetVarExprVar(), SCIPhashmapExists(), SCIPhashmapGetImage(), SCIPhashmapInsert(), and SCIPisExprVar().
Referenced by SCIP_DECL_EXPR_OWNEREVALACTIVITY().
◆ createExprVar()
|
static |
creates a variable expression or retrieves from hashmap in conshdlr data
- Parameters
-
scip SCIP data structure conshdlr nonlinear constraint handler expr pointer where to store expression var variable to be stored
Definition at line 633 of file cons_nonlinear.c.
References NULL, SCIP_CALL, SCIP_DECL_EXPR_MAPEXPR(), SCIP_OKAY, SCIPcaptureExpr(), SCIPconshdlrGetData(), SCIPcreateExprVar(), and SCIPhashmapGetImage().
Referenced by getBinaryProductExpr(), getBinaryProductExprDo(), reformulateFactorizedBinaryQuadratic(), SCIP_DECL_EXPR_MAPEXPR(), SCIP_DECL_EXPR_OWNERCREATE(), and SCIPaddLinearVarNonlinear().
◆ SCIP_DECL_EXPR_MAPEXPR() [1/2]
|
static |
Definition at line 666 of file cons_nonlinear.c.
References createExprVar(), NULL, SCIP_CALL, SCIP_OKAY, SCIPgetVarExprVar(), and SCIPisExprVar().
Referenced by createExprVar().
◆ SCIP_DECL_EXPR_MAPEXPR() [2/2]
|
static |
Definition at line 688 of file cons_nonlinear.c.
References createExprVar(), NULL, SCIP_CALL, SCIP_OKAY, SCIPgetTransformedVar(), SCIPgetVarExprVar(), SCIPisExprVar(), and storeVarExprs().
◆ storeVarExprs()
|
static |
stores all variable expressions into a given constraint
- Parameters
-
scip SCIP data structure conshdlr constraint handler consdata constraint data
Definition at line 718 of file cons_nonlinear.c.
References freeVarExprs(), NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemoryArray, SCIPconshdlrGetData(), SCIPgetExprNVars(), SCIPgetExprVarExprs(), SCIPgetNVars(), SCIPgetVarExprVar(), SCIPhashmapExists(), SCIPhashmapInsert(), and SCIPreallocBlockMemoryArray.
Referenced by canonicalizeConstraints(), getConsRelViolation(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSGETNVARS(), SCIP_DECL_CONSGETVARS(), SCIP_DECL_CONSINIT(), and SCIP_DECL_EXPR_MAPEXPR().
◆ freeVarExprs()
|
static |
frees all variable expression stored in storeVarExprs()
- Parameters
-
scip SCIP data structure consdata constraint data
Definition at line 782 of file cons_nonlinear.c.
References NULL, SCIP_CALL, SCIP_DECL_EXPR_INTEVALVAR(), SCIP_OKAY, SCIPfreeBlockMemoryArrayNull, and SCIPreleaseExpr().
Referenced by canonicalizeConstraints(), SCIP_DECL_CONSDEACTIVE(), SCIP_DECL_CONSDELETE(), SCIP_DECL_CONSEXIT(), and storeVarExprs().
◆ SCIP_DECL_EXPR_INTEVALVAR() [1/2]
|
static |
interval evaluation of variables as used in bound tightening
Returns slightly relaxed local variable bounds of a variable as interval. Does not relax beyond integer values, thus does not relax bounds on integer variables at all.
Definition at line 820 of file cons_nonlinear.c.
References EPSFRAC, EPSROUND, infty2infty, MAX, NULL, REALABS, SCIP_DECL_SORTPTRCOMP(), SCIP_INTERVAL_INFINITY, SCIP_Real, SCIP_VARTYPE_IMPLINT, SCIPABORT, SCIPerrorMessage, SCIPinfinity(), SCIPintervalSetBounds(), SCIPisInfinity(), SCIPvarGetLbGlobal(), SCIPvarGetLbLocal(), SCIPvarGetType(), SCIPvarGetUbGlobal(), SCIPvarGetUbLocal(), and SCIPvarIsIntegral().
Referenced by freeVarExprs(), and presolveMergeConss().
◆ SCIP_DECL_SORTPTRCOMP() [1/3]
|
static |
compares two nonlinear constraints by its index
Usable as compare operator in array sort functions.
Definition at line 947 of file cons_nonlinear.c.
References NULL, SCIP_DECL_EVENTEXEC(), and SCIPconsGetData().
Referenced by createNlRow(), SCIP_DECL_EXPR_INTEVALVAR(), and SCIP_DECL_HASHKEYVAL().
◆ SCIP_DECL_EVENTEXEC() [1/2]
|
static |
processes variable fixing or bound change event
Definition at line 960 of file cons_nonlinear.c.
References catchVarEvent(), FALSE, SCIP_Interval::inf, NULL, SCIP_CALL, SCIP_EVENTTYPE_BOUNDCHANGED, SCIP_EVENTTYPE_BOUNDRELAXED, SCIP_EVENTTYPE_BOUNDTIGHTENED, SCIP_EVENTTYPE_FORMAT, SCIP_EVENTTYPE_VARFIXED, SCIP_OKAY, SCIP_STAGE_PRESOLVING, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPdebugMsg, SCIPeventGetType(), SCIPeventGetVar(), SCIPexprGetOwnerData(), SCIPexprSetActivity(), SCIPgetStage(), SCIPinProbing(), SCIPisExprVar(), SCIPvarGetLbGlobal(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), SCIPvarGetUbLocal(), and SCIP_Interval::sup.
Referenced by addTightEstimatorCuts(), and SCIP_DECL_SORTPTRCOMP().
◆ catchVarEvent()
|
static |
registers event handler to catch variable events on variable
Additionally, the given constraint is stored in the ownerdata of the variable-expression. When an event occurs, all stored constraints are notified.
- Parameters
-
scip SCIP data structure eventhdlr event handler expr variable expression cons nonlinear constraint
Definition at line 1056 of file cons_nonlinear.c.
References catchVarEvents(), NULL, SCIP_CALL, SCIP_EVENTTYPE_BOUNDCHANGED, SCIP_EVENTTYPE_VARFIXED, SCIP_OKAY, SCIPcatchVarEvent(), SCIPensureBlockMemoryArray, SCIPexprGetOwnerData(), SCIPgetVarExprVar(), SCIPisExprVar(), and TRUE.
Referenced by catchVarEvents(), and SCIP_DECL_EVENTEXEC().
◆ catchVarEvents()
|
static |
catch variable events
- Parameters
-
scip SCIP data structure eventhdlr event handler cons constraint for which to catch bound change events
Definition at line 1111 of file cons_nonlinear.c.
References catchVarEvent(), dropVarEvent(), SCIP_Interval::inf, NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPdebugMsg, SCIPexprGetActivityTag(), SCIPexprSetActivity(), SCIPgetVarExprVar(), SCIPisExprVar(), SCIPvarGetName(), SCIP_Interval::sup, and TRUE.
Referenced by canonicalizeConstraints(), catchVarEvent(), SCIP_DECL_CONSENABLE(), and SCIP_DECL_CONSINIT().
◆ dropVarEvent()
|
static |
unregisters event handler to catch variable events on variable
The given constraint is removed from the constraints array in the ownerdata of the variable-expression. If this was the last constraint, then the event handler is unregistered for this variable.
- Parameters
-
scip SCIP data structure eventhdlr event handler expr variable expression cons expr constraint
Definition at line 1175 of file cons_nonlinear.c.
References dropVarEvents(), FALSE, NULL, SCIP_CALL, SCIP_ERROR, SCIP_EVENTTYPE_BOUNDCHANGED, SCIP_EVENTTYPE_VARFIXED, SCIP_OKAY, SCIPconsGetName(), SCIPdropVarEvent(), SCIPerrorMessage, SCIPexprGetOwnerData(), SCIPgetVarExprVar(), SCIPisExprVar(), SCIPsortedvecFindPtr(), SCIPsortPtr(), SCIPvarGetName(), and TRUE.
Referenced by catchVarEvents(), and dropVarEvents().
◆ dropVarEvents()
|
static |
drop variable events
- Parameters
-
scip SCIP data structure eventhdlr event handler cons constraint for which to drop bound change events
Definition at line 1241 of file cons_nonlinear.c.
References createCons(), dropVarEvent(), FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsGetName(), and SCIPdebugMsg.
Referenced by canonicalizeConstraints(), dropVarEvent(), SCIP_DECL_CONSDEACTIVE(), SCIP_DECL_CONSDISABLE(), and SCIP_DECL_CONSEXIT().
◆ createCons()
|
static |
creates and captures a nonlinear constraint
- Attention
- Use copyexpr=FALSE only if expr is already "owned" by conshdlr, that is, if expressions were created with exprownerCreate() and ownerdata passed in the last two arguments
- Parameters
-
scip SCIP data structure conshdlr constraint handler cons pointer to hold the created constraint name name of constraint expr expression of constraint (must not be NULL) lhs left hand side of constraint rhs right hand side of constraint copyexpr whether to copy the expression or reuse the given expr (capture it) initial should the LP relaxation of constraint be in the initial LP? Usually set to TRUE. Set to FALSE for 'lazy constraints'. separate should the constraint be separated during LP processing? Usually set to TRUE. enforce should the constraint be enforced during node processing? TRUE for model constraints, FALSE for additional, redundant constraints. check should the constraint be checked for feasibility? TRUE for model constraints, FALSE for additional, redundant constraints. propagate should the constraint be propagated during node processing? Usually set to TRUE. local is constraint only valid locally? Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. modifiable is constraint modifiable (subject to column generation)? Usually set to FALSE. In column generation applications, set to TRUE if pricing adds coefficients to this constraint. dynamic is constraint subject to aging? Usually set to FALSE. Set to TRUE for own cuts which are separated as constraints. removable should the relaxation be removed from the LP due to aging or cleanup? Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'.
Definition at line 1282 of file cons_nonlinear.c.
References FALSE, getExprAbsOrigViolation(), NULL, SCIP_CALL, SCIP_EXPRCURV_UNKNOWN, SCIP_INVALIDCALL, SCIP_OKAY, SCIP_Real, SCIPallocClearBlockMemory, SCIPcaptureExpr(), SCIPconshdlrGetData(), SCIPcreateCons(), SCIPduplicateExpr(), SCIPerrorMessage, and SCIPgetDepth().
Referenced by dropVarEvents(), SCIP_DECL_CONSCOPY(), SCIP_DECL_CONSPARSE(), SCIP_DECL_CONSTRANS(), SCIPcreateConsNonlinear(), and SCIPcreateConsQuadraticNonlinear().
◆ getExprAbsOrigViolation()
|
static |
returns absolute violation for auxvar relation in an expression w.r.t. original variables
Assume the expression is f(x), where x are original (i.e., not auxiliary) variables. Assume that f(x) is associated with auxiliary variable z.
If there are negative locks, then return the violation of z ≤ f(x) and sets violover
to TRUE. If there are positive locks, then return the violation of z ≥ f(x) and sets violunder
to TRUE. Of course, if there both negative and positive locks, then return the violation of z = f(x). If f could not be evaluated, then return SCIPinfinity() and set both violover
and violunder
to TRUE.
- Note
- This does not reevaluate the violation, but assumes that the expression has been evaluated
- Parameters
-
scip SCIP data structure expr expression sol solution that has been evaluated violunder buffer to store whether z >= f(x) is violated, or NULL violover buffer to store whether z <= f(x) is violated, or NULL
Definition at line 1373 of file cons_nonlinear.c.
References FALSE, getExprAbsAuxViolation(), NULL, SCIP_INVALID, SCIP_Real, SCIPexprGetEvalValue(), SCIPexprGetOwnerData(), SCIPgetSolVal(), SCIPinfinity(), and TRUE.
Referenced by analyzeViolation(), createCons(), enforceExpr(), and SCIPgetExprAbsOrigViolationNonlinear().
◆ getExprAbsAuxViolation()
|
static |
returns absolute violation for auxvar relation in an expression w.r.t. auxiliary variables
Assume the expression is f(w), where w are auxiliary variables that were introduced by some nlhdlr. Assume that f(w) is associated with auxiliary variable z.
If there are negative locks, then return the violation of z ≤ f(w) and sets violover
to TRUE. If there are positive locks, then return the violation of z ≥ f(w) and sets violunder
to TRUE. Of course, if there both negative and positive locks, then return the violation of z = f(w). If f could not be evaluated, then return SCIPinfinity() and set both violover
and violunder
to TRUE.
- Note
- This does not reevaluate the violation, but assumes that f(w) is passed in with auxvalue.
- Parameters
-
scip SCIP data structure expr expression auxvalue value of f(w) sol solution that has been evaluated violunder buffer to store whether z >= f(w) is violated, or NULL violover buffer to store whether z <= f(w) is violated, or NULL
Definition at line 1439 of file cons_nonlinear.c.
References computeViolation(), FALSE, NULL, SCIP_INVALID, SCIP_Real, SCIPexprGetOwnerData(), SCIPgetSolVal(), SCIPinfinity(), and TRUE.
Referenced by analyzeViolation(), enforceExpr(), getExprAbsOrigViolation(), SCIPgetExprAbsAuxViolationNonlinear(), SCIPgetExprRelAuxViolationNonlinear(), and SCIPprocessRowprepNonlinear().
◆ computeViolation()
|
static |
computes violation of a constraint
- Parameters
-
scip SCIP data structure cons constraint sol solution or NULL if LP solution should be used soltag tag that uniquely identifies the solution (with its values), or 0.
Definition at line 1496 of file cons_nonlinear.c.
References getConsAbsViolation(), NULL, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPconsGetData(), SCIPevalExpr(), SCIPexprGetEvalValue(), SCIPinfinity(), and SCIPisInfinity().
Referenced by consEnfo(), consSepa(), getExprAbsAuxViolation(), SCIP_DECL_CONSCHECK(), SCIP_DECL_CONSENFOPS(), SCIPgetAbsViolationNonlinear(), and SCIPgetRelViolationNonlinear().
◆ getConsAbsViolation()
returns absolute violation of a constraint
- Note
- This does not reevaluate the violation, but assumes that computeViolation() has been called before.
- Parameters
-
cons constraint
Definition at line 1535 of file cons_nonlinear.c.
References getConsRelViolation(), NULL, and SCIPconsGetData().
Referenced by analyzeViolation(), computeViolation(), enforceConstraints(), getConsRelViolation(), isConsViolated(), registerBranchingCandidatesAllUnfixed(), SCIP_DECL_CONSCHECK(), and SCIPgetAbsViolationNonlinear().
◆ getConsRelViolation()
|
static |
computes relative violation of a constraint
- Note
- This does not reevaluate the violation, but assumes that computeViolation() has been called before.
- Parameters
-
scip SCIP data structure cons constraint viol buffer to store violation sol solution or NULL if LP solution should be used soltag tag that uniquely identifies the solution (with its values), or 0
Definition at line 1554 of file cons_nonlinear.c.
References getConsAbsViolation(), isConsViolated(), MAX, NULL, REALABS, SCIP_Bool, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetData(), SCIPevalExprGradient(), SCIPexprGetDerivative(), SCIPexprGetDiffTag(), SCIPexprGetEvalValue(), SCIPisInfinity(), and storeVarExprs().
Referenced by analyzeViolation(), collectBranchingCandidates(), enforceConstraints(), getConsAbsViolation(), and SCIPgetRelViolationNonlinear().
◆ isConsViolated()
returns whether constraint is currently violated
- Note
- This does not reevaluate the violation, but assumes that computeViolation() has been called before.
- Parameters
-
scip SCIP data structure cons constraint
Definition at line 1654 of file cons_nonlinear.c.
References findUnlockedLinearVar(), getConsAbsViolation(), and SCIPfeastol().
Referenced by analyzeViolation(), collectBranchingCandidates(), consEnfo(), consSepa(), enforceConstraints(), getConsRelViolation(), registerBranchingCandidates(), registerBranchingCandidatesAllUnfixed(), SCIP_DECL_CONSCHECK(), and SCIP_DECL_CONSENFOPS().
◆ findUnlockedLinearVar()
checks for a linear variable that can be increased or decreased without harming feasibility
- Parameters
-
scip SCIP data structure cons constraint
Definition at line 1664 of file cons_nonlinear.c.
References NULL, proposeFeasibleSolution(), SCIP_LOCKTYPE_MODEL, SCIP_Real, SCIPconsGetData(), SCIPdebugMsg, SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPgetCoefsExprSum(), SCIPgetVarExprVar(), SCIPisExprSum(), SCIPisExprVar(), SCIPisInfinity(), SCIPvarGetName(), SCIPvarGetNLocksDownType(), SCIPvarGetNLocksUpType(), and SCIPvarGetObj().
Referenced by initSolve(), isConsViolated(), SCIPgetLinvarMayDecreaseNonlinear(), and SCIPgetLinvarMayIncreaseNonlinear().
◆ proposeFeasibleSolution()
|
static |
Given a solution where every nonlinear constraint is either feasible or can be made feasible by moving a linear variable, construct the corresponding feasible solution and pass it to the trysol heuristic.
The method assumes that this is always possible and that not all constraints are feasible already.
- Parameters
-
scip SCIP data structure conshdlr constraint handler conss constraints to process nconss number of constraints sol solution to process success buffer to store whether we succeeded to construct a solution that satisfies all provided constraints
Definition at line 1760 of file cons_nonlinear.c.
References addTightEstimatorCut(), FALSE, MAX, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_STAGE_INITPRESOLVE, SCIP_STAGE_SOLVED, SCIPceil(), SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPcreateLPSol(), SCIPcreateSolCopy(), SCIPdebugMsg, SCIPfeastol(), SCIPfloor(), SCIPfreeSol(), SCIPgetSolTransObj(), SCIPgetSolVal(), SCIPgetStage(), SCIPgetUpperbound(), SCIPheurGetName(), SCIPheurPassSolTrySol(), SCIPincSolVal(), SCIPisInfinity(), SCIPisNegative(), SCIPisPositive(), SCIPisSumLT(), SCIPisZero(), SCIPsolGetHeur(), SCIPunlinkSol(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), SCIPvarIsIntegral(), and TRUE.
Referenced by findUnlockedLinearVar(), and SCIP_DECL_CONSCHECK().
◆ addTightEstimatorCut()
|
static |
adds globally valid tight estimators in a given solution as cut to cutpool
Called by addTightEstimatorCuts() for a specific expression, nlhdlr, and estimate-direction (over or under).
- Parameters
-
scip SCIP data structure conshdlr constraint handler cons constraint expr expression exprenfo expression enfo data, e.g., nlhdlr to use sol reference point where to estimate overestimate whether to overestimate rowpreps array for rowpreps
Definition at line 1908 of file cons_nonlinear.c.
References addTightEstimatorCuts(), EXPRENFO::auxvalue, ENFOLOG, FALSE, EXPRENFO::nlhdlr, EXPRENFO::nlhdlrexprdata, NULL, r, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIPaddPoolCut(), SCIPaddRowprepTerm(), SCIPcleanupRowprep2(), SCIPclearPtrarray(), SCIPexprGetEvalValue(), SCIPexprGetHdlr(), SCIPexprhdlrGetName(), SCIPfreeRowprep(), SCIPgetExprAuxVarNonlinear(), SCIPgetPtrarrayMaxIdx(), SCIPgetPtrarrayMinIdx(), SCIPgetPtrarrayVal(), SCIPgetRowprepRowCons(), SCIPgetSolVal(), SCIPinfinity(), SCIPinfoMessage(), SCIPisFeasGE(), SCIPisFeasLE(), SCIPnlhdlrGetName(), SCIPprintRow(), SCIPreleaseRow(), SCIProwprepGetCoefs(), SCIProwprepGetNVars(), SCIProwprepGetSide(), SCIProwprepGetSidetype(), SCIProwprepGetVars(), and SCIProwprepIsLocal().
Referenced by addTightEstimatorCuts(), and proposeFeasibleSolution().
◆ addTightEstimatorCuts()
|
static |
adds globally valid tight estimators in a given solution as cuts to cutpool
Essentially we want to ensure that the LP relaxation is tight in the new solution, if possible. For convex constraints, we would achieve this by linearizing. To avoid checking explicitly for convexity, we compute estimators via any nlhdlr that didn't say it would use bound information and check whether the estimator is tight.
Since linearization may happen in auxiliary variables, we ensure that auxiliary variables are set to the eval-value of its expression, i.e., we change sol so it is also feasible in the extended formulation.
- Parameters
-
scip SCIP data structure conshdlr constraint handler conss constraints nconss number of constraints sol reference point where to estimate
Definition at line 2020 of file cons_nonlinear.c.
References addTightEstimatorCut(), ENFOLOG, FALSE, NULL, SCIP_CALL, SCIP_DECL_EVENTEXEC(), SCIP_EXPRITER_DFS, SCIP_EXPRITER_LEAVEEXPR, SCIP_INVALID, SCIP_Longint, SCIP_NLHDLR_METHOD_SEPAABOVE, SCIP_NLHDLR_METHOD_SEPABELOW, SCIP_OKAY, SCIPconsGetData(), SCIPconsIsActive(), SCIPconsIsDeleted(), SCIPconsIsEnabled(), SCIPconsIsSeparationEnabled(), SCIPcreateExpriter(), SCIPcreatePtrarray(), SCIPevalExpr(), SCIPexprGetEvalTag(), SCIPexprGetEvalValue(), SCIPexprGetOwnerData(), SCIPexpriterGetNext(), SCIPexpriterInit(), SCIPexpriterIsEnd(), SCIPexpriterRestartDFS(), SCIPexpriterSetStagesDFS(), SCIPfreeExpriter(), SCIPfreePtrarray(), SCIPgetExprNewSoltag(), SCIPgetSolVal(), SCIPgetVarExprVar(), SCIPheurGetName(), SCIPinfoMessage(), SCIPisEQ(), SCIPisExprSum(), SCIPnlhdlrGetName(), SCIPnlhdlrHasEstimate(), SCIPprintCons(), SCIPprintExpr(), SCIPsetSolVal(), SCIPsolGetHeur(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), and TRUE.
Referenced by addTightEstimatorCut(), and SCIP_DECL_EVENTEXEC().
◆ SCIP_DECL_EVENTEXEC() [2/2]
|
static |
processes the event that a new primal solution has been found
Definition at line 2157 of file cons_nonlinear.c.
References addTightEstimatorCuts(), NULL, SCIP_CALL, SCIP_EVENTTYPE_FORMAT, SCIP_EVENTTYPE_SOLFOUND, SCIP_OKAY, SCIPconshdlrGetConss(), SCIPconshdlrGetData(), SCIPconshdlrGetNConss(), SCIPdebugMsg, SCIPeventGetSol(), SCIPeventGetType(), SCIPheurGetName(), SCIPsolGetHeur(), and tightenAuxVarBounds().
◆ tightenAuxVarBounds()
|
static |
tightens the bounds of the auxiliary variable associated with an expression (or original variable if being a variable-expression) according to given bounds
The given bounds may very well be the exprs activity (when called from forwardPropExpr()), but can also be some tighter bounds (when called from SCIPtightenExprIntervalNonlinear()).
Nothing will happen if SCIP is not in presolve or solve.
- Parameters
-
scip SCIP data structure conshdlr constraint handler expr expression whose auxvar is to be tightened bounds bounds to be used for tightening (must not be empty) cutoff buffer to store whether a cutoff was detected ntightenings buffer to add the total number of tightenings, or NULL
Definition at line 2202 of file cons_nonlinear.c.
References FALSE, forwardPropExpr(), SCIP_Interval::inf, NULL, SCIP_Bool, SCIP_CALL, SCIP_INTERVAL_INFINITY, SCIP_OKAY, SCIP_STAGE_INITPRESOLVE, SCIP_STAGE_SOLVING, SCIPconshdlrGetData(), SCIPdebugMsg, SCIPgetExprAuxVarNonlinear(), SCIPgetStage(), SCIPintervalIsEmpty(), SCIPisEQ(), SCIPtightenVarLb(), SCIPtightenVarUb(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), and SCIP_Interval::sup.
Referenced by createAuxVar(), forwardPropExpr(), SCIP_DECL_EVENTEXEC(), and SCIPtightenExprIntervalNonlinear().
◆ isIntervalBetter()
|
static |
returns whether intersecting oldinterval
with newinterval
would provide a properly smaller interval
If subsetsufficient
is TRUE, then the intersection being smaller than oldinterval is sufficient.
If subsetsufficient
is FALSE, then we require
- a change from an unbounded interval to a bounded one, or
- or a change from an unfixed (width > epsilon) to a fixed interval, or
- a minimal tightening of one of the interval bounds as defined by SCIPis{Lb,Ub}Better().
- Parameters
-
scip SCIP data structure subsetsufficient whether the intersection being a proper subset of oldinterval is sufficient newinterval new interval oldinterval old interval
Definition at line 2577 of file cons_nonlinear.c.
References FALSE, SCIP_Interval::inf, MAX, NULL, reversePropQueue(), SCIP_INTERVAL_INFINITY, SCIPintervalIsEmpty(), SCIPintervalIsSubsetEQ(), SCIPisEQ(), SCIPisLbBetter(), SCIPisUbBetter(), SCIP_Interval::sup, and TRUE.
Referenced by forwardPropExpr(), and SCIPtightenExprIntervalNonlinear().
◆ reversePropQueue()
|
static |
propagates bounds for each sub-expression in the reversepropqueue
by starting from the root expressions
The expression will be traversed in breadth first search by using this queue.
- Note
- Calling this function requires feasible intervals for each sub-expression; this is guaranteed by calling forwardPropExpr() before calling this function.
-
Calling this function with
*infeasible
= TRUE will only empty the queue.
- Parameters
-
scip SCIP data structure conshdlr constraint handler infeasible buffer to update whether an expression's bounds were propagated to an empty interval ntightenings buffer to store the number of (variable) tightenings
Definition at line 2625 of file cons_nonlinear.c.
References FALSE, SCIP_Interval::inf, NULL, propConss(), SCIP_CALL, SCIP_INTERVAL_INFINITY, SCIP_NLHDLR_METHOD_ACTIVITY, SCIP_OKAY, SCIPallocBufferArray, SCIPconshdlrGetData(), SCIPdebugMsg, SCIPdebugMsgPrint, SCIPexprGetActivity(), SCIPexprGetChildren(), SCIPexprGetHdlr(), SCIPexprGetNChildren(), SCIPexprGetOwnerData(), SCIPexprhdlrGetName(), SCIPexprhdlrHasReverseProp(), SCIPfreeBufferArray, SCIPgetExprBoundsNonlinear(), SCIPintervalIsEmpty(), SCIPintervalIsEntire(), SCIPnlhdlrGetName(), SCIPprintExpr(), SCIPqueueIsEmpty(), SCIPqueueRemove(), SCIPtightenExprIntervalNonlinear(), SCIP_Interval::sup, and TRUE.
Referenced by isIntervalBetter(), propConss(), and propExprDomains().
◆ propConss()
|
static |
calls domain propagation for a given set of constraints
The algorithm alternates calls of forward and reverse propagation. Forward propagation ensures that activity of expressions is up to date. Reverse propagation tries to derive tighter variable bounds by reversing the activity computation, using the constraints [lhs,rhs] interval as starting point.
The propagation algorithm works as follows:
- apply forward propagation (update activities) for all constraints not marked as propagated
- if presolve or propauxvars is disabled: collect expressions for which the constraint sides provide tighter bounds if solve and propauxvars is enabled: collect expressions for which auxvars (including those in root exprs) provide tighter bounds
- apply reverse propagation to all collected expressions; don't explore sub-expressions which have not changed since the beginning of the propagation loop
- if we have found enough tightenings go to 1, otherwise leave propagation loop
- Note
- After calling forward propagation for a constraint, we mark this constraint as propagated. This flag might be reset during the reverse propagation when we find a bound tightening of a variable expression contained in the constraint. Resetting this flag is done in the EVENTEXEC callback of the event handler
TODO should we distinguish between expressions where activity information is used for separation and those where not, e.g., try less to propagate on convex constraints?
- Parameters
-
scip SCIP data structure conshdlr constraint handler conss constraints to propagate nconss total number of constraints force force tightening even if below bound strengthening tolerance result pointer to store the result nchgbds buffer to add the number of changed bounds
Definition at line 2786 of file cons_nonlinear.c.
References FALSE, forwardPropExpr(), NULL, propExprDomains(), reversePropQueue(), SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_EXPRITER_BFS, SCIP_INTERVAL_INFINITY, SCIP_OKAY, SCIP_Real, SCIP_REDUCEDDOM, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsActive(), SCIPconsIsDeleted(), SCIPconsIsPropagationEnabled(), SCIPcreateExpriter(), SCIPdebugMsg, SCIPdebugPrintCons, SCIPexprGetActivity(), SCIPexprGetOwnerData(), SCIPexpriterGetCurrent(), SCIPexpriterGetNext(), SCIPexpriterInit(), SCIPexpriterIsEnd(), SCIPfreeExpriter(), SCIPintervalIsEmpty(), SCIPintervalSetBounds(), SCIPisInfinity(), SCIPqueueIsEmpty(), SCIPtightenExprIntervalNonlinear(), and TRUE.
Referenced by consEnfo(), reversePropQueue(), SCIP_DECL_CONSENFOPS(), SCIP_DECL_CONSPRESOL(), and SCIP_DECL_CONSPROP().
◆ propExprDomains()
|
static |
calls the reverseprop callbacks of all nlhdlrs in all expressions in all constraints using activity as bounds
This is meant to propagate any domain restrictions on functions onto variable bounds, if possible.
Assumes that activities are still valid and curpropboundstag does not need to be increased. Therefore, a good place to call this function is immediately after propConss() or after forwardPropExpr() if outside propagation.
- Parameters
-
scip SCIP data structure conshdlr constraint handler conss constraints to propagate nconss total number of constraints result pointer to store the result nchgbds buffer to add the number of changed bounds
Definition at line 2988 of file cons_nonlinear.c.
References FALSE, NULL, propagateLocks(), reversePropQueue(), SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_EXPRITER_DFS, SCIP_NLHDLR_METHOD_ACTIVITY, SCIP_OKAY, SCIP_REDUCEDDOM, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsActive(), SCIPconsIsDeleted(), SCIPconsIsPropagationEnabled(), SCIPcreateExpriter(), SCIPdebugMsg, SCIPexprGetActivity(), SCIPexprGetOwnerData(), SCIPexpriterGetNext(), SCIPexpriterInit(), SCIPexpriterIsEnd(), SCIPexpriterRestartDFS(), SCIPfreeExpriter(), and SCIPqueueIsEmpty().
Referenced by initSepa(), propConss(), and SCIP_DECL_CONSPRESOL().
◆ propagateLocks()
|
static |
propagates variable locks through expression and adds locks to variables
- Parameters
-
scip SCIP data structure expr expression nlockspos number of positive locks nlocksneg number of negative locks
Definition at line 3099 of file cons_nonlinear.c.
References addLocks(), SCIP_EXPRITER_USERDATA::intvals, NULL, SCIP_CALL, SCIP_EXPRITER_DFS, SCIP_EXPRITER_ENTEREXPR, SCIP_EXPRITER_LEAVEEXPR, SCIP_EXPRITER_VISITINGCHILD, SCIP_MONOTONE_CONST, SCIP_MONOTONE_DEC, SCIP_MONOTONE_INC, SCIP_MONOTONE_UNKNOWN, SCIP_OKAY, SCIPABORT, SCIPaddVarLocks(), SCIPallocBlockMemoryArray, SCIPcreateExpriter(), SCIPexprGetHdlr(), SCIPexprGetNChildren(), SCIPexprGetOwnerData(), SCIPexprhdlrHasMonotonicity(), SCIPexpriterGetChildIdxDFS(), SCIPexpriterGetCurrent(), SCIPexpriterGetCurrentUserData(), SCIPexpriterGetNext(), SCIPexpriterGetStageDFS(), SCIPexpriterInit(), SCIPexpriterIsEnd(), SCIPexpriterSetChildUserData(), SCIPexpriterSetCurrentUserData(), SCIPexpriterSetStagesDFS(), SCIPfreeBlockMemoryArray, SCIPfreeExpriter(), SCIPgetVarExprVar(), SCIPisExprVar(), and TRUE.
Referenced by addLocks(), and propExprDomains().
◆ addLocks()
|
static |
main function for adding locks to expressions and variables
Locks for a nonlinear constraint are used to update locks for all sub-expressions and variables. Locks of expressions depend on the monotonicity of expressions w.r.t. their children, e.g., consider the constraint \(x^2 \leq 1\) with \(x \in [-2,-1]\) implies an up-lock for the root expression (pow) and a down-lock for its child \(x\) because \(x^2\) is decreasing on [-2,-1]. Since the monotonicity (and thus the locks) might also depend on variable bounds, the function remembers the computed monotonicity information of each expression until all locks of an expression have been removed, which implies that updating the monotonicity information during the next locking of this expression does not break existing locks.
- Note
- When modifying the structure of an expression, e.g., during simplification, it is necessary to remove all locks from an expression and repropagating them after the structural changes have been applied. Because of existing common sub-expressions, it might be necessary to remove the locks of all constraints to ensure that an expression is unlocked (see canonicalizeConstraints() for an example)
- Parameters
-
scip SCIP data structure cons nonlinear constraint nlockspos number of positive rounding locks nlocksneg number of negative rounding locks
Definition at line 3252 of file cons_nonlinear.c.
References createNlRow(), NULL, propagateLocks(), SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), and SCIPisInfinity().
Referenced by canonicalizeConstraints(), presolveMergeConss(), propagateLocks(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSDEACTIVE(), and SCIP_DECL_CONSLOCK().
◆ createNlRow()
|
static |
create a nonlinear row representation of a nonlinear constraint and stores them in consdata
- Parameters
-
scip SCIP data structure cons nonlinear constraint
Definition at line 3300 of file cons_nonlinear.c.
References NULL, SCIP_CALL, SCIP_DECL_SORTPTRCOMP(), SCIP_EXPRCURV_UNKNOWN, SCIP_OKAY, SCIP_Real, SCIPaddLinearCoefToNlRow(), SCIPappendExprSumExpr(), SCIPchgNlRowConstant(), SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPcreateExprSum(), SCIPcreateNlRow(), SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPgetCoefsExprSum(), SCIPgetConstantExprSum(), SCIPgetVarExprVar(), SCIPisExprSum(), SCIPisExprVar(), SCIPreleaseExpr(), SCIPreleaseNlRow(), and SCIPsetNlRowExpr().
Referenced by addLocks(), initSolve(), and SCIPgetNlRowNonlinear().
◆ SCIP_DECL_SORTPTRCOMP() [2/3]
|
static |
compares enfodata by enforcement priority of nonlinear handler
If handlers have same enforcement priority, then compare by detection priority, then by name.
Definition at line 3374 of file cons_nonlinear.c.
References detectNlhdlr(), NULL, SCIPnlhdlrGetDetectPriority(), SCIPnlhdlrGetEnfoPriority(), and SCIPnlhdlrGetName().
◆ detectNlhdlr()
|
static |
install nlhdlrs in one expression
- Parameters
-
scip SCIP data structure expr expression for which to run detection routines cons constraint for which expr == consdata->expr, otherwise NULL
Definition at line 3399 of file cons_nonlinear.c.
References detectNlhdlrs(), FALSE, h, NULL, SCIP_CALL, SCIP_ERROR, SCIP_NLHDLR_METHOD_ACTIVITY, SCIP_NLHDLR_METHOD_ALL, SCIP_NLHDLR_METHOD_NONE, SCIP_NLHDLR_METHOD_SEPAABOVE, SCIP_NLHDLR_METHOD_SEPABELOW, SCIP_NLHDLR_METHOD_SEPABOTH, SCIP_OKAY, SCIP_STAGE_SOLVING, SCIPallocBlockMemory(), SCIPallocBlockMemoryArray, SCIPconshdlrGetData(), SCIPdebugMsg, SCIPensureBlockMemoryArray, SCIPerrorMessage, SCIPexprGetHdlr(), SCIPexprGetOwnerData(), SCIPexprhdlrGetName(), SCIPgetStage(), SCIPnlhdlrGetName(), SCIPnlhdlrIsEnabled(), SCIPreallocBlockMemoryArray, SCIPsortDownPtr(), and TRUE.
Referenced by detectNlhdlrs(), and SCIP_DECL_SORTPTRCOMP().
◆ detectNlhdlrs()
|
static |
detect nlhdlrs that can handle the expressions
- Parameters
-
scip SCIP data structure conshdlr constraint handler conss constraints for which to run nlhdlr detect nconss total number of constraints
Definition at line 3563 of file cons_nonlinear.c.
References detectNlhdlr(), FALSE, freeEnfoData(), initSolve(), NULL, SCIP_CALL, SCIP_EXPRITER_DFS, SCIP_OKAY, SCIP_STAGE_INITSOLVE, SCIP_STAGE_PRESOLVING, SCIP_STAGE_SOLVING, SCIPcomputeExprIntegrality(), SCIPconsGetData(), SCIPconshdlrGetData(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsPropagated(), SCIPconsIsSeparated(), SCIPcreateExpriter(), SCIPexprGetOwnerData(), SCIPexpriterGetNext(), SCIPexpriterInit(), SCIPexpriterIsEnd(), SCIPexpriterRestartDFS(), SCIPfreeExpriter(), SCIPgetDepth(), SCIPgetStage(), SCIPincrementCurBoundsTagNonlinear(), SCIPregisterExprUsageNonlinear(), and TRUE.
Referenced by detectNlhdlr(), and initSolve().
◆ initSolve()
|
static |
initializes (pre)solving data of constraints
This initializes data in a constraint that is used for separation, propagation, etc, and assumes that expressions will not be modified. In particular, this function
- runs the detection method of nlhldrs
- looks for unlocked linear variables
- checks curvature (if not in presolve)
- creates and add row to NLP (if not in presolve)
This function can be called in presolve and solve and can be called several times with different sets of constraints, e.g., it should be called in INITSOL and for constraints that are added during solve.
- Parameters
-
scip SCIP data structure conshdlr constraint handler conss constraints nconss number of constraints
Definition at line 3713 of file cons_nonlinear.c.
References createNlRow(), deinitSolve(), detectNlhdlrs(), FALSE, findUnlockedLinearVar(), NULL, SCIP_Bool, SCIP_CALL, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_LINEAR, SCIP_OKAY, SCIP_STAGE_INITSOLVE, SCIP_STAGE_SOLVING, SCIPaddNlRow(), SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsActive(), SCIPdebugMsg, SCIPgetStage(), SCIPhasExprCurvature(), SCIPisInfinity(), SCIPisNLPConstructed(), SCIPnlrowSetCurvature(), and SCIPwarningMessage().
Referenced by canonicalizeConstraints(), detectNlhdlrs(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSINITSOL(), and SCIP_DECL_CONSLOCK().
◆ deinitSolve()
|
static |
deinitializes (pre)solving data of constraints
This removes the initialization data created in initSolve().
This function can be called in presolve and solve.
TODO At the moment, it should not be called for a constraint if there are other constraints that use the same expressions but still require their nlhdlr. We should probably only decrement the auxvar and activity usage for the root expr and then proceed as in detectNlhdlrs(), i.e., free enfo data only where none is used.
- Parameters
-
scip SCIP data structure conshdlr constraint handler conss constraints nconss number of constraints
Definition at line 3802 of file cons_nonlinear.c.
References FALSE, freeEnfoData(), isBinaryProduct(), NULL, SCIP_Bool, SCIP_CALL, SCIP_EXPRCURV_UNKNOWN, SCIP_EXPRITER_DFS, SCIP_EXPRITER_LEAVEEXPR, SCIP_OKAY, SCIP_STAGE_SOLVING, SCIPconsGetData(), SCIPconshdlrGetData(), SCIPcreateExpriter(), SCIPdebugMsg, SCIPdelNlRow(), SCIPevalExprActivity(), SCIPexprGetActivityTag(), SCIPexpriterGetNext(), SCIPexpriterInit(), SCIPexpriterIsEnd(), SCIPexpriterRestartDFS(), SCIPexpriterSetStagesDFS(), SCIPfreeExpriter(), SCIPfreeExprQuadratic(), SCIPgetStage(), SCIPreleaseNlRow(), and TRUE.
Referenced by canonicalizeConstraints(), initSolve(), SCIP_DECL_CONSDEACTIVE(), SCIP_DECL_CONSEXITSOL(), and SCIP_DECL_CONSLOCK().
◆ isBinaryProduct()
helper method to decide whether a given expression is product of at least two binary variables
- Parameters
-
scip SCIP data structure expr expression
Definition at line 3884 of file cons_nonlinear.c.
References FALSE, getBilinearBinaryTerms(), NULL, SCIP_Real, SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPgetCoefExprProduct(), SCIPgetVarExprVar(), SCIPisEQ(), SCIPisExprProduct(), SCIPisExprVar(), SCIPvarGetLbLocal(), SCIPvarGetUbLocal(), SCIPvarIsIntegral(), and TRUE.
Referenced by deinitSolve(), getBilinearBinaryTerms(), and getBinaryProductExpr().
◆ getBilinearBinaryTerms()
|
static |
helper method to collect all bilinear binary product terms
- Parameters
-
scip SCIP data structure sumexpr sum expression xs array to collect first variable of each bilinear binary product ys array to collect second variable of each bilinear binary product childidxs array to store the index of the child of each stored bilinear binary product nterms pointer to store the total number of bilinear binary terms
Definition at line 3930 of file cons_nonlinear.c.
References isBinaryProduct(), nterms, NULL, reformulateFactorizedBinaryQuadratic(), SCIP_OKAY, SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPgetVarExprVar(), SCIPisExprSum(), x, and y.
Referenced by getFactorizedBinaryQuadraticExpr(), and isBinaryProduct().
◆ reformulateFactorizedBinaryQuadratic()
|
static |
helper method to reformulate \(x_i \sum_j c_{ij} x_j\)
- Parameters
-
scip SCIP data structure conshdlr constraint handler cons constraint facvar variable that has been factorized vars variables of sum_j c_ij x_j coefs coefficients of sum_j c_ij x_j nvars total number of variables in sum_j c_ij x_j newexpr pointer to store the new expression naddconss pointer to update the total number of added constraints (might be NULL)
Definition at line 3980 of file cons_nonlinear.c.
References createExprVar(), getFactorizedBinaryQuadraticExpr(), MAX, NULL, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_CONTINUOUS, SCIP_VARTYPE_IMPLINT, SCIPaddCoefLinear(), SCIPaddCons(), SCIPaddVar(), SCIPconsGetName(), SCIPcreateConsBasicLinear(), SCIPcreateConsBasicVarbound(), SCIPcreateVarBasic(), SCIPinfinity(), SCIPisIntegral(), SCIPisZero(), SCIPreleaseCons(), SCIPreleaseVar(), SCIPsnprintf(), SCIPvarGetName(), and TRUE.
Referenced by getBilinearBinaryTerms(), and getFactorizedBinaryQuadraticExpr().
◆ getFactorizedBinaryQuadraticExpr()
|
static |
helper method to generate an expression for a sum of products of binary variables; note that the method captures the generated expression
- Parameters
-
scip SCIP data structure conshdlr constraint handler cons constraint sumexpr expression minterms minimum number of terms in a the sum of x_i sum_j c_j x_j newexpr pointer to store the expression that represents the binary quadratic naddconss pointer to update the total number of added constraints (might be NULL)
Definition at line 4079 of file cons_nonlinear.c.
References getBilinearBinaryTerms(), getBinaryProductExprDo(), nterms, NULL, reformulateFactorizedBinaryQuadratic(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPallocClearBufferArray, SCIPcreateExprSum(), SCIPdebugMsg, SCIPduplicateBufferArray, SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPfreeBufferArray, SCIPfreeBufferArrayNull, SCIPgetCoefsExprSum(), SCIPgetConstantExprSum(), SCIPgetNTotalVars(), SCIPgetNVars(), SCIPgetVars(), SCIPisExprSum(), SCIPreleaseExpr(), SCIPsortDownIntPtr(), SCIPvarGetIndex(), SCIPvarGetName(), and TRUE.
Referenced by presolveBinaryProducts(), reformulateFactorizedBinaryQuadratic(), and replaceBinaryProducts().
◆ getBinaryProductExprDo()
|
static |
helper method to create an AND constraint or varbound constraints for a given binary product expression
- Parameters
-
scip SCIP data structure conshdlr constraint handler prodexpr product expression newexpr pointer to store the expression that represents the product naddconss pointer to update the total number of added constraints (might be NULL) empathy4and whether to use an AND constraint, if possible
Definition at line 4277 of file cons_nonlinear.c.
References createExprVar(), getBinaryProductExpr(), NULL, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_IMPLINT, SCIPaddCons(), SCIPaddVar(), SCIPallocBufferArray, SCIPcreateConsBasicAnd(), SCIPcreateConsBasicLinear(), SCIPcreateConsBasicVarbound(), SCIPcreateVarBasic(), SCIPdebugMsg, SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPfreeBufferArray, SCIPgetVarExprVar(), SCIPinfinity(), SCIPisExprProduct(), SCIPreleaseCons(), SCIPreleaseVar(), SCIPsnprintf(), SCIPvarGetName(), w, x, and y.
Referenced by getBinaryProductExpr(), and getFactorizedBinaryQuadraticExpr().
◆ getBinaryProductExpr()
|
static |
helper method to generate an expression for the product of binary variables; note that the method captures the generated expression
- Parameters
-
scip SCIP data structure conshdlr constraint handler exprmap map to remember generated variables for visited product expressions prodexpr product expression newexpr pointer to store the expression that represents the product naddconss pointer to update the total number of added constraints (might be NULL) nchgcoefs pointer to update the total number of changed coefficients (might be NULL)
Definition at line 4384 of file cons_nonlinear.c.
References createExprVar(), FALSE, getBinaryProductExprDo(), isBinaryProduct(), NULL, replaceBinaryProducts(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPcaptureExpr(), SCIPcliqueHasVar(), SCIPconshdlrGetData(), SCIPcreateExprSum(), SCIPcreateExprValue(), SCIPdebugMsg, SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPgetVarExprVar(), SCIPhashmapExists(), SCIPhashmapGetImage(), SCIPhashmapInsert(), SCIPreleaseExpr(), SCIPvarGetCliques(), SCIPvarGetNCliques(), TRUE, x, and y.
Referenced by getBinaryProductExprDo(), and replaceBinaryProducts().
◆ replaceBinaryProducts()
|
static |
helper function to replace binary products in a given constraint
- Parameters
-
scip SCIP data structure conshdlr constraint handler cons constraint exprmap map to remember generated variables for visited product expressions it expression iterator naddconss pointer to update the total number of added constraints (might be NULL) nchgcoefs pointer to update the total number of changed coefficients (might be NULL)
Definition at line 4533 of file cons_nonlinear.c.
References FALSE, getBinaryProductExpr(), getFactorizedBinaryQuadraticExpr(), NULL, presolveBinaryProducts(), SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPdebugMsg, SCIPexprGetNChildren(), SCIPexpriterGetChildExprDFS(), SCIPexpriterGetChildIdxDFS(), SCIPexpriterGetNext(), SCIPexpriterIsEnd(), SCIPexpriterRestartDFS(), SCIPreleaseExpr(), and SCIPreplaceExprChild().
Referenced by getBinaryProductExpr(), and presolveBinaryProducts().
◆ presolveBinaryProducts()
|
static |
reformulates products of binary variables during presolving in the following way:
Let \(\sum_{i,j} Q_{ij} x_i x_j\) be a subexpression that only contains binary variables. Each term \(x_i x_j\) is reformulated with the help of an extra (implicit integer) variable \(z_{ij}\) in {0,1}:
\[ z_{ij} \leq x_i, \qquad z_{ij} \leq x_j, \qquad x_i + x_j - z_{ij} \leq 1. \]
Before reformulating \(x_i x_j\) in this way, it is checked whether there is a clique that contains \(x_i\) and \(x_j\). These cliques allow for a better reformulation. There are four cases:
- \(x_i + x_j \leq 1\) implies that \(x_i x_j = 0\)
- \(x_i + (1 - x_j) \leq 1\) implies \(x_i x_j = x_i\)
- \((1 - x_i) + x_j \leq 1\) implies \(x_i x_j = x_j\)
- \((1 - x_i) + (1 - x_j) \leq 1\) implies \(x_i x_j = x_i + x_j - 1\)
The reformulation using \(z_{ij}\) or the cliques is implemented in getBinaryProductExpr().
Introducing too many extra variables and constraints can have a negative impact on the performance (e.g., due to slow probing). For this reason, it is checked in getFactorizedBinaryQuadraticExpr() whether \(\sum_{i,j} Q_{ij} x_i x_j\) contains large (≥ reformbinprodsfac
parameter) lower sums of the form \(x_i \sum_j Q_{ij} x_j\). Such a lower sum is reformulated with only one extra variable w_i:
\begin{align} \text{maxact} & := \sum_j \max(0, Q_{ij}), \\ \text{minact} & := \sum_j \min(0, Q_{ij}), \\ \text{minact}\, x_i & \leq w_i, \\ w_i &\leq \text{maxact}\, x_i, \\ \text{minact} &\leq \sum_j Q_{ij} x_j - w_i + \text{minact}\, x_i \\ \text{maxact} &\geq \sum_j Q_{ij} x_j - w_i + \text{maxact}\, x_i \end{align}
We mark \(w_i\) to be implicit integer if all \(Q_{ij}\) are integer. After each replacement of a lower sum, it is checked whether there are enough terms left to factorize other binary variables. Lower sums with a larger number of terms are prioritized.
- Parameters
-
scip SCIP data structure conshdlr constraint handler conss constraints nconss total number of constraints naddconss pointer to store the total number of added constraints (might be NULL) nchgcoefs pointer to store the total number of changed coefficients (might be NULL)
Definition at line 4637 of file cons_nonlinear.c.
References FALSE, getFactorizedBinaryQuadraticExpr(), NULL, replaceBinaryProducts(), scaleConsSides(), SCIP_CALL, SCIP_EXPRITER_DFS, SCIP_EXPRITER_VISITINGCHILD, SCIP_OKAY, SCIPblkmem(), SCIPconsGetData(), SCIPconshdlrGetData(), SCIPcreateExpriter(), SCIPdebugMsg, SCIPexpriterInit(), SCIPexpriterSetStagesDFS(), SCIPfreeExpriter(), SCIPgetNBinVars(), SCIPgetNVars(), SCIPhashmapCreate(), SCIPhashmapFree(), and SCIPreleaseExpr().
Referenced by canonicalizeConstraints(), and replaceBinaryProducts().
◆ scaleConsSides()
|
static |
scales the sides of the constraint \(\ell \leq \sum_i c_i f_i(x) \leq r\).
Let \(n_+\) the number of positive coefficients \(c_i\) and \(n_-\) be the number of negative coefficients. Then scale by -1 if
- \(n_+ < n_-\), or
- \(n_+ = n_-\) and \(r = \infty\).
- Parameters
-
scip SCIP data structure conshdlr nonlinear constraint handler cons nonlinear constraint changed buffer to store if the expression of cons changed
Definition at line 4716 of file cons_nonlinear.c.
References forbidNonlinearVariablesMultiaggration(), NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPcaptureExpr(), SCIPconsGetData(), SCIPcreateExprSum(), SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPfreeBufferArray, SCIPgetCoefsExprSum(), SCIPgetConstantExprSum(), SCIPisExprSum(), SCIPisInfinity(), SCIPreleaseExpr(), SCIPswapReals(), and TRUE.
Referenced by canonicalizeConstraints(), and presolveBinaryProducts().
◆ forbidNonlinearVariablesMultiaggration()
|
static |
forbid multiaggrations of variables that appear nonlinear in constraints
- Parameters
-
scip SCIP data structure conshdlr constraint handler conss constraints nconss number of constraints
Definition at line 4799 of file cons_nonlinear.c.
References canonicalizeConstraints(), FALSE, NULL, SCIP_CALL, SCIP_EXPRITER_DFS, SCIP_OKAY, SCIPconsGetData(), SCIPconshdlrGetData(), SCIPcreateExpriter(), SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPexpriterGetNext(), SCIPexpriterInit(), SCIPexpriterIsEnd(), SCIPexpriterRestartDFS(), SCIPfreeExpriter(), SCIPgetVarExprVar(), SCIPisExprSum(), SCIPisExprVar(), and SCIPmarkDoNotMultaggrVar().
Referenced by canonicalizeConstraints(), and scaleConsSides().
◆ canonicalizeConstraints()
|
static |
simplifies expressions and replaces common subexpressions for a set of constraints
- Parameters
-
scip SCIP data structure conshdlr constraint handler conss constraints nconss total number of constraints presoltiming presolve timing (SCIP_PRESOLTIMING_ALWAYS if not in presolving) infeasible buffer to store whether infeasibility has been detected ndelconss counter to add number of deleted constraints, or NULL naddconss counter to add number of added constraints, or NULL nchgcoefs counter to add number of changed coefficients, or NULL
Definition at line 4866 of file cons_nonlinear.c.
References addLocks(), catchVarEvents(), deinitSolve(), dropVarEvents(), FALSE, forbidNonlinearVariablesMultiaggration(), freeVarExprs(), initSolve(), SCIP_Cons::nlockspos, NULL, presolveBinaryProducts(), presolveMergeConss(), scaleConsSides(), SCIP_Bool, SCIP_CALL, SCIP_EXPRITER_RTOPOLOGIC, SCIP_OKAY, SCIP_PRESOLTIMING_EXHAUSTIVE, SCIP_Real, SCIP_STAGE_PRESOLVING, SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsDeleted(), SCIPcreateExpriter(), SCIPdebugMsg, SCIPdebugPrintCons, SCIPdelCons(), SCIPduplicateBufferArray, SCIPexprGetOwnerData(), SCIPexpriterGetNext(), SCIPexpriterInit(), SCIPexpriterIsEnd(), SCIPfreeBufferArray, SCIPfreeExpriter(), SCIPgetStage(), SCIPgetValueExprValue(), SCIPisExprValue(), SCIPisFeasNegative(), SCIPisFeasPositive(), SCIPisInfinity(), SCIPnlhdlrResetNDetectionslast, SCIPreleaseExpr(), SCIPreplaceCommonSubexpressions(), SCIPsimplifyExpr(), SCIPsortPtr(), SCIPstartClock(), SCIPstopClock(), storeVarExprs(), and TRUE.
Referenced by forbidNonlinearVariablesMultiaggration(), SCIP_DECL_CONSEXITPRE(), and SCIP_DECL_CONSPRESOL().
◆ presolveMergeConss()
|
static |
merges constraints that have the same root expression
- Parameters
-
scip SCIP data structure conss constraints to process nconss number of constraints success pointer to store whether at least one constraint could be deleted
Definition at line 5138 of file cons_nonlinear.c.
References addLocks(), FALSE, MAX, SCIP_Cons::nlockspos, NULL, SCIP_Bool, SCIP_CALL, SCIP_DECL_EXPR_INTEVALVAR(), SCIP_OKAY, SCIPallocBufferArray, SCIPallocClearBufferArray, SCIPblkmem(), SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsDeleted(), SCIPdebugMsg, SCIPdelCons(), SCIPfreeBufferArray, SCIPhashmapCreate(), SCIPhashmapExists(), SCIPhashmapFree(), SCIPhashmapGetImageInt(), SCIPhashmapInsertInt(), SCIPisInfinity(), and TRUE.
Referenced by canonicalizeConstraints(), and SCIP_DECL_CONSPRESOL().
◆ SCIP_DECL_EXPR_INTEVALVAR() [2/2]
|
static |
interval evaluation of variables as used in redundancy check
Returns local variable bounds of a variable, relaxed by feastol, as interval.
Definition at line 5241 of file cons_nonlinear.c.
References infty2infty, NULL, presolveRedundantConss(), SCIP_INTERVAL_INFINITY, SCIP_Real, SCIPfeastol(), SCIPinfinity(), SCIPintervalSetBounds(), SCIPisInfinity(), SCIPisRelEQ(), SCIPvarGetLbGlobal(), SCIPvarGetLbLocal(), SCIPvarGetUbGlobal(), and SCIPvarGetUbLocal().
◆ presolveRedundantConss()
|
static |
removes constraints that are always feasible or very simple
Checks whether the activity of constraint functions is a subset of the constraint sides (relaxed by feastol). To compute the activity, we use forwardPropExpr(), but relax variable bounds by feastol, because solutions to be checked might violate variable bounds by up to feastol, too. This is the main reason why the redundancy check is not done in propConss(), which relaxes variable bounds by epsilon only.
Also removes constraints of the form lhs ≤ variable ≤ rhs.
- Note
- This could should not run during solving, because the forwardProp takes the bounds of auxiliary variables into account. For the root expression, these bounds are already set to the constraint sides, so that the activity of every expression would appear as if the constraint is redundant.
- Parameters
-
scip SCIP data structure conshdlr constraint handler conss constraints to propagate nconss total number of constraints cutoff pointer to store whether infeasibility has been identified ndelconss buffer to add the number of deleted constraints nchgbds buffer to add the number of variable bound tightenings
Definition at line 5304 of file cons_nonlinear.c.
References FALSE, forwardPropExpr(), SCIP_Interval::inf, NULL, presolveUpgrade(), SCIP_Bool, SCIP_CALL, SCIP_INTERVAL_INFINITY, SCIP_OKAY, SCIP_Real, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsActive(), SCIPconsIsDeleted(), SCIPdebugMsg, SCIPdebugPrintCons, SCIPdelConsLocal(), SCIPexprGetActivity(), SCIPexprGetActivityTag(), SCIPfeastol(), SCIPgetValueExprValue(), SCIPgetVarExprVar(), SCIPintervalIsEmpty(), SCIPintervalIsSubsetEQ(), SCIPintervalSetBounds(), SCIPisExprValue(), SCIPisExprVar(), SCIPisInfinity(), SCIPtightenVarLb(), SCIPtightenVarUb(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), SCIP_Interval::sup, and TRUE.
Referenced by SCIP_DECL_CONSPRESOL(), and SCIP_DECL_EXPR_INTEVALVAR().
◆ presolveUpgrade()
|
static |
tries to automatically convert a nonlinear constraint into a more specific and more specialized constraint
- Parameters
-
scip SCIP data structure conshdlr constraint handler data structure cons source constraint to try to convert upgraded buffer to store whether constraint was upgraded nupgdconss buffer to increase if constraint was upgraded naddconss buffer to increase with number of additional constraints created during upgrade
Definition at line 5473 of file cons_nonlinear.c.
References FALSE, isSingleLockedCand(), NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPaddCons(), SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsModifiable(), SCIPdebugMsg, SCIPdebugMsgPrint, SCIPdebugPrintCons, SCIPdelCons(), SCIPfreeBufferArray, SCIPreallocBufferArray, SCIPreleaseCons(), and TRUE.
Referenced by presolveRedundantConss(), and SCIP_DECL_CONSPRESOL().
◆ isSingleLockedCand()
returns whether the variable of a given variable expression is a candidate for presolveSingleLockedVars(), i.e., the variable is only contained in a single nonlinear constraint, has no objective coefficient, has finite variable bounds, and is not binary
- Parameters
-
scip SCIP data structure expr variable expression
Definition at line 5580 of file cons_nonlinear.c.
References NULL, removeSingleLockedVars(), SCIP_LOCKTYPE_MODEL, SCIP_VARTYPE_BINARY, SCIPexprGetOwnerData(), SCIPgetVarExprVar(), SCIPisEQ(), SCIPisExprVar(), SCIPisInfinity(), SCIPisZero(), SCIPvarGetLbGlobal(), SCIPvarGetNLocksDownType(), SCIPvarGetNLocksUpType(), SCIPvarGetObj(), SCIPvarGetType(), and SCIPvarGetUbGlobal().
Referenced by presolveSingleLockedVars(), and presolveUpgrade().
◆ removeSingleLockedVars()
|
static |
removes all variable expressions that are contained in a given expression from a hash map
- Parameters
-
scip SCIP data structure expr expression it expression iterator exprcands map to hash variable expressions
Definition at line 5606 of file cons_nonlinear.c.
References presolveSingleLockedVars(), SCIP_CALL, SCIP_OKAY, SCIPexpriterGetNext(), SCIPexpriterIsEnd(), SCIPexpriterRestartDFS(), SCIPhashmapExists(), SCIPhashmapRemove(), and SCIPisExprVar().
Referenced by isSingleLockedCand(), and presolveSingleLockedVars().
◆ presolveSingleLockedVars()
|
static |
presolving method to fix a variable \(x_i\) to one of its bounds if the variable is only contained in a single nonlinear constraint g(x) ≤ rhs (≥ lhs) if g() is concave (convex) in \(x_i\)
If a continuous variable has bounds [0,1], then the variable type is changed to be binary. Otherwise, a bound disjunction constraint is added.
- Parameters
-
scip SCIP data structure conshdlr nonlinear constraint handler cons nonlinear constraint nchgvartypes pointer to store the total number of changed variable types naddconss pointer to store the total number of added constraints infeasible pointer to store whether problem is infeasible
Definition at line 5639 of file cons_nonlinear.c.
References FALSE, isSingleLockedCand(), NULL, presolveImplint(), removeSingleLockedVars(), SCIP_Bool, SCIP_BOUNDTYPE_LOWER, SCIP_BOUNDTYPE_UPPER, SCIP_CALL, SCIP_EXPRITER_DFS, SCIP_EXPRITER_ENTEREXPR, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_BINARY, SCIPaddCons(), SCIPallocBufferArray, SCIPblkmem(), SCIPchgVarType(), SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPcreateConsBounddisjunction(), SCIPcreateExpriter(), SCIPdebugMsg, SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPexpriterInit(), SCIPexpriterSetStagesDFS(), SCIPfindConshdlr(), SCIPfreeBufferArray, SCIPfreeExpriter(), SCIPgetCoefsExprSum(), SCIPgetExponentExprPow(), SCIPgetVarExprVar(), SCIPhashmapCreate(), SCIPhashmapExists(), SCIPhashmapFree(), SCIPhashmapInsert(), SCIPisEQ(), SCIPisExprPower(), SCIPisExprProduct(), SCIPisExprSum(), SCIPisExprVar(), SCIPisInfinity(), SCIPreleaseCons(), SCIPsnprintf(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetType(), SCIPvarGetUbGlobal(), and TRUE.
Referenced by removeSingleLockedVars(), and SCIP_DECL_CONSPRESOL().
◆ presolveImplint()
|
static |
presolving method to check if there is a single linear continuous variable that can be made implicit integer
- Parameters
-
scip SCIP data structure conshdlr constraint handler conss nonlinear constraints nconss total number of nonlinear constraints nchgvartypes pointer to update the total number of changed variable types infeasible pointer to store whether problem is infeasible
Definition at line 5843 of file cons_nonlinear.c.
References createAuxVar(), FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_IMPLINT, SCIPchgVarType(), SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPexprIsIntegral(), SCIPexprSetIntegrality(), SCIPgetCoefsExprSum(), SCIPgetConstantExprSum(), SCIPgetNBinVars(), SCIPgetNContVars(), SCIPgetNIntVars(), SCIPgetVarExprVar(), SCIPisEQ(), SCIPisExprSum(), SCIPisExprVar(), SCIPisIntegral(), SCIPvarGetName(), SCIPvarIsIntegral(), and TRUE.
Referenced by presolveSingleLockedVars(), and SCIP_DECL_CONSPRESOL().
◆ createAuxVar()
|
static |
creates auxiliary variable for a given expression
- Note
- for a variable expression it does nothing
- this function can only be called in stage SCIP_STAGE_SOLVING
- Parameters
-
scip SCIP data structure expr expression
Definition at line 5972 of file cons_nonlinear.c.
References SCIP_Interval::inf, initSepa(), MAX, NULL, SCIP_Bool, SCIP_CALL, SCIP_INTERVAL_INFINITY, SCIP_INVALIDCALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_STAGE_SOLVING, SCIP_VARTYPE_CONTINUOUS, SCIP_VARTYPE_IMPLINT, SCIPABORT, SCIPaddVar(), SCIPaddVarLocks(), SCIPconshdlrGetData(), SCIPcreateVarBasic(), SCIPdebugAddSolVal, SCIPdebugMsg, SCIPerrorMessage, SCIPexprGetActivity(), SCIPexprGetActivityTag(), SCIPexprGetEvalValue(), SCIPexprGetHdlr(), SCIPexprGetOwnerData(), SCIPexprhdlrGetName(), SCIPexprIsIntegral(), SCIPgetDepth(), SCIPgetStage(), SCIPinfinity(), SCIPintervalIsEmpty(), SCIPintervalSetEntire(), SCIPisExprValue(), SCIPisExprVar(), SCIPsnprintf(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), SCIPvarMarkRelaxationOnly(), SCIP_Interval::sup, and tightenAuxVarBounds().
Referenced by initSepa(), and presolveImplint().
◆ initSepa()
|
static |
initializes separation for constraint
- ensures that activities are up to date in all expressions
- creates auxiliary variables where required
- calls propExprDomains() to possibly tighten auxvar bounds
- calls separation initialization callback of nlhdlrs
- Parameters
-
scip SCIP data structure conshdlr nonlinear constraints handler conss constraints nconss number of constraints infeasible pointer to store whether the problem is infeasible or not
Definition at line 6095 of file cons_nonlinear.c.
References branchAuxNonlinear(), createAuxVar(), FALSE, NULL, propExprDomains(), SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_EXPRITER_DFS, SCIP_NLHDLR_METHOD_SEPABOTH, SCIP_OKAY, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPcreateExpriter(), SCIPdebugMsg, SCIPevalExpr(), SCIPevalExprActivity(), SCIPexprGetOwnerData(), SCIPexpriterGetNext(), SCIPexpriterInit(), SCIPexpriterIsEnd(), SCIPexpriterRestartDFS(), SCIPfreeExpriter(), SCIPnlhdlrHasInitSepa(), SCIPtightenVarLb(), SCIPtightenVarUb(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), and TRUE.
Referenced by createAuxVar(), and SCIP_DECL_CONSINITLP().
◆ branchAuxNonlinear()
|
static |
returns whether we are ok to branch on auxiliary variables
Currently returns whether depth of node in B&B tree is at least value of constraints/nonlinear/branching/aux parameter.
- Parameters
-
scip SCIP data structure conshdlr constraint handler
Definition at line 6277 of file cons_nonlinear.c.
References getViolSplitWeight(), NULL, SCIP_Real, SCIPconshdlrGetData(), and SCIPgetDepth().
Referenced by collectBranchingCandidates(), initSepa(), registerBranchingCandidates(), SCIPaddExprsViolScoreNonlinear(), and SCIPaddExprViolScoreNonlinear().
◆ getViolSplitWeight()
|
static |
gets weight of variable when splitting violation score onto several variables in an expression
- Parameters
-
scip SCIP data structure conshdlr expr constraint handler var variable sol current solution
Definition at line 6294 of file cons_nonlinear.c.
References addExprsViolScore(), MAX, NULL, SCIP_INVALID, SCIP_Real, SCIPABORT, SCIPconshdlrGetData(), SCIPerrorMessage, SCIPgetSolVal(), SCIPvarGetLbLocal(), and SCIPvarGetUbLocal().
Referenced by addExprsViolScore(), and branchAuxNonlinear().
◆ addExprsViolScore()
|
static |
adds violation-branching score to a set of expressions, thereby distributing the score
Each expression must either be a variable expression or have an aux-variable.
If unbounded variables are present, each unbounded var gets an even score. If no unbounded variables, then parameter constraints/nonlinear/branching/violsplit decides weight for each var.
- Parameters
-
scip SCIP data structure exprs expressions where to add branching score nexprs number of expressions violscore violation-branching score to add to expression sol current solution success buffer to store whether at least one violscore was added
Definition at line 6347 of file cons_nonlinear.c.
References addExprViolScoresAuxVars(), FALSE, getViolSplitWeight(), NULL, SCIP_Real, SCIPaddExprViolScoreNonlinear(), SCIPdebugMsg, SCIPexprGetOwnerData(), SCIPgetExprAuxVarNonlinear(), SCIPisEQ(), SCIPisInfinity(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), and TRUE.
Referenced by getViolSplitWeight(), and SCIPaddExprsViolScoreNonlinear().
◆ addExprViolScoresAuxVars()
|
static |
adds violation-branching score to children of expression for given auxiliary variables
Iterates over the successors of expr
to find expressions that are associated with one of the given auxiliary variables. Adds violation-branching scores to all found exprs by means of SCIPaddExprsViolScoreNonlinear().
- Note
- This method may modify the given auxvars array by means of sorting.
- Parameters
-
scip SCIP data structure expr expression where to start searching violscore violation score to add to expression auxvars auxiliary variables for which to find expression nauxvars number of auxiliary variables sol current solution (NULL for the LP solution) success buffer to store whether at least one violscore was added
Definition at line 6433 of file cons_nonlinear.c.
References FALSE, NULL, registerBranchingCandidatesAllUnfixed(), SCIP_CALL, SCIP_EXPRITER_BFS, SCIP_OKAY, SCIPaddExprsViolScoreNonlinear(), SCIPallocBufferArray, SCIPcreateExpriter(), SCIPdebugMsg, SCIPexpriterGetNext(), SCIPexpriterInit(), SCIPexpriterIsEnd(), SCIPfreeBufferArray, SCIPfreeExpriter(), SCIPgetExprAuxVarNonlinear(), SCIPsortedvecFindPtr(), SCIPsortPtr(), and SCIPvarGetName().
Referenced by addExprsViolScore(), and SCIPprocessRowprepNonlinear().
◆ registerBranchingCandidatesAllUnfixed()
|
static |
registers all unfixed variables in violated constraints as branching candidates
- Parameters
-
scip SCIP data structure conshdlr nonlinear constraints handler conss constraints nconss number of constraints nnotify counter for number of notifications performed
Definition at line 6498 of file cons_nonlinear.c.
References getConsAbsViolation(), isConsViolated(), NULL, registerBranchingCandidates(), SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIPaddExternBranchCand(), SCIPconsGetData(), SCIPgetVarExprVar(), SCIPisEQ(), SCIPvarGetLbLocal(), and SCIPvarGetUbLocal().
Referenced by addExprViolScoresAuxVars(), consEnfo(), and SCIP_DECL_CONSENFOPS().
◆ registerBranchingCandidates()
|
static |
registers all variables in violated constraints with branching scores as external branching candidates
- Parameters
-
scip SCIP data structure conshdlr nonlinear constraints handler conss constraints nconss number of constraints success buffer to store whether at least one branching candidate was added
Definition at line 6548 of file cons_nonlinear.c.
References branchAuxNonlinear(), collectBranchingCandidates(), ENFOLOG, FALSE, isConsViolated(), NULL, SCIP_CALL, SCIP_EXPRITER_DFS, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPaddExternBranchCand(), SCIPconsGetData(), SCIPcreateExpriter(), SCIPexprGetOwnerData(), SCIPexpriterGetNext(), SCIPexpriterInit(), SCIPexpriterIsEnd(), SCIPexpriterRestartDFS(), SCIPfreeExpriter(), SCIPgetExprAuxVarNonlinear(), SCIPgetExprViolScoreNonlinear(), SCIPgetVarExprVar(), SCIPinfoMessage(), SCIPisEQ(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), and TRUE.
Referenced by branching(), and registerBranchingCandidatesAllUnfixed().
◆ collectBranchingCandidates()
|
static |
collect branching candidates from violated constraints
Fills array with expressions that serve as branching candidates. Collects those expressions that have a branching score assigned and stores the score in the auxviol field of the branching candidate.
If branching on aux-variables is allowed, then iterate through expressions of violated constraints, otherwise iterate through variable-expressions only.
- Parameters
-
scip SCIP data structure conshdlr constraint handler conss constraints to process nconss number of constraints maxrelconsviol maximal scaled constraint violation sol solution to enforce (NULL for the LP solution) soltag tag of solution cands array where to store candidates, must be at least SCIPgetNVars() long ncands number of candidates found
Definition at line 6683 of file cons_nonlinear.c.
References BRANCHCAND::auxviol, branchAuxNonlinear(), ENFOLOG, BRANCHCAND::expr, FALSE, getConsRelViolation(), getDualBranchscore(), isConsViolated(), NULL, SCIP_CALL, SCIP_EXPRITER_DFS, SCIP_OKAY, SCIP_Real, SCIPconsGetData(), SCIPconshdlrGetData(), SCIPcreateExpriter(), SCIPexprGetOwnerData(), SCIPexpriterGetNext(), SCIPexpriterInit(), SCIPexpriterIsEnd(), SCIPexpriterRestartDFS(), SCIPfreeExpriter(), SCIPgetExprAuxVarNonlinear(), SCIPgetExprViolScoreNonlinear(), SCIPgetNVars(), SCIPgetVarExprVar(), SCIPinfoMessage(), SCIPisEQ(), SCIPvarGetLbLocal(), SCIPvarGetName(), and SCIPvarGetUbLocal().
Referenced by branching(), and registerBranchingCandidates().
◆ getDualBranchscore()
|
static |
computes a branching score for a variable that reflects how important branching on this variable would be for improving the dual bound from the LP relaxation
Assume the Lagrangian for the current LP is something of the form L(x,z,lambda) = c'x + sum_i lambda_i (a_i'x - z_i + b_i) + ... where x are the original variables, z the auxiliary variables, and a_i'x - z_i + b_i <= 0 are the rows of the LP.
Assume that a_i'x + b_i <= z_i was derived from some nonlinear constraint f(x) <= z and drop index i. If we could have used not only an estimator, but the actual function f(x), then this would have contributed lambda*(f(x) - z) to the Lagrangian function (though the value of z would be different). Using a lot of handwaving, we claim that lambda_i * (f(x) - a_i'x + b_i) is a value that can be used to quantity how much improving the estimator a'x + b <= z could change the dual bound. If an estimator depended on local bounds, then it could be improved by branching. We use row-is-local as proxy for estimator-depending-on-lower-bounds.
To score a variable, we then sum the values lambda_i * (f(x) - a_i'x + b_i) for all rows in which the variable appears. To scale, we divide by the LP objective value (if >1).
TODO if we branch only on original variables, we neglect here estimators that are build on auxiliary variables; these are affected by the bounds on original variables indirectly (through forward-propagation)
TODO if we branch also on auxiliary variables, then separating z from the x-variables in the row a'x+b <= z should happen; in effect, we should go from the row to the expression for which it was generated and consider only variables that would also be branching candidates
- Parameters
-
scip SCIP data structure conshdlr nonlinear constraints handler var variable
Definition at line 6859 of file cons_nonlinear.c.
References MAX, NULL, r, REALABS, SCIP_LPSOLSTAT_OPTIMAL, SCIP_Real, SCIP_VARSTATUS_COLUMN, SCIPcolGetNLPNonz(), SCIPcolGetRows(), SCIPcolIsInLP(), SCIPgetHugeValue(), SCIPgetLPObjval(), SCIPgetLPSolstat(), SCIPisFinite, SCIPisHugeValue(), SCIPisZero(), SCIProwGetDualsol(), SCIProwGetName(), SCIProwGetOriginConshdlr(), SCIPvarGetCol(), SCIPvarGetStatus(), and scoreBranchingCandidates().
Referenced by collectBranchingCandidates(), and scoreBranchingCandidates().
◆ scoreBranchingCandidates()
|
static |
computes branching scores (including weighted score) for a set of candidates
For each candidate in the array, compute and store the various branching scores (violation, pseudo-costs, vartype, domainwidth). For pseudo-costs, it's possible that the score is not available, in which case cands[c].pscost will be set to SCIP_INVALID.
For each score, compute the maximum over all candidates.
Then compute for each candidate a "weighted" score using the weights as specified by parameters and the scores as previously computed, but scale each score to be in [0,1], i.e., divide each score by the maximum score of all candidates. Further divide by the sum of all weights where a score was available (even if the score was 0).
For example:
- Let variable x have violation-score 10.0 and pseudo-cost-score 5.0.
- Let variable y have violation-score 12.0 but no pseudo-cost-score (because it hasn't yet been branched on sufficiently often).
- Assuming violation is weighted by 2.0 and pseudo-costs are weighted by 3.0.
- Then the weighted scores for x will be (2.0 * 10.0/12.0 + 3.0 * 5.0/5.0) / (2.0 + 3.0) = 0.9333. The weighted score for y will be (2.0 * 12.0/12.0) / 2.0 = 1.0.
- Parameters
-
scip SCIP data structure conshdlr constraint handler cands branching candidates ncands number of candidates sol solution to enforce (NULL for the LP solution)
Definition at line 6955 of file cons_nonlinear.c.
References BRANCHCAND::auxviol, BRANCHCAND::domain, BRANCHCAND::dual, ENFOLOG, getDualBranchscore(), MAX, NULL, BRANCHCAND::pscost, SCIP_BRANCHDIR_DOWNWARDS, SCIP_BRANCHDIR_UPWARDS, SCIP_DECL_SORTINDCOMP(), SCIP_INVALID, SCIP_Real, SCIP_VARTYPE_BINARY, SCIP_VARTYPE_CONTINUOUS, SCIP_VARTYPE_IMPLINT, SCIP_VARTYPE_INTEGER, SCIPadjustedVarLb(), SCIPadjustedVarUb(), SCIPconshdlrGetData(), SCIPepsilon(), SCIPerrorMessage, SCIPgetBranchingPoint(), SCIPgetBranchScore(), SCIPgetExprAuxVarNonlinear(), SCIPgetNObjVars(), SCIPgetSolVal(), SCIPgetVarPseudocostCountCurrentRun(), SCIPgetVarPseudocostVal(), SCIPinfinity(), SCIPinfoMessage(), SCIPisInfinity(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetType(), SCIPvarGetUbLocal(), BRANCHCAND::vartype, and BRANCHCAND::weighted.
Referenced by branching(), and getDualBranchscore().
◆ SCIP_DECL_SORTINDCOMP()
|
static |
compare two branching candidates by their weighted score
if weighted score is equal, use variable index of (aux)var
Definition at line 7225 of file cons_nonlinear.c.
References branching(), SCIPgetExprAuxVarNonlinear(), SCIPvarGetIndex(), and BRANCHCAND::weighted.
Referenced by scoreBranchingCandidates().
◆ branching()
|
static |
do branching or register branching candidates
- Parameters
-
scip SCIP data structure conshdlr constraint handler conss constraints to process nconss number of constraints maxrelconsviol maximal scaled constraint violation sol solution to enforce (NULL for the LP solution) soltag tag of solution result pointer to store the result of branching
Definition at line 7237 of file cons_nonlinear.c.
References BRANCH_RANDNUMINITSEED, collectBranchingCandidates(), ENFOLOG, enforceExprNlhdlr(), NULL, registerBranchingCandidates(), SCIP_Bool, SCIP_BRANCHED, SCIP_CALL, SCIP_DIDNOTFIND, SCIP_INFEASIBLE, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIP_REDUCEDDOM, SCIPallocBufferArray, SCIPbranchVarVal(), SCIPconshdlrGetData(), SCIPcreateRandom(), SCIPfreeBufferArray, SCIPgetBranchingPoint(), SCIPgetExprAuxVarNonlinear(), SCIPgetNVars(), SCIPinfoMessage(), SCIPrandomGetInt(), SCIPsortDown(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), scoreBranchingCandidates(), and TRUE.
Referenced by enforceConstraints(), and SCIP_DECL_SORTINDCOMP().
◆ enforceExprNlhdlr()
|
static |
call enforcement or estimate callback of nonlinear handler
Calls the enforcement callback, if available. Otherwise, calls the estimate callback, if available, and constructs a cut from the estimator.
If cut is weak, but estimator is not tight, tries to add branching candidates.
- Parameters
-
scip SCIP main data structure conshdlr constraint handler cons nonlinear constraint nlhdlr nonlinear handler expr expression nlhdlrexprdata nonlinear handler data of expression sol solution to be separated (NULL for the LP solution) auxvalue current value of expression w.r.t. auxiliary variables as obtained from EVALAUX overestimate whether the expression needs to be over- or underestimated separated whether another nonlinear handler already added a cut for this expression allowweakcuts whether we allow for weak cuts inenforcement whether we are in enforcement (and not just separation) result pointer to store the result
Definition at line 7385 of file cons_nonlinear.c.
References ENFOLOG, enforceExpr(), FALSE, NULL, r, SCIP_Bool, SCIP_CALL, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_OKAY, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIPaddRowprepTerm(), SCIPcreatePtrarray(), SCIPfreePtrarray(), SCIPfreeRowprep(), SCIPgetExprAuxVarNonlinear(), SCIPgetPtrarrayMaxIdx(), SCIPgetPtrarrayMinIdx(), SCIPgetPtrarrayVal(), SCIPgetSolVal(), SCIPinfoMessage(), SCIPnlhdlrGetName(), SCIPnlhdlrHasEstimate(), SCIPprocessRowprepNonlinear(), and SCIProwprepGetSidetype().
Referenced by branching(), and enforceExpr().
◆ enforceExpr()
|
static |
tries to enforce violation in an expression by separation, bound tightening, or finding a branching candidate
if not inenforcement, then we should be called by consSepa(), and thus only try separation
- Parameters
-
scip SCIP data structure conshdlr nonlinear constraints handler cons nonlinear constraint expr expression sol solution to separate, or NULL if LP solution should be used soltag tag of solution allowweakcuts whether we allow weak cuts inenforcement whether we are in enforcement (and not just separation) result pointer to store the result of the enforcing call
Definition at line 7480 of file cons_nonlinear.c.
References ENFOLOG, enforceConstraint(), enforceExprNlhdlr(), FALSE, getExprAbsAuxViolation(), getExprAbsOrigViolation(), NULL, SCIP_Bool, SCIP_BRANCHED, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_NLHDLR_METHOD_SEPAABOVE, SCIP_NLHDLR_METHOD_SEPABELOW, SCIP_NLHDLR_METHOD_SEPABOTH, SCIP_OKAY, SCIP_Real, SCIP_REDUCEDDOM, SCIP_SEPARATED, SCIPconshdlrGetData(), SCIPevalExpr(), SCIPexprGetActivity(), SCIPexprGetEvalValue(), SCIPexprGetHdlr(), SCIPexprGetOwnerData(), SCIPexprhdlrGetName(), SCIPfeastol(), SCIPgetSolVal(), SCIPinfoMessage(), SCIPisInfinity(), SCIPnlhdlrGetName(), SCIPprintExpr(), and TRUE.
Referenced by enforceConstraint(), and enforceExprNlhdlr().
◆ enforceConstraint()
|
static |
helper function to enforce a single constraint
- Parameters
-
scip SCIP data structure conshdlr constraint handler cons constraint to process sol solution to enforce (NULL for the LP solution) soltag tag of solution it expression iterator that we can just use here allowweakcuts whether to allow weak cuts in this round inenforcement whether to we are in enforcement, and not just separation result pointer to update with result of the enforcing call success buffer to store whether some enforcement took place
Definition at line 7689 of file cons_nonlinear.c.
References ENFOLOG, enforceConstraints(), enforceExpr(), FALSE, forwardPropExpr(), NULL, SCIP_Bool, SCIP_BRANCHED, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_REDUCEDDOM, SCIP_SEPARATED, SCIPconsGetData(), SCIPconshdlrGetData(), SCIPexprGetOwnerData(), SCIPexpriterGetNext(), SCIPexpriterIsEnd(), SCIPexpriterRestartDFS(), SCIPinfoMessage(), SCIPprintExpr(), and TRUE.
Referenced by enforceConstraints(), and enforceExpr().
◆ enforceConstraints()
|
static |
try to separate violated constraints and, if in enforcement, register branching scores
Sets result to
- SCIP_DIDNOTFIND, if nothing of the below has been done
- SCIP_CUTOFF, if node can be cutoff,
- SCIP_SEPARATED, if a cut has been added,
- SCIP_REDUCEDDOM, if a domain reduction has been found,
- SCIP_BRANCHED, if branching has been done,
- SCIP_REDUCEDDOM, if a variable got fixed (in an attempt to branch on it),
- SCIP_INFEASIBLE, if external branching candidates were registered
- Parameters
-
scip SCIP data structure conshdlr constraint handler conss constraints to process nconss number of constraints sol solution to enforce (NULL for the LP solution) soltag tag of solution inenforcement whether we are in enforcement, and not just separation maxrelconsviol largest scaled violation among all violated expr-constraints, only used if in enforcement result pointer to store the result of the enforcing call
Definition at line 7807 of file cons_nonlinear.c.
References analyzeViolation(), branching(), ENFOLOG, enforceConstraint(), FALSE, getConsAbsViolation(), getConsRelViolation(), isConsViolated(), NULL, SCIP_Bool, SCIP_BRANCHED, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_EXPRITER_DFS, SCIP_INFEASIBLE, SCIP_OKAY, SCIP_Real, SCIP_REDUCEDDOM, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsActive(), SCIPconsIsDeleted(), SCIPconsIsEnabled(), SCIPconsIsSeparationEnabled(), SCIPcreateExpriter(), SCIPexpriterInit(), SCIPfreeExpriter(), SCIPgetSolVal(), SCIPgetVarExprVar(), SCIPinfoMessage(), SCIPprintCons(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), and TRUE.
Referenced by consEnfo(), consSepa(), and enforceConstraint().
◆ analyzeViolation()
|
static |
collect (and print (if debugging enfo)) information on violation in expressions
assumes that constraint violations have been computed
- Parameters
-
scip SCIP data structure conss constraints nconss number of constraints sol solution to separate, or NULL if LP solution should be used soltag tag of solution maxabsconsviol buffer to store maximal absolute violation of constraints maxrelconsviol buffer to store maximal relative violation of constraints minauxviol buffer to store minimal (nonzero) violation of auxiliaries maxauxviol buffer to store maximal violation of auxiliaries (violation in "extended formulation") maxvarboundviol buffer to store maximal violation of variable bounds
Definition at line 7933 of file cons_nonlinear.c.
References consEnfo(), ENFOLOG, FALSE, getConsAbsViolation(), getConsRelViolation(), getExprAbsAuxViolation(), getExprAbsOrigViolation(), isConsViolated(), MAX, NULL, SCIP_Bool, SCIP_CALL, SCIP_EXPRITER_DFS, SCIP_NLHDLR_METHOD_SEPABOTH, SCIP_OKAY, SCIP_Real, SCIPconsGetData(), SCIPconsIsActive(), SCIPconsIsDeleted(), SCIPconsIsEnabled(), SCIPconsIsSeparationEnabled(), SCIPcreateExpriter(), SCIPexprGetActivity(), SCIPexprGetEvalValue(), SCIPexprGetOwnerData(), SCIPexpriterGetNext(), SCIPexpriterInit(), SCIPexpriterIsEnd(), SCIPexpriterRestartDFS(), SCIPfreeExpriter(), SCIPgetSolVal(), SCIPgetVarExprVar(), SCIPinfinity(), SCIPinfoMessage(), SCIPisExprVar(), SCIPisInfinity(), SCIPnlhdlrGetName(), SCIPprintExpr(), SCIPvarGetLbLocal(), SCIPvarGetName(), and SCIPvarGetUbLocal().
Referenced by consEnfo(), and enforceConstraints().
◆ consEnfo()
|
static |
enforcement of constraints called by enfolp and enforelax
- Parameters
-
scip SCIP data structure conshdlr constraint handler conss constraints to process nconss number of constraints sol solution to enforce (NULL for the LP solution) result pointer to store the result of the enforcing call
Definition at line 8109 of file cons_nonlinear.c.
References analyzeViolation(), computeViolation(), consSepa(), ENFOLOG, enforceConstraints(), isConsViolated(), MAX, NULL, propConss(), registerBranchingCandidatesAllUnfixed(), SCIP_BRANCHED, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_FEASIBLE, SCIP_INFEASIBLE, SCIP_Longint, SCIP_OKAY, SCIP_Real, SCIP_REDUCEDDOM, SCIP_SEPARATED, SCIP_SOLVELP, SCIPconshdlrGetData(), SCIPepsilon(), SCIPgetCurrentNode(), SCIPgetExprNewSoltag(), SCIPgetLPFeastol(), SCIPinfoMessage(), SCIPisPositive(), SCIPisZero(), SCIPnodeGetNumber(), SCIPsetLPFeastol(), and TRUE.
Referenced by analyzeViolation(), SCIP_DECL_CONSENFOLP(), and SCIP_DECL_CONSENFORELAX().
◆ consSepa()
|
static |
separation for all violated constraints to be used by SEPA callbacks
- Parameters
-
scip SCIP data structure conshdlr constraint handler conss constraints to process nconss number of constraints sol solution to enforce (NULL for the LP solution) result pointer to store the result of the enforcing call
Definition at line 8301 of file cons_nonlinear.c.
References computeViolation(), ENFOLOG, enforceConstraints(), FALSE, isConsViolated(), NULL, SCIP_Bool, SCIP_CALL, SCIP_DECL_HASHGETKEY(), SCIP_DIDNOTFIND, SCIP_INVALID, SCIP_Longint, SCIP_OKAY, SCIPconsIsActive(), SCIPconsIsDeleted(), SCIPconsIsEnabled(), SCIPconsIsSeparationEnabled(), SCIPgetCurrentNode(), SCIPgetExprNewSoltag(), SCIPinfoMessage(), SCIPnodeGetNumber(), and TRUE.
Referenced by consEnfo(), SCIP_DECL_CONSSEPALP(), and SCIP_DECL_CONSSEPASOL().
◆ SCIP_DECL_HASHGETKEY()
|
static |
hash key retrieval function for bilinear term entries
Definition at line 8351 of file cons_nonlinear.c.
References NULL, and SCIP_DECL_HASHKEYEQ().
Referenced by consSepa().
◆ SCIP_DECL_HASHKEYEQ()
|
static |
returns TRUE iff the bilinear term entries are equal
Definition at line 8367 of file cons_nonlinear.c.
References NULL, SCIP_DECL_HASHKEYVAL(), SCIPvarCompare(), SCIP_ConsNonlinear_BilinTerm::x, and SCIP_ConsNonlinear_BilinTerm::y.
Referenced by SCIP_DECL_HASHGETKEY().
◆ SCIP_DECL_HASHKEYVAL()
|
static |
returns the hash value of the key
Definition at line 8385 of file cons_nonlinear.c.
References NULL, SCIP_DECL_SORTPTRCOMP(), SCIPhashTwo, SCIPvarCompare(), SCIPvarGetIndex(), SCIP_ConsNonlinear_BilinTerm::x, and SCIP_ConsNonlinear_BilinTerm::y.
Referenced by SCIP_DECL_HASHKEYEQ().
◆ SCIP_DECL_SORTPTRCOMP() [3/3]
|
static |
compare two auxiliary expressions
Compares auxiliary variables, followed by coefficients, and then constants.
Definition at line 8401 of file cons_nonlinear.c.
References SCIP_ConsNonlinear_Auxexpr::auxvar, bilinTermAddAuxExpr(), SCIP_ConsNonlinear_Auxexpr::coefs, SCIP_ConsNonlinear_Auxexpr::cst, and SCIPvarCompare().
◆ bilinTermAddAuxExpr()
|
static |
- Parameters
-
scip SCIP data structure conshdlrdata nonlinear constraint handler data term bilinear term auxexpr auxiliary expression to add added pointer to store whether auxexpr has been added
Definition at line 8426 of file cons_nonlinear.c.
References SCIP_ConsNonlinear_BilinTerm::aux, SCIP_ConsNonlinear_BilinTerm::auxexprssize, bilinearTermsInsertAll(), SCIP_ConsNonlinear_BilinTerm::exprs, FALSE, SCIP_ConsNonlinear_BilinTerm::nauxexprs, SCIP_ConsNonlinear_Auxexpr::overestimate, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPensureBlockMemoryArray, SCIPsortedvecFindPtr(), TRUE, and SCIP_ConsNonlinear_Auxexpr::underestimate.
Referenced by SCIP_DECL_SORTPTRCOMP(), and SCIPinsertBilinearTermImplicitNonlinear().
◆ bilinearTermsInsertAll()
|
static |
iterates through all expressions of all nonlinear constraints and adds the corresponding bilinear terms to the hash table
- Parameters
-
scip SCIP data structure conshdlr constraint handler conss nonlinear constraints nconss total number of nonlinear constraints
Definition at line 8479 of file cons_nonlinear.c.
References bilinearTermsInsertEntry(), FALSE, NULL, SCIP_CALL, SCIP_EXPRITER_DFS, SCIP_EXPRITER_ENTEREXPR, SCIP_OKAY, SCIPconsGetData(), SCIPconshdlrGetData(), SCIPcreateExpriter(), SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPexpriterGetNext(), SCIPexpriterInit(), SCIPexpriterIsEnd(), SCIPexpriterRestartDFS(), SCIPexpriterSetStagesDFS(), SCIPfreeExpriter(), SCIPgetExponentExprPow(), SCIPgetExprAuxVarNonlinear(), SCIPgetExprNLocksNegNonlinear(), SCIPgetExprNLocksPosNonlinear(), SCIPinsertBilinearTermExistingNonlinear(), SCIPisExprPower(), SCIPisExprProduct(), x, and y.
Referenced by bilinTermAddAuxExpr(), SCIP_DECL_CONSINITLP(), and SCIPcollectBilinTermsNonlinear().
◆ bilinearTermsInsertEntry()
|
static |
store x, y and the locks in a new bilinear term
- Parameters
-
scip SCIP data structure conshdlr nonlinear constraint handler x the first variable y the second variable nlockspos number of positive locks of the bilinear term nlocksneg number of negative locks of the bilinear term idx pointer to store the position of the term in bilinterms array existing whether the term exists explicitly in the problem
Definition at line 8554 of file cons_nonlinear.c.
References SCIP_ConsNonlinear_BilinTerm::aux, SCIP_ConsNonlinear_BilinTerm::auxexprssize, bilinearTermsFree(), SCIP_ConsNonlinear_BilinTerm::existing, SCIP_ConsNonlinear_BilinTerm::exprs, SCIP_ConsNonlinear_BilinTerm::nauxexprs, SCIP_ConsNonlinear_BilinTerm::nlocksneg, SCIP_ConsNonlinear_BilinTerm::nlockspos, NULL, SCIP_CALL, SCIP_OKAY, SCIPblkmem(), SCIPcaptureVar(), SCIPconshdlrGetData(), SCIPensureBlockMemoryArray, SCIPgetBilinTermIdxNonlinear(), SCIPhashtableCreate(), SCIPhashtableInsert(), SCIPswapPointers(), SCIPvarCompare(), SCIP_ConsNonlinear_BilinTerm::var, x, SCIP_ConsNonlinear_BilinTerm::x, y, and SCIP_ConsNonlinear_BilinTerm::y.
Referenced by bilinearTermsInsertAll(), SCIPinsertBilinearTermExistingNonlinear(), and SCIPinsertBilinearTermImplicitNonlinear().
◆ bilinearTermsFree()
|
static |
frees array of bilinear terms and hash table
- Parameters
-
scip SCIP data structure conshdlrdata constraint handler data
Definition at line 8647 of file cons_nonlinear.c.
References buildVertexPolyhedralSeparationLP(), NULL, SCIP_CALL, SCIP_OKAY, SCIPfreeBlockMemory, SCIPfreeBlockMemoryArray, SCIPfreeBlockMemoryArrayNull, SCIPhashtableFree(), and SCIPreleaseVar().
Referenced by bilinearTermsInsertEntry(), and SCIP_DECL_CONSEXITSOL().
◆ buildVertexPolyhedralSeparationLP()
|
static |
builds LP used to compute facets of the convex envelope of vertex-polyhedral functions
- Parameters
-
scip SCIP data structure nvars number of (unfixed) variables in vertex-polyhedral functions lp pointer to store created LP
Definition at line 8717 of file cons_nonlinear.c.
References a, computeVertexPolyhedralMaxFacetError(), NULL, POWEROFTWO, SCIP_CALL, SCIP_MAXVERTEXPOLYDIM, SCIP_OBJSEN_MINIMIZE, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPallocClearBufferArray, SCIPdebugMsg, SCIPfreeBufferArray, SCIPgetMessagehdlr(), SCIPlpiChgSides(), SCIPlpiCreate(), SCIPlpiInfinity(), and SCIPlpiLoadColLP().
Referenced by bilinearTermsFree(), and computeVertexPolyhedralFacetLP().
◆ computeVertexPolyhedralMaxFacetError()
|
static |
the given facet might not be a valid under(over)estimator, because of numerics and bad fixings; we compute \( \max_{v \in V} f(v) - (\alpha v + \beta) \) ( \(\max_{v \in V} \alpha v + \beta - f(v) \)) where \( V \) is the set of vertices of the domain
- Parameters
-
scip SCIP data structure overestimate whether we check for an over or underestimator funvals array containing the evaluation of the function at all corners, length: 2^nvars box box for which facet was computed, length: 2*nallvars nallvars number of all variables nvars number of unfixed variables nonfixedpos indices of unfixed variables, length: nvars facetcoefs current facet candidate's coefficients, length: nallvars facetconstant current facet candidate's constant, length: nallvars
Definition at line 8828 of file cons_nonlinear.c.
References computeVertexPolyhedralFacetLP(), MAX, NULL, POWEROFTWO, SCIP_Real, and SCIPdebugMsg.
Referenced by buildVertexPolyhedralSeparationLP(), and SCIPcomputeFacetVertexPolyhedralNonlinear().
◆ computeVertexPolyhedralFacetLP()
|
static |
computes a facet of the convex or concave envelope of a vertex polyhedral function by solving an LP
- Parameters
-
scip SCIP data structure conshdlr nonlinear constraint handler overestimate whether to compute facet of concave (TRUE) or convex (FALSE) envelope xstar point to be separated box box where to compute facet: should be lb_1, ub_1, lb_2, ub_2... nallvars half of the length of box nonfixedpos indices of nonfixed variables funvals values of function in all corner points (w.r.t. nonfixed variables) nvars number of nonfixed variables targetvalue target value: no need to compute facet if value in xstar would be worse than this value success buffer to store whether a facet could be computed successfully facetcoefs buffer to store coefficients of facet defining inequality; must be an zero'ed array of length at least nallvars facetconstant buffer to store constant part of facet defining inequality
Definition at line 8916 of file cons_nonlinear.c.
References buildVertexPolyhedralSeparationLP(), computeVertexPolyhedralFacetUnivariate(), FALSE, MAX, NULL, POWEROFTWO, REALABS, SCIP_CALL, SCIP_LPERROR, SCIP_LPPAR_DUALFEASTOL, SCIP_LPPAR_FEASTOL, SCIP_LPPAR_LPINFO, SCIP_LPPAR_LPITLIM, SCIP_LPPAR_OBJLIM, SCIP_MAXVERTEXPOLYDIM, SCIP_OBJSEN_MAXIMIZE, SCIP_OBJSEN_MINIMIZE, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPconshdlrGetData(), SCIPcreateRandom(), SCIPdebugMsg, SCIPdebugMsgPrint, SCIPepsilon(), SCIPfeastol(), SCIPfreeBufferArray, SCIPinfinity(), SCIPisEQ(), SCIPisInfinity(), SCIPlpiChgObj(), SCIPlpiChgObjsen(), SCIPlpiChgSides(), SCIPlpiGetNCols(), SCIPlpiGetNRows(), SCIPlpiGetSol(), SCIPlpiIsDualFeasible(), SCIPlpiSetIntpar(), SCIPlpiSetRealpar(), SCIPlpiSolveDual(), SCIPlpiSolvePrimal(), SCIPrandomGetReal(), TRUE, and VERTEXPOLY_RANDNUMINITSEED.
Referenced by computeVertexPolyhedralMaxFacetError(), and SCIPcomputeFacetVertexPolyhedralNonlinear().
◆ computeVertexPolyhedralFacetUnivariate()
|
static |
computes a facet of the convex or concave envelope of a univariant vertex polyhedral function
In other words, compute the line that passes through two given points.
- Parameters
-
scip SCIP data structure left left coordinate right right coordinate funleft value of function in left coordinate funright value of function in right coordinate success buffer to store whether a facet could be computed successfully facetcoef buffer to store coefficient of facet defining inequality facetconstant buffer to store constant part of facet defining inequality
Definition at line 9172 of file cons_nonlinear.c.
References computeHyperplaneThreePoints(), NULL, SCIP_INVALID, SCIP_OKAY, SCIPisFinite, SCIPisInfinity(), SCIPisLE(), and TRUE.
Referenced by computeVertexPolyhedralFacetLP(), and SCIPcomputeFacetVertexPolyhedralNonlinear().
◆ computeHyperplaneThreePoints()
|
static |
given three points, constructs coefficient of equation for hyperplane generated by these three points
Three points a, b, and c are given. Computes coefficients alpha, beta, gamma, and delta, such that a, b, and c, satisfy alpha * x1 + beta * x2 + gamma * x3 = delta and gamma >= 0.0.
- Parameters
-
scip SCIP data structure a1 first coordinate of a a2 second coordinate of a a3 third coordinate of a b1 first coordinate of b b2 second coordinate of b b3 third coordinate of b c1 first coordinate of c c2 second coordinate of c c3 third coordinate of c alpha coefficient of first coordinate beta coefficient of second coordinate gamma_ coefficient of third coordinate delta constant right-hand side
Definition at line 9208 of file cons_nonlinear.c.
References computeVertexPolyhedralFacetBivariate(), NULL, REALABS, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMsg, SCIPisInfinity(), SCIPisRelEQ(), and SCIPsolveLinearEquationsIpopt().
Referenced by computeVertexPolyhedralFacetBivariate(), and computeVertexPolyhedralFacetUnivariate().
◆ computeVertexPolyhedralFacetBivariate()
|
static |
computes a facet of the convex or concave envelope of a bivariate vertex polyhedral function
- Parameters
-
scip SCIP data structure overestimate whether to compute facet of concave (TRUE) or convex (FALSE) envelope p1 first vertex of box p2 second vertex of box p3 third vertex of box p4 forth vertex of box p1val value in p1 p2val value in p2 p3val value in p3 p4val value in p4 xstar point to be separated targetvalue target value: no need to compute facet if value in xstar would be worse than this value success buffer to store whether a facet could be computed successfully facetcoefs buffer to store coefficients of facet defining inequality; must be an array of length at least 2 facetconstant buffer to store constant part of facet defining inequality
Definition at line 9319 of file cons_nonlinear.c.
References computeHyperplaneThreePoints(), FALSE, NULL, SCIP_CALL, SCIP_DECL_CONSHDLRCOPY(), SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPdebugMsg, SCIPisFinite, SCIPisNegative(), SCIPisZero(), and TRUE.
Referenced by computeHyperplaneThreePoints(), and SCIPcomputeFacetVertexPolyhedralNonlinear().
◆ SCIP_DECL_CONSHDLRCOPY()
|
static |
copy method for constraint handler plugins (called when SCIP copies plugins)
Definition at line 9464 of file cons_nonlinear.c.
References CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_DECL_CONSFREE(), SCIP_OKAY, SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPfindConshdlr(), SCIPincludeConshdlrNonlinear(), and TRUE.
Referenced by computeVertexPolyhedralFacetBivariate().
◆ SCIP_DECL_CONSFREE()
|
static |
destructor of constraint handler to free constraint handler data (called when SCIP is exiting)
Definition at line 9498 of file cons_nonlinear.c.
References NULL, SCIP_CALL, SCIP_DECL_CONSINIT(), SCIP_MAXVERTEXPOLYDIM, SCIP_OKAY, SCIPconshdlrGetData(), SCIPconshdlrSetData(), SCIPfreeBlockMemory, SCIPfreeBlockMemoryArrayNull, SCIPfreeClock(), SCIPfreeMemory, SCIPfreeRandom(), SCIPhashmapFree(), SCIPhashmapGetNElements(), SCIPlpiFree(), SCIPnlhdlrFree(), and SCIPqueueFree().
Referenced by SCIP_DECL_CONSHDLRCOPY().
◆ SCIP_DECL_CONSINIT()
|
static |
initialization method of constraint handler (called after problem was transformed)
Definition at line 9553 of file cons_nonlinear.c.
References catchVarEvents(), ENFOLOG, NULL, SCIP_CALL, SCIP_DECL_CONSEXIT(), SCIP_OKAY, SCIPconsGetData(), SCIPconshdlrGetData(), SCIPfindHeur(), SCIPresetClock(), SCIPsortDownPtr(), and storeVarExprs().
Referenced by SCIP_DECL_CONSFREE().
◆ SCIP_DECL_CONSEXIT()
|
static |
deinitialization method of constraint handler (called before transformed problem is freed)
Definition at line 9608 of file cons_nonlinear.c.
References consInitpreNonlinear, dropVarEvents(), ENFOLOG, freeVarExprs(), NULL, SCIP_CALL, SCIP_DECL_CONSINITPRE, SCIP_MAXVERTEXPOLYDIM, SCIP_OKAY, SCIPABORT, SCIPconsGetData(), SCIPconshdlrGetData(), SCIPduplicateBufferArray, SCIPerrorMessage, SCIPfreeBufferArray, SCIPfreeRandom(), SCIPlpiFree(), and SCIPsortDownPtr().
Referenced by SCIP_DECL_CONSINIT().
◆ SCIP_DECL_CONSEXITPRE()
|
static |
presolving deinitialization method of constraint handler (called after presolving has been finished)
Definition at line 9684 of file cons_nonlinear.c.
References canonicalizeConstraints(), NULL, SCIP_Bool, SCIP_CALL, SCIP_DECL_CONSINITSOL(), SCIP_OKAY, SCIP_PRESOLTIMING_ALWAYS, SCIP_STATUS_INFEASIBLE, SCIPenableNLP(), and SCIPgetStatus().
◆ SCIP_DECL_CONSINITSOL()
|
static |
solving process initialization method of constraint handler (called when branch and bound process is about to begin)
Definition at line 9713 of file cons_nonlinear.c.
References CONSHDLR_NAME, initSolve(), NULL, SCIP_CALL, SCIP_DECL_CONSEXITSOL(), SCIP_EVENTTYPE_BESTSOLFOUND, SCIP_EVENTTYPE_SOLFOUND, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_STATUS_INFEASIBLE, SCIP_STATUS_INFORUNBD, SCIP_STATUS_OPTIMAL, SCIP_STATUS_UNBOUNDED, SCIPABORT, SCIPcatchEvent(), SCIPconshdlrGetData(), SCIPerrorMessage, SCIPfindEventhdlr(), SCIPgetCharParam(), SCIPgetStatus(), and SCIPnlhdlrResetNDetectionslast.
Referenced by SCIP_DECL_CONSEXITPRE().
◆ SCIP_DECL_CONSEXITSOL()
|
static |
solving process deinitialization method of constraint handler (called before branch and bound process data is freed)
Definition at line 9771 of file cons_nonlinear.c.
References bilinearTermsFree(), CONSHDLR_NAME, deinitSolve(), FALSE, NULL, SCIP_CALL, SCIP_DECL_CONSDELETE(), SCIP_EVENTTYPE_BESTSOLFOUND, SCIP_EVENTTYPE_SOLFOUND, SCIP_OKAY, SCIPconshdlrGetData(), SCIPdropEvent(), and SCIPfindEventhdlr().
Referenced by SCIP_DECL_CONSINITSOL().
◆ SCIP_DECL_CONSDELETE()
|
static |
frees specific constraint data
Definition at line 9804 of file cons_nonlinear.c.
References freeVarExprs(), NULL, SCIP_CALL, SCIP_DECL_CONSTRANS(), SCIP_OKAY, SCIPfreeBlockMemory, SCIPreleaseExpr(), and SCIPreleaseNlRow().
Referenced by SCIP_DECL_CONSEXITSOL().
◆ SCIP_DECL_CONSTRANS()
|
static |
transforms constraint data into data belonging to the transformed problem
Definition at line 9833 of file cons_nonlinear.c.
References createCons(), FALSE, NULL, SCIP_CALL, SCIP_DECL_CONSINITLP(), SCIP_OKAY, SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPduplicateExpr(), and SCIPreleaseExpr().
Referenced by SCIP_DECL_CONSDELETE().
◆ SCIP_DECL_CONSINITLP()
|
static |
LP initialization method of constraint handler (called before the initial LP relaxation at a node is solved)
Definition at line 9862 of file cons_nonlinear.c.
References bilinearTermsInsertAll(), initSepa(), SCIP_CALL, SCIP_DECL_CONSSEPALP(), and SCIP_OKAY.
Referenced by SCIP_DECL_CONSTRANS().
◆ SCIP_DECL_CONSSEPALP()
|
static |
separation method of constraint handler for LP solutions
Definition at line 9884 of file cons_nonlinear.c.
References consSepa(), NULL, SCIP_CALL, SCIP_DECL_CONSSEPASOL(), and SCIP_OKAY.
Referenced by SCIP_DECL_CONSINITLP().
◆ SCIP_DECL_CONSSEPASOL()
|
static |
separation method of constraint handler for arbitrary primal solutions
Definition at line 9894 of file cons_nonlinear.c.
References consSepa(), SCIP_CALL, SCIP_DECL_CONSENFOLP(), and SCIP_OKAY.
Referenced by SCIP_DECL_CONSSEPALP().
◆ SCIP_DECL_CONSENFOLP()
|
static |
constraint enforcing method of constraint handler for LP solutions
Definition at line 9904 of file cons_nonlinear.c.
References consEnfo(), NULL, SCIP_CALL, SCIP_DECL_CONSENFORELAX(), and SCIP_OKAY.
Referenced by SCIP_DECL_CONSSEPASOL().
◆ SCIP_DECL_CONSENFORELAX()
|
static |
constraint enforcing method of constraint handler for relaxation solutions
Definition at line 9914 of file cons_nonlinear.c.
References consEnfo(), SCIP_CALL, SCIP_DECL_CONSENFOPS(), and SCIP_OKAY.
Referenced by SCIP_DECL_CONSENFOLP().
◆ SCIP_DECL_CONSENFOPS()
|
static |
constraint enforcing method of constraint handler for pseudo solutions
Definition at line 9924 of file cons_nonlinear.c.
References computeViolation(), isConsViolated(), NULL, propConss(), registerBranchingCandidatesAllUnfixed(), SCIP_CALL, SCIP_CUTOFF, SCIP_DECL_CONSCHECK(), SCIP_FEASIBLE, SCIP_INFEASIBLE, SCIP_Longint, SCIP_OKAY, SCIP_REDUCEDDOM, SCIP_SOLVELP, SCIPconshdlrGetData(), SCIPdebugMsg, SCIPgetExprNewSoltag(), and TRUE.
Referenced by SCIP_DECL_CONSENFORELAX().
◆ SCIP_DECL_CONSCHECK()
|
static |
feasibility check method of constraint handler for integral solutions
Definition at line 9977 of file cons_nonlinear.c.
References computeViolation(), FALSE, getConsAbsViolation(), isConsViolated(), MAX, NULL, proposeFeasibleSolution(), SCIP_Bool, SCIP_CALL, SCIP_DECL_CONSPROP(), SCIP_FEASIBLE, SCIP_INFEASIBLE, SCIP_Longint, SCIP_OKAY, SCIP_Real, SCIP_STAGE_SOLVING, SCIP_STAGE_TRANSFORMED, SCIPconsGetData(), SCIPconshdlrGetData(), SCIPfeastol(), SCIPgetExprNewSoltag(), SCIPgetStage(), SCIPinfoMessage(), SCIPisInfinity(), SCIPprintCons(), and SCIPupdateStartpointHeurSubNlp().
Referenced by SCIP_DECL_CONSENFOPS().
◆ SCIP_DECL_CONSPROP()
|
static |
domain propagation method of constraint handler
Definition at line 10086 of file cons_nonlinear.c.
References FALSE, propConss(), SCIP_CALL, SCIP_DECL_CONSPRESOL(), and SCIP_OKAY.
Referenced by SCIP_DECL_CONSCHECK().
◆ SCIP_DECL_CONSPRESOL()
|
static |
presolving method of constraint handler
Definition at line 10101 of file cons_nonlinear.c.
References canonicalizeConstraints(), consRespropNonlinear, FALSE, NULL, presolveImplint(), presolveMergeConss(), presolveRedundantConss(), presolveSingleLockedVars(), presolveUpgrade(), propConss(), propExprDomains(), SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DECL_CONSRESPROP, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_OKAY, SCIP_PRESOLTIMING_EXHAUSTIVE, SCIP_PRESOLTIMING_MEDIUM, SCIP_REDUCEDDOM, SCIP_SUCCESS, SCIPABORT, SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsActive(), SCIPconsIsDeleted(), SCIPdebugMsg, SCIPerrorMessage, SCIPisPresolveFinished(), and TRUE.
Referenced by SCIP_DECL_CONSPROP().
◆ SCIP_DECL_CONSLOCK()
|
static |
variable rounding lock method of constraint handler
Definition at line 10244 of file cons_nonlinear.c.
References addLocks(), deinitSolve(), FALSE, initSolve(), NULL, SCIP_Bool, SCIP_CALL, SCIP_DECL_CONSACTIVE(), SCIP_OKAY, SCIPconsGetData(), SCIPexprGetOwnerData(), and TRUE.
◆ SCIP_DECL_CONSACTIVE()
|
static |
constraint activation notification method of constraint handler
Definition at line 10290 of file cons_nonlinear.c.
References addLocks(), FALSE, initSolve(), NULL, SCIP_Bool, SCIP_CALL, SCIP_DECL_CONSDEACTIVE(), SCIP_EXPRITER_DFS, SCIP_EXPRITER_VISITINGCHILD, SCIP_OKAY, SCIP_STAGE_EXITPRESOLVE, SCIP_STAGE_INITPRESOLVE, SCIP_STAGE_TRANSFORMED, SCIPconsGetData(), SCIPconshdlrGetData(), SCIPconsIsChecked(), SCIPcreateExpriter(), SCIPexpriterGetChildExprDFS(), SCIPexpriterGetChildIdxDFS(), SCIPexpriterGetCurrent(), SCIPexpriterGetNext(), SCIPexpriterInit(), SCIPexpriterIsEnd(), SCIPexpriterSetStagesDFS(), SCIPfreeExpriter(), SCIPgetStage(), SCIPgetVarExprVar(), SCIPhashmapGetImage(), SCIPisExprVar(), SCIPreleaseExpr(), SCIPreplaceCommonSubexpressions(), SCIPreplaceExprChild(), SCIPsimplifyExpr(), storeVarExprs(), and TRUE.
Referenced by SCIP_DECL_CONSLOCK().
◆ SCIP_DECL_CONSDEACTIVE()
|
static |
constraint deactivation notification method of constraint handler
Definition at line 10382 of file cons_nonlinear.c.
References addLocks(), deinitSolve(), dropVarEvents(), freeVarExprs(), NULL, SCIP_CALL, SCIP_DECL_CONSENABLE(), SCIP_OKAY, SCIP_STAGE_EXITSOLVE, SCIP_STAGE_TRANSFORMED, SCIPconsGetData(), SCIPconshdlrGetData(), SCIPconsIsChecked(), and SCIPgetStage().
Referenced by SCIP_DECL_CONSACTIVE().
◆ SCIP_DECL_CONSENABLE()
|
static |
constraint enabling notification method of constraint handler
Definition at line 10415 of file cons_nonlinear.c.
References catchVarEvents(), NULL, SCIP_CALL, SCIP_DECL_CONSDISABLE(), SCIP_OKAY, SCIP_STAGE_TRANSFORMED, SCIPconshdlrGetData(), and SCIPgetStage().
Referenced by SCIP_DECL_CONSDEACTIVE().
◆ SCIP_DECL_CONSDISABLE()
|
static |
constraint disabling notification method of constraint handler
Definition at line 10433 of file cons_nonlinear.c.
References consDelvarsNonlinear, dropVarEvents(), NULL, SCIP_CALL, SCIP_DECL_CONSDELVARS(), SCIP_OKAY, SCIP_STAGE_TRANSFORMED, SCIPABORT, SCIPconshdlrGetData(), SCIPerrorMessage, and SCIPgetStage().
Referenced by SCIP_DECL_CONSENABLE().
◆ SCIP_DECL_CONSPRINT()
|
static |
constraint display method of constraint handler
Definition at line 10465 of file cons_nonlinear.c.
References NULL, SCIP_CALL, SCIP_DECL_CONSCOPY(), SCIP_OKAY, SCIPconsGetData(), SCIPinfoMessage(), SCIPisEQ(), SCIPisInfinity(), and SCIPprintExpr().
◆ SCIP_DECL_CONSCOPY()
|
static |
constraint copying method of constraint handler
Definition at line 10498 of file cons_nonlinear.c.
References CONSHDLR_NAME, createCons(), FALSE, NULL, SCIP_CALL, SCIP_DECL_CONSPARSE(), SCIP_OKAY, SCIPconsGetData(), SCIPconsGetName(), SCIPcopyExpr(), SCIPfindConshdlr(), and SCIPreleaseExpr().
Referenced by SCIP_DECL_CONSPRINT().
◆ SCIP_DECL_CONSPARSE()
|
static |
constraint parsing method of constraint handler
Definition at line 10538 of file cons_nonlinear.c.
References createCons(), FALSE, NULL, SCIP_CALL, SCIP_DECL_CONSGETVARS(), SCIP_OKAY, SCIP_READERROR, SCIP_Real, SCIPconsGetName(), SCIPdebugMsg, SCIPerrorMessage, SCIPinfinity(), SCIPisInfinity(), SCIPparseExpr(), SCIPreleaseExpr(), SCIPstrToRealValue(), and TRUE.
Referenced by SCIP_DECL_CONSCOPY().
◆ SCIP_DECL_CONSGETVARS()
|
static |
constraint method of constraint handler which returns the variables (if possible)
Definition at line 10675 of file cons_nonlinear.c.
References FALSE, NULL, SCIP_CALL, SCIP_DECL_CONSGETNVARS(), SCIP_OKAY, SCIPconsGetData(), SCIPgetVarExprVar(), storeVarExprs(), and TRUE.
Referenced by SCIP_DECL_CONSPARSE().
◆ SCIP_DECL_CONSGETNVARS()
|
static |
constraint method of constraint handler which returns the number of variables (if possible)
Definition at line 10706 of file cons_nonlinear.c.
References consGetDiveBdChgsNonlinear, NULL, SCIP_CALL, SCIP_DECL_CONSGETDIVEBDCHGS, SCIP_OKAY, SCIPABORT, SCIPconsGetData(), SCIPerrorMessage, storeVarExprs(), and TRUE.
Referenced by SCIP_DECL_CONSGETVARS().
◆ SCIP_DECL_TABLEOUTPUT() [1/2]
|
static |
output method of statistics table to output file stream 'file'
Definition at line 10738 of file cons_nonlinear.c.
References CONSHDLR_NAME, NULL, SCIP_OKAY, SCIPconshdlrGetData(), SCIPfindConshdlr(), SCIPgetClockTime(), and SCIPinfoMessage().
◆ SCIP_DECL_TABLEOUTPUT() [2/2]
|
static |
output method of statistics table to output file stream 'file'
Definition at line 10768 of file cons_nonlinear.c.
References CONSHDLR_NAME, NULL, SCIP_DECL_DIALOGEXEC(), SCIP_OKAY, SCIPconshdlrGetData(), SCIPconshdlrGetMaxNActiveConss(), SCIPfindConshdlr(), and SCIPnlhdlrPrintStatistics().
◆ SCIP_DECL_DIALOGEXEC()
|
static |
execution method of display nlhdlrs dialog
Definition at line 10791 of file cons_nonlinear.c.
References CONSHDLR_NAME, FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPconshdlrGetData(), SCIPdialoghdlrAddHistory(), SCIPdialoghdlrGetRoot(), SCIPdialogMessage(), SCIPfindConshdlr(), SCIPincludeConshdlrNonlinear(), SCIPnlhdlrGetDesc(), SCIPnlhdlrGetDetectPriority(), SCIPnlhdlrGetEnfoPriority(), SCIPnlhdlrGetName(), and SCIPnlhdlrIsEnabled().
Referenced by SCIP_DECL_TABLEOUTPUT().