Scippy

SCIP

Solving Constraint Integer Programs

cons_nonlinear.c File Reference

Detailed Description

constraint handler for nonlinear constraints $\textrm{lhs} \leq \sum_{i=1}^n a_ix_i + \sum_{j=1}^m c_jf_j(x) \leq \textrm{rhs}$

Author
Stefan Vigerske
Ingmar Vierhaus (consparse)

Definition in file cons_nonlinear.c.

#include <assert.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include "scip/cons_nonlinear.h"
#include "scip/cons_linear.h"
#include "scip/heur_trysol.h"
#include "scip/heur_subnlp.h"
#include "nlpi/exprinterpret.h"
#include "nlpi/nlpi_ipopt.h"
#include "scip/debug.h"

Go to the source code of this file.

Macros

#define CONSHDLR_NAME   "nonlinear"
 
#define CONSHDLR_DESC   "constraint handler for nonlinear constraints"
 
#define CONSHDLR_SEPAPRIORITY   10
 
#define CONSHDLR_ENFOPRIORITY   -60
 
#define CONSHDLR_CHECKPRIORITY   -4000010
 
#define CONSHDLR_SEPAFREQ   1
 
#define CONSHDLR_PROPFREQ   1
 
#define CONSHDLR_EAGERFREQ   100
 
#define CONSHDLR_MAXPREROUNDS   -1
 
#define CONSHDLR_DELAYSEPA   FALSE
 
#define CONSHDLR_DELAYPROP   FALSE
 
#define CONSHDLR_NEEDSCONS   TRUE
 
#define CONSHDLR_PROP_TIMING   SCIP_PROPTIMING_BEFORELP
 
#define CONSHDLR_PRESOLTIMING   SCIP_PRESOLTIMING_ALWAYS
 
#define INTERVALINFTY   1E+43
 
#define BOUNDTIGHTENING_MINSTRENGTH   0.05
 
#define INITLPMAXVARVAL   1000.0
 
#define infty2infty(infty1, infty2, val)   ((val) >= (infty1) ? (infty2) : (val))
 

Typedefs

typedef struct LinVarEventData LINVAREVENTDATA
 
typedef struct SCIP_NlConsUpgrade SCIP_NLCONSUPGRADE
 

Functions

static SCIP_RETCODE catchLinearVarEvents (SCIP *scip, SCIP_CONS *cons, int linvarpos)
 
static SCIP_RETCODE dropLinearVarEvents (SCIP *scip, SCIP_CONS *cons, int linvarpos)
 
static SCIP_RETCODE lockLinearVariable (SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real coef)
 
static SCIP_RETCODE unlockLinearVariable (SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real coef)
 
static void consdataUpdateLinearActivity (SCIP *scip, SCIP_CONSDATA *consdata)
 
static void consdataUpdateLinearActivityLbChange (SCIP *scip, SCIP_CONSDATA *consdata, SCIP_Real coef, SCIP_Real oldbnd, SCIP_Real newbnd)
 
static void consdataUpdateLinearActivityUbChange (SCIP *scip, SCIP_CONSDATA *consdata, SCIP_Real coef, SCIP_Real oldbnd, SCIP_Real newbnd)
 
static SCIP_DECL_EVENTEXEC (processLinearVarEvent)
 
static SCIP_DECL_EVENTEXEC (processNonlinearVarEvent)
 
static SCIP_DECL_EXPRGRAPHVARADDED (exprgraphVarAdded)
 
static SCIP_DECL_EXPRGRAPHVARREMOVE (exprgraphVarRemove)
 
static SCIP_RETCODE consdataAddExprtrees (SCIP *scip, SCIP_CONSDATA *consdata, int nexprtrees, SCIP_EXPRTREE **exprtrees, SCIP_Real *coefs, SCIP_Bool copytrees)
 
static SCIP_RETCODE consdataSetExprtrees (SCIP *scip, SCIP_CONSDATA *consdata, int nexprtrees, SCIP_EXPRTREE **exprtrees, SCIP_Real *coefs, SCIP_Bool copytrees)
 
static SCIP_RETCODE consdataEnsureLinearVarsSize (SCIP *scip, SCIP_CONSDATA *consdata, int num)
 
static SCIP_RETCODE consdataCreate (SCIP *scip, SCIP_CONSDATA **consdata, SCIP_Real lhs, SCIP_Real rhs, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nexprtrees, SCIP_EXPRTREE **exprtrees, SCIP_Real *nonlincoefs, SCIP_Bool capturevars)
 
static SCIP_RETCODE consdataCreateEmpty (SCIP *scip, SCIP_CONSDATA **consdata)
 
static SCIP_RETCODE consdataFree (SCIP *scip, SCIP_CONSDATA **consdata)
 
static void consdataSortLinearVars (SCIP_CONSDATA *consdata)
 
static void consdataMoveLinearVar (SCIP_CONSDATA *consdata, int oldpos, int newpos)
 
static SCIP_RETCODE addLinearCoef (SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real coef)
 
static SCIP_RETCODE delLinearCoefPos (SCIP *scip, SCIP_CONS *cons, int pos)
 
static SCIP_RETCODE chgLinearCoefPos (SCIP *scip, SCIP_CONS *cons, int pos, SCIP_Real newcoef)
 
static SCIP_RETCODE mergeAndCleanLinearVars (SCIP *scip, SCIP_CONS *cons)
 
static SCIP_RETCODE removeFixedLinearVariables (SCIP *scip, SCIP_CONS *cons)
 
static SCIP_RETCODE removeFixedNonlinearVariables (SCIP *scip, SCIP_CONSHDLR *conshdlr)
 
static SCIP_RETCODE splitOffLinearPart (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons)
 
static SCIP_RETCODE createNlRow (SCIP *scip, SCIP_CONS *cons)
 
static SCIP_RETCODE presolveUpgrade (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_Bool *upgraded, int *nupgdconss, int *naddconss)
 
static SCIP_RETCODE checkCurvature (SCIP *scip, SCIP_CONS *cons, SCIP_Bool expensivechecks, SCIP_Bool assumeconvex)
 
static SCIP_RETCODE reformReplaceNode (SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE **node, SCIP_EXPRGRAPHNODE *replacement, SCIP_CONS **conss, int nconss)
 
static SCIP_RETCODE reformNode2Var (SCIP *scip, SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node, SCIP_CONS **conss, int nconss, int *naddcons, SCIP_Bool donotmultaggr)
 
static SCIP_RETCODE reformEnsureChildrenMinCurvature (SCIP *scip, SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node, SCIP_EXPRCURV mincurv, SCIP_CONS **conss, int nconss, int *naddcons)
 
static SCIP_RETCODE reformMonomial (SCIP *scip, SCIP_EXPRGRAPH *exprgraph, int nfactors, SCIP_EXPRGRAPHNODE **factors, SCIP_Real *exponents, SCIP_EXPRGRAPHNODE **resultnode, SCIP_Bool createauxcons, int *naddcons)
 
static SCIP_RETCODE reformulate (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, int *naddcons)
 
static SCIP_RETCODE getGradientMaxElement (SCIP *scip, SCIP_EXPRINT *exprint, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool newsol, SCIP_Real *maxelem)
 
static SCIP_RETCODE computeViolation (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_SOL *sol)
 
static SCIP_RETCODE computeViolations (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_CONS **maxviolcon)
 
static SCIP_RETCODE addLinearization (SCIP *scip, SCIP_EXPRINT *exprint, SCIP_CONS *cons, int exprtreeidx, SCIP_Real *x, SCIP_Bool newx, SCIP_ROW *row, SCIP_Bool *success)
 
static SCIP_RETCODE addConcaveEstimatorUnivariate (SCIP *scip, SCIP_CONS *cons, int exprtreeidx, SCIP_ROW *row, SCIP_Bool *success)
 
static SCIP_RETCODE addConcaveEstimatorBivariate (SCIP *scip, SCIP_CONS *cons, int exprtreeidx, SCIP_Real *ref, SCIP_ROW *row, SCIP_Bool *success)
 
static SCIP_RETCODE addConcaveEstimatorMultivariate (SCIP *scip, SCIP_CONS *cons, int exprtreeidx, SCIP_Real *ref, SCIP_ROW *row, SCIP_Bool *success)
 
static SCIP_RETCODE getCoeffsAndConstantFromLinearExpr (SCIP_EXPR *expr, SCIP_Real scalar, SCIP_Real *varcoeffs, SCIP_Real *constant)
 
static SCIP_RETCODE addUserEstimator (SCIP *scip, SCIP_CONS *cons, int exprtreeidx, SCIP_Real *x, SCIP_Bool overestimate, SCIP_ROW *row, SCIP_Bool *success)
 
static SCIP_RETCODE addIntervalGradientEstimator (SCIP *scip, SCIP_EXPRINT *exprint, SCIP_CONS *cons, int exprtreeidx, SCIP_Real *x, SCIP_Bool newx, SCIP_Bool overestimate, SCIP_ROW *row, SCIP_Bool *success)
 
static SCIP_RETCODE generateCut (SCIP *scip, SCIP_EXPRINT *exprint, SCIP_CONS *cons, SCIP_Real **ref, SCIP_SOL *sol, SCIP_Bool newsol, SCIP_SIDETYPE side, SCIP_ROW **row, SCIP_Real maxrange, SCIP_Bool expensivecurvchecks, SCIP_Bool assumeconvex)
 
static SCIP_RETCODE separatePoint (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, int nusefulconss, SCIP_SOL *sol, SCIP_Bool newsol, SCIP_Real minefficacy, SCIP_Bool inenforcement, SCIP_RESULT *result, SCIP_Real *bestefficacy)
 
static SCIP_RETCODE addLinearizationCuts (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_SOL *ref, SCIP_Bool *separatedlpsol, SCIP_Real minefficacy)
 
static SCIP_DECL_EVENTEXEC (processNewSolutionEvent)
 
static SCIP_RETCODE registerBranchingVariables (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, int *nnotify)
 
static SCIP_RETCODE registerLargeLPValueVariableForBranching (SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_VAR **brvar)
 
static SCIP_RETCODE replaceViolatedByLinearConstraints (SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_Bool *addedcons, SCIP_Bool *reduceddom, SCIP_Bool *infeasible)
 
static SCIP_RETCODE propagateBoundsTightenVarLb (SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real bnd, SCIP_RESULT *result, int *nchgbds)
 
static SCIP_RETCODE propagateBoundsTightenVarUb (SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real bnd, SCIP_RESULT *result, int *nchgbds)
 
static SCIP_RETCODE propagateBoundsCons (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_RESULT *result, int *nchgbds, SCIP_Bool *redundant)
 
static SCIP_RETCODE propagateConstraintSides (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_RESULT *result, int *nchgbds)
 
static SCIP_RETCODE propagateBounds (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_Bool needclear, SCIP_RESULT *result, int *nchgbds, int *ndelconss)
 
static void consdataFindUnlockedLinearVar (SCIP *scip, SCIP_CONSDATA *consdata)
 
static SCIP_RETCODE proposeFeasibleSolution (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_Bool *success)
 
static SCIP_DECL_CONSHDLRCOPY (conshdlrCopyNonlinear)
 
static SCIP_DECL_CONSFREE (consFreeNonlinear)
 
static SCIP_DECL_CONSINIT (consInitNonlinear)
 
static SCIP_DECL_CONSEXIT (consExitNonlinear)
 
static SCIP_DECL_CONSINITPRE (consInitpreNonlinear)
 
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_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_CONSGETVARS (consGetVarsNonlinear)
 
static SCIP_DECL_CONSGETNVARS (consGetNVarsNonlinear)
 
static SCIP_DECL_CONSPARSE (consParseNonlinear)
 
SCIP_RETCODE SCIPincludeConshdlrNonlinear (SCIP *scip)
 
SCIP_RETCODE SCIPincludeNonlinconsUpgrade (SCIP *scip, SCIP_DECL_NONLINCONSUPGD((*nonlinconsupgd)), SCIP_DECL_EXPRGRAPHNODEREFORM((*nodereform)), int priority, SCIP_Bool active, const char *conshdlrname)
 
