Scippy

SCIP

Solving Constraint Integer Programs

Detailed Description

constraint handler for nonlinear constraints specified by algebraic expressions

Author
Ksenia Bestuzheva
Benjamin Mueller
Felipe Serrano
Stefan Vigerske

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
 

Macros

#define CONSHDLR_NAME   "nonlinear"
 
#define CONSHDLR_DESC   "handler for nonlinear constraints specified by algebraic expressions"
 
#define CONSHDLR_ENFOPRIORITY   -60
 
#define CONSHDLR_CHECKPRIORITY   -4000010
 
#define CONSHDLR_EAGERFREQ   100
 
#define CONSHDLR_NEEDSCONS   TRUE
 
#define CONSHDLR_SEPAPRIORITY   10
 
#define CONSHDLR_SEPAFREQ   1
 
#define CONSHDLR_DELAYSEPA   FALSE
 
#define CONSHDLR_PROPFREQ   1
 
#define CONSHDLR_DELAYPROP   FALSE
 
#define CONSHDLR_PROP_TIMING   SCIP_PROPTIMING_BEFORELP
 
#define CONSHDLR_PRESOLTIMING   SCIP_PRESOLTIMING_ALWAYS
 
#define CONSHDLR_MAXPREROUNDS   -1
 
#define TABLE_NAME_NONLINEAR   "cons_nonlinear"
 
#define TABLE_DESC_NONLINEAR   "nonlinear constraint handler statistics"
 
#define TABLE_POSITION_NONLINEAR   14600
 
#define TABLE_EARLIEST_STAGE_NONLINEAR   SCIP_STAGE_TRANSFORMED
 
#define TABLE_NAME_NLHDLR   "nlhdlr"
 
#define TABLE_DESC_NLHDLR   "nonlinear handler statistics"
 
#define TABLE_POSITION_NLHDLR   14601
 
#define TABLE_EARLIEST_STAGE_NLHDLR   SCIP_STAGE_PRESOLVING
 
#define DIALOG_NAME   "nlhdlrs"
 
#define DIALOG_DESC   "display nonlinear handlers"
 
#define DIALOG_ISSUBMENU   FALSE
 
#define VERTEXPOLY_MAXPERTURBATION   1e-3
 
#define VERTEXPOLY_USEDUALSIMPLEX   TRUE
 
#define VERTEXPOLY_RANDNUMINITSEED   20181029
 
#define VERTEXPOLY_ADJUSTFACETFACTOR   1e1
 
#define BRANCH_RANDNUMINITSEED   20191229
 
#define BILIN_MAXNAUXEXPRS   10
 
#define infty2infty(infty1, infty2, val)   ((val) >= (infty1) ? (infty2) : (val))
 
#define POWEROFTWO(x)   (0x1u << (x))
 
#define ENFOLOG(x)
 
#define consInitpreNonlinear   NULL
 
#define consRespropNonlinear   NULL
 
#define consDelvarsNonlinear   NULL
 
#define consGetDiveBdChgsNonlinear   NULL
 

Functions

static SCIP_RETCODE forwardPropExpr (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_EXPR *rootexpr, SCIP_Bool tightenauxvars, SCIP_Bool *infeasible, int *ntightenings)
 
static SCIP_RETCODE freeAuxVar (SCIP *scip, SCIP_EXPR *expr)
 
static SCIP_RETCODE freeEnfoData (SCIP *scip, SCIP_EXPR *expr, SCIP_Bool freeauxvar)
 
static SCIP_DECL_EXPR_OWNERFREE (exprownerFree)
 
static SCIP_DECL_EXPR_OWNERPRINT (exprownerPrint)
 
static SCIP_DECL_EXPR_OWNEREVALACTIVITY (exprownerEvalactivity)
 
static SCIP_DECL_EXPR_OWNERCREATE (exprownerCreate)
 
static SCIP_RETCODE createExprVar (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_EXPR **expr, SCIP_VAR *var)
 
static SCIP_DECL_EXPR_MAPEXPR (mapexprvar)
 
static SCIP_DECL_EXPR_MAPEXPR (mapexprtransvar)
 
static SCIP_RETCODE storeVarExprs (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONSDATA *consdata)
 
static SCIP_RETCODE freeVarExprs (SCIP *scip, SCIP_CONSDATA *consdata)
 
static SCIP_DECL_EXPR_INTEVALVAR (intEvalVarBoundTightening)
 
static SCIP_DECL_SORTPTRCOMP (compIndexConsNonlinear)
 
static SCIP_DECL_EVENTEXEC (processVarEvent)
 
static SCIP_RETCODE catchVarEvent (SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_EXPR *expr, SCIP_CONS *cons)
 
static SCIP_RETCODE catchVarEvents (SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_CONS *cons)
 
static SCIP_RETCODE dropVarEvent (SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_EXPR *expr, SCIP_CONS *cons)
 
static SCIP_RETCODE dropVarEvents (SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_CONS *cons)
 
static SCIP_RETCODE createCons (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **cons, const char *name, SCIP_EXPR *expr, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool copyexpr, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable)
 
static SCIP_Real getExprAbsOrigViolation (SCIP *scip, SCIP_EXPR *expr, SCIP_SOL *sol, SCIP_Bool *violunder, SCIP_Bool *violover)
 
static SCIP_Real getExprAbsAuxViolation (SCIP *scip, SCIP_EXPR *expr, SCIP_Real auxvalue, SCIP_SOL *sol, SCIP_Bool *violunder, SCIP_Bool *violover)
 
static SCIP_RETCODE computeViolation (SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Longint soltag)
 
static SCIP_Real getConsAbsViolation (SCIP_CONS *cons)
 
static SCIP_RETCODE getConsRelViolation (SCIP *scip, SCIP_CONS *cons, SCIP_Real *viol, SCIP_SOL *sol, SCIP_Longint soltag)
 
static SCIP_Bool isConsViolated (SCIP *scip, SCIP_CONS *cons)
 
static void findUnlockedLinearVar (SCIP *scip, SCIP_CONS *cons)
 
static SCIP_RETCODE proposeFeasibleSolution (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_Bool *success)
 
static SCIP_RETCODE addTightEstimatorCut (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_EXPR *expr, EXPRENFO *exprenfo, SCIP_SOL *sol, SCIP_Bool overestimate, SCIP_PTRARRAY *rowpreps)
 
static SCIP_RETCODE addTightEstimatorCuts (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_SOL *sol)
 
static SCIP_DECL_EVENTEXEC (processNewSolutionEvent)
 
static SCIP_RETCODE tightenAuxVarBounds (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_EXPR *expr, SCIP_INTERVAL bounds, SCIP_Bool *cutoff, int *ntightenings)
 
static SCIP_Bool isIntervalBetter (SCIP *scip, SCIP_Bool subsetsufficient, SCIP_INTERVAL newinterval, SCIP_INTERVAL oldinterval)
 
static SCIP_RETCODE reversePropQueue (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_Bool *infeasible, int *ntightenings)
 
static SCIP_RETCODE propConss (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_Bool force, SCIP_RESULT *result, int *nchgbds)
 
static SCIP_RETCODE propExprDomains (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_RESULT *result, int *nchgbds)
 
static SCIP_RETCODE propagateLocks (SCIP *scip, SCIP_EXPR *expr, int nlockspos, int nlocksneg)
 
static SCIP_RETCODE addLocks (SCIP *scip, SCIP_CONS *cons, int nlockspos, int nlocksneg)
 
static SCIP_RETCODE createNlRow (SCIP *scip, SCIP_CONS *cons)
 
static SCIP_DECL_SORTPTRCOMP (enfodataCmp)
 
static SCIP_RETCODE detectNlhdlr (SCIP *scip, SCIP_EXPR *expr, SCIP_CONS *cons)
 
static SCIP_RETCODE detectNlhdlrs (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss)
 
static SCIP_RETCODE initSolve (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss)
 
static SCIP_RETCODE deinitSolve (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss)
 
static SCIP_Bool isBinaryProduct (SCIP *scip, SCIP_EXPR *expr)
 
static SCIP_RETCODE getBilinearBinaryTerms (SCIP *scip, SCIP_EXPR *sumexpr, SCIP_VAR **xs, SCIP_VAR **ys, int *childidxs, int *nterms)
 
static SCIP_RETCODE reformulateFactorizedBinaryQuadratic (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_VAR *facvar, SCIP_VAR **vars, SCIP_Real *coefs, int nvars, SCIP_EXPR **newexpr, int *naddconss)
 
static SCIP_RETCODE getFactorizedBinaryQuadraticExpr (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_EXPR *sumexpr, int minterms, SCIP_EXPR **newexpr, int *naddconss)
 
static SCIP_RETCODE getBinaryProductExprDo (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_EXPR *prodexpr, SCIP_EXPR **newexpr, int *naddconss, SCIP_Bool empathy4and)
 
static SCIP_RETCODE getBinaryProductExpr (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_HASHMAP *exprmap, SCIP_EXPR *prodexpr, SCIP_EXPR **newexpr, int *naddconss, int *nchgcoefs)
 
static SCIP_RETCODE replaceBinaryProducts (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_HASHMAP *exprmap, SCIP_EXPRITER *it, int *naddconss, int *nchgcoefs)
 
static SCIP_RETCODE presolveBinaryProducts (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, int *naddconss, int *nchgcoefs)
 
static SCIP_RETCODE scaleConsSides (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_Bool *changed)
 
