cons_linear.h
Go to the documentation of this file.
18 * @brief Constraint handler for linear constraints in their most general form, \f$lhs <= a^T x <= rhs\f$.
26 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
69 * with \f$a_i \in Q, i = 1,\dots,n\f$, \f$lhs\in Q \cup \{-\infty\}\f$, \f$rhs\in Q \cup \{\infty\}\f$,
72 * Furthermore, this header offers the upgrade functionality of a general linear constraint into a more specific
73 * constraint, such as a knapsack constraint, via SCIP_DECL_LINCONSUPGD() and SCIPincludeLinconsUpgrade()
94 * - nposimpl : number of implicit integer variables with positive coefficient (including implicit binary variables)
95 * - nnegimpl : number of implicit integer variables with negative coefficient (including implicit binary variables)
111 #define SCIP_DECL_LINCONSUPGD(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONS* cons, int nvars, SCIP_VAR** vars, SCIP_Real* vals, SCIP_Real lhs, SCIP_Real rhs, \
112 int nposbin, int nnegbin, int nposint, int nnegint, int nposimpl, int nnegimpl, int nposimplbin, int nnegimplbin, int nposcont, int nnegcont, \
113 int ncoeffspone, int ncoeffsnone, int ncoeffspint, int ncoeffsnint, int ncoeffspfrac, int ncoeffsnfrac, \
127 * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
159 SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
165 * in its most basic version, i. e., all constraint flags are set to their basic value as explained for the
170 * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
193 SCIP_Real* sourcecoefs, /**< coefficient array of the linear constraint, or NULL if all coefficients are one */
198 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
208 SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup? */
209 SCIP_Bool stickingatnode, /**< should the constraint always be kept at the node where it was added, even
224 /** changes coefficient of variable in linear constraint; deletes the variable if coefficient is zero; adds variable if
227 * @note This method may only be called during problem creation stage for an original constraint and variable.
229 * @note This method requires linear time to search for occurences of the variable in the constraint data.
241 * @note This method may only be called during problem creation stage for an original constraint and variable.
243 * @note This method requires linear time to search for occurences of the variable in the constraint data.
289 /** gets the array of variables in the linear constraint; the user must not modify this array! */
296 /** gets the array of coefficient values in the linear constraint; the user must not modify this array! */
305 * @note if the solution contains values at infinity, this method will return SCIP_INVALID in case the activity
337 /** returns the linear relaxation of the given linear constraint; may return NULL if no LP row was yet created;
346 /** tries to automatically convert a linear constraint into a more specific and more specialized constraint */
356 * iterates through all linear constraints and stores relevant statistics in the linear constraint statistics \p linconsstats.
358 * @note only constraints are iterated that belong to the linear constraint handler. If the problem has been presolved already,
359 * constraints that were upgraded to more special types such as, e.g., varbound constraints, will not be shown correctly anymore.
360 * Similarly, if specialized constraints were created through the API, these are currently not present.
SCIP_Real SCIPgetActivityLinear(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol)
Definition: cons_linear.c:18277
Definition: struct_cons.h:280
SCIP_RETCODE SCIPincludeConshdlrLinear(SCIP *scip)
Definition: cons_linear.c:17311
type definitions for miscellaneous datastructures
SCIP_RETCODE SCIPcreateConsBasicLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs)
Definition: cons_linear.c:17725
Definition: struct_scip.h:58
SCIP_RETCODE SCIPcopyConsLinear(SCIP *scip, SCIP_CONS **cons, SCIP *sourcescip, const char *name, int nvars, SCIP_VAR **sourcevars, SCIP_Real *sourcecoefs, SCIP_Real lhs, SCIP_Real rhs, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, 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_Bool global, SCIP_Bool *valid)
Definition: cons_linear.c:17745
Definition: struct_var.h:198
SCIP_ROW * SCIPgetRowLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18387
type definitions for return codes for SCIP methods
SCIP_RETCODE SCIPdelCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
Definition: cons_linear.c:18103
SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18142
SCIP_RETCODE SCIPaddCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
Definition: cons_linear.c:17874
type definitions for LP management
Definition: struct_sol.h:63
Definition: struct_misc.h:127
Definition: struct_cons.h:37
SCIP_Real SCIPgetDualsolLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18331
SCIP_RETCODE SCIPupgradeConsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_CONS **upgdcons)
Definition: cons_linear.c:18410
type definitions for SCIP's main datastructure
type definitions for problem variables
SCIP_Real SCIPgetDualfarkasLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18358
Definition: struct_lp.h:192
SCIP_RETCODE SCIPchgRhsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_Real rhs)
Definition: cons_linear.c:18186
SCIP_Real SCIPgetFeasibilityLinear(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol)
Definition: cons_linear.c:18304
SCIP_RETCODE SCIPclassifyConstraintTypesLinear(SCIP *scip, SCIP_LINCONSSTATS *linconsstats)
Definition: cons_linear.c:15107
type definitions for storing primal CIP solutions
SCIP_RETCODE SCIPincludeLinconsUpgrade(SCIP *scip, SCIP_DECL_LINCONSUPGD((*linconsupgd)), int priority, const char *conshdlrname)
Definition: cons_linear.c:17494
SCIP_RETCODE SCIPcreateConsLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, 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)
Definition: cons_linear.c:17546
SCIP_VAR ** SCIPgetVarsLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18227
Definition: cons_linear.c:334
SCIP_Real * SCIPgetValsLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18250
SCIP_RETCODE SCIPchgLhsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_Real lhs)
Definition: cons_linear.c:18165
common defines and data types used in all packages of SCIP
Definition: objbenders.h:33
int SCIPgetNVarsLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18204
SCIP_Real SCIPgetLhsLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18119
type definitions for constraints and constraint handlers
SCIP_RETCODE SCIPchgCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
Definition: cons_linear.c:18035