SCIP_RETCODE SCIPcreateConsNonlinear (SCIP *scip, SCIP_CONS **cons, const char *name, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nexprtrees, SCIP_EXPRTREE **exprtrees, SCIP_Real *nonlincoefs, 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_Bool stickingatnode)
 
SCIP_RETCODE SCIPcreateConsBasicNonlinear (SCIP *scip, SCIP_CONS **cons, const char *name, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nexprtrees, SCIP_EXPRTREE **exprtrees, SCIP_Real *nonlincoefs, SCIP_Real lhs, SCIP_Real rhs)
 
SCIP_RETCODE SCIPcreateConsNonlinear2 (SCIP *scip, SCIP_CONS **cons, const char *name, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, SCIP_EXPRGRAPHNODE *exprgraphnode, 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_Bool stickingatnode)
 
SCIP_RETCODE SCIPcreateConsBasicNonlinear2 (SCIP *scip, SCIP_CONS **cons, const char *name, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, SCIP_EXPRGRAPHNODE *exprgraphnode, SCIP_Real lhs, SCIP_Real rhs)
 
SCIP_RETCODE SCIPaddLinearVarNonlinear (SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real coef)
 
SCIP_RETCODE SCIPsetExprtreesNonlinear (SCIP *scip, SCIP_CONS *cons, int nexprtrees, SCIP_EXPRTREE **exprtrees, SCIP_Real *coefs)
 
SCIP_RETCODE SCIPaddExprtreesNonlinear (SCIP *scip, SCIP_CONS *cons, int nexprtrees, SCIP_EXPRTREE **exprtrees, SCIP_Real *coefs)
 
SCIP_RETCODE SCIPgetNlRowNonlinear (SCIP *scip, SCIP_CONS *cons, SCIP_NLROW **nlrow)
 
int SCIPgetNLinearVarsNonlinear (SCIP *scip, SCIP_CONS *cons)
 
SCIP_VAR ** SCIPgetLinearVarsNonlinear (SCIP *scip, SCIP_CONS *cons)
 
SCIP_RealSCIPgetLinearCoefsNonlinear (SCIP *scip, SCIP_CONS *cons)
 
int SCIPgetNExprtreesNonlinear (SCIP *scip, SCIP_CONS *cons)
 
SCIP_EXPRTREE ** SCIPgetExprtreesNonlinear (SCIP *scip, SCIP_CONS *cons)
 
SCIP_RealSCIPgetExprtreeCoefsNonlinear (SCIP *scip, SCIP_CONS *cons)
 
SCIP_EXPRGRAPHNODESCIPgetExprgraphNodeNonlinear (SCIP *scip, SCIP_CONS *cons)
 
SCIP_Real SCIPgetLhsNonlinear (SCIP *scip, SCIP_CONS *cons)
 
SCIP_Real SCIPgetRhsNonlinear (SCIP *scip, SCIP_CONS *cons)
 
SCIP_RETCODE SCIPcheckCurvatureNonlinear (SCIP *scip, SCIP_CONS *cons)
 
SCIP_RETCODE SCIPgetCurvatureNonlinear (SCIP *scip, SCIP_CONS *cons, SCIP_Bool checkcurv, SCIP_EXPRCURV *curvature)
 
SCIP_RETCODE SCIPgetExprtreeCurvaturesNonlinear (SCIP *scip, SCIP_CONS *cons, SCIP_Bool checkcurv, SCIP_EXPRCURV **curvatures)
 
SCIP_RETCODE SCIPgetViolationNonlinear (SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Real *violation)
 
SCIP_EXPRGRAPHSCIPgetExprgraphNonlinear (SCIP *scip, SCIP_CONSHDLR *conshdlr)
 
SCIP_RETCODE SCIPcomputeHyperplaneThreePoints (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)
 

Macro Definition Documentation

#define CONSHDLR_DESC   "constraint handler for nonlinear constraints"

Definition at line 39 of file cons_nonlinear.c.

Referenced by SCIPincludeConshdlrNonlinear().

#define CONSHDLR_SEPAPRIORITY   10

priority of the constraint handler for separation

Definition at line 40 of file cons_nonlinear.c.

Referenced by SCIPincludeConshdlrNonlinear().

#define CONSHDLR_ENFOPRIORITY   -60

priority of the constraint handler for constraint enforcing

Definition at line 41 of file cons_nonlinear.c.

Referenced by SCIPincludeConshdlrNonlinear().

#define CONSHDLR_CHECKPRIORITY   -4000010

priority of the constraint handler for checking feasibility

Definition at line 42 of file cons_nonlinear.c.

Referenced by SCIPincludeConshdlrNonlinear().

#define CONSHDLR_SEPAFREQ   1

frequency for separating cuts; zero means to separate only in the root node

Definition at line 43 of file cons_nonlinear.c.

Referenced by SCIPincludeConshdlrNonlinear().

#define CONSHDLR_PROPFREQ   1

frequency for propagating domains; zero means only preprocessing propagation

Definition at line 44 of file cons_nonlinear.c.

Referenced by SCIPincludeConshdlrNonlinear().

#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 45 of file cons_nonlinear.c.

Referenced by SCIPincludeConshdlrNonlinear().

#define CONSHDLR_MAXPREROUNDS   -1

maximal number of presolving rounds the constraint handler participates in (-1: no limit)

Definition at line 48 of file cons_nonlinear.c.

Referenced by SCIPincludeConshdlrNonlinear().

#define CONSHDLR_DELAYSEPA   FALSE

should separation method be delayed, if other separators found cuts?

Definition at line 49 of file cons_nonlinear.c.

Referenced by SCIPincludeConshdlrNonlinear().

#define CONSHDLR_DELAYPROP   FALSE

should propagation method be delayed, if other propagators found reductions?

Definition at line 50 of file cons_nonlinear.c.

Referenced by SCIPincludeConshdlrNonlinear().

#define CONSHDLR_NEEDSCONS   TRUE

should the constraint handler be skipped, if no constraints are available?

Definition at line 51 of file cons_nonlinear.c.

Referenced by SCIPincludeConshdlrNonlinear().

#define CONSHDLR_PROP_TIMING   SCIP_PROPTIMING_BEFORELP

propagation timing mask of the constraint handler

Definition at line 53 of file cons_nonlinear.c.

Referenced by SCIPincludeConshdlrNonlinear().

#define CONSHDLR_PRESOLTIMING   SCIP_PRESOLTIMING_ALWAYS

presolving timing of the constraint handler (fast, medium, or exhaustive)

Definition at line 54 of file cons_nonlinear.c.

Referenced by SCIPincludeConshdlrNonlinear().

#define BOUNDTIGHTENING_MINSTRENGTH   0.05

minimal required bound tightening strength in expression graph domain tightening for propagating bound change

Definition at line 57 of file cons_nonlinear.c.

Referenced by propagateConstraintSides(), reformEnsureChildrenMinCurvature(), reformMonomial(), reformNode2Var(), and reformulate().

#define INITLPMAXVARVAL   1000.0

maximal absolute value of variable for still generating a linearization cut at that point in initlp

Definition at line 58 of file cons_nonlinear.c.

Referenced by SCIP_DECL_CONSINITLP().

#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 177 of file cons_nonlinear.c.

Referenced by addIntervalGradientEstimator(), addUserEstimator(), checkCurvature(), propagateBoundsCons(), SCIP_DECL_EVENTEXEC(), and SCIP_DECL_EXPRGRAPHVARADDED().

Typedef Documentation

Definition at line 72 of file cons_nonlinear.c.

Definition at line 128 of file cons_nonlinear.c.

Function Documentation

static SCIP_RETCODE dropLinearVarEvents ( SCIP scip,
SCIP_CONS cons,
int  linvarpos 
)
static
static SCIP_RETCODE lockLinearVariable ( SCIP scip,
SCIP_CONS cons,
SCIP_VAR var,
SCIP_Real  coef 
)
static

locks a linear variable in a constraint

Parameters
scipSCIP data structure
consconstraint where to lock a variable
varvariable to lock
coefcoefficient of variable in constraint

Definition at line 308 of file cons_nonlinear.c.

References LinVarEventData::consdata, NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPisInfinity(), SCIPlockVarCons(), and unlockLinearVariable().

Referenced by addLinearCoef(), chgLinearCoefPos(), and dropLinearVarEvents().

static SCIP_RETCODE unlockLinearVariable ( SCIP scip,
SCIP_CONS cons,
SCIP_VAR var,
SCIP_Real  coef 
)
static

unlocks a linear variable in a constraint

Parameters
scipSCIP data structure
consconstraint where to unlock a variable
varvariable to unlock
coefcoefficient of variable in constraint

Definition at line 339 of file cons_nonlinear.c.

References LinVarEventData::consdata, consdataUpdateLinearActivity(), NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPisInfinity(), and SCIPunlockVarCons().

Referenced by chgLinearCoefPos(), delLinearCoefPos(), and lockLinearVariable().

static void consdataUpdateLinearActivity ( SCIP scip,
SCIP_CONSDATA consdata 
)
static

computes the minimal and maximal activity for the linear part in a constraint data only sums up terms that contribute finite values gives the number of terms that contribute infinite values only computes those activities where the corresponding side of the constraint is finite

Parameters
scipSCIP data structure
consdataconstraint data

Definition at line 374 of file cons_nonlinear.c.

References LinVarEventData::consdata, consdataUpdateLinearActivityLbChange(), INTERVALINFTY, NULL, SCIP_INVALID, SCIP_Real, SCIPintervalGetRoundingMode(), SCIPintervalSetRoundingMode(), SCIPintervalSetRoundingModeDownwards(), SCIPintervalSetRoundingModeUpwards(), SCIPisInfinity(), SCIPvarGetLbLocal(), and SCIPvarGetUbLocal().

Referenced by propagateBoundsCons(), and unlockLinearVariable().

static void consdataUpdateLinearActivityLbChange ( SCIP scip,
SCIP_CONSDATA consdata,
SCIP_Real  coef,
SCIP_Real  oldbnd,
SCIP_Real  newbnd 
)
static

update the linear activities after a change in the lower bound of a variable

Parameters
scipSCIP data structure
consdataconstraint data
coefcoefficient of variable in constraint
oldbndprevious lower bound of variable
newbndnew lower bound of variable

Definition at line 484 of file cons_nonlinear.c.

References LinVarEventData::consdata, consdataUpdateLinearActivityUbChange(), INTERVALINFTY, NULL, SCIP_INVALID, SCIPintervalGetRoundingMode(), SCIPintervalNegateReal(), SCIPintervalSetRoundingMode(), SCIPintervalSetRoundingModeDownwards(), SCIPintervalSetRoundingModeUpwards(), and SCIPisInfinity().

Referenced by consdataUpdateLinearActivity(), and SCIP_DECL_EVENTEXEC().

static void consdataUpdateLinearActivityUbChange ( SCIP scip,
SCIP_CONSDATA consdata,
SCIP_Real  coef,
SCIP_Real  oldbnd,
SCIP_Real  newbnd 
)
static

update the linear activities after a change in the upper bound of a variable

Parameters
scipSCIP data structure
consdataconstraint data
coefcoefficient of variable in constraint
oldbndprevious lower bound of variable
newbndnew lower bound of variable

Definition at line 581 of file cons_nonlinear.c.

References LinVarEventData::consdata, INTERVALINFTY, NULL, SCIP_DECL_EVENTEXEC(), SCIP_INVALID, SCIPintervalGetRoundingMode(), SCIPintervalNegateReal(), SCIPintervalSetRoundingMode(), SCIPintervalSetRoundingModeDownwards(), SCIPintervalSetRoundingModeUpwards(), and SCIPisInfinity().

Referenced by consdataUpdateLinearActivityLbChange(), and SCIP_DECL_EVENTEXEC().

static SCIP_DECL_EXPRGRAPHVARREMOVE ( exprgraphVarRemove  )
static
static SCIP_RETCODE consdataAddExprtrees ( SCIP scip,
SCIP_CONSDATA consdata,
int  nexprtrees,
SCIP_EXPRTREE **  exprtrees,
SCIP_Real coefs,
SCIP_Bool  copytrees 
)
static
Parameters
scipSCIP data structure
consdatanonlinear constraint data
nexprtreesnumber of expression trees
exprtreesexpression trees
coefscoefficients of expression trees, or NULL if all 1.0
copytreeswhether trees should be copied or ownership should be assumed

