All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cons_nonlinear.h File Reference Detailed Descriptionconstraint handler for nonlinear constraints This constraint handler handles constraints of the form
where and are coefficients and are nonlinear functions (given as expression tree). Constraints are enforced by separation, domain propagation, and spatial branching. For convex or concave , cuts that separate on the convex hull of the function graph are implemented. For that are not known to be convex or concave, a simple variant of linear estimation based on interval gradients is implemented. Branching is performed for variables in nonconvex terms, if the relaxation solution cannot be separated. This header offers the upgrade functionality to upgrade a general nonlinear constraint into a more specific constraint via SCIP_DECL_NONLINCONSUPGD(). Furthermore, the definition of callbacks used to reformulate an expression graph is offered by SCIP_DECL_EXPRGRAPHNODEREFORM(). Further, the function representation is stored in an expression graph, which allows to propagate variable domains and constraint sides and offers a simple convexity check. During presolve, the expression graph is reformulated, whereby new variables and constraints are created such that for the remaining nonlinear constraints the functions are known to be convex or concave. See also
Definition in file cons_nonlinear.h. #include "scip/scip.h" Go to the source code of this file.
Macro Definition Documentation
Value:
upgrading method for nonlinear constraints into more specific constraints the method might upgrade a nonlinear constraint into a set of upgrade constraints the caller provided an array upgdconss to store upgrade constraints the length of upgdconss is given by upgdconsssize if an upgrade is not possible, set *nupgdconss to zero if more than upgdconsssize many constraints shall replace cons, the function should return the required number as negated value in *nupgdconss i.e., if cons should be replaced by 3 constraints, the function should set *nupgdconss to -3 and return with SCIP_OKAY input:
Definition at line 82 of file cons_nonlinear.h.
Value:
SCIP_RETCODE x (SCIP* scip, \
SCIP_EXPRGRAPH* exprgraph, SCIP_EXPRGRAPHNODE* node, \
int* naddcons, SCIP_EXPRGRAPHNODE** reformnode)
reformulation method for expression graph nodes The method might reformulate a node in an expression graph by adding auxiliary constraints and/or variables. The caller provided an expression graph node which is to be reformulated. If the method takes action, it has to return the node that should replace the given node in *reformnode. The caller will then ensure that all parents of node will use *reformnode, so node may be freed. If the method does not do any reformulation, it shall return NULL in *reformnode. The counter naddcons can be used to setup the names of added variables/constraints. The method should increase this counter by the number of added constraints. The method has to ensure that the reformulated node, if still valid, has valid bound and curvature information. input:
output:
Definition at line 109 of file cons_nonlinear.h. Function Documentation
creates the handler for nonlinear constraints and includes it in SCIP
Definition at line 8639 of file cons_nonlinear.c. References BMSclearMemory, CONSHDLR_CHECKPRIORITY, CONSHDLR_DELAYPRESOL, CONSHDLR_DELAYPROP, CONSHDLR_DELAYSEPA, CONSHDLR_DESC, CONSHDLR_EAGERFREQ, CONSHDLR_ENFOPRIORITY, CONSHDLR_MAXPREROUNDS, CONSHDLR_NAME, CONSHDLR_NEEDSCONS, CONSHDLR_PROP_TIMING, CONSHDLR_PROPFREQ, CONSHDLR_SEPAFREQ, CONSHDLR_SEPAPRIORITY, FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPaddBoolParam(), SCIPaddCharParam(), SCIPaddIntParam(), SCIPaddRealParam(), SCIPallocMemory, SCIPblkmem(), SCIPexprgraphCreate(), SCIPexprintCreate(), SCIPincludeConshdlrBasic(), SCIPincludeEventhdlrBasic(), SCIPinfinity(), SCIPsetConshdlrActive(), SCIPsetConshdlrCopy(), SCIPsetConshdlrDeactive(), SCIPsetConshdlrDelete(), SCIPsetConshdlrDisable(), SCIPsetConshdlrEnable(), SCIPsetConshdlrExit(), SCIPsetConshdlrExitpre(), SCIPsetConshdlrExitsol(), SCIPsetConshdlrFree(), SCIPsetConshdlrGetNVars(), SCIPsetConshdlrGetVars(), SCIPsetConshdlrInit(), SCIPsetConshdlrInitlp(), SCIPsetConshdlrInitpre(), SCIPsetConshdlrInitsol(), SCIPsetConshdlrParse(), SCIPsetConshdlrPresol(), SCIPsetConshdlrPrint(), SCIPsetConshdlrProp(), SCIPsetConshdlrSepa(), SCIPsetConshdlrTrans(), and TRUE. Referenced by SCIP_DECL_CONSHDLRCOPY(), and SCIPincludeDefaultPlugins().
includes a nonlinear constraint upgrade method into the nonlinear constraint handler
Definition at line 8762 of file cons_nonlinear.c. References SCIP_NlConsUpgrade::active, CONSHDLR_NAME, FALSE, NULL, paramname, SCIP_NlConsUpgrade::priority, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIPaddBoolParam(), SCIPallocMemory, SCIPcalcMemGrowSize(), SCIPconshdlrGetData(), SCIPerrorMessage, SCIPfindConshdlr(), SCIPreallocMemoryArray, SCIPsnprintf(), and SCIPwarningMessage(). Referenced by SCIPincludeConshdlrAbspower(), SCIPincludeConshdlrAnd(), SCIPincludeConshdlrBivariate(), SCIPincludeConshdlrLinear(), and SCIPincludeConshdlrQuadratic().
creates and captures a nonlinear constraint this variant takes expression trees as input
Definition at line 8847 of file cons_nonlinear.c. References addLinearCoef(), consdataCreateEmpty(), consdataEnsureLinearVarsSize(), consdataSetExprtrees(), CONSHDLR_NAME, FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIPcreateCons(), SCIPdebugMessage, SCIPdebugPrintCons, SCIPerrorMessage, SCIPfindConshdlr(), SCIPisZero(), and TRUE. Referenced by readConstraints(), readNonlinearExprs(), readObjective(), removeFixedVariables(), SCIP_DECL_CONSCOPY(), SCIP_DECL_CONSPARSE(), and SCIPcreateConsBasicNonlinear().
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
Definition at line 8940 of file cons_nonlinear.c. References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPcreateConsNonlinear(), and TRUE.
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
Definition at line 8970 of file cons_nonlinear.c. References addLinearCoef(), consdataCreateEmpty(), consdataEnsureLinearVarsSize(), CONSHDLR_NAME, FALSE, NULL, SCIP_CALL, SCIP_EXPRCURV_UNKNOWN, SCIP_INVALID, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIP_STAGE_PRESOLVING, SCIPcreateCons(), SCIPdebugMessage, SCIPdebugPrintCons, SCIPerrorMessage, SCIPexprgraphCaptureNode(), SCIPfindConshdlr(), SCIPgetStage(), and SCIPisZero(). Referenced by reformMonomial(), reformNode2Var(), reformulate(), SCIP_DECL_EXPRGRAPHNODEREFORM(), SCIP_DECL_NONLINCONSUPGD(), and SCIPcreateConsBasicNonlinear2().
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 SCIPcreateConsNonlinear2(); 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
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
Definition at line 9068 of file cons_nonlinear.c. References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPcreateConsNonlinear2(), and TRUE.
adds a linear variable with coefficient to a nonlinear constraint
Definition at line 9089 of file cons_nonlinear.c. References addLinearCoef(), NULL, REALABS, SCIP_CALL, SCIP_OKAY, and SCIPisInfinity().
sets the expression trees in a nonlinear constraint constraint must not be active yet
Definition at line 9109 of file cons_nonlinear.c. References consdataSetExprtrees(), NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsIsActive(), and TRUE.
adds expression trees to a nonlinear constraint constraint must not be active yet
Definition at line 9131 of file cons_nonlinear.c. References consdataAddExprtrees(), NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsIsActive(), and TRUE. Referenced by readNonlinearExprs().
gets the nonlinear constraint as a nonlinear row representation
Definition at line 9151 of file cons_nonlinear.c. References createNlRow(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPconsGetData(). gets the number of variables in the linear term of a nonlinear constraint
Definition at line 9176 of file cons_nonlinear.c. References NULL, and SCIPconsGetData(). Referenced by readNonlinearExprs(), SCIP_DECL_NONLINCONSUPGD(), SCIPwriteGms(), and SCIPwritePip(). gets the variables in the linear part of a nonlinear constraint
Definition at line 9188 of file cons_nonlinear.c. References NULL, and SCIPconsGetData(). Referenced by readNonlinearExprs(), SCIP_DECL_NONLINCONSUPGD(), SCIPwriteGms(), and SCIPwritePip(). gets the coefficients in the linear part of a nonlinear constraint
Definition at line 9200 of file cons_nonlinear.c. References NULL, and SCIPconsGetData(). Referenced by readNonlinearExprs(), SCIP_DECL_NONLINCONSUPGD(), SCIPwriteGms(), and SCIPwritePip(). gets the number of expression trees of a nonlinear constraint
Definition at line 9212 of file cons_nonlinear.c. References NULL, SCIP_STAGE_EXITPRESOLVE, SCIP_STAGE_INITPRESOLVE, SCIPconsGetData(), and SCIPgetStage(). Referenced by SCIPwriteGms(), and SCIPwritePip().
gets the expression trees of a nonlinear constraint
Definition at line 9225 of file cons_nonlinear.c. References NULL, SCIP_STAGE_EXITPRESOLVE, SCIP_STAGE_INITPRESOLVE, SCIPconsGetData(), and SCIPgetStage(). Referenced by SCIPwriteGms(), and SCIPwritePip(). gets the coefficients of the expression trees of a nonlinear constraint
Definition at line 9238 of file cons_nonlinear.c. References NULL, SCIP_STAGE_EXITPRESOLVE, SCIP_STAGE_INITPRESOLVE, SCIPconsGetData(), and SCIPgetStage(). Referenced by SCIPwriteGms(), and SCIPwritePip().
gets the expression graph node of a nonlinear constraint
Definition at line 9251 of file cons_nonlinear.c. References NULL, and SCIPconsGetData(). Referenced by SCIP_DECL_NONLINCONSUPGD(), and SCIPwriteGms(). gets the left hand side of a nonlinear constraint
Definition at line 9263 of file cons_nonlinear.c. References NULL, and SCIPconsGetData(). Referenced by readNonlinearExprs(), SCIP_DECL_NONLINCONSUPGD(), SCIPwriteGms(), and SCIPwritePip(). gets the right hand side of a nonlinear constraint
Definition at line 9275 of file cons_nonlinear.c. References NULL, and SCIPconsGetData(). Referenced by readNonlinearExprs(), SCIP_DECL_NONLINCONSUPGD(), SCIPwriteGms(), and SCIPwritePip().
check the function of a nonlinear constraint for convexity/concavity, if not done yet
Definition at line 9287 of file cons_nonlinear.c. References checkCurvature(), NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetHdlr(), and SCIPconshdlrGetData().
gets the curvature of the nonlinear function of a nonlinear constraint The curvature is computed by summing up the curvature for each nonlinear summand. To get the curvature for single summands, use SCIPgetExprtreeCurvaturesNonlinear(). gets the curvature of the nonlinear function of a nonlinear constraint
Definition at line 9309 of file cons_nonlinear.c. References checkCurvature(), NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsGetHdlr(), and SCIPconshdlrGetData().
gets the curvature of the expression trees (multiplied by their coefficient) of a nonlinear constraint
Definition at line 9343 of file cons_nonlinear.c. References checkCurvature(), NULL, SCIP_CALL, SCIP_OKAY, SCIP_STAGE_EXITPRESOLVE, SCIP_STAGE_INITPRESOLVE, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetData(), and SCIPgetStage().
computes the violation of a nonlinear constraint by a solution
Definition at line 9380 of file cons_nonlinear.c. References computeViolation(), MAX, NULL, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_STAGE_EXITPRESOLVE, SCIP_STAGE_INITPRESOLVE, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconsIsActive(), SCIPgetStage(), and SCIPwarningMessage().
gets expression graph of nonlinear constraint handler
Definition at line 9416 of file cons_nonlinear.c. References NULL, and SCIPconshdlrGetData(). Referenced by SCIP_DECL_NONLINCONSUPGD(), and SCIPwriteGms(). |