static SCIP_RETCODE forbidNonlinearVariablesMultiaggration (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss)
 
static SCIP_RETCODE canonicalizeConstraints (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_PRESOLTIMING presoltiming, SCIP_Bool *infeasible, int *ndelconss, int *naddconss, int *nchgcoefs)
 
static SCIP_RETCODE presolveMergeConss (SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_Bool *success)
 
static SCIP_DECL_EXPR_INTEVALVAR (intEvalVarRedundancyCheck)
 
static SCIP_RETCODE presolveRedundantConss (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_Bool *cutoff, int *ndelconss, int *nchgbds)
 
static SCIP_RETCODE presolveUpgrade (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_Bool *upgraded, int *nupgdconss, int *naddconss)
 
static SCIP_Bool isSingleLockedCand (SCIP *scip, SCIP_EXPR *expr)
 
static SCIP_RETCODE removeSingleLockedVars (SCIP *scip, SCIP_EXPR *expr, SCIP_EXPRITER *it, SCIP_HASHMAP *exprcands)
 
static SCIP_RETCODE presolveSingleLockedVars (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, int *nchgvartypes, int *naddconss, SCIP_Bool *infeasible)
 
static SCIP_RETCODE presolveImplint (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, int *nchgvartypes, SCIP_Bool *infeasible)
 
static SCIP_RETCODE createAuxVar (SCIP *scip, SCIP_EXPR *expr)
 
static SCIP_RETCODE initSepa (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_Bool *infeasible)
 
static SCIP_Bool branchAuxNonlinear (SCIP *scip, SCIP_CONSHDLR *conshdlr)
 
static SCIP_Real getViolSplitWeight (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_VAR *var, SCIP_SOL *sol)
 
static void addExprsViolScore (SCIP *scip, SCIP_EXPR **exprs, int nexprs, SCIP_Real violscore, SCIP_SOL *sol, SCIP_Bool *success)
 
static SCIP_RETCODE addExprViolScoresAuxVars (SCIP *scip, SCIP_EXPR *expr, SCIP_Real violscore, SCIP_VAR **auxvars, int nauxvars, SCIP_SOL *sol, SCIP_Bool *success)
 
static SCIP_RETCODE registerBranchingCandidatesAllUnfixed (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, int *nnotify)
 
static SCIP_RETCODE registerBranchingCandidates (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_Bool *success)
 
static SCIP_RETCODE collectBranchingCandidates (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_Real maxrelconsviol, SCIP_SOL *sol, SCIP_Longint soltag, BRANCHCAND *cands, int *ncands)
 
static SCIP_Real getDualBranchscore (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_VAR *var)
 
static void scoreBranchingCandidates (SCIP *scip, SCIP_CONSHDLR *conshdlr, BRANCHCAND *cands, int ncands, SCIP_SOL *sol)
 
static SCIP_DECL_SORTINDCOMP (branchcandCompare)
 
static SCIP_RETCODE branching (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_Real maxrelconsviol, SCIP_SOL *sol, SCIP_Longint soltag, SCIP_RESULT *result)
 
static SCIP_RETCODE enforceExprNlhdlr (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_NLHDLR *nlhdlr, SCIP_EXPR *expr, SCIP_NLHDLREXPRDATA *nlhdlrexprdata, SCIP_SOL *sol, SCIP_Real auxvalue, SCIP_Bool overestimate, SCIP_Bool separated, SCIP_Bool allowweakcuts, SCIP_Bool inenforcement, SCIP_RESULT *result)
 
static SCIP_RETCODE enforceExpr (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_EXPR *expr, SCIP_SOL *sol, SCIP_Longint soltag, SCIP_Bool allowweakcuts, SCIP_Bool inenforcement, SCIP_RESULT *result)
 
static SCIP_RETCODE enforceConstraint (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Longint soltag, SCIP_EXPRITER *it, SCIP_Bool allowweakcuts, SCIP_Bool inenforcement, SCIP_RESULT *result, SCIP_Bool *success)
 
static SCIP_RETCODE enforceConstraints (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_Longint soltag, SCIP_Bool inenforcement, SCIP_Real maxrelconsviol, SCIP_RESULT *result)
 
static SCIP_RETCODE analyzeViolation (SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_Longint soltag, SCIP_Real *maxabsconsviol, SCIP_Real *maxrelconsviol, SCIP_Real *minauxviol, SCIP_Real *maxauxviol, SCIP_Real *maxvarboundviol)
 
static SCIP_RETCODE consEnfo (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_RESULT *result)
 
static SCIP_RETCODE consSepa (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_RESULT *result)
 
static SCIP_DECL_HASHGETKEY (bilinearTermsGetHashkey)
 
static SCIP_DECL_HASHKEYEQ (bilinearTermsIsHashkeyEq)
 
static SCIP_DECL_HASHKEYVAL (bilinearTermsGetHashkeyVal)
 
static SCIP_DECL_SORTPTRCOMP (auxexprComp)
 
static SCIP_RETCODE bilinTermAddAuxExpr (SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_CONSNONLINEAR_BILINTERM *term, SCIP_CONSNONLINEAR_AUXEXPR *auxexpr, SCIP_Bool *added)
 
static SCIP_RETCODE bilinearTermsInsertAll (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss)
 
static SCIP_RETCODE bilinearTermsInsertEntry (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_VAR *x, SCIP_VAR *y, int nlockspos, int nlocksneg, int *idx, SCIP_Bool existing)
 
static SCIP_RETCODE bilinearTermsFree (SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata)
 
static SCIP_RETCODE buildVertexPolyhedralSeparationLP (SCIP *scip, int nvars, SCIP_LPI **lp)
 
static SCIP_Real computeVertexPolyhedralMaxFacetError (SCIP *scip, SCIP_Bool overestimate, SCIP_Real *funvals, SCIP_Real *box, int nallvars, int nvars, int *nonfixedpos, SCIP_Real *facetcoefs, SCIP_Real facetconstant)
 
static SCIP_RETCODE computeVertexPolyhedralFacetLP (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_Bool overestimate, SCIP_Real *xstar, SCIP_Real *box, int nallvars, int *nonfixedpos, SCIP_Real *funvals, int nvars, SCIP_Real targetvalue, SCIP_Bool *success, SCIP_Real *facetcoefs, SCIP_Real *facetconstant)
 
static SCIP_RETCODE computeVertexPolyhedralFacetUnivariate (SCIP *scip, SCIP_Real left, SCIP_Real right, SCIP_Real funleft, SCIP_Real funright, SCIP_Bool *success, SCIP_Real *facetcoef, SCIP_Real *facetconstant)
 
static SCIP_RETCODE computeHyperplaneThreePoints (SCIP *scip, SCIP_Real a1, SCIP_Real a2, SCIP_Real a3, SCIP_Real b1, SCIP_Real b2, SCIP_Real b3, SCIP_Real c1, SCIP_Real c2, SCIP_Real c3, SCIP_Real *alpha, SCIP_Real *beta, SCIP_Real *gamma_, SCIP_Real *delta)
 
static SCIP_RETCODE computeVertexPolyhedralFacetBivariate (SCIP *scip, SCIP_Bool overestimate, SCIP_Real p1[2], SCIP_Real p2[2], SCIP_Real p3[2], SCIP_Real p4[2], SCIP_Real p1val, SCIP_Real p2val, SCIP_Real p3val, SCIP_Real p4val, SCIP_Real xstar[2], SCIP_Real targetvalue, SCIP_Bool *success, SCIP_Real *facetcoefs, SCIP_Real *facetconstant)
 
static SCIP_DECL_CONSHDLRCOPY (conshdlrCopyNonlinear)
 
static SCIP_DECL_CONSFREE (consFreeNonlinear)
 
static SCIP_DECL_CONSINIT (consInitNonlinear)
 
static SCIP_DECL_CONSEXIT (consExitNonlinear)
 
static SCIP_DECL_CONSEXITPRE (consExitpreNonlinear)
 
static SCIP_DECL_CONSINITSOL (consInitsolNonlinear)
 
static SCIP_DECL_CONSEXITSOL (consExitsolNonlinear)
 
static SCIP_DECL_CONSDELETE (consDeleteNonlinear)
 
static SCIP_DECL_CONSTRANS (consTransNonlinear)
 
static SCIP_DECL_CONSINITLP (consInitlpNonlinear)
 
static SCIP_DECL_CONSSEPALP (consSepalpNonlinear)
 
static SCIP_DECL_CONSSEPASOL (consSepasolNonlinear)
 
static SCIP_DECL_CONSENFOLP (consEnfolpNonlinear)
 
static SCIP_DECL_CONSENFORELAX (consEnforelaxNonlinear)
 
static SCIP_DECL_CONSENFOPS (consEnfopsNonlinear)
 
static SCIP_DECL_CONSCHECK (consCheckNonlinear)
 
static SCIP_DECL_CONSPROP (consPropNonlinear)
 
static SCIP_DECL_CONSPRESOL (consPresolNonlinear)
 
static SCIP_DECL_CONSLOCK (consLockNonlinear)
 
static SCIP_DECL_CONSACTIVE (consActiveNonlinear)
 
static SCIP_DECL_CONSDEACTIVE (consDeactiveNonlinear)
 
static SCIP_DECL_CONSENABLE (consEnableNonlinear)
 
static SCIP_DECL_CONSDISABLE (consDisableNonlinear)
 
static SCIP_DECL_CONSPRINT (consPrintNonlinear)
 