Definition at line 856 of file cons_nonlinear.c.

References LinVarEventData::consdata, consdataSetExprtrees(), FALSE, NULL, SCIP_CALL, SCIP_EXPRCURV_UNKNOWN, SCIP_INVALID, SCIP_OKAY, SCIPallocBlockMemoryArray, SCIPblkmem(), SCIPexprtreeCopy(), SCIPexprtreeGetNVars(), SCIPexprtreeGetVars(), SCIPreallocBlockMemoryArray, and SCIPreleaseNlRow().

Referenced by consdataSetExprtrees(), SCIP_DECL_EXPRGRAPHVARREMOVE(), and SCIPaddExprtreesNonlinear().

static SCIP_RETCODE consdataSetExprtrees ( SCIP scip,
SCIP_CONSDATA consdata,
int  nexprtrees,
SCIP_EXPRTREE **  exprtrees,
SCIP_Real coefs,
SCIP_Bool  copytrees 
)
static
Parameters
scipSCIP data structure
consdatanonlinear constraint data
nexprtreesnumber of expression trees
exprtreesexpression trees
coefscoefficients of expression trees, or NULL if all 1.0
copytreeswhether trees should be copied or ownership should be assumed

Definition at line 929 of file cons_nonlinear.c.

References LinVarEventData::consdata, consdataAddExprtrees(), consdataEnsureLinearVarsSize(), FALSE, NULL, SCIP_CALL, SCIP_EXPRCURV_LINEAR, SCIP_INVALID, SCIP_OKAY, SCIPexprtreeFree(), SCIPfreeBlockMemoryArray, SCIPreleaseNlRow(), and TRUE.

Referenced by consdataAddExprtrees(), consdataCreate(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSDEACTIVE(), SCIP_DECL_CONSEXITPRE(), SCIP_DECL_CONSINITPRE(), SCIPcreateConsNonlinear(), and SCIPsetExprtreesNonlinear().

static SCIP_RETCODE consdataEnsureLinearVarsSize ( SCIP scip,
SCIP_CONSDATA consdata,
int  num 
)
static

ensures, that linear vars and coefs arrays can store at least num entries

Parameters
scipSCIP data structure
consdatanonlinear constraint data
numminimum number of entries to store

Definition at line 979 of file cons_nonlinear.c.

References LinVarEventData::consdata, consdataCreate(), NULL, SCIP_CALL, SCIP_OKAY, SCIPcalcMemGrowSize(), and SCIPreallocBlockMemoryArray.

Referenced by addLinearCoef(), consdataSetExprtrees(), removeFixedLinearVariables(), SCIPcreateConsNonlinear(), and SCIPcreateConsNonlinear2().

static SCIP_RETCODE consdataCreate ( SCIP scip,
SCIP_CONSDATA **  consdata,
SCIP_Real  lhs,
SCIP_Real  rhs,
int  nlinvars,
SCIP_VAR **  linvars,
SCIP_Real lincoefs,
int  nexprtrees,
SCIP_EXPRTREE **  exprtrees,
SCIP_Real nonlincoefs,
SCIP_Bool  capturevars 
)
static

creates constraint data structure

Parameters
scipSCIP data structure
consdataa buffer to store pointer to new constraint data
lhsleft hand side of constraint
rhsright hand side of constraint
nlinvarsnumber of linear variables
linvarsarray of linear variables
lincoefsarray of coefficients of linear variables
nexprtreesnumber of expression trees
exprtreesexpression trees
nonlincoefscoefficients of expression trees
capturevarswhether we should capture variables

Definition at line 1009 of file cons_nonlinear.c.

References BMSclearMemory, LinVarEventData::consdata, consdataCreateEmpty(), consdataSetExprtrees(), NULL, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIPallocBlockMemory, SCIPcaptureVar(), SCIPduplicateBlockMemoryArray, SCIPisInfinity(), and TRUE.

Referenced by consdataEnsureLinearVarsSize(), and SCIP_DECL_CONSTRANS().

static SCIP_RETCODE consdataCreateEmpty ( SCIP scip,
SCIP_CONSDATA **  consdata 
)
static

creates empty constraint data structure

Parameters
scipSCIP data structure
consdataa buffer to store pointer to new constraint data

Definition at line 1077 of file cons_nonlinear.c.

References BMSclearMemory, LinVarEventData::consdata, consdataFree(), NULL, SCIP_CALL, SCIP_EXPRCURV_LINEAR, SCIP_INVALID, SCIP_OKAY, SCIPallocBlockMemory, SCIPinfinity(), and TRUE.

Referenced by consdataCreate(), SCIPcreateConsNonlinear(), and SCIPcreateConsNonlinear2().

static SCIP_RETCODE consdataFree ( SCIP scip,
SCIP_CONSDATA **  consdata 
)
static

frees constraint data structure

Parameters
scipSCIP data structure
consdatapointer to constraint data to free

Definition at line 1115 of file cons_nonlinear.c.

References LinVarEventData::consdata, consdataSortLinearVars(), NULL, SCIP_CALL, SCIP_OKAY, SCIPexprtreeFree(), SCIPfreeBlockMemory, SCIPfreeBlockMemoryArray, SCIPfreeBlockMemoryArrayNull, SCIPreleaseNlRow(), and SCIPreleaseVar().

Referenced by consdataCreateEmpty(), and SCIP_DECL_CONSDELETE().

static void consdataSortLinearVars ( SCIP_CONSDATA consdata)
static

sorts linear part of constraint data

Parameters
consdatanonlinear constraint data

Definition at line 1175 of file cons_nonlinear.c.

References LinVarEventData::consdata, consdataMoveLinearVar(), NULL, SCIPsortedvecFindPtr(), SCIPsortPtrPtrReal(), SCIPsortPtrReal(), and TRUE.

Referenced by consdataFree(), and mergeAndCleanLinearVars().

static void consdataMoveLinearVar ( SCIP_CONSDATA consdata,
int  oldpos,
int  newpos 
)
static

moves a linear variable from one position to another

Parameters
consdataconstraint data
oldposposition of variable that shall be moved
newposnew position of variable

Definition at line 1237 of file cons_nonlinear.c.

References addLinearCoef(), LinVarEventData::consdata, FALSE, and NULL.

Referenced by consdataSortLinearVars(), and delLinearCoefPos().

static SCIP_RETCODE delLinearCoefPos ( SCIP scip,
SCIP_CONS cons,
int  pos 
)
static

deletes linear coefficient at given position from nonlinear constraint data

Parameters
scipSCIP data structure
consnonlinear constraint
posposition of coefficient to delete

Definition at line 1350 of file cons_nonlinear.c.

References chgLinearCoefPos(), LinVarEventData::consdata, consdataMoveLinearVar(), dropLinearVarEvents(), FALSE, NULL, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPconsGetData(), SCIPconsIsEnabled(), SCIPreleaseNlRow(), SCIPreleaseVar(), and unlockLinearVariable().

Referenced by addLinearCoef(), mergeAndCleanLinearVars(), and removeFixedLinearVariables().

static SCIP_RETCODE chgLinearCoefPos ( SCIP scip,
SCIP_CONS cons,
int  pos,
SCIP_Real  newcoef 
)
static

changes linear coefficient value at given position of nonlinear constraint

Parameters
scipSCIP data structure
consnonlinear constraint
posposition of linear coefficient to change
newcoefnew value of linear coefficient

Definition at line 1410 of file cons_nonlinear.c.

References catchLinearVarEvents(), LinVarEventData::consdata, dropLinearVarEvents(), FALSE, lockLinearVariable(), mergeAndCleanLinearVars(), NULL, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPconsGetData(), SCIPconsIsEnabled(), SCIPconsIsLocked(), SCIPconsIsTransformed(), SCIPisZero(), SCIPreleaseNlRow(), SCIPvarIsTransformed(), and unlockLinearVariable().

Referenced by delLinearCoefPos(), and mergeAndCleanLinearVars().

static SCIP_RETCODE mergeAndCleanLinearVars ( SCIP scip,
SCIP_CONS cons 
)
static
static SCIP_RETCODE splitOffLinearPart ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS cons 
)
static

moves constant and linear part from expression graph node into constraint sides and linear part frees expression graph node if expression is constant or linear

Parameters
scipSCIP data structure
conshdlrconstraint handler
consnonlinear constraint

Definition at line 1755 of file cons_nonlinear.c.

References addLinearCoef(), LinVarEventData::consdata, LinVarEventData::conshdlrdata, createNlRow(), MAX, NULL, REALABS, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPconsGetData(), SCIPconshdlrGetData(), SCIPexprgraphGetNodeNChildren(), SCIPexprgraphNodeSplitOffLinear(), SCIPfreeBufferArray, and SCIPisInfinity().

Referenced by removeFixedNonlinearVariables(), SCIP_DECL_CONSEXITPRE(), and SCIP_DECL_CONSPRESOL().

static SCIP_RETCODE createNlRow ( SCIP scip,
SCIP_CONS cons 
)
static

create a nonlinear row representation of the constraint and stores them in consdata

Parameters
scipSCIP data structure
consnonlinear constraint

Definition at line 1822 of file cons_nonlinear.c.

References LinVarEventData::consdata, LinVarEventData::conshdlrdata, NULL, presolveUpgrade(), SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPcreateNlRow(), SCIPexprgraphGetTree(), SCIPexprtreeFree(), and SCIPreleaseNlRow().

Referenced by SCIP_DECL_CONSINITSOL(), SCIPgetNlRowNonlinear(), and splitOffLinearPart().

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 (or a part of it) 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 1880 of file cons_nonlinear.c.

References checkCurvature(), LinVarEventData::conshdlrdata, FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPaddCons(), SCIPallocBufferArray, SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsModifiable(), SCIPdebugGetSolVal, SCIPdebugMessage, SCIPdebugPrintCons, SCIPdebugPrintf, SCIPdelCons(), SCIPexprgraphEval(), SCIPexprgraphGetNVars(), SCIPexprgraphGetVars(), SCIPfreeBufferArray, SCIPreallocBufferArray, SCIPreleaseCons(), and TRUE.

Referenced by createNlRow(), and SCIP_DECL_CONSPRESOL().

static SCIP_RETCODE reformReplaceNode ( SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE **  node,
SCIP_EXPRGRAPHNODE replacement,
SCIP_CONS **  conss,
int  nconss 
)
static
Parameters
exprgraphexpression graph
nodepointer to node to be replaced in expression graph
replacementnode which takes node's place
conssconstraints
nconssnumber of constraints

Definition at line 2096 of file cons_nonlinear.c.

References LinVarEventData::consdata, FALSE, NULL, reformNode2Var(), SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPexprgraphCaptureNode(), SCIPexprgraphGetNodeNParents(), SCIPexprgraphMoveNodeParents(), and SCIPexprgraphReleaseNode().

Referenced by checkCurvature(), reformNode2Var(), and reformulate().

static SCIP_RETCODE reformNode2Var ( SCIP scip,
SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE node,
SCIP_CONS **  conss,
int  nconss,
int *  naddcons,
SCIP_Bool  donotmultaggr 
)
static

creates a new auxiliary variable and a new auxiliary nonlinear constraint connecting the var and a given node node is replaced by new new auxiliary variables node in all parents of node in expression graph and in all constraints that use node

Parameters
scipSCIP data structure
exprgraphexpression graph
nodeexpression graph node
conssconstraints where to update exprgraphnode
nconssnumber of constraints
naddconscounter to increase when constraint is added
donotmultaggrwhether to mark auxiliary variable as not to multiaggregate

Definition at line 2150 of file cons_nonlinear.c.

