cons_linear.h
Go to the documentation of this file.
27 * @brief Constraint handler for linear constraints in their most general form, \f$lhs <= a^T x <= rhs\f$.
35 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
78 * 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$,
81 * Furthermore, this header offers the upgrade functionality of a general linear constraint into a more specific
82 * constraint, such as a knapsack constraint, via SCIP_DECL_LINCONSUPGD() and SCIPincludeLinconsUpgrade()
103 * - nposimpl : number of implicit integer variables with positive coefficient (including implicit binary variables)
104 * - nnegimpl : number of implicit integer variables with negative coefficient (including implicit binary variables)
120 #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, \
121 int nposbin, int nnegbin, int nposint, int nnegint, int nposimpl, int nnegimpl, int nposimplbin, int nnegimplbin, int nposcont, int nnegcont, \
122 int ncoeffspone, int ncoeffsnone, int ncoeffspint, int ncoeffsnint, int ncoeffspfrac, int ncoeffsnfrac, \
136 * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
168 SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
174 * in its most basic version, i. e., all constraint flags are set to their basic value as explained for the
179 * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
202 SCIP_Real* sourcecoefs, /**< coefficient array of the linear constraint, or NULL if all coefficients are one */
207 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
217 SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup? */
218 SCIP_Bool stickingatnode, /**< should the constraint always be kept at the node where it was added, even
233 /** changes coefficient of variable in linear constraint; deletes the variable if coefficient is zero; adds variable if
236 * @note This method may only be called during problem creation stage for an original constraint and variable.
238 * @note This method requires linear time to search for occurences of the variable in the constraint data.
250 * @note This method may only be called during problem creation stage for an original constraint and variable.
252 * @note This method requires linear time to search for occurences of the variable in the constraint data.
298 /** gets the array of variables in the linear constraint; the user must not modify this array! */
305 /** gets the array of coefficient values in the linear constraint; the user must not modify this array! */
314 * @note if the solution contains values at infinity, this method will return SCIP_INVALID in case the activity
346 /** returns the linear relaxation of the given linear constraint; may return NULL if no LP row was yet created;
355 /** tries to automatically convert a linear constraint into a more specific and more specialized constraint */
365 * iterates through all linear constraints and stores relevant statistics in the linear constraint statistics \p linconsstats.
367 * @note only constraints are iterated that belong to the linear constraint handler. If the problem has been presolved already,
368 * constraints that were upgraded to more special types such as, e.g., varbound constraints, will not be shown correctly anymore.
369 * Similarly, if specialized constraints were created through the API, these are currently not present.
383 SCIP_Bool* infeasible /**< pointer to return whether the problem was detected to be infeasible */
SCIP_Real SCIPgetActivityLinear(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol)
Definition: cons_linear.c:18699
Definition: struct_cons.h:291
SCIP_RETCODE SCIPincludeConshdlrLinear(SCIP *scip)
Definition: cons_linear.c:17694
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:18139
Definition: struct_scip.h:69
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:18159
SCIP_RETCODE SCIPcleanupConssLinear(SCIP *scip, SCIP_Bool onlychecked, SCIP_Bool *infeasible)
Definition: cons_linear.c:19077
Definition: struct_var.h:207
SCIP_ROW * SCIPgetRowLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18813
type definitions for return codes for SCIP methods
SCIP_RETCODE SCIPdelCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
Definition: cons_linear.c:18520
SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18560
SCIP_RETCODE SCIPaddCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
Definition: cons_linear.c:18291
type definitions for LP management
Definition: struct_sol.h:73
Definition: struct_misc.h:137
Definition: struct_cons.h:46
SCIP_Real SCIPgetDualsolLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18755
SCIP_RETCODE SCIPupgradeConsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_CONS **upgdcons)
Definition: cons_linear.c:18837
type definitions for SCIP's main datastructure
type definitions for problem variables
SCIP_Real SCIPgetDualfarkasLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18783
Definition: struct_lp.h:201
SCIP_RETCODE SCIPchgRhsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_Real rhs)
Definition: cons_linear.c:18605
SCIP_Real SCIPgetFeasibilityLinear(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol)
Definition: cons_linear.c:18727
SCIP_RETCODE SCIPclassifyConstraintTypesLinear(SCIP *scip, SCIP_LINCONSSTATS *linconsstats)
Definition: cons_linear.c:15431
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:17887
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:17939
SCIP_VAR ** SCIPgetVarsLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18647
Definition: cons_linear.c:352
SCIP_Real * SCIPgetValsLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18671
SCIP_RETCODE SCIPchgLhsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_Real lhs)
Definition: cons_linear.c:18584
common defines and data types used in all packages of SCIP
Definition: objbenders.h:43
int SCIPgetNVarsLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18623
SCIP_Real SCIPgetLhsLinear(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linear.c:18536
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:18452