static SCIP_DECL_CONSCOPY (consCopyNonlinear)
 
static SCIP_DECL_CONSPARSE (consParseNonlinear)
 
static SCIP_DECL_CONSGETVARS (consGetVarsNonlinear)
 
static SCIP_DECL_CONSGETNVARS (consGetNVarsNonlinear)
 
static SCIP_DECL_TABLEOUTPUT (tableOutputNonlinear)
 
static SCIP_DECL_TABLEOUTPUT (tableOutputNlhdlr)
 
static SCIP_DECL_DIALOGEXEC (dialogExecDisplayNlhdlrs)
 
SCIP_RETCODE SCIPincludeConshdlrNonlinear (SCIP *scip)
 
SCIP_RETCODE SCIPincludeConsUpgradeNonlinear (SCIP *scip, SCIP_DECL_NONLINCONSUPGD((*nlconsupgd)), int priority, SCIP_Bool active, const char *conshdlrname)
 
SCIP_RETCODE SCIPcreateConsNonlinear (SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_EXPR *expr, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable)
 
SCIP_RETCODE SCIPcreateConsBasicNonlinear (SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_EXPR *expr, SCIP_Real lhs, SCIP_Real rhs)
 
SCIP_RETCODE SCIPcreateConsQuadraticNonlinear (SCIP *scip, SCIP_CONS **cons, const char *name, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nquadterms, SCIP_VAR **quadvars1, SCIP_VAR **quadvars2, SCIP_Real *quadcoefs, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable)
 
SCIP_RETCODE SCIPcreateConsBasicQuadraticNonlinear (SCIP *scip, SCIP_CONS **cons, const char *name, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nquadterms, SCIP_VAR **quadvars1, SCIP_VAR **quadvars2, SCIP_Real *quadcoefs, SCIP_Real lhs, SCIP_Real rhs)
 
SCIP_RETCODE SCIPcreateConsBasicSOCNonlinear (SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *coefs, SCIP_Real *offsets, SCIP_Real constant, SCIP_VAR *rhsvar, SCIP_Real rhscoeff, SCIP_Real rhsoffset)
 
SCIP_RETCODE SCIPcreateConsBasicSignpowerNonlinear (SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *x, SCIP_VAR *z, SCIP_Real exponent, SCIP_Real xoffset, SCIP_Real zcoef, SCIP_Real lhs, SCIP_Real rhs)
 
SCIP_Longint SCIPgetCurBoundsTagNonlinear (SCIP_CONSHDLR *conshdlr)
 
SCIP_Longint SCIPgetLastBoundRelaxTagNonlinear (SCIP_CONSHDLR *conshdlr)
 
void SCIPincrementCurBoundsTagNonlinear (SCIP_CONSHDLR *conshdlr, SCIP_Bool boundrelax)
 
SCIP_HASHMAPSCIPgetVarExprHashmapNonlinear (SCIP_CONSHDLR *conshdlr)
 
SCIP_RETCODE SCIPprocessRowprepNonlinear (SCIP *scip, SCIP_NLHDLR *nlhdlr, SCIP_CONS *cons, SCIP_EXPR *expr, SCIP_ROWPREP *rowprep, SCIP_Bool overestimate, SCIP_VAR *auxvar, SCIP_Real auxvalue, SCIP_Bool allowweakcuts, SCIP_Bool branchscoresuccess, SCIP_Bool inenforcement, SCIP_SOL *sol, SCIP_RESULT *result)
 
SCIP_Bool SCIPassumeConvexNonlinear (SCIP_CONSHDLR *conshdlr)
 
SCIP_RETCODE SCIPcollectBilinTermsNonlinear (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss)
 
int SCIPgetNBilinTermsNonlinear (SCIP_CONSHDLR *conshdlr)
 
SCIP_CONSNONLINEAR_BILINTERMSCIPgetBilinTermsNonlinear (SCIP_CONSHDLR *conshdlr)
 
int SCIPgetBilinTermIdxNonlinear (SCIP_CONSHDLR *conshdlr, SCIP_VAR *x, SCIP_VAR *y)
 
SCIP_CONSNONLINEAR_BILINTERMSCIPgetBilinTermNonlinear (SCIP_CONSHDLR *conshdlr, SCIP_VAR *x, SCIP_VAR *y)
 
SCIP_Real SCIPevalBilinAuxExprNonlinear (SCIP *scip, SCIP_VAR *x, SCIP_VAR *y, SCIP_CONSNONLINEAR_AUXEXPR *auxexpr, SCIP_SOL *sol)
 
SCIP_RETCODE SCIPinsertBilinearTermExistingNonlinear (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_VAR *x, SCIP_VAR *y, SCIP_VAR *auxvar, int nlockspos, int nlocksneg)
 
SCIP_RETCODE SCIPinsertBilinearTermImplicitNonlinear (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_VAR *x, SCIP_VAR *y, SCIP_VAR *auxvar, SCIP_Real coefx, SCIP_Real coefy, SCIP_Real coefaux, SCIP_Real cst, SCIP_Bool overestimate)
 
SCIP_RETCODE SCIPcomputeFacetVertexPolyhedralNonlinear (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_Bool overestimate, SCIP_DECL_VERTEXPOLYFUN((*function)), void *fundata, SCIP_Real *xstar, SCIP_Real *box, int nallvars, SCIP_Real targetvalue, SCIP_Bool *success, SCIP_Real *facetcoefs, SCIP_Real *facetconstant)
 
SCIP_EXPRSCIPgetExprNonlinear (SCIP_CONS *cons)
 
SCIP_Real SCIPgetLhsNonlinear (SCIP_CONS *cons)
 
SCIP_Real SCIPgetRhsNonlinear (SCIP_CONS *cons)
 
SCIP_RETCODE SCIPgetNlRowNonlinear (SCIP *scip, SCIP_CONS *cons, SCIP_NLROW **nlrow)
 
SCIP_EXPRCURV SCIPgetCurvatureNonlinear (SCIP_CONS *cons)
 
SCIP_RETCODE SCIPcheckQuadraticNonlinear (SCIP *scip, SCIP_CONS *cons, SCIP_Bool *isquadratic)
 
SCIP_RETCODE SCIPchgLhsNonlinear (SCIP *scip, SCIP_CONS *cons, SCIP_Real lhs)
 
SCIP_RETCODE SCIPchgRhsNonlinear (SCIP *scip, SCIP_CONS *cons, SCIP_Real rhs)
 
SCIP_RETCODE SCIPchgExprNonlinear (SCIP *scip, SCIP_CONS *cons, SCIP_EXPR *expr)
 
SCIP_RETCODE SCIPaddLinearVarNonlinear (SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real coef)
 
SCIP_RETCODE SCIPaddExprNonlinear (SCIP *scip, SCIP_CONS *cons, SCIP_EXPR *expr, SCIP_Real coef)
 
SCIP_RETCODE SCIPgetAbsViolationNonlinear (SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Real *viol)
 
SCIP_RETCODE SCIPgetRelViolationNonlinear (SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Real *viol)
 
void SCIPgetLinvarMayDecreaseNonlinear (SCIP *scip, SCIP_CONS *cons, SCIP_VAR **var, SCIP_Real *coef)
 
void SCIPgetLinvarMayIncreaseNonlinear (SCIP *scip, SCIP_CONS *cons, SCIP_VAR **var, SCIP_Real *coef)
 
int SCIPgetExprNLocksPosNonlinear (SCIP_EXPR *expr)
 
int SCIPgetExprNLocksNegNonlinear (SCIP_EXPR *expr)
 
SCIP_VARSCIPgetExprAuxVarNonlinear (SCIP_EXPR *expr)
 
int SCIPgetExprNEnfosNonlinear (SCIP_EXPR *expr)
 
void SCIPgetExprEnfoDataNonlinear (SCIP_EXPR *expr, int idx, SCIP_NLHDLR **nlhdlr, SCIP_NLHDLREXPRDATA **nlhdlrexprdata, SCIP_NLHDLR_METHOD *nlhdlrparticipation, SCIP_Bool *sepabelowusesactivity, SCIP_Bool *sepaaboveusesactivity, SCIP_Real *auxvalue)
 
void SCIPsetExprEnfoAuxValueNonlinear (SCIP_EXPR *expr, int idx, SCIP_Real auxvalue)
 
unsigned int SCIPgetExprNPropUsesActivityNonlinear (SCIP_EXPR *expr)
 
unsigned int SCIPgetExprNSepaUsesActivityNonlinear (SCIP_EXPR *expr)
 
unsigned int SCIPgetExprNAuxvarUsesNonlinear (SCIP_EXPR *expr)
 
SCIP_RETCODE SCIPregisterExprUsageNonlinear (SCIP *scip, SCIP_EXPR *expr, SCIP_Bool useauxvar, SCIP_Bool useactivityforprop, SCIP_Bool useactivityforsepabelow, SCIP_Bool useactivityforsepaabove)
 
SCIP_RETCODE SCIPgetExprAbsOrigViolationNonlinear (SCIP *scip, SCIP_EXPR *expr, SCIP_SOL *sol, SCIP_Longint soltag, SCIP_Real *viol, SCIP_Bool *violunder, SCIP_Bool *violover)
 
SCIP_RETCODE SCIPgetExprAbsAuxViolationNonlinear (SCIP *scip, SCIP_EXPR *expr, SCIP_Real auxvalue, SCIP_SOL *sol, SCIP_Real *viol, SCIP_Bool *violunder, SCIP_Bool *violover)
 