References BOUNDTIGHTENING_MINSTRENGTH, FALSE, INTERVALINFTY, NULL, reformEnsureChildrenMinCurvature(), reformReplaceNode(), SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_CONTINUOUS, SCIPaddCons(), SCIPaddVar(), SCIPcreateConsNonlinear2(), SCIPcreateVar(), SCIPdebugAddSolVal, SCIPdebugMessage, SCIPexprgraphAddVars(), SCIPexprgraphGetNodeBounds(), SCIPexprgraphGetNodeDepth(), SCIPexprgraphGetNodePosition(), SCIPexprgraphGetNodeVal(), SCIPexprgraphSetVarNodeValue(), SCIPexprgraphTightenNodeBounds(), SCIPintervalGetInf(), SCIPintervalGetSup(), SCIPmarkDoNotMultaggrVar(), SCIPreleaseCons(), SCIPreleaseVar(), SCIPsnprintf(), and TRUE.

Referenced by reformEnsureChildrenMinCurvature(), reformReplaceNode(), and reformulate().

static SCIP_RETCODE reformEnsureChildrenMinCurvature ( SCIP scip,
SCIP_EXPRGRAPH exprgraph,
SCIP_EXPRGRAPHNODE node,
SCIP_EXPRCURV  mincurv,
SCIP_CONS **  conss,
int  nconss,
int *  naddcons 
)
static

ensures that all children of a node have at least a given curvature by adding auxiliary variables

Parameters
scipSCIP data structure
exprgraphexpression graph
nodeexpression graph node
mincurvminimal desired curvature
conssconstraints to check whether they use one of the replaced nodes
nconssnumber of constraints to check
naddconscounter to increase when constraint is added

Definition at line 2223 of file cons_nonlinear.c.

References BOUNDTIGHTENING_MINSTRENGTH, FALSE, INTERVALINFTY, NULL, reformMonomial(), reformNode2Var(), SCIP_Bool, SCIP_CALL, SCIP_EXPR_VARIDX, SCIP_EXPRCURV_UNKNOWN, SCIP_OKAY, SCIPdebugMessage, SCIPexprcurvGetName(), SCIPexprgraphGetNodeBounds(), SCIPexprgraphGetNodeChildren(), SCIPexprgraphGetNodeCurvature(), SCIPexprgraphGetNodeDepth(), SCIPexprgraphGetNodeNChildren(), SCIPexprgraphGetNodeOperator(), SCIPexprgraphGetNodePosition(), SCIPexprgraphUpdateNodeBoundsCurvature(), SCIPintervalIsEmpty(), and TRUE.

Referenced by reformNode2Var(), and reformulate().

static SCIP_RETCODE reformMonomial ( SCIP scip,
SCIP_EXPRGRAPH exprgraph,
int  nfactors,
SCIP_EXPRGRAPHNODE **  factors,
SCIP_Real exponents,
SCIP_EXPRGRAPHNODE **  resultnode,
SCIP_Bool  createauxcons,
int *  naddcons 
)
static
static SCIP_RETCODE reformulate ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
int *  naddcons 
)
static

reformulates expression graph into a form so that for each node under- and overestimators could be computed similar to factorable reformulation in other global solvers, but sometimes does not split up complex operands (like quadratic)

Parameters
scipSCIP data structure
conshdlrconstraint handler
conssconstraints
nconssnumber of constraints
naddconsbuffer to increase by the number of added constraints

Definition at line 2600 of file cons_nonlinear.c.

References BMSclearMemoryArray, BOUNDTIGHTENING_MINSTRENGTH, SCIP_QuadElement::coef, LinVarEventData::consdata, LinVarEventData::conshdlrdata, FALSE, getGradientMaxElement(), SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, SCIP_Interval::inf, INTERVALINFTY, NULL, reformEnsureChildrenMinCurvature(), reformMonomial(), reformNode2Var(), reformReplaceNode(), SCIP_Bool, SCIP_CALL, SCIP_ERROR, SCIP_EXPR_ABS, SCIP_EXPR_CONST, SCIP_EXPR_COS, SCIP_EXPR_DIV, SCIP_EXPR_EXP, SCIP_EXPR_INTPOWER, SCIP_EXPR_LAST, SCIP_EXPR_LINEAR, SCIP_EXPR_LOG, SCIP_EXPR_MAX, SCIP_EXPR_MIN, SCIP_EXPR_MINUS, SCIP_EXPR_MUL, SCIP_EXPR_PARAM, SCIP_EXPR_PLUS, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_PRODUCT, SCIP_EXPR_QUADRATIC, SCIP_EXPR_REALPOWER, SCIP_EXPR_SIGN, SCIP_EXPR_SIGNPOWER, SCIP_EXPR_SIN, SCIP_EXPR_SQRT, SCIP_EXPR_SQUARE, SCIP_EXPR_SUM, SCIP_EXPR_TAN, SCIP_EXPR_USER, SCIP_EXPR_VARIDX, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_STAGE_PRESOLVING, SCIP_VARTYPE_CONTINUOUS, SCIPABORT, SCIPaddCons(), SCIPaddVar(), SCIPallocBufferArray, SCIPblkmem(), SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPcreateConsNonlinear2(), SCIPcreateVar(), SCIPdebug, SCIPdebugAddSolVal, SCIPdebugGetSolVal, SCIPdebugMessage, SCIPdebugPrintCons, SCIPdebugPrintf, SCIPerrorMessage, SCIPexprCreateMonomial(), SCIPexprcurvGetName(), SCIPexprcurvMultiply(), SCIPexprcurvNegate(), SCIPexprcurvPower(), SCIPexprGetMonomialChildIndices(), SCIPexprGetMonomialCoef(), SCIPexprGetMonomialExponents(), SCIPexprGetMonomialNFactors(), SCIPexprgraphAddNode(), SCIPexprgraphAddVars(), SCIPexprgraphCreateNode(), SCIPexprgraphCreateNodeLinear(), SCIPexprgraphCreateNodePolynomial(), SCIPexprgraphCreateNodeQuadratic(), SCIPexprgraphEval(), SCIPexprgraphGetDepth(), SCIPexprgraphGetNNodes(), SCIPexprgraphGetNodeBounds(), SCIPexprgraphGetNodeChildren(), SCIPexprgraphGetNodeCurvature(), SCIPexprgraphGetNodeDepth(), SCIPexprgraphGetNodeIntPowerExponent(), SCIPexprgraphGetNodeNChildren(), SCIPexprgraphGetNodeNParents(), SCIPexprgraphGetNodeOperator(), SCIPexprgraphGetNodePolynomialConstant(), SCIPexprgraphGetNodePolynomialMonomialCurvature(), SCIPexprgraphGetNodePolynomialMonomials(), SCIPexprgraphGetNodePolynomialNMonomials(), SCIPexprgraphGetNodePosition(), SCIPexprgraphGetNodes(), SCIPexprgraphGetNodeSignPowerExponent(), SCIPexprgraphGetNodeVal(), SCIPexprgraphGetNVars(), SCIPexprgraphGetVars(), SCIPexprgraphHasNodeNonlinearAncestor(), SCIPexprgraphHasNodeSibling(), SCIPexprgraphIsNodeEnabled(), SCIPexprgraphPrintNode(), SCIPexprgraphPropagateVarBounds(), SCIPexprgraphSetVarNodeValue(), SCIPexprgraphUpdateNodeBoundsCurvature(), SCIPexpropGetName(), SCIPfreeBufferArray, SCIPfreeBufferArrayNull, SCIPgetMessagehdlr(), SCIPgetStage(), SCIPinProbing(), SCIPintervalGetInf(), SCIPintervalGetSup(), SCIPintervalIsEmpty(), SCIPisGE(), SCIPisInfinity(), SCIPisIntegral(), SCIPisLE(), SCIPreleaseCons(), SCIPreleaseVar(), SCIPround(), SCIPsnprintf(), SCIP_Interval::sup, and TRUE.

Referenced by reformMonomial(), and SCIP_DECL_CONSPRESOL().

static SCIP_RETCODE getGradientMaxElement ( SCIP scip,
SCIP_EXPRINT exprint,
SCIP_CONS cons,
SCIP_SOL sol,
SCIP_Bool  newsol,
SCIP_Real maxelem 
)
static

gets maximal absolute element of gradient of nonlinear function

Parameters
scipSCIP data structure
exprintexpressions interpreter
consconstraint
solsolution or NULL if LP solution should be used
newsolhave the expression trees been evaluated at sol before?
maxelembuffer to store maximal element

Definition at line 3540 of file cons_nonlinear.c.

References computeViolation(), LinVarEventData::consdata, FALSE, NULL, REALABS, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_STAGE_SOLVING, SCIPallocBufferArray, SCIPconsGetData(), SCIPexprintCompile(), SCIPexprintGrad(), SCIPexprtreeGetInterpreterData(), SCIPexprtreeGetNVars(), SCIPexprtreeGetVars(), SCIPfreeBufferArray, SCIPgetSolVal(), SCIPgetSolVals(), SCIPgetStage(), and TRUE.

Referenced by computeViolation(), and reformulate().

static SCIP_RETCODE computeViolation ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS cons,
SCIP_SOL sol 
)
static
static SCIP_RETCODE computeViolations ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
SCIP_SOL sol,
SCIP_CONS **  maxviolcon 
)
static

computes violation of a set of constraints

Parameters
scipSCIP data structure
conshdlrconstraint handler
conssconstraints
nconssnumber of constraints
solsolution or NULL if LP solution should be used
maxviolconbuffer to store constraint with largest violation, or NULL if solution is feasible

Definition at line 3866 of file cons_nonlinear.c.

References addLinearization(), computeViolation(), LinVarEventData::consdata, LinVarEventData::conshdlrdata, MAX, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_STAGE_EXITPRESOLVE, SCIP_STAGE_INITPRESOLVE, SCIPallocBufferArray, SCIPconsGetData(), SCIPconshdlrGetData(), SCIPexprgraphEval(), SCIPexprgraphGetNVars(), SCIPexprgraphGetVars(), SCIPfeastol(), SCIPfreeBufferArray, SCIPgetSolVals(), SCIPgetStage(), and SCIPisGT().

Referenced by computeViolation(), SCIP_DECL_CONSENFOLP(), SCIP_DECL_CONSENFOPS(), SCIP_DECL_CONSSEPALP(), and SCIP_DECL_CONSSEPASOL().

static SCIP_RETCODE addLinearization ( SCIP scip,
SCIP_EXPRINT exprint,
SCIP_CONS cons,
int  exprtreeidx,
SCIP_Real x,
SCIP_Bool  newx,
SCIP_ROW row,
SCIP_Bool success 
)
static

adds linearization of a constraints expression tree in reference point to a row

Parameters
scipSCIP data structure
exprintexpression interpreter
consconstraint
exprtreeidxfor which tree a linearization should be added
xvalue of expression tree variables where to generate cut
newxwhether the last evaluation of the expression with the expression interpreter was not at x
rowrow where to add linearization
successbuffer to store whether a linearization was succefully added to the row

Definition at line 3931 of file cons_nonlinear.c.

References addConcaveEstimatorUnivariate(), LinVarEventData::consdata, FALSE, MIN, NULL, REALABS, SCIP_Bool, SCIP_CALL, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_OKAY, SCIP_Real, SCIPaddVarsToRow(), SCIPallocBufferArray, SCIPchgRowLhs(), SCIPchgRowRhs(), SCIPconsGetData(), SCIPconsGetName(), SCIPdebug, SCIPdebugMessage, SCIPdebugPrintf, SCIPexprintCompile(), SCIPexprintGrad(), SCIPexprtreeGetInterpreterData(), SCIPexprtreeGetNVars(), SCIPexprtreeGetVars(), SCIPfeastol(), SCIPfreeBufferArray, SCIPisEQ(), SCIPisFinite, SCIPisInfinity(), SCIPisZero(), SCIPprintRow(), SCIProwGetLhs(), SCIProwGetRhs(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), and TRUE.

Referenced by computeViolations(), and generateCut().

static SCIP_RETCODE addConcaveEstimatorUnivariate ( SCIP scip,
SCIP_CONS cons,
int  exprtreeidx,
SCIP_ROW row,
SCIP_Bool success 
)
static

adds secant of a constraints univariate expression tree in reference point to a row

Parameters
scipSCIP data structure
consconstraint
exprtreeidxfor which tree a secant should be added
rowrow where to add secant
successbuffer to store whether a secant was succefully added to the row

