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.
374 SCIP_Bool* infeasible /**< pointer to return whether the problem was detected to be infeasible */
SCIP_EXPORT 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:17744
Definition: struct_cons.h:280
SCIP_EXPORT SCIP_Real SCIPgetLhsLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18330
type definitions for miscellaneous datastructures
Definition: struct_scip.h:59
SCIP_EXPORT SCIP_RETCODE SCIPaddCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
Definition: cons_linear.c:18085
Definition: struct_var.h:198
SCIP_EXPORT 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:17933
SCIP_EXPORT SCIP_RETCODE SCIPdelCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
Definition: cons_linear.c:18314
SCIP_EXPORT SCIP_RETCODE SCIPchgLhsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_Real lhs)
Definition: cons_linear.c:18378
type definitions for return codes for SCIP methods
SCIP_EXPORT SCIP_Real * SCIPgetValsLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18465
type definitions for LP management
Definition: struct_sol.h:64
SCIP_EXPORT SCIP_Real SCIPgetFeasibilityLinear(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol)
Definition: cons_linear.c:18521
Definition: struct_misc.h:128
Definition: struct_cons.h:37
SCIP_EXPORT SCIP_Real SCIPgetDualfarkasLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18577
type definitions for SCIP's main datastructure
SCIP_EXPORT SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18354
type definitions for problem variables
SCIP_EXPORT 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:17953
Definition: struct_lp.h:192
SCIP_EXPORT int SCIPgetNVarsLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18417
SCIP_EXPORT SCIP_Real SCIPgetActivityLinear(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol)
Definition: cons_linear.c:18493
SCIP_EXPORT SCIP_RETCODE SCIPchgCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
Definition: cons_linear.c:18246
type definitions for storing primal CIP solutions
SCIP_EXPORT SCIP_ROW * SCIPgetRowLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18607
SCIP_EXPORT SCIP_Real SCIPgetDualsolLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18549
Definition: cons_linear.c:341
SCIP_EXPORT SCIP_RETCODE SCIPcleanupConssLinear(SCIP *scip, SCIP_Bool onlychecked, SCIP_Bool *infeasible)
Definition: cons_linear.c:18871
SCIP_EXPORT SCIP_RETCODE SCIPupgradeConsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_CONS **upgdcons)
Definition: cons_linear.c:18631
common defines and data types used in all packages of SCIP
SCIP_EXPORT SCIP_RETCODE SCIPchgRhsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_Real rhs)
Definition: cons_linear.c:18399
SCIP_EXPORT SCIP_RETCODE SCIPincludeLinconsUpgrade(SCIP *scip, SCIP_DECL_LINCONSUPGD((*linconsupgd)), int priority, const char *conshdlrname)
Definition: cons_linear.c:17692
Definition: objbenders.h:33
SCIP_EXPORT SCIP_VAR ** SCIPgetVarsLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18441
SCIP_EXPORT SCIP_RETCODE SCIPincludeConshdlrLinear(SCIP *scip)
Definition: cons_linear.c:17497
type definitions for constraints and constraint handlers
SCIP_EXPORT SCIP_RETCODE SCIPclassifyConstraintTypesLinear(SCIP *scip, SCIP_LINCONSSTATS *linconsstats)
Definition: cons_linear.c:15257