SCIP_RETCODE SCIPgetExprRelAuxViolationNonlinear (SCIP *scip, SCIP_EXPR *expr, SCIP_Real auxvalue, SCIP_SOL *sol, SCIP_Real *viol, SCIP_Bool *violunder, SCIP_Bool *violover)
 
SCIP_INTERVAL SCIPgetExprBoundsNonlinear (SCIP *scip, SCIP_EXPR *expr)
 
SCIP_RETCODE SCIPtightenExprIntervalNonlinear (SCIP *scip, SCIP_EXPR *expr, SCIP_INTERVAL newbounds, SCIP_Bool *cutoff, int *ntightenings)
 
SCIP_RETCODE SCIPmarkExprPropagateNonlinear (SCIP *scip, SCIP_EXPR *expr)
 
void SCIPaddExprViolScoreNonlinear (SCIP *scip, SCIP_EXPR *expr, SCIP_Real violscore)
 
SCIP_RETCODE SCIPaddExprsViolScoreNonlinear (SCIP *scip, SCIP_EXPR **exprs, int nexprs, SCIP_Real violscore, SCIP_SOL *sol, SCIP_Bool *success)
 
SCIP_Real SCIPgetExprViolScoreNonlinear (SCIP_EXPR *expr)
 
SCIP_Real SCIPgetExprPartialDiffNonlinear (SCIP *scip, SCIP_EXPR *expr, SCIP_VAR *var)
 
SCIP_Real SCIPgetExprPartialDiffGradientDirNonlinear (SCIP *scip, SCIP_EXPR *expr, SCIP_VAR *var)
 
SCIP_Real SCIPevalExprQuadraticAuxNonlinear (SCIP *scip, SCIP_EXPR *expr, SCIP_SOL *sol)
 
SCIP_RETCODE SCIPincludeNlhdlrNonlinear (SCIP *scip, SCIP_NLHDLR **nlhdlr, const char *name, const char *desc, int detectpriority, int enfopriority, SCIP_DECL_NLHDLRDETECT((*detect)), SCIP_DECL_NLHDLREVALAUX((*evalaux)), SCIP_NLHDLRDATA *nlhdlrdata)
 
int SCIPgetNNlhdlrsNonlinear (SCIP_CONSHDLR *conshdlr)
 
SCIP_NLHDLR ** SCIPgetNlhdlrsNonlinear (SCIP_CONSHDLR *conshdlr)
 
SCIP_NLHDLRSCIPfindNlhdlrNonlinear (SCIP_CONSHDLR *conshdlr, const char *name)
 
SCIP_NLHDLREXPRDATASCIPgetNlhdlrExprDataNonlinear (SCIP_NLHDLR *nlhdlr, SCIP_EXPR *expr)
 

Macro Definition Documentation

◆ CONSHDLR_NAME

◆ 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))

◆ ENFOLOG

◆ consInitpreNonlinear

#define consInitpreNonlinear   NULL

presolving initialization method of constraint handler (called when presolving is about to begin)

Definition at line 9677 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 10237 of file cons_nonlinear.c.

Referenced by SCIP_DECL_CONSPRESOL(), and SCIPincludeConshdlrNonlinear().

◆ consDelvarsNonlinear

#define consDelvarsNonlinear   NULL

variable deletion of constraint handler

Definition at line 10458 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 10732 of file cons_nonlinear.c.

Referenced by SCIP_DECL_CONSGETNVARS(), and SCIPincludeConshdlrNonlinear().

Function Documentation

◆ forwardPropExpr()

static SCIP_RETCODE forwardPropExpr ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_EXPR rootexpr,
SCIP_Bool  tightenauxvars,
SCIP_Bool infeasible,
int *  ntightenings 
)
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
scipSCIP data structure
conshdlrconstraint handler
rootexprexpression
tightenauxvarsshould the bounds of auxiliary variables be tightened?
infeasiblebuffer to store whether the problem is infeasible (NULL if not needed)
ntighteningsbuffer 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 SCIP_RETCODE freeAuxVar ( SCIP scip,
SCIP_EXPR expr 
)
static

frees auxiliary variables of expression, if any

Parameters
scipSCIP data structure
exprexpression 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 SCIP_RETCODE freeEnfoData ( SCIP scip,
SCIP_EXPR expr,
SCIP_Bool  freeauxvar 
)
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
scipSCIP data structure
exprexpression whose enforcement data will be released
freeauxvarwhether 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 SCIP_DECL_EXPR_OWNERFREE ( exprownerFree  )
static

◆ SCIP_DECL_EXPR_OWNERPRINT()

◆ SCIP_DECL_EXPR_OWNEREVALACTIVITY()

static SCIP_DECL_EXPR_OWNEREVALACTIVITY ( exprownerEvalactivity  )
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 SCIP_DECL_EXPR_OWNERCREATE ( exprownerCreate  )
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 SCIP_RETCODE createExprVar ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_EXPR **  expr,
SCIP_VAR var 
)
static

creates a variable expression or retrieves from hashmap in conshdlr data

Parameters
scipSCIP data structure
conshdlrnonlinear constraint handler
exprpointer where to store expression
varvariable 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 SCIP_DECL_EXPR_MAPEXPR ( mapexprvar  )
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 SCIP_DECL_EXPR_MAPEXPR ( mapexprtransvar  )
static

◆ storeVarExprs()

static SCIP_RETCODE storeVarExprs ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONSDATA consdata 
)
static

◆ freeVarExprs()

static SCIP_RETCODE freeVarExprs ( SCIP scip,
SCIP_CONSDATA consdata 
)
static

frees all variable expression stored in storeVarExprs()

Parameters
scipSCIP data structure
consdataconstraint 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 SCIP_DECL_EXPR_INTEVALVAR ( intEvalVarBoundTightening  )
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 SCIP_DECL_SORTPTRCOMP ( compIndexConsNonlinear  )
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]

◆ catchVarEvent()

static SCIP_RETCODE catchVarEvent ( SCIP scip,
SCIP_EVENTHDLR eventhdlr,
SCIP_EXPR expr,
SCIP_CONS cons 
)
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
scipSCIP data structure
eventhdlrevent handler
exprvariable expression
consnonlinear 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 SCIP_RETCODE catchVarEvents ( SCIP scip,
SCIP_EVENTHDLR eventhdlr,
SCIP_CONS cons 
)
static

◆ dropVarEvent()

static SCIP_RETCODE dropVarEvent ( SCIP scip,
SCIP_EVENTHDLR eventhdlr,
SCIP_EXPR expr,
SCIP_CONS cons 
)
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
scipSCIP data structure
eventhdlrevent handler
exprvariable expression
consexpr 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 SCIP_RETCODE dropVarEvents ( SCIP scip,
SCIP_EVENTHDLR eventhdlr,
SCIP_CONS cons 
)
static

drop variable events

Parameters
scipSCIP data structure
eventhdlrevent handler
consconstraint 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 SCIP_RETCODE createCons ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  cons,
const char *  name,
SCIP_EXPR expr,
SCIP_Real  lhs,
SCIP_Real  rhs,
SCIP_Bool  copyexpr,
SCIP_Bool  initial,
SCIP_Bool  separate,
SCIP_Bool  enforce,
SCIP_Bool  check,
SCIP_Bool  propagate,
SCIP_Bool  local,
SCIP_Bool  modifiable,
SCIP_Bool  dynamic,
SCIP_Bool  removable 
)
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
scipSCIP data structure
conshdlrconstraint handler
conspointer to hold the created constraint
namename of constraint
exprexpression of constraint (must not be NULL)
lhsleft hand side of constraint
rhsright hand side of constraint
copyexprwhether to copy the expression or reuse the given expr (capture it)
initialshould the LP relaxation of constraint be in the initial LP? Usually set to TRUE. Set to FALSE for 'lazy constraints'.
separateshould the constraint be separated during LP processing? Usually set to TRUE.
enforceshould the constraint be enforced during node processing? TRUE for model constraints, FALSE for additional, redundant constraints.
checkshould the constraint be checked for feasibility? TRUE for model constraints, FALSE for additional, redundant constraints.
propagateshould the constraint be propagated during node processing? Usually set to TRUE.
localis constraint only valid locally? Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints.
modifiableis constraint modifiable (subject to column generation)? Usually set to FALSE. In column generation applications, set to TRUE if pricing adds coefficients to this constraint.
dynamicis constraint subject to aging? Usually set to FALSE. Set to TRUE for own cuts which are separated as constraints.
removableshould 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 SCIP_Real getExprAbsOrigViolation ( SCIP scip,
SCIP_EXPR expr,
SCIP_SOL sol,
SCIP_Bool violunder,
SCIP_Bool violover 
)
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
scipSCIP data structure
exprexpression
solsolution that has been evaluated
violunderbuffer to store whether z >= f(x) is violated, or NULL
violoverbuffer 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 SCIP_Real getExprAbsAuxViolation ( SCIP scip,
SCIP_EXPR expr,
SCIP_Real  auxvalue,
SCIP_SOL sol,
SCIP_Bool violunder,
SCIP_Bool violover 
)
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
scipSCIP data structure
exprexpression
auxvaluevalue of f(w)
solsolution that has been evaluated
violunderbuffer to store whether z >= f(w) is violated, or NULL
violoverbuffer 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 SCIP_RETCODE computeViolation ( SCIP scip,
SCIP_CONS cons,
SCIP_SOL sol,
SCIP_Longint  soltag 
)
static