Definition at line 4094 of file cons_nonlinear.c.

References addConcaveEstimatorBivariate(), LinVarEventData::consdata, FALSE, MAX, MIN, NULL, REALABS, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPaddVarsToRow(), SCIPchgRowLhs(), SCIPchgRowRhs(), SCIPconsGetData(), SCIPconsGetName(), SCIPdebug, SCIPdebugMessage, SCIPexprtreeEval(), SCIPexprtreeGetNVars(), SCIPexprtreeGetVars(), SCIPisEQ(), SCIPisFinite, SCIPisInfinity(), SCIPisLE(), SCIPprintRow(), SCIProwGetLhs(), SCIProwGetRhs(), SCIPvarGetLbLocal(), SCIPvarGetUbLocal(), and TRUE.

Referenced by addLinearization(), and generateCut().

static SCIP_RETCODE addConcaveEstimatorBivariate ( SCIP scip,
SCIP_CONS cons,
int  exprtreeidx,
SCIP_Real ref,
SCIP_ROW row,
SCIP_Bool success 
)
static

adds estimator of a constraints bivariate expression tree to a row a reference point is given to decide which hyperplane to choose

Parameters
scipSCIP data structure
consconstraint
exprtreeidxfor which tree a secant should be added
refreference values of expression tree variables where to generate cut
rowrow where to add secant
successbuffer to store whether a secant was succefully added to the row

Definition at line 4201 of file cons_nonlinear.c.

References addConcaveEstimatorMultivariate(), LinVarEventData::consdata, FALSE, MAX, MIN, NULL, REALABS, SCIP_Bool, SCIP_CALL, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_OKAY, SCIP_Real, SCIPaddVarsToRow(), SCIPchgRowLhs(), SCIPchgRowRhs(), SCIPcomputeHyperplaneThreePoints(), SCIPconsGetData(), SCIPconsGetName(), SCIPdebug, SCIPdebugMessage, SCIPexprtreeEval(), SCIPexprtreeGetNVars(), SCIPexprtreeGetVars(), SCIPisEQ(), SCIPisFeasGE(), SCIPisFeasLE(), SCIPisFinite, SCIPisInfinity(), SCIPisNegative(), SCIPisRelEQ(), SCIPisRelLE(), SCIPisZero(), SCIPprintRow(), SCIProwGetLhs(), SCIProwGetRhs(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), and TRUE.

Referenced by addConcaveEstimatorUnivariate(), and generateCut().

static SCIP_RETCODE addConcaveEstimatorMultivariate ( SCIP scip,
SCIP_CONS cons,
int  exprtreeidx,
SCIP_Real ref,
SCIP_ROW row,
SCIP_Bool success 
)
static

adds estimator of a constraints multivariate expression tree to a row Given concave function f(x) and reference point ref. Let (v_i: i=1,...,n) be corner points of current domain of x. Find (coef,constant) such that <coef,v_i> + constant <= f(v_i) (cut validity) and such that <coef, ref> + constant is maximized (cut efficacy). Then <coef, x> + constant <= f(x) for all x in current domain.

Similar to compute an overestimator for a convex function f(x). Find (coef,constant) such that <coef,v_i> + constant >= f(v_i) and such that <coef, ref> + constant is minimized. Then <coef, x> + constant >= f(x) for all x in current domain.

Parameters
scipSCIP data structure
consconstraint
exprtreeidxfor which tree a secant should be added
refreference values of expression tree variables where to generate cut
rowrow where to add secant
successbuffer to store whether a secant was succefully added to the row

Definition at line 4560 of file cons_nonlinear.c.

References BMScopyMemoryArray, LinVarEventData::consdata, FALSE, getCoeffsAndConstantFromLinearExpr(), MAX, MIN, NULL, REALABS, SCIP_Bool, SCIP_CALL, SCIP_ERROR, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_LPPAR_FEASTOL, SCIP_LPPAR_FROMSCRATCH, SCIP_LPPAR_LOBJLIM, SCIP_LPPAR_LPITLIM, SCIP_LPPAR_SCALING, SCIP_LPPAR_UOBJLIM, SCIP_OBJSEN_MAXIMIZE, SCIP_OBJSEN_MINIMIZE, SCIP_OKAY, SCIP_Real, SCIPaddVarsToRow(), SCIPallocBufferArray, SCIPchgRowLhs(), SCIPchgRowRhs(), SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMessage, SCIPdebugPrintf, SCIPerrorMessage, SCIPexprtreeEval(), SCIPexprtreeGetNVars(), SCIPexprtreeGetVars(), SCIPfeastol(), SCIPfreeBufferArray, SCIPgetMessagehdlr(), SCIPisFeasGE(), SCIPisFeasGT(), SCIPisFeasLE(), SCIPisFinite, SCIPisInfinity(), SCIPlpiAddCols(), SCIPlpiAddRows(), SCIPlpiCreate(), SCIPlpiFree(), SCIPlpiGetSol(), SCIPlpiInfinity(), SCIPlpiIsIterlimExc(), SCIPlpiIsObjlimExc(), SCIPlpiIsOptimal(), SCIPlpiIsPrimalFeasible(), SCIPlpiIsPrimalUnbounded(), SCIPlpiSetIntpar(), SCIPlpiSetRealpar(), SCIPlpiSolveDual(), SCIProwGetLhs(), SCIProwGetRhs(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), SCIPwarningMessage(), and TRUE.

Referenced by addConcaveEstimatorBivariate(), and generateCut().

static SCIP_RETCODE getCoeffsAndConstantFromLinearExpr ( SCIP_EXPR expr,
SCIP_Real  scalar,
SCIP_Real varcoeffs,
SCIP_Real constant 
)
static

Computes the linear coeffs and the constant in a linear expression both scaled by a given scalar value. The coeffs of the variables will be stored in the given array at their variable index. The constant of the given linear expression will be added to the given buffer.

Parameters
exprthe linear expression
scalarthe scalar value, i.e. the coeff of the given expression
varcoeffsbuffer array to store the computed coefficients
constantbuffer to hold the constant value of the given expression

Definition at line 4819 of file cons_nonlinear.c.

References addUserEstimator(), SCIP_CALL, SCIP_ERROR, SCIP_EXPR_CONST, SCIP_EXPR_LINEAR, SCIP_EXPR_MINUS, SCIP_EXPR_MUL, SCIP_EXPR_PLUS, SCIP_EXPR_VARIDX, SCIP_OKAY, SCIP_Real, SCIPABORT, SCIPerrorMessage, SCIPexprGetChildren(), SCIPexprGetLinearCoefs(), SCIPexprGetLinearConstant(), SCIPexprGetNChildren(), SCIPexprGetOperator(), SCIPexprGetOpIndex(), and SCIPexprGetOpReal().

Referenced by addConcaveEstimatorMultivariate(), and addUserEstimator().

static SCIP_RETCODE addUserEstimator ( SCIP scip,
SCIP_CONS cons,
int  exprtreeidx,
SCIP_Real x,
SCIP_Bool  overestimate,
SCIP_ROW row,
SCIP_Bool success 
)
static

adds estimator from user callback of a constraints user expression tree to a row

Parameters
scipSCIP data structure
consconstraint
exprtreeidxfor which tree an estimator should be added
xvalue of expression tree variables where to generate cut
overestimatewhether to compute an overestimator instead of an underestimator
rowrow where to add cut
successbuffer to store whether a cut was succefully added to the row

Definition at line 4916 of file cons_nonlinear.c.

References addIntervalGradientEstimator(), LinVarEventData::consdata, FALSE, getCoeffsAndConstantFromLinearExpr(), infty2infty, INTERVALINFTY, MAX, MIN, NULL, SCIP_CALL, SCIP_EXPR_USER, SCIP_OKAY, SCIP_Real, SCIPaddVarsToRow(), SCIPallocBufferArray, SCIPchgRowLhs(), SCIPchgRowRhs(), SCIPconsGetData(), SCIPexprEstimateUser(), SCIPexprEval(), SCIPexprEvalInt(), SCIPexprGetChildren(), SCIPexprGetNChildren(), SCIPexprGetOperator(), SCIPexprHasUserEstimator(), SCIPexprtreeGetNVars(), SCIPexprtreeGetParamVals(), SCIPexprtreeGetRoot(), SCIPexprtreeGetVars(), SCIPfreeBufferArray, SCIPinfinity(), SCIPintervalSetBounds(), SCIPisInfinity(), SCIProwGetLhs(), SCIProwGetRhs(), SCIPvarGetLbLocal(), and SCIPvarGetUbLocal().

Referenced by generateCut(), and getCoeffsAndConstantFromLinearExpr().

static SCIP_RETCODE addIntervalGradientEstimator ( SCIP scip,
SCIP_EXPRINT exprint,
SCIP_CONS cons,
int  exprtreeidx,
SCIP_Real x,
SCIP_Bool  newx,
SCIP_Bool  overestimate,
SCIP_ROW row,
SCIP_Bool success 
)
static

adds estimator from interval gradient of a constraints univariate expression tree to a row a reference point is used to decide in which corner to generate the cut

Parameters
scipSCIP data structure
exprintexpression interpreter
consconstraint
exprtreeidxfor which tree a secant should be added
xvalue of expression tree variables where to generate cut
newxwhether the last evaluation of the expression with the expression interpreter was not at x
overestimatewhether to compute an overestimator instead of an underestimator
rowrow where to add secant
successbuffer to store whether a secant was succefully added to the row

Definition at line 5035 of file cons_nonlinear.c.

References LinVarEventData::consdata, FALSE, generateCut(), infty2infty, INTERVALINFTY, MAX, MIN, NULL, SCIP_CALL, SCIP_EXPRINTCAPABILITY_INTGRADIENT, SCIP_OKAY, SCIP_Real, SCIPaddVarsToRow(), SCIPallocBufferArray, SCIPchgRowLhs(), SCIPchgRowRhs(), SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMessage, SCIPexprintCompile(), SCIPexprintEval(), SCIPexprintGetCapability(), SCIPexprintGradInt(), SCIPexprtreeGetInterpreterData(), SCIPexprtreeGetNVars(), SCIPexprtreeGetVars(), SCIPfreeBufferArrayNull, SCIPinfinity(), SCIPintervalGetInf(), SCIPintervalGetSup(), SCIPintervalMulScalar(), SCIPintervalSetBounds(), SCIPisEQ(), SCIPisFinite, SCIPisInfinity(), SCIPisZero(), SCIProwGetLhs(), SCIProwGetRhs(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), and TRUE.

Referenced by addUserEstimator(), and generateCut().

static SCIP_RETCODE generateCut ( SCIP scip,
SCIP_EXPRINT exprint,
SCIP_CONS cons,
SCIP_Real **  ref,
SCIP_SOL sol,
SCIP_Bool  newsol,
SCIP_SIDETYPE  side,
SCIP_ROW **  row,
SCIP_Real  maxrange,
SCIP_Bool  expensivecurvchecks,
SCIP_Bool  assumeconvex 
)
static

generates a cut based on linearization (if convex), secant (if concave), or intervalgradient (if indefinite)

Parameters
scipSCIP data structure
exprintexpression interpreter
consconstraint
refreference point for each exprtree, or NULL if sol should be used
solreference solution where cut should be generated, or NULL if LP solution should be used
newsolwhether the last evaluation of the expression with the expression interpreter was not at sol
sidefor which side a cut should be generated
rowstorage for cut
maxrangemaximal range allowed
expensivecurvcheckswhether also expensive checks should be executed
assumeconvexwhether to assume convexity in inequalities

Definition at line 5197 of file cons_nonlinear.c.