computes violation of a constraint

Parameters
scipSCIP data structure
consconstraint
solsolution or NULL if LP solution should be used
soltagtag 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()

static SCIP_Real getConsAbsViolation ( SCIP_CONS cons)
static

returns absolute violation of a constraint

Note
This does not reevaluate the violation, but assumes that computeViolation() has been called before.
Parameters
consconstraint

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 SCIP_RETCODE getConsRelViolation ( SCIP scip,
SCIP_CONS cons,
SCIP_Real viol,
SCIP_SOL sol,
SCIP_Longint  soltag 
)
static

computes relative violation of a constraint

Note
This does not reevaluate the violation, but assumes that computeViolation() has been called before.
Parameters
scipSCIP data structure
consconstraint
violbuffer to store violation
solsolution or NULL if LP solution should be used
soltagtag 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()

static SCIP_Bool isConsViolated ( SCIP scip,
SCIP_CONS cons 
)
static

returns whether constraint is currently violated

Note
This does not reevaluate the violation, but assumes that computeViolation() has been called before.
Parameters
scipSCIP data structure
consconstraint

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()

static void findUnlockedLinearVar ( SCIP scip,
SCIP_CONS cons 
)
static

◆ proposeFeasibleSolution()

static SCIP_RETCODE proposeFeasibleSolution ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
SCIP_SOL sol,
SCIP_Bool success 
)
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
scipSCIP data structure
conshdlrconstraint handler
conssconstraints to process
nconssnumber of constraints
solsolution to process
successbuffer 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 SCIP_RETCODE addTightEstimatorCut ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS cons,
SCIP_EXPR expr,
EXPRENFO exprenfo,
SCIP_SOL sol,
SCIP_Bool  overestimate,
SCIP_PTRARRAY rowpreps 
)
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
scipSCIP data structure
conshdlrconstraint handler
consconstraint
exprexpression
exprenfoexpression enfo data, e.g., nlhdlr to use
solreference point where to estimate
overestimatewhether to overestimate
rowprepsarray 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 SCIP_RETCODE addTightEstimatorCuts ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
SCIP_SOL sol 
)
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
scipSCIP data structure
conshdlrconstraint handler
conssconstraints
nconssnumber of constraints
solreference 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 SCIP_DECL_EVENTEXEC ( processNewSolutionEvent  )
static

◆ tightenAuxVarBounds()

static SCIP_RETCODE tightenAuxVarBounds ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_EXPR expr,
SCIP_INTERVAL  bounds,
SCIP_Bool cutoff,
int *  ntightenings 
)
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
scipSCIP data structure
conshdlrconstraint handler
exprexpression whose auxvar is to be tightened
boundsbounds to be used for tightening (must not be empty)
cutoffbuffer to store whether a cutoff was detected
ntighteningsbuffer 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 SCIP_Bool isIntervalBetter ( SCIP scip,
SCIP_Bool  subsetsufficient,
SCIP_INTERVAL  newinterval,
SCIP_INTERVAL  oldinterval 
)
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
scipSCIP data structure
subsetsufficientwhether the intersection being a proper subset of oldinterval is sufficient
newintervalnew interval
oldintervalold 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 SCIP_RETCODE reversePropQueue ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_Bool infeasible,
int *  ntightenings 
)
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
scipSCIP data structure
conshdlrconstraint handler
infeasiblebuffer to update whether an expression's bounds were propagated to an empty interval
ntighteningsbuffer 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 SCIP_RETCODE propConss ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
SCIP_Bool  force,
SCIP_RESULT result,
int *  nchgbds 
)
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:

  1. apply forward propagation (update activities) for all constraints not marked as propagated
  2. 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
  3. apply reverse propagation to all collected expressions; don't explore sub-expressions which have not changed since the beginning of the propagation loop
  4. 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
scipSCIP data structure
conshdlrconstraint handler
conssconstraints to propagate
nconsstotal number of constraints
forceforce tightening even if below bound strengthening tolerance
resultpointer to store the result
nchgbdsbuffer 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 SCIP_RETCODE propExprDomains ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
SCIP_RESULT result,
int *  nchgbds 
)
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
scipSCIP data structure
conshdlrconstraint handler
conssconstraints to propagate
nconsstotal number of constraints
resultpointer to store the result
nchgbdsbuffer 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()

◆ addLocks()

static SCIP_RETCODE addLocks ( SCIP scip,
SCIP_CONS cons,
int  nlockspos,
int  nlocksneg 
)
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
scipSCIP data structure
consnonlinear constraint
nlocksposnumber of positive rounding locks
nlocksnegnumber 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()

◆ SCIP_DECL_SORTPTRCOMP() [2/3]

static SCIP_DECL_SORTPTRCOMP ( enfodataCmp  )
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()

◆ detectNlhdlrs()

◆ initSolve()

static SCIP_RETCODE initSolve ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss 
)
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
scipSCIP data structure
conshdlrconstraint handler
conssconstraints
nconssnumber 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 SCIP_RETCODE deinitSolve ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss 
)
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
scipSCIP data structure
conshdlrconstraint handler
conssconstraints
nconssnumber 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()

static SCIP_Bool isBinaryProduct ( SCIP scip,
SCIP_EXPR expr 
)
static

helper method to decide whether a given expression is product of at least two binary variables

Parameters
scipSCIP data structure
exprexpression

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 SCIP_RETCODE getBilinearBinaryTerms ( SCIP scip,
SCIP_EXPR sumexpr,
SCIP_VAR **  xs,
SCIP_VAR **  ys,
int *  childidxs,
int *  nterms 
)
static

helper method to collect all bilinear binary product terms

Parameters
scipSCIP data structure
sumexprsum expression
xsarray to collect first variable of each bilinear binary product
ysarray to collect second variable of each bilinear binary product
childidxsarray to store the index of the child of each stored bilinear binary product
ntermspointer 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 SCIP_RETCODE reformulateFactorizedBinaryQuadratic ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS cons,
SCIP_VAR facvar,
SCIP_VAR **  vars,
SCIP_Real coefs,
int  nvars,
SCIP_EXPR **  newexpr,
int *  naddconss 
)
static

helper method to reformulate \(x_i \sum_j c_{ij} x_j\)

Parameters
scipSCIP data structure
conshdlrconstraint handler
consconstraint
facvarvariable that has been factorized
varsvariables of sum_j c_ij x_j
coefscoefficients of sum_j c_ij x_j
nvarstotal number of variables in sum_j c_ij x_j
newexprpointer to store the new expression
naddconsspointer 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 SCIP_RETCODE getFactorizedBinaryQuadraticExpr ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS cons,
SCIP_EXPR sumexpr,
int  minterms,
SCIP_EXPR **  newexpr,
int *  naddconss 
)
static

helper method to generate an expression for a sum of products of binary variables; note that the method captures the generated expression

Parameters
scipSCIP data structure
conshdlrconstraint handler
consconstraint
sumexprexpression
mintermsminimum number of terms in a the sum of x_i sum_j c_j x_j
newexprpointer to store the expression that represents the binary quadratic
naddconsspointer 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 SCIP_RETCODE getBinaryProductExprDo ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_EXPR prodexpr,
SCIP_EXPR **  newexpr,
int *  naddconss,
SCIP_Bool  empathy4and 
)
static

helper method to create an AND constraint or varbound constraints for a given binary product expression

Parameters
scipSCIP data structure
conshdlrconstraint handler
prodexprproduct expression
newexprpointer to store the expression that represents the product
naddconsspointer to update the total number of added constraints (might be NULL)
empathy4andwhether 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 SCIP_RETCODE getBinaryProductExpr ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_HASHMAP exprmap,
SCIP_EXPR prodexpr,
SCIP_EXPR **  newexpr,
int *  naddconss,
int *  nchgcoefs 
)
static

helper method to generate an expression for the product of binary variables; note that the method captures the generated expression

Parameters
scipSCIP data structure
conshdlrconstraint handler
exprmapmap to remember generated variables for visited product expressions
prodexprproduct expression
newexprpointer to store the expression that represents the product
naddconsspointer to update the total number of added constraints (might be NULL)
nchgcoefspointer 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 SCIP_RETCODE replaceBinaryProducts ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS cons,
SCIP_HASHMAP exprmap,
SCIP_EXPRITER it,
int *  naddconss,
int *  nchgcoefs 
)
static

helper function to replace binary products in a given constraint

Parameters
scipSCIP data structure
conshdlrconstraint handler
consconstraint
exprmapmap to remember generated variables for visited product expressions
itexpression iterator
naddconsspointer to update the total number of added constraints (might be NULL)
nchgcoefspointer 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 SCIP_RETCODE presolveBinaryProducts ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
int *  naddconss,
int *  nchgcoefs 
)
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:

  1. \(x_i + x_j \leq 1\) implies that \(x_i x_j = 0\)
  2. \(x_i + (1 - x_j) \leq 1\) implies \(x_i x_j = x_i\)
  3. \((1 - x_i) + x_j \leq 1\) implies \(x_i x_j = x_j\)
  4. \((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
scipSCIP data structure
conshdlrconstraint handler
conssconstraints
nconsstotal number of constraints
naddconsspointer to store the total number of added constraints (might be NULL)
nchgcoefspointer 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 SCIP_RETCODE scaleConsSides ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS cons,
SCIP_Bool changed 
)
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
scipSCIP data structure
conshdlrnonlinear constraint handler
consnonlinear constraint
changedbuffer 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 SCIP_RETCODE forbidNonlinearVariablesMultiaggration ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss 
)
static

forbid multiaggrations of variables that appear nonlinear in constraints

Parameters
scipSCIP data structure
conshdlrconstraint handler
conssconstraints
nconssnumber 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 SCIP_RETCODE canonicalizeConstraints ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
SCIP_PRESOLTIMING  presoltiming,
SCIP_Bool infeasible,
int *  ndelconss,
int *  naddconss,
int *  nchgcoefs 
)
static

simplifies expressions and replaces common subexpressions for a set of constraints

Parameters
scipSCIP data structure
conshdlrconstraint handler
conssconstraints
nconsstotal number of constraints
presoltimingpresolve timing (SCIP_PRESOLTIMING_ALWAYS if not in presolving)
infeasiblebuffer to store whether infeasibility has been detected
ndelconsscounter to add number of deleted constraints, or NULL
naddconsscounter to add number of added constraints, or NULL
nchgcoefscounter 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 SCIP_RETCODE presolveMergeConss ( SCIP scip,
SCIP_CONS **  conss,
int  nconss,
SCIP_Bool success 
)
static

merges constraints that have the same root expression

Parameters
scipSCIP data structure
conssconstraints to process
nconssnumber of constraints
successpointer 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 SCIP_DECL_EXPR_INTEVALVAR ( intEvalVarRedundancyCheck  )
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 SCIP_RETCODE presolveRedundantConss ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
SCIP_Bool cutoff,
int *  ndelconss,
int *  nchgbds 
)
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
scipSCIP data structure
conshdlrconstraint handler
conssconstraints to propagate
nconsstotal number of constraints
cutoffpointer to store whether infeasibility has been identified
ndelconssbuffer to add the number of deleted constraints
nchgbdsbuffer 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 SCIP_RETCODE presolveUpgrade ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS cons,
SCIP_Bool upgraded,
int *  nupgdconss,
int *  naddconss 
)
static

tries to automatically convert a nonlinear constraint into a more specific and more specialized constraint

Parameters
scipSCIP data structure
conshdlrconstraint handler data structure
conssource constraint to try to convert
upgradedbuffer to store whether constraint was upgraded
nupgdconssbuffer to increase if constraint was upgraded
naddconssbuffer 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()

static SCIP_Bool isSingleLockedCand ( SCIP scip,
SCIP_EXPR expr 
)
static

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
scipSCIP data structure
exprvariable 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 SCIP_RETCODE removeSingleLockedVars ( SCIP scip,
SCIP_EXPR expr,
SCIP_EXPRITER it,
SCIP_HASHMAP exprcands 
)
static

removes all variable expressions that are contained in a given expression from a hash map

Parameters
scipSCIP data structure
exprexpression
itexpression iterator
exprcandsmap 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 SCIP_RETCODE presolveSingleLockedVars ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS cons,
int *  nchgvartypes,
int *  naddconss,
SCIP_Bool infeasible 
)
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
scipSCIP data structure
conshdlrnonlinear constraint handler
consnonlinear constraint
nchgvartypespointer to store the total number of changed variable types
naddconsspointer to store the total number of added constraints
infeasiblepointer to store whether problem is infeasible

Definition at line 5638 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 SCIP_RETCODE presolveImplint ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
int *  nchgvartypes,
SCIP_Bool infeasible 
)
static

presolving method to check if there is a single linear continuous variable that can be made implicit integer

Parameters
scipSCIP data structure
conshdlrconstraint handler
conssnonlinear constraints
nconsstotal number of nonlinear constraints
nchgvartypespointer to update the total number of changed variable types
infeasiblepointer to store whether problem is infeasible

Definition at line 5842 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()

◆ initSepa()

static SCIP_RETCODE initSepa ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
SCIP_Bool infeasible 
)
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
scipSCIP data structure
conshdlrnonlinear constraints handler
conssconstraints
nconssnumber of constraints
infeasiblepointer to store whether the problem is infeasible or not

Definition at line 6094 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 SCIP_Bool branchAuxNonlinear ( SCIP scip,
SCIP_CONSHDLR conshdlr 
)
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
scipSCIP data structure
conshdlrconstraint handler

Definition at line 6276 of file cons_nonlinear.c.

References getViolSplitWeight(), NULL, SCIP_Real, SCIPconshdlrGetData(), and SCIPgetDepth().

Referenced by collectBranchingCandidates(), initSepa(), registerBranchingCandidates(), SCIPaddExprsViolScoreNonlinear(), and SCIPaddExprViolScoreNonlinear().

◆ getViolSplitWeight()

static SCIP_Real getViolSplitWeight ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_VAR var,
SCIP_SOL sol 
)
static

gets weight of variable when splitting violation score onto several variables in an expression

Parameters
scipSCIP data structure
conshdlrexpr constraint handler
varvariable
solcurrent solution

Definition at line 6293 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 void addExprsViolScore ( SCIP scip,
SCIP_EXPR **  exprs,
int  nexprs,
SCIP_Real  violscore,
SCIP_SOL sol,
SCIP_Bool success 
)
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
scipSCIP data structure
exprsexpressions where to add branching score
nexprsnumber of expressions
violscoreviolation-branching score to add to expression
solcurrent solution
successbuffer to store whether at least one violscore was added

Definition at line 6346 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 SCIP_RETCODE addExprViolScoresAuxVars ( SCIP scip,
SCIP_EXPR expr,
SCIP_Real  violscore,
SCIP_VAR **  auxvars,
int  nauxvars,
SCIP_SOL sol,
SCIP_Bool success 
)
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
scipSCIP data structure
exprexpression where to start searching
violscoreviolation score to add to expression
auxvarsauxiliary variables for which to find expression
nauxvarsnumber of auxiliary variables
solcurrent solution (NULL for the LP solution)
successbuffer to store whether at least one violscore was added

Definition at line 6432 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 SCIP_RETCODE registerBranchingCandidatesAllUnfixed ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
int *  nnotify 
)
static

registers all unfixed variables in violated constraints as branching candidates

Parameters
scipSCIP data structure
conshdlrnonlinear constraints handler
conssconstraints
nconssnumber of constraints
nnotifycounter for number of notifications performed

Definition at line 6497 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 SCIP_RETCODE registerBranchingCandidates ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
SCIP_Bool success 
)
static

registers all variables in violated constraints with branching scores as external branching candidates

Parameters
scipSCIP data structure
conshdlrnonlinear constraints handler
conssconstraints
nconssnumber of constraints
successbuffer to store whether at least one branching candidate was added

Definition at line 6547 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 SCIP_RETCODE collectBranchingCandidates ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
SCIP_Real  maxrelconsviol,
SCIP_SOL sol,
SCIP_Longint  soltag,
BRANCHCAND cands,
int *  ncands 
)
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
scipSCIP data structure
conshdlrconstraint handler
conssconstraints to process
nconssnumber of constraints
maxrelconsviolmaximal scaled constraint violation
solsolution to enforce (NULL for the LP solution)
soltagtag of solution
candsarray where to store candidates, must be at least SCIPgetNVars() long
ncandsnumber of candidates found

Definition at line 6682 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 SCIP_Real getDualBranchscore ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_VAR var 
)
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
scipSCIP data structure
conshdlrnonlinear constraints handler
varvariable

Definition at line 6858 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 void scoreBranchingCandidates ( SCIP scip,
SCIP_CONSHDLR conshdlr,
BRANCHCAND cands,
int  ncands,
SCIP_SOL sol 
)
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
scipSCIP data structure
conshdlrconstraint handler
candsbranching candidates
ncandsnumber of candidates
solsolution to enforce (NULL for the LP solution)

Definition at line 6954 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 SCIP_DECL_SORTINDCOMP ( branchcandCompare  )
static

compare two branching candidates by their weighted score

if weighted score is equal, use variable index of (aux)var

Definition at line 7224 of file cons_nonlinear.c.

References branching(), SCIPgetExprAuxVarNonlinear(), SCIPvarGetIndex(), and BRANCHCAND::weighted.

Referenced by scoreBranchingCandidates().

◆ branching()

static SCIP_RETCODE branching ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
SCIP_Real  maxrelconsviol,
SCIP_SOL sol,
SCIP_Longint  soltag,
SCIP_RESULT result 
)
static

do branching or register branching candidates

Parameters
scipSCIP data structure
conshdlrconstraint handler
conssconstraints to process
nconssnumber of constraints
maxrelconsviolmaximal scaled constraint violation
solsolution to enforce (NULL for the LP solution)
soltagtag of solution
resultpointer to store the result of branching

Definition at line 7236 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 SCIP_RETCODE enforceExprNlhdlr ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS cons,
SCIP_NLHDLR nlhdlr,
SCIP_EXPR expr,
SCIP_NLHDLREXPRDATA nlhdlrexprdata,
SCIP_SOL sol,
SCIP_Real  auxvalue,
SCIP_Bool  overestimate,
SCIP_Bool  separated,
SCIP_Bool  allowweakcuts,
SCIP_Bool  inenforcement,
SCIP_RESULT result 
)
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
scipSCIP main data structure
conshdlrconstraint handler
consnonlinear constraint
nlhdlrnonlinear handler
exprexpression
nlhdlrexprdatanonlinear handler data of expression
solsolution to be separated (NULL for the LP solution)
auxvaluecurrent value of expression w.r.t. auxiliary variables as obtained from EVALAUX
overestimatewhether the expression needs to be over- or underestimated
separatedwhether another nonlinear handler already added a cut for this expression
allowweakcutswhether we allow for weak cuts
inenforcementwhether we are in enforcement (and not just separation)
resultpointer to store the result