References addConcaveEstimatorBivariate(), addConcaveEstimatorMultivariate(), addConcaveEstimatorUnivariate(), addIntervalGradientEstimator(), addLinearization(), addUserEstimator(), checkCurvature(), LinVarEventData::consdata, FALSE, MAX, MIN, NULL, REALABS, SCIP_Bool, SCIP_CALL, SCIP_EXPR_USER, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIP_STAGE_SOLVING, SCIPaddVarsToRow(), SCIPaddVarToRow(), SCIPallocBufferArray, SCIPchgRowLhs(), SCIPchgRowRhs(), SCIPcolGetVar(), SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconsIsLocal(), SCIPcreateEmptyRowCons(), SCIPdebugMessage, SCIPexprGetOperator(), SCIPexprtreeGetNVars(), SCIPexprtreeGetRoot(), SCIPexprtreeGetVars(), SCIPfreeBufferArray, SCIPgetRowMaxCoef(), SCIPgetRowMinCoef(), SCIPgetSolVal(), SCIPgetSolVals(), SCIPgetStage(), SCIPinfinity(), SCIPisEQ(), SCIPisInfinity(), SCIPreallocBufferArray, SCIPreleaseRow(), SCIProwGetCols(), SCIProwGetLhs(), SCIProwGetNNonz(), SCIProwGetRhs(), SCIProwGetVals(), SCIProwIsLocal(), SCIPsnprintf(), SCIPvarGetLbGlobal(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), SCIPvarGetUbLocal(), separatePoint(), and TRUE.

Referenced by addIntervalGradientEstimator(), addLinearizationCuts(), SCIP_DECL_CONSINITLP(), and separatePoint().

static SCIP_RETCODE separatePoint ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
int  nusefulconss,
SCIP_SOL sol,
SCIP_Bool  newsol,
SCIP_Real  minefficacy,
SCIP_Bool  inenforcement,
SCIP_RESULT result,
SCIP_Real bestefficacy 
)
static

tries to separate solution or LP solution by a linear cut

assumes that constraint violations have been computed

Parameters
scipSCIP data structure
conshdlrnonlinear constraints handler
conssconstraints
nconssnumber of constraints
nusefulconssnumber of constraints that seem to be useful
solsolution to separate, or NULL if LP solution should be used
newsolhave the constraints just been evaluated at this point?
minefficacyminimal efficacy of a cut if it should be added to the LP
inenforcementwhether we are in constraint enforcement
resultresult of separation
bestefficacybuffer to store best efficacy of a cut that was added to the LP, if found; or NULL if not of interest

Definition at line 5436 of file cons_nonlinear.c.

References addLinearizationCuts(), LinVarEventData::consdata, LinVarEventData::conshdlrdata, FALSE, generateCut(), MAX, MIN, NULL, REALABS, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_FEASIBLE, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_Real, SCIP_SEPARATED, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIPABORT, SCIPaddCut(), SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsActive(), SCIPconsIsDeleted(), SCIPconsIsEnabled(), SCIPdebug, SCIPdebugMessage, SCIPepsilon(), SCIPerrorMessage, SCIPfeastol(), SCIPgetRelaxFeastolFactor(), SCIPgetRowLPFeasibility(), SCIPgetRowMaxCoef(), SCIPgetRowSolFeasibility(), SCIPisCutApplicable(), SCIPisGT(), SCIPisInfinity(), SCIPmarkRowNotRemovableLocal(), SCIPprintRow(), SCIPreleaseRow(), SCIPresetConsAge(), SCIProwGetLhs(), and SCIProwGetRhs().

Referenced by generateCut(), SCIP_DECL_CONSENFOLP(), SCIP_DECL_CONSSEPALP(), and SCIP_DECL_CONSSEPASOL().

static SCIP_RETCODE addLinearizationCuts ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
SCIP_SOL ref,
SCIP_Bool separatedlpsol,
SCIP_Real  minefficacy 
)
static

adds linearizations cuts for convex constraints w.r.t. a given reference point to cutpool and sepastore if separatedlpsol is not NULL, then a cut that separates the LP solution is added to the sepastore and is forced to enter the LP if separatedlpsol is not NULL, but cut does not separate the LP solution, then it is added to the cutpool only if separatedlpsol is NULL, then cut is added to cutpool only

Parameters
scipSCIP data structure
conshdlrquadratic constraints handler
conssconstraints
nconssnumber of constraints
refreference point where to linearize, or NULL for LP solution
separatedlpsolbuffer to store whether a cut that separates the current LP solution was found and added to LP, or NULL if adding to cutpool only
minefficacyminimal efficacy of a cut when checking for separation of LP solution

Definition at line 5594 of file cons_nonlinear.c.

References checkCurvature(), LinVarEventData::consdata, LinVarEventData::conshdlrdata, FALSE, generateCut(), MAX, MIN, NULL, REALABS, SCIP_Bool, SCIP_CALL, SCIP_DECL_EVENTEXEC(), SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_Real, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIPABORT, SCIPaddCut(), SCIPaddPoolCut(), SCIPconsGetData(), SCIPconshdlrGetData(), SCIPconsIsLocal(), SCIPerrorMessage, SCIPgetRowLPFeasibility(), SCIPgetRowMaxCoef(), SCIPisInfinity(), SCIPreleaseRow(), SCIProwGetLhs(), SCIProwGetRhs(), SCIProwIsLocal(), and TRUE.

Referenced by SCIP_DECL_CONSSEPALP(), SCIP_DECL_EVENTEXEC(), and separatePoint().

static SCIP_DECL_EVENTEXEC ( processNewSolutionEvent  )
static
static SCIP_RETCODE registerBranchingVariables ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
int *  nnotify 
)
static

registers unfixed variables in nonlinear terms of violated constraints as external branching candidates

Parameters
scipSCIP data structure
conshdlrconstraint handler
conssconstraints to check
nconssnumber of constraints to check
nnotifycounter for number of notifications performed

Definition at line 5753 of file cons_nonlinear.c.

References LinVarEventData::consdata, MAX, NULL, registerLargeLPValueVariableForBranching(), SCIP_CALL, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_INVALID, SCIP_OKAY, SCIPaddExternBranchCand(), SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMessage, SCIPexprcurvGetName(), SCIPexprtreeGetNVars(), SCIPexprtreeGetVars(), SCIPfeastol(), SCIPisGT(), SCIPisRelEQ(), SCIPvarGetLbLocal(), SCIPvarGetName(), and SCIPvarGetUbLocal().

Referenced by SCIP_DECL_CONSENFOLP(), and SCIP_DECL_EVENTEXEC().

static SCIP_RETCODE registerLargeLPValueVariableForBranching ( SCIP scip,
SCIP_CONS **  conss,
int  nconss,
SCIP_VAR **  brvar 
)
static

registers a nonlinear variable from a violated constraint as branching candidate that has a large absolute value in the LP relaxation

Parameters
scipSCIP data structure
conssconstraints
nconssnumber of constraints
brvarbuffer to store branching variable

Definition at line 5819 of file cons_nonlinear.c.

References LinVarEventData::consdata, NULL, REALABS, replaceViolatedByLinearConstraints(), SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPaddExternBranchCand(), SCIPconsGetData(), SCIPexprtreeGetNVars(), SCIPexprtreeGetVars(), SCIPfeastol(), SCIPgetSolVal(), SCIPisGT(), SCIPisRelEQ(), SCIPvarGetLbLocal(), and SCIPvarGetUbLocal().

Referenced by registerBranchingVariables(), and SCIP_DECL_CONSENFOLP().

static SCIP_RETCODE replaceViolatedByLinearConstraints ( SCIP scip,
SCIP_CONS **  conss,
int  nconss,
SCIP_Bool addedcons,
SCIP_Bool reduceddom,
SCIP_Bool infeasible 
)
static
static SCIP_RETCODE propagateBoundsTightenVarLb ( SCIP scip,
SCIP_CONS cons,
SCIP_VAR var,
SCIP_Real  bnd,
SCIP_RESULT result,
int *  nchgbds 
)
static
Parameters
scipSCIP data structure
consconstraint where we currently propagate, or NULL if tightening is from expression graph
varvariable which domain we might reduce
bndnew lower bound for variable
resultresult to update if there was a tightening or cutoff
nchgbdscounter to increase if a bound was tightened

Definition at line 6049 of file cons_nonlinear.c.

References FALSE, INTERVALINFTY, NULL, propagateBoundsTightenVarUb(), SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_REDUCEDDOM, SCIPadjustedVarLb(), SCIPconsGetName(), SCIPdebugMessage, SCIPinProbing(), SCIPisInfinity(), SCIPresetConsAge(), SCIPtightenVarLb(), and SCIPvarGetName().

Referenced by propagateBoundsCons(), propagateConstraintSides(), and replaceViolatedByLinearConstraints().

static SCIP_RETCODE propagateBoundsTightenVarUb ( SCIP scip,
SCIP_CONS cons,
SCIP_VAR var,
SCIP_Real  bnd,
SCIP_RESULT result,
int *  nchgbds 
)
static
Parameters
scipSCIP data structure
consconstraint where we currently propagate, or NULL if tightening is from expression graph
varvariable which domain we might reduce
bndnew upper bound for variable
resultresult to update if there was a tightening or cutoff
nchgbdscounter to increase if a bound was tightened

Definition at line 6110 of file cons_nonlinear.c.

References FALSE, INTERVALINFTY, NULL, propagateBoundsCons(), SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_REDUCEDDOM, SCIPadjustedVarUb(), SCIPconsGetName(), SCIPdebugMessage, SCIPinProbing(), SCIPisInfinity(), SCIPresetConsAge(), SCIPtightenVarUb(), and SCIPvarGetName().

Referenced by propagateBoundsCons(), propagateBoundsTightenVarLb(), and propagateConstraintSides().

static SCIP_RETCODE propagateBoundsCons ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS cons,
SCIP_RESULT result,
int *  nchgbds,
SCIP_Bool redundant 
)
static
static SCIP_RETCODE propagateBounds ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_CONS **  conss,
int  nconss,
SCIP_Bool  needclear,
SCIP_RESULT result,
int *  nchgbds,
int *  ndelconss 
)
static

calls domain propagation for a set of constraints

Parameters
scipSCIP data structure
conshdlrconstraint handler
conssconstraints to process
nconssnumber of constraints
needclearwhether we may need to clear remainings from a previous backward propagation
resultpointer to store the result of the propagation calls
nchgbdsbuffer where to add the the number of changed bounds
ndelconssbuffer where to increase if a constraint was deleted (locally) due to redundancy

Definition at line 6564 of file cons_nonlinear.c.

References LinVarEventData::consdata, consdataFindUnlockedLinearVar(), LinVarEventData::conshdlrdata, FALSE, INTERVALINFTY, NULL, propagateBoundsCons(), propagateConstraintSides(), SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_OKAY, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsActive(), SCIPconsIsDeleted(), SCIPconsIsEnabled(), SCIPdebugMessage, SCIPdelConsLocal(), SCIPexprgraphGetNodeBounds(), SCIPexprgraphPrintDot(), SCIPexprgraphPropagateVarBounds(), SCIPgetMessagehdlr(), SCIPintervalIsEmpty(), and TRUE.

Referenced by propagateConstraintSides(), SCIP_DECL_CONSENFOLP(), SCIP_DECL_CONSENFOPS(), SCIP_DECL_CONSPRESOL(), and SCIP_DECL_CONSPROP().

static void consdataFindUnlockedLinearVar ( SCIP scip,
SCIP_CONSDATA consdata 
)
static
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 6752 of file cons_nonlinear.c.

References computeViolation(), LinVarEventData::consdata, LinVarEventData::conshdlrdata, FALSE, MAX, MIN, NULL, SCIP_CALL, SCIP_DECL_CONSHDLRCOPY(), SCIP_OKAY, SCIP_Real, SCIP_STAGE_INITPRESOLVE, SCIP_STAGE_SOLVED, SCIPceil(), SCIPconsGetData(), SCIPconshdlrGetData(), SCIPcreateLPSol(), SCIPcreateSolCopy(), SCIPdebugMessage, SCIPfeastol(), SCIPfloor(), SCIPfreeSol(), SCIPgetSolTransObj(), SCIPgetSolVal(), SCIPgetStage(), SCIPgetUpperbound(), SCIPheurPassSolTrySol(), SCIPincSolVal(), SCIPisGT(), SCIPisInfinity(), SCIPisNegative(), SCIPisPositive(), SCIPisSumLT(), SCIPisZero(), SCIPunlinkSol(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), SCIPvarIsIntegral(), and TRUE.

Referenced by consdataFindUnlockedLinearVar(), and SCIP_DECL_CONSCHECK().

static SCIP_DECL_CONSHDLRCOPY ( conshdlrCopyNonlinear  )
static

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

Definition at line 6903 of file cons_nonlinear.c.

References NULL, SCIP_CALL, SCIP_DECL_CONSFREE(), SCIP_OKAY, SCIPincludeConshdlrNonlinear(), and TRUE.

Referenced by proposeFeasibleSolution().

static SCIP_DECL_CONSFREE ( consFreeNonlinear  )
static

destructor of constraint handler to free constraint handler data (called when SCIP is exiting)

Definition at line 6919 of file cons_nonlinear.c.

References LinVarEventData::conshdlrdata, NULL, SCIP_CALL, SCIP_DECL_CONSINIT(), SCIP_OKAY, SCIPconshdlrGetData(), SCIPexprgraphFree(), SCIPexprgraphGetNVars(), SCIPexprintFree(), SCIPfreeMemory, and SCIPfreeMemoryArrayNull.

Referenced by SCIP_DECL_CONSHDLRCOPY().

static SCIP_DECL_CONSINIT ( consInitNonlinear  )
static

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

Definition at line 6954 of file cons_nonlinear.c.

References LinVarEventData::conshdlrdata, NULL, SCIP_CALL, SCIP_DECL_CONSEXIT(), SCIP_OKAY, SCIPconshdlrGetData(), SCIPexprgraphPrintDot(), SCIPfindHeur(), and SCIPgetMessagehdlr().

Referenced by SCIP_DECL_CONSFREE().

static SCIP_DECL_CONSEXIT ( consExitNonlinear  )
static

deinitialization method of constraint handler (called before transformed problem is freed)

Definition at line 6987 of file cons_nonlinear.c.

References LinVarEventData::conshdlrdata, NULL, SCIP_DECL_CONSINITPRE(), SCIP_OKAY, and SCIPconshdlrGetData().

Referenced by SCIP_DECL_CONSINIT().

static SCIP_DECL_CONSINITPRE ( consInitpreNonlinear  )
static

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

Definition at line 7006 of file cons_nonlinear.c.

References LinVarEventData::consdata, consdataSetExprtrees(), FALSE, NULL, SCIP_CALL, SCIP_DECL_CONSEXITPRE(), SCIP_OKAY, SCIPconsGetData(), and SCIPconsIsActive().

Referenced by SCIP_DECL_CONSEXIT().

static SCIP_DECL_CONSINITSOL ( consInitsolNonlinear  )
static
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 7205 of file cons_nonlinear.c.

References LinVarEventData::consdata, CONSHDLR_NAME, LinVarEventData::conshdlrdata, NULL, SCIP_CALL, SCIP_DECL_CONSDELETE(), SCIP_EVENTTYPE_SOLFOUND, SCIP_OKAY, SCIPconsGetData(), SCIPconshdlrGetData(), SCIPdropEvent(), SCIPfindEventhdlr(), and SCIPreleaseNlRow().

Referenced by SCIP_DECL_CONSINITSOL().

static SCIP_DECL_CONSDELETE ( consDeleteNonlinear  )
static
static SCIP_DECL_CONSSEPASOL ( consSepasolNonlinear  )
static

separation method of constraint handler for arbitrary primal solutions

Definition at line 7598 of file cons_nonlinear.c.

References computeViolations(), LinVarEventData::conshdlrdata, FALSE, NULL, SCIP_CALL, SCIP_DECL_CONSENFOLP(), SCIP_DIDNOTFIND, SCIP_OKAY, SCIPconshdlrGetData(), and separatePoint().

Referenced by SCIP_DECL_CONSSEPALP().

static SCIP_DECL_CONSPROP ( consPropNonlinear  )
static

domain propagation method of constraint handler

Definition at line 8011 of file cons_nonlinear.c.

References NULL, propagateBounds(), SCIP_CALL, SCIP_DECL_CONSPRESOL(), SCIP_OKAY, and TRUE.

Referenced by SCIP_DECL_CONSCHECK().

static SCIP_DECL_CONSLOCK ( consLockNonlinear  )
static
static SCIP_DECL_CONSENABLE ( consEnableNonlinear  )
static
static SCIP_DECL_CONSDISABLE ( consDisableNonlinear  )
static
static SCIP_DECL_CONSGETNVARS ( consGetNVarsNonlinear  )
static
SCIP_RETCODE SCIPincludeConshdlrNonlinear ( SCIP scip)
SCIP_RETCODE SCIPincludeNonlinconsUpgrade ( SCIP scip,
SCIP_DECL_NONLINCONSUPGD((*nonlinconsupgd))  ,
SCIP_DECL_EXPRGRAPHNODEREFORM((*nodereform))  ,
int  priority,
SCIP_Bool  active,
const char *  conshdlrname 
)

includes a nonlinear constraint upgrade method into the nonlinear constraint handler

Parameters
scipSCIP data structure
prioritypriority of upgrading method
activeshould the upgrading method by active by default?
conshdlrnamename of the constraint handler

Definition at line 9110 of file cons_nonlinear.c.

References SCIP_NlConsUpgrade::active, CONSHDLR_NAME, LinVarEventData::conshdlrdata, FALSE, NULL, paramname, SCIP_NlConsUpgrade::priority, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIPaddBoolParam(), SCIPallocMemory, SCIPcalcMemGrowSize(), SCIPconshdlrGetData(), SCIPcreateConsNonlinear(), SCIPerrorMessage, SCIPfindConshdlr(), SCIPreallocMemoryArray, SCIPsnprintf(), and SCIPwarningMessage().

Referenced by SCIPincludeConshdlrAbspower(), SCIPincludeConshdlrAnd(), SCIPincludeConshdlrBivariate(), SCIPincludeConshdlrNonlinear(), and SCIPincludeConshdlrQuadratic().

SCIP_RETCODE SCIPcreateConsNonlinear ( SCIP scip,
SCIP_CONS **  cons,
const char *  name,
int  nlinvars,
SCIP_VAR **  linvars,
SCIP_Real lincoefs,
int  nexprtrees,
SCIP_EXPRTREE **  exprtrees,
SCIP_Real nonlincoefs,
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_Bool  stickingatnode 
)

creates and captures a nonlinear constraint this variant takes expression trees as input

Note
the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
Parameters
scipSCIP data structure
conspointer to hold the created constraint
namename of constraint
nlinvarsnumber of linear variables in the constraint
linvarsarray with linear variables of constraint entries
lincoefsarray with coefficients of constraint linear entries
nexprtreesnumber of expression trees for nonlinear part of constraint
exprtreesexpression trees for nonlinear part of constraint
nonlincoefscoefficients for expression trees for nonlinear part, or NULL if all 1.0
lhsleft hand side of constraint
rhsright hand side of constraint
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 seperated 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'.
stickingatnodeshould the constraint always be kept at the node where it was added, even if it may be moved to a more global node? Usually set to FALSE. Set to TRUE to for constraints that represent node data.

Definition at line 9195 of file cons_nonlinear.c.

References addLinearCoef(), LinVarEventData::consdata, consdataCreateEmpty(), consdataEnsureLinearVarsSize(), consdataSetExprtrees(), CONSHDLR_NAME, FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIPcreateCons(), SCIPcreateConsBasicNonlinear(), SCIPdebugMessage, SCIPdebugPrintCons, SCIPerrorMessage, SCIPfindConshdlr(), SCIPisZero(), and TRUE.

Referenced by readConstraints(), readNonlinearExprs(), readObjective(), removeFixedVariables(), SCIP_DECL_CONSCOPY(), SCIP_DECL_CONSPARSE(), SCIPcreateConsBasicNonlinear(), and SCIPincludeNonlinconsUpgrade().

SCIP_RETCODE SCIPcreateConsBasicNonlinear ( SCIP scip,
SCIP_CONS **  cons,
const char *  name,
int  nlinvars,
SCIP_VAR **  linvars,
SCIP_Real lincoefs,
int  nexprtrees,
SCIP_EXPRTREE **  exprtrees,
SCIP_Real nonlincoefs,
SCIP_Real  lhs,
SCIP_Real  rhs 
)