Definition at line 7384 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 SCIP_RETCODE enforceExpr ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS cons,
SCIP_EXPR expr,
SCIP_SOL sol,
SCIP_Longint  soltag,
SCIP_Bool  allowweakcuts,
SCIP_Bool  inenforcement,
SCIP_RESULT result 
)
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
scipSCIP data structure
conshdlrnonlinear constraints handler
consnonlinear constraint
exprexpression
solsolution to separate, or NULL if LP solution should be used
soltagtag of solution
allowweakcutswhether we allow weak cuts
inenforcementwhether we are in enforcement (and not just separation)
resultpointer to store the result of the enforcing call

Definition at line 7479 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 SCIP_RETCODE enforceConstraint ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS cons,
SCIP_SOL sol,
SCIP_Longint  soltag,
SCIP_EXPRITER it,
SCIP_Bool  allowweakcuts,
SCIP_Bool  inenforcement,
SCIP_RESULT result,
SCIP_Bool success 
)
static

helper function to enforce a single constraint

Parameters
scipSCIP data structure
conshdlrconstraint handler
consconstraint to process
solsolution to enforce (NULL for the LP solution)
soltagtag of solution
itexpression iterator that we can just use here
allowweakcutswhether to allow weak cuts in this round
inenforcementwhether to we are in enforcement, and not just separation
resultpointer to update with result of the enforcing call
successbuffer to store whether some enforcement took place

Definition at line 7688 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 SCIP_RETCODE enforceConstraints ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
SCIP_SOL sol,
SCIP_Longint  soltag,
SCIP_Bool  inenforcement,
SCIP_Real  maxrelconsviol,
SCIP_RESULT result 
)
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
scipSCIP data structure
conshdlrconstraint handler
conssconstraints to process
nconssnumber of constraints
solsolution to enforce (NULL for the LP solution)
soltagtag of solution
inenforcementwhether we are in enforcement, and not just separation
maxrelconsviollargest scaled violation among all violated expr-constraints, only used if in enforcement
resultpointer to store the result of the enforcing call

Definition at line 7806 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 SCIP_RETCODE analyzeViolation ( SCIP scip,
SCIP_CONS **  conss,
int  nconss,
SCIP_SOL sol,
SCIP_Longint  soltag,
SCIP_Real maxabsconsviol,
SCIP_Real maxrelconsviol,
SCIP_Real minauxviol,
SCIP_Real maxauxviol,
SCIP_Real maxvarboundviol 
)
static

collect (and print (if debugging enfo)) information on violation in expressions

assumes that constraint violations have been computed

Parameters
scipSCIP data structure
conssconstraints
nconssnumber of constraints
solsolution to separate, or NULL if LP solution should be used
soltagtag of solution
maxabsconsviolbuffer to store maximal absolute violation of constraints
maxrelconsviolbuffer to store maximal relative violation of constraints
minauxviolbuffer to store minimal (nonzero) violation of auxiliaries
maxauxviolbuffer to store maximal violation of auxiliaries (violation in "extended formulation")
maxvarboundviolbuffer to store maximal violation of variable bounds

Definition at line 7932 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 SCIP_RETCODE consEnfo ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
SCIP_SOL sol,
SCIP_RESULT result 
)
static

enforcement of constraints called by enfolp and enforelax

Parameters
scipSCIP data structure
conshdlrconstraint handler
conssconstraints to process
nconssnumber of constraints
solsolution to enforce (NULL for the LP solution)
resultpointer to store the result of the enforcing call

Definition at line 8108 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 SCIP_RETCODE consSepa ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
SCIP_SOL sol,
SCIP_RESULT result 
)
static

separation for all violated constraints to be used by SEPA callbacks

Parameters
scipSCIP data structure
conshdlrconstraint handler
conssconstraints to process
nconssnumber of constraints
solsolution to enforce (NULL for the LP solution)
resultpointer to store the result of the enforcing call

Definition at line 8300 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 SCIP_DECL_HASHGETKEY ( bilinearTermsGetHashkey  )
static

hash key retrieval function for bilinear term entries

Definition at line 8350 of file cons_nonlinear.c.

References NULL, and SCIP_DECL_HASHKEYEQ().

Referenced by consSepa().

◆ SCIP_DECL_HASHKEYEQ()

static SCIP_DECL_HASHKEYEQ ( bilinearTermsIsHashkeyEq  )
static

returns TRUE iff the bilinear term entries are equal

Definition at line 8366 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 SCIP_DECL_HASHKEYVAL ( bilinearTermsGetHashkeyVal  )
static

◆ SCIP_DECL_SORTPTRCOMP() [3/3]

static SCIP_DECL_SORTPTRCOMP ( auxexprComp  )
static

compare two auxiliary expressions

Compares auxiliary variables, followed by coefficients, and then constants.

Definition at line 8400 of file cons_nonlinear.c.

References SCIP_ConsNonlinear_Auxexpr::auxvar, bilinTermAddAuxExpr(), SCIP_ConsNonlinear_Auxexpr::coefs, SCIP_ConsNonlinear_Auxexpr::cst, and SCIPvarCompare().

◆ bilinTermAddAuxExpr()

static SCIP_RETCODE bilinTermAddAuxExpr ( SCIP scip,
SCIP_CONSHDLRDATA conshdlrdata,
SCIP_CONSNONLINEAR_BILINTERM term,
SCIP_CONSNONLINEAR_AUXEXPR auxexpr,
SCIP_Bool added 
)
static
Parameters
scipSCIP data structure
conshdlrdatanonlinear constraint handler data
termbilinear term
auxexprauxiliary expression to add
addedpointer to store whether auxexpr has been added

Definition at line 8425 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 SCIP_RETCODE bilinearTermsInsertAll ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss 
)
static

◆ bilinearTermsInsertEntry()

static SCIP_RETCODE bilinearTermsInsertEntry ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_VAR x,
SCIP_VAR y,
int  nlockspos,
int  nlocksneg,
int *  idx,
SCIP_Bool  existing 
)
static

store x, y and the locks in a new bilinear term

Parameters
scipSCIP data structure
conshdlrnonlinear constraint handler
xthe first variable
ythe second variable
nlocksposnumber of positive locks of the bilinear term
nlocksnegnumber of negative locks of the bilinear term
idxpointer to store the position of the term in bilinterms array
existingwhether the term exists explicitly in the problem

Definition at line 8553 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 SCIP_RETCODE bilinearTermsFree ( SCIP scip,
SCIP_CONSHDLRDATA conshdlrdata 
)
static

frees array of bilinear terms and hash table

Parameters
scipSCIP data structure
conshdlrdataconstraint handler data

Definition at line 8646 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 SCIP_RETCODE buildVertexPolyhedralSeparationLP ( SCIP scip,
int  nvars,
SCIP_LPI **  lp 
)
static

builds LP used to compute facets of the convex envelope of vertex-polyhedral functions

Parameters
scipSCIP data structure
nvarsnumber of (unfixed) variables in vertex-polyhedral functions
lppointer to store created LP

Definition at line 8716 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 SCIP_Real computeVertexPolyhedralMaxFacetError ( SCIP scip,
SCIP_Bool  overestimate,
SCIP_Real funvals,
SCIP_Real box,
int  nallvars,
int  nvars,
int *  nonfixedpos,
SCIP_Real facetcoefs,
SCIP_Real  facetconstant 
)
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
scipSCIP data structure
overestimatewhether we check for an over or underestimator
funvalsarray containing the evaluation of the function at all corners, length: 2^nvars
boxbox for which facet was computed, length: 2*nallvars
nallvarsnumber of all variables
nvarsnumber of unfixed variables
nonfixedposindices of unfixed variables, length: nvars
facetcoefscurrent facet candidate's coefficients, length: nallvars
facetconstantcurrent facet candidate's constant, length: nallvars

Definition at line 8827 of file cons_nonlinear.c.

References computeVertexPolyhedralFacetLP(), MAX, NULL, POWEROFTWO, SCIP_Real, and SCIPdebugMsg.

Referenced by buildVertexPolyhedralSeparationLP(), and SCIPcomputeFacetVertexPolyhedralNonlinear().

◆ computeVertexPolyhedralFacetLP()

static SCIP_RETCODE computeVertexPolyhedralFacetLP ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_Bool  overestimate,
SCIP_Real xstar,
SCIP_Real box,
int  nallvars,
int *  nonfixedpos,
SCIP_Real funvals,
int  nvars,
SCIP_Real  targetvalue,
SCIP_Bool success,
SCIP_Real facetcoefs,
SCIP_Real facetconstant 
)
static

computes a facet of the convex or concave envelope of a vertex polyhedral function by solving an LP

Parameters
scipSCIP data structure
conshdlrnonlinear constraint handler
overestimatewhether to compute facet of concave (TRUE) or convex (FALSE) envelope
xstarpoint to be separated
boxbox where to compute facet: should be lb_1, ub_1, lb_2, ub_2...
nallvarshalf of the length of box
nonfixedposindices of nonfixed variables
funvalsvalues of function in all corner points (w.r.t. nonfixed variables)
nvarsnumber of nonfixed variables
targetvaluetarget value: no need to compute facet if value in xstar would be worse than this value
successbuffer to store whether a facet could be computed successfully
facetcoefsbuffer to store coefficients of facet defining inequality; must be an zero'ed array of length at least nallvars
facetconstantbuffer to store constant part of facet defining inequality

Definition at line 8915 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 SCIP_RETCODE computeVertexPolyhedralFacetUnivariate ( SCIP scip,
SCIP_Real  left,
SCIP_Real  right,
SCIP_Real  funleft,
SCIP_Real  funright,
SCIP_Bool success,
SCIP_Real facetcoef,
SCIP_Real facetconstant 
)
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
scipSCIP data structure
leftleft coordinate
rightright coordinate
funleftvalue of function in left coordinate
funrightvalue of function in right coordinate
successbuffer to store whether a facet could be computed successfully
facetcoefbuffer to store coefficient of facet defining inequality
facetconstantbuffer to store constant part of facet defining inequality

Definition at line 9171 of file cons_nonlinear.c.

References computeHyperplaneThreePoints(), NULL, SCIP_INVALID, SCIP_OKAY, SCIPisFinite, SCIPisInfinity(), SCIPisLE(), and TRUE.

Referenced by computeVertexPolyhedralFacetLP(), and SCIPcomputeFacetVertexPolyhedralNonlinear().

◆ computeHyperplaneThreePoints()

static SCIP_RETCODE computeHyperplaneThreePoints ( SCIP scip,
SCIP_Real  a1,
SCIP_Real  a2,
SCIP_Real  a3,
SCIP_Real  b1,
SCIP_Real  b2,
SCIP_Real  b3,
SCIP_Real  c1,
SCIP_Real  c2,
SCIP_Real  c3,
SCIP_Real alpha,
SCIP_Real beta,
SCIP_Real gamma_,
SCIP_Real delta 
)
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
scipSCIP data structure
a1first coordinate of a
a2second coordinate of a
a3third coordinate of a
b1first coordinate of b
b2second coordinate of b
b3third coordinate of b
c1first coordinate of c
c2second coordinate of c
c3third coordinate of c
alphacoefficient of first coordinate
betacoefficient of second coordinate
gamma_coefficient of third coordinate
deltaconstant right-hand side

Definition at line 9207 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 SCIP_RETCODE computeVertexPolyhedralFacetBivariate ( SCIP scip,
SCIP_Bool  overestimate,
SCIP_Real  p1[2],
SCIP_Real  p2[2],
SCIP_Real  p3[2],
SCIP_Real  p4[2],
SCIP_Real  p1val,
SCIP_Real  p2val,
SCIP_Real  p3val,
SCIP_Real  p4val,
SCIP_Real  xstar[2],
SCIP_Real  targetvalue,
SCIP_Bool success,
SCIP_Real facetcoefs,
SCIP_Real facetconstant 
)
static

computes a facet of the convex or concave envelope of a bivariate vertex polyhedral function

Parameters
scipSCIP data structure
overestimatewhether to compute facet of concave (TRUE) or convex (FALSE) envelope
p1first vertex of box
p2second vertex of box
p3third vertex of box
p4forth vertex of box
p1valvalue in p1
p2valvalue in p2
p3valvalue in p3
p4valvalue in p4
xstarpoint to be separated
targetvaluetarget value: no need to compute facet if value in xstar would be worse than this value
successbuffer to store whether a facet could be computed successfully
facetcoefsbuffer to store coefficients of facet defining inequality; must be an array of length at least 2
facetconstantbuffer to store constant part of facet defining inequality

Definition at line 9318 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 SCIP_DECL_CONSHDLRCOPY ( conshdlrCopyNonlinear  )
static

copy method for constraint handler plugins (called when SCIP copies plugins)

Definition at line 9463 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 SCIP_DECL_CONSFREE ( consFreeNonlinear  )
static

◆ SCIP_DECL_CONSINIT()

static SCIP_DECL_CONSINIT ( consInitNonlinear  )
static

initialization method of constraint handler (called after problem was transformed)

Definition at line 9552 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 SCIP_DECL_CONSEXIT ( consExitNonlinear  )
static

◆ SCIP_DECL_CONSEXITPRE()

static SCIP_DECL_CONSEXITPRE ( consExitpreNonlinear  )
static

presolving deinitialization method of constraint handler (called after presolving has been finished)

Definition at line 9683 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 SCIP_DECL_CONSINITSOL ( consInitsolNonlinear  )
static

◆ SCIP_DECL_CONSEXITSOL()

static SCIP_DECL_CONSEXITSOL ( consExitsolNonlinear  )
static

solving process deinitialization method of constraint handler (called before branch and bound process data is freed)

Definition at line 9770 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 SCIP_DECL_CONSDELETE ( consDeleteNonlinear  )
static

frees specific constraint data

Definition at line 9803 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()

◆ SCIP_DECL_CONSINITLP()

static SCIP_DECL_CONSINITLP ( consInitlpNonlinear  )
static

LP initialization method of constraint handler (called before the initial LP relaxation at a node is solved)

Definition at line 9861 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 SCIP_DECL_CONSSEPALP ( consSepalpNonlinear  )
static

separation method of constraint handler for LP solutions

Definition at line 9883 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 SCIP_DECL_CONSSEPASOL ( consSepasolNonlinear  )
static

separation method of constraint handler for arbitrary primal solutions

Definition at line 9893 of file cons_nonlinear.c.

References consSepa(), SCIP_CALL, SCIP_DECL_CONSENFOLP(), and SCIP_OKAY.

Referenced by SCIP_DECL_CONSSEPALP().

◆ SCIP_DECL_CONSENFOLP()

static SCIP_DECL_CONSENFOLP ( consEnfolpNonlinear  )
static

constraint enforcing method of constraint handler for LP solutions

Definition at line 9903 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 SCIP_DECL_CONSENFORELAX ( consEnforelaxNonlinear  )
static

constraint enforcing method of constraint handler for relaxation solutions

Definition at line 9913 of file cons_nonlinear.c.

References consEnfo(), SCIP_CALL, SCIP_DECL_CONSENFOPS(), and SCIP_OKAY.

Referenced by SCIP_DECL_CONSENFOLP().

◆ SCIP_DECL_CONSENFOPS()

static SCIP_DECL_CONSENFOPS ( consEnfopsNonlinear  )
static

◆ SCIP_DECL_CONSCHECK()

◆ SCIP_DECL_CONSPROP()

static SCIP_DECL_CONSPROP ( consPropNonlinear  )
static

domain propagation method of constraint handler

Definition at line 10085 of file cons_nonlinear.c.

References FALSE, propConss(), SCIP_CALL, SCIP_DECL_CONSPRESOL(), and SCIP_OKAY.

Referenced by SCIP_DECL_CONSCHECK().

◆ SCIP_DECL_CONSPRESOL()

◆ SCIP_DECL_CONSLOCK()

static SCIP_DECL_CONSLOCK ( consLockNonlinear  )
static

variable rounding lock method of constraint handler

Definition at line 10243 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()

◆ SCIP_DECL_CONSDEACTIVE()

static SCIP_DECL_CONSDEACTIVE ( consDeactiveNonlinear  )
static

◆ SCIP_DECL_CONSENABLE()

static SCIP_DECL_CONSENABLE ( consEnableNonlinear  )
static

constraint enabling notification method of constraint handler

Definition at line 10414 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 SCIP_DECL_CONSDISABLE ( consDisableNonlinear  )
static

constraint disabling notification method of constraint handler

Definition at line 10432 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 SCIP_DECL_CONSPRINT ( consPrintNonlinear  )
static

constraint display method of constraint handler

Definition at line 10464 of file cons_nonlinear.c.

References NULL, SCIP_CALL, SCIP_DECL_CONSCOPY(), SCIP_OKAY, SCIPconsGetData(), SCIPinfoMessage(), SCIPisEQ(), SCIPisInfinity(), and SCIPprintExpr().

◆ SCIP_DECL_CONSCOPY()

static SCIP_DECL_CONSCOPY ( consCopyNonlinear  )
static

constraint copying method of constraint handler

Definition at line 10497 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 SCIP_DECL_CONSPARSE ( consParseNonlinear  )
static

◆ SCIP_DECL_CONSGETVARS()

static SCIP_DECL_CONSGETVARS ( consGetVarsNonlinear  )
static

constraint method of constraint handler which returns the variables (if possible)

Definition at line 10674 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 SCIP_DECL_CONSGETNVARS ( consGetNVarsNonlinear  )
static

constraint method of constraint handler which returns the number of variables (if possible)

Definition at line 10705 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 SCIP_DECL_TABLEOUTPUT ( tableOutputNonlinear  )
static

output method of statistics table to output file stream 'file'

Definition at line 10737 of file cons_nonlinear.c.

References CONSHDLR_NAME, NULL, SCIP_OKAY, SCIPconshdlrGetData(), SCIPfindConshdlr(), SCIPgetClockTime(), and SCIPinfoMessage().

◆ SCIP_DECL_TABLEOUTPUT() [2/2]

static SCIP_DECL_TABLEOUTPUT ( tableOutputNlhdlr  )
static

output method of statistics table to output file stream 'file'

Definition at line 10767 of file cons_nonlinear.c.

References CONSHDLR_NAME, NULL, SCIP_DECL_DIALOGEXEC(), SCIP_OKAY, SCIPconshdlrGetData(), SCIPconshdlrGetMaxNActiveConss(), SCIPfindConshdlr(), and SCIPnlhdlrPrintStatistics().

◆ SCIP_DECL_DIALOGEXEC()