creates and captures a nonlinear constraint in its most basic version, i. e., all constraint flags are set to their basic value as explained for the method SCIPcreateConsNonlinear(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h

this variant takes expression trees as input

See also
SCIPcreateConsNonlinear() for information about the basic constraint flag configuration
Note
the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
Parameters
scipSCIP data structure
conspointer to hold the created constraint
namename of constraint
nlinvarsnumber of linear variables in the constraint
linvarsarray with linear variables of constraint entries
lincoefsarray with coefficients of constraint linear entries
nexprtreesnumber of expression trees for nonlinear part of constraint
exprtreesexpression trees for nonlinear part of constraint
nonlincoefscoefficients for expression trees for nonlinear part, or NULL if all 1.0
lhsleft hand side of constraint
rhsright hand side of constraint

Definition at line 9288 of file cons_nonlinear.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPcreateConsNonlinear(), SCIPcreateConsNonlinear2(), and TRUE.

Referenced by SCIPcreateConsNonlinear().

SCIP_RETCODE SCIPcreateConsNonlinear2 ( SCIP scip,
SCIP_CONS **  cons,
const char *  name,
int  nlinvars,
SCIP_VAR **  linvars,
SCIP_Real lincoefs,
SCIP_EXPRGRAPHNODE exprgraphnode,
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_Bool  stickingatnode 
)

creates and captures a nonlinear constraint this variant takes a node of the expression graph as input and can only be used during presolving it is assumed that the nonlinear constraint will be added to the transformed problem short after creation the given exprgraphnode is captured in this method

Note
the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
Parameters
scipSCIP data structure
conspointer to hold the created constraint
namename of constraint
nlinvarsnumber of linear variables in the constraint
linvarsarray with linear variables of constraint entries
lincoefsarray with coefficients of constraint linear entries
exprgraphnodeexpression graph node associated to nonlinear expression
lhsleft hand side of constraint
rhsright hand side of constraint
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 seperated 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'.
stickingatnodeshould the constraint always be kept at the node where it was added, even if it may be moved to a more global node? Usually set to FALSE. Set to TRUE to for constraints that represent node data.

Definition at line 9318 of file cons_nonlinear.c.

References addLinearCoef(), LinVarEventData::consdata, consdataCreateEmpty(), consdataEnsureLinearVarsSize(), CONSHDLR_NAME, FALSE, NULL, SCIP_CALL, SCIP_EXPRCURV_UNKNOWN, SCIP_INVALID, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIP_STAGE_PRESOLVING, SCIPcreateCons(), SCIPcreateConsBasicNonlinear2(), SCIPdebugMessage, SCIPdebugPrintCons, SCIPerrorMessage, SCIPexprgraphCaptureNode(), SCIPfindConshdlr(), SCIPgetStage(), and SCIPisZero().

Referenced by reformMonomial(), reformNode2Var(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), SCIP_DECL_NONLINCONSUPGD(), SCIPcreateConsBasicNonlinear(), and SCIPcreateConsBasicNonlinear2().

SCIP_RETCODE SCIPcreateConsBasicNonlinear2 ( SCIP scip,
SCIP_CONS **  cons,
const char *  name,
int  nlinvars,
SCIP_VAR **  linvars,
SCIP_Real lincoefs,
SCIP_EXPRGRAPHNODE exprgraphnode,
SCIP_Real  lhs,
SCIP_Real  rhs 
)

creates and captures a nonlinear constraint in its most basic version, i. e., all constraint flags are set to their basic value as explained for the method SCIPcreateConsNonlinear(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h

this variant takes a node of the expression graph as input and can only be used during presolving it is assumed that the nonlinear constraint will be added to the transformed problem short after creation the given exprgraphnode is captured in this method

See also
SCIPcreateConsNonlinear() for information about the basic constraint flag configuration
Note
the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
Parameters
scipSCIP data structure
conspointer to hold the created constraint
namename of constraint
nlinvarsnumber of linear variables in the constraint
linvarsarray with linear variables of constraint entries
lincoefsarray with coefficients of constraint linear entries
exprgraphnodeexpression graph node associated to nonlinear expression
lhsleft hand side of constraint
rhsright hand side of constraint

Definition at line 9416 of file cons_nonlinear.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPaddLinearVarNonlinear(), SCIPcreateConsNonlinear2(), and TRUE.

Referenced by SCIPcreateConsNonlinear2().

SCIP_RETCODE SCIPaddLinearVarNonlinear ( SCIP scip,
SCIP_CONS cons,
SCIP_VAR var,
SCIP_Real  coef 
)

adds a linear variable with coefficient to a nonlinear constraint

Parameters
scipSCIP data structure
consconstraint
varvariable
coefcoefficient of variable

Definition at line 9437 of file cons_nonlinear.c.

References addLinearCoef(), NULL, REALABS, SCIP_CALL, SCIP_OKAY, SCIPisInfinity(), and SCIPsetExprtreesNonlinear().

Referenced by SCIPcreateConsBasicNonlinear2().

SCIP_RETCODE SCIPsetExprtreesNonlinear ( SCIP scip,
SCIP_CONS cons,
int  nexprtrees,
SCIP_EXPRTREE **  exprtrees,
SCIP_Real coefs 
)

sets the expression trees in a nonlinear constraint constraint must not be active yet

Parameters
scipSCIP data structure
consconstraint
nexprtreesnumber of expression trees
exprtreesnew expression trees, or NULL if nexprtrees is 0
coefscoefficients of expression trees, or NULL if all 1.0

Definition at line 9457 of file cons_nonlinear.c.

References consdataSetExprtrees(), NULL, SCIP_CALL, SCIP_OKAY, SCIPaddExprtreesNonlinear(), SCIPconsGetData(), SCIPconsIsActive(), and TRUE.

Referenced by SCIPaddLinearVarNonlinear().

SCIP_RETCODE SCIPaddExprtreesNonlinear ( SCIP scip,
SCIP_CONS cons,
int  nexprtrees,
SCIP_EXPRTREE **  exprtrees,
SCIP_Real coefs 
)

adds expression trees to a nonlinear constraint constraint must not be active yet

Parameters
scipSCIP data structure
consconstraint
nexprtreesnumber of expression trees
exprtreesnew expression trees, or NULL if nexprtrees is 0
coefscoefficients of expression trees, or NULL if all 1.0

Definition at line 9479 of file cons_nonlinear.c.

References consdataAddExprtrees(), NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsIsActive(), SCIPgetNlRowNonlinear(), and TRUE.

Referenced by readNonlinearExprs(), and SCIPsetExprtreesNonlinear().

SCIP_RETCODE SCIPgetNlRowNonlinear ( SCIP scip,
SCIP_CONS cons,
SCIP_NLROW **  nlrow 
)

gets the nonlinear constraint as a nonlinear row representation

Parameters
scipSCIP data structure
consconstraint
nlrowpointer to store nonlinear row

Definition at line 9499 of file cons_nonlinear.c.

References LinVarEventData::consdata, createNlRow(), NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), and SCIPgetNLinearVarsNonlinear().

Referenced by SCIPaddExprtreesNonlinear().

int SCIPgetNLinearVarsNonlinear ( SCIP scip,
SCIP_CONS cons 
)

gets the number of variables in the linear term of a nonlinear constraint

Parameters
scipSCIP data structure
consconstraint

Definition at line 9524 of file cons_nonlinear.c.

References NULL, SCIPconsGetData(), and SCIPgetLinearVarsNonlinear().

Referenced by readNonlinearExprs(), SCIP_DECL_NONLINCONSUPGD(), SCIP_DECL_QUADCONSUPGD(), SCIPgetNlRowNonlinear(), SCIPwriteGms(), and SCIPwritePip().

SCIP_VAR** SCIPgetLinearVarsNonlinear ( SCIP scip,
SCIP_CONS cons 
)

gets the variables in the linear part of a nonlinear constraint

Parameters
scipSCIP data structure
consconstraint

Definition at line 9536 of file cons_nonlinear.c.

References NULL, SCIP_Real, SCIPconsGetData(), and SCIPgetLinearCoefsNonlinear().

Referenced by readNonlinearExprs(), SCIP_DECL_NONLINCONSUPGD(), SCIPgetNLinearVarsNonlinear(), SCIPwriteGms(), and SCIPwritePip().

SCIP_Real* SCIPgetLinearCoefsNonlinear ( SCIP scip,
SCIP_CONS cons 
)

gets the coefficients in the linear part of a nonlinear constraint

Parameters
scipSCIP data structure
consconstraint

Definition at line 9548 of file cons_nonlinear.c.

References NULL, SCIPconsGetData(), and SCIPgetNExprtreesNonlinear().

Referenced by readNonlinearExprs(), SCIP_DECL_NONLINCONSUPGD(), SCIPgetLinearVarsNonlinear(), SCIPwriteGms(), and SCIPwritePip().

int SCIPgetNExprtreesNonlinear ( SCIP scip,
SCIP_CONS cons 
)

gets the number of expression trees of a nonlinear constraint

Parameters
scipSCIP data structure
consconstraint

Definition at line 9560 of file cons_nonlinear.c.

References NULL, SCIP_STAGE_EXITPRESOLVE, SCIP_STAGE_INITPRESOLVE, SCIPconsGetData(), SCIPgetExprtreesNonlinear(), and SCIPgetStage().

Referenced by SCIPgetLinearCoefsNonlinear(), SCIPwriteGms(), and SCIPwritePip().

SCIP_EXPRTREE** SCIPgetExprtreesNonlinear ( SCIP scip,
SCIP_CONS cons 
)

gets the expression trees of a nonlinear constraint

Parameters
scipSCIP data structure
consconstraint

Definition at line 9573 of file cons_nonlinear.c.

References NULL, SCIP_Real, SCIP_STAGE_EXITPRESOLVE, SCIP_STAGE_INITPRESOLVE, SCIPconsGetData(), SCIPgetExprtreeCoefsNonlinear(), and SCIPgetStage().

Referenced by SCIPgetNExprtreesNonlinear(), SCIPwriteGms(), and SCIPwritePip().

SCIP_Real* SCIPgetExprtreeCoefsNonlinear ( SCIP scip,
SCIP_CONS cons 
)

gets the coefficients of the expression trees of a nonlinear constraint

Parameters
scipSCIP data structure
consconstraint

Definition at line 9586 of file cons_nonlinear.c.

References NULL, SCIP_STAGE_EXITPRESOLVE, SCIP_STAGE_INITPRESOLVE, SCIPconsGetData(), SCIPgetExprgraphNodeNonlinear(), and SCIPgetStage().

Referenced by SCIPgetExprtreesNonlinear(), SCIPwriteGms(), and SCIPwritePip().

SCIP_EXPRGRAPHNODE* SCIPgetExprgraphNodeNonlinear ( SCIP scip,
SCIP_CONS cons 
)

gets the expression graph node of a nonlinear constraint

Parameters
scipSCIP data structure
consconstraint

Definition at line 9599 of file cons_nonlinear.c.

References NULL, SCIP_Real, SCIPconsGetData(), and SCIPgetLhsNonlinear().

Referenced by SCIP_DECL_NONLINCONSUPGD(), SCIP_DECL_QUADCONSUPGD(), SCIPgetExprtreeCoefsNonlinear(), and SCIPwriteGms().

SCIP_Real SCIPgetLhsNonlinear ( SCIP scip,
SCIP_CONS cons 
)

gets the left hand side of a nonlinear constraint

Parameters
scipSCIP data structure
consconstraint

Definition at line 9611 of file cons_nonlinear.c.

References NULL, SCIP_Real, SCIPconsGetData(), and SCIPgetRhsNonlinear().

Referenced by readNonlinearExprs(), SCIP_DECL_NONLINCONSUPGD(), SCIPgetExprgraphNodeNonlinear(), SCIPwriteGms(), and SCIPwritePip().

SCIP_Real SCIPgetRhsNonlinear ( SCIP scip,
SCIP_CONS cons 
)

gets the right hand side of a nonlinear constraint

Parameters
scipSCIP data structure
consconstraint

Definition at line 9623 of file cons_nonlinear.c.

References NULL, SCIPcheckCurvatureNonlinear(), and SCIPconsGetData().

Referenced by readNonlinearExprs(), SCIP_DECL_NONLINCONSUPGD(), SCIPgetLhsNonlinear(), SCIPwriteGms(), and SCIPwritePip().

SCIP_RETCODE SCIPcheckCurvatureNonlinear ( SCIP scip,
SCIP_CONS cons 
)

check the function of a nonlinear constraint for convexity/concavity, if not done yet

Parameters
scipSCIP data structure
consconstraint

Definition at line 9635 of file cons_nonlinear.c.

References checkCurvature(), LinVarEventData::conshdlrdata, NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetHdlr(), SCIPconshdlrGetData(), and SCIPgetCurvatureNonlinear().

Referenced by SCIPgetRhsNonlinear().

SCIP_RETCODE SCIPgetCurvatureNonlinear ( SCIP scip,
SCIP_CONS cons,
SCIP_Bool  checkcurv,
SCIP_EXPRCURV curvature 
)

gets the curvature of the nonlinear function of a nonlinear constraint

Parameters
scipSCIP data structure
consconstraint
checkcurvwhether to check constraint curvature, if not checked before
curvaturepointer to store curvature of constraint

Definition at line 9657 of file cons_nonlinear.c.

References checkCurvature(), LinVarEventData::consdata, LinVarEventData::conshdlrdata, NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetData(), and SCIPgetExprtreeCurvaturesNonlinear().

Referenced by SCIPcheckCurvatureNonlinear().

SCIP_RETCODE SCIPgetExprtreeCurvaturesNonlinear ( SCIP scip,
SCIP_CONS cons,
SCIP_Bool  checkcurv,
SCIP_EXPRCURV **  curvatures 
)

gets the curvature of the expression trees (multiplied by their coefficient) of a nonlinear constraint

Parameters
scipSCIP data structure
consconstraint
checkcurvwhether to check constraint curvature, if not checked before
curvaturesbuffer to store curvatures of exprtrees

Definition at line 9691 of file cons_nonlinear.c.

References checkCurvature(), LinVarEventData::consdata, LinVarEventData::conshdlrdata, NULL, SCIP_CALL, SCIP_OKAY, SCIP_STAGE_EXITPRESOLVE, SCIP_STAGE_INITPRESOLVE, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetData(), SCIPgetStage(), and SCIPgetViolationNonlinear().

Referenced by SCIPgetCurvatureNonlinear().

SCIP_RETCODE SCIPgetViolationNonlinear ( SCIP scip,
SCIP_CONS cons,
SCIP_SOL sol,
SCIP_Real violation 
)

computes the violation of a nonlinear constraint by a solution

Parameters
scipSCIP data structure
consconstraint
solsolution which violation to calculate, or NULL for LP solution
violationpointer to store violation of constraint

Definition at line 9728 of file cons_nonlinear.c.

References computeViolation(), LinVarEventData::consdata, MAX, NULL, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_STAGE_EXITPRESOLVE, SCIP_STAGE_INITPRESOLVE, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconsIsActive(), SCIPgetExprgraphNonlinear(), SCIPgetStage(), and SCIPwarningMessage().

Referenced by SCIPgetExprtreeCurvaturesNonlinear().

SCIP_EXPRGRAPH* SCIPgetExprgraphNonlinear ( SCIP scip,
SCIP_CONSHDLR conshdlr 
)

gets expression graph of nonlinear constraint handler

Parameters
scipSCIP data structure
conshdlrnonlinear constraint handler

Definition at line 9764 of file cons_nonlinear.c.

References LinVarEventData::conshdlrdata, NULL, SCIPcomputeHyperplaneThreePoints(), and SCIPconshdlrGetData().

Referenced by SCIP_DECL_NONLINCONSUPGD(), SCIPgetViolationNonlinear(), and SCIPwriteGms().

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

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 9786 of file cons_nonlinear.c.

References NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPisRelEQ(), and SCIPsolveLinearProb().

Referenced by addConcaveEstimatorBivariate(), generateEstimatingHyperplane(), and SCIPgetExprgraphNonlinear().