All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cons_linear.c
Go to the documentation of this file.
17 * @brief Constraint handler for linear constraints in their most general form, \f$lhs <= a^T x <= rhs\f$.
47 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
64 #define CONSHDLR_ENFOPRIORITY -1000000 /**< priority of the constraint handler for constraint enforcing */
65 #define CONSHDLR_CHECKPRIORITY -1000000 /**< priority of the constraint handler for checking feasibility */
66 #define CONSHDLR_SEPAFREQ 0 /**< frequency for separating cuts; zero means to separate only in the root node */
67 #define CONSHDLR_PROPFREQ 1 /**< frequency for propagating domains; zero means only preprocessing propagation */
68 #define CONSHDLR_EAGERFREQ 100 /**< frequency for using all instead of only the useful constraints in separation,
70 #define CONSHDLR_MAXPREROUNDS -1 /**< maximal number of presolving rounds the constraint handler participates in (-1: no limit) */
71 #define CONSHDLR_DELAYSEPA FALSE /**< should separation method be delayed, if other separators found cuts? */
72 #define CONSHDLR_DELAYPROP FALSE /**< should propagation method be delayed, if other propagators found reductions? */
73 #define CONSHDLR_DELAYPRESOL FALSE /**< should presolving method be delayed, if other presolvers found reductions? */
74 #define CONSHDLR_NEEDSCONS TRUE /**< should the constraint handler be skipped, if no constraints are available? */
85 #define DEFAULT_TIGHTENBOUNDSFREQ 1 /**< multiplier on propagation frequency, how often the bounds are tightened */
87 #define DEFAULT_MAXROUNDSROOT -1 /**< maximal number of separation rounds in the root node (-1: unlimited) */
89 #define DEFAULT_MAXSEPACUTSROOT 200 /**< maximal number of cuts separated per separation round in root node */
90 #define DEFAULT_PRESOLPAIRWISE TRUE /**< should pairwise constraint comparison be performed in presolving? */
91 #define DEFAULT_PRESOLUSEHASHING TRUE /**< should hash table be used for detecting redundant constraints in advance */
92 #define DEFAULT_NMINCOMPARISONS 200000 /**< number for minimal pairwise presolving comparisons */
93 #define DEFAULT_MINGAINPERNMINCOMP 1e-06 /**< minimal gain per minimal pairwise presolving comparisons to repeat pairwise
95 #define DEFAULT_SORTVARS TRUE /**< should variables be sorted after presolve w.r.t their coefficient absolute for faster
97 #define DEFAULT_CHECKRELMAXABS FALSE /**< should the violation for a constraint with side 0.0 be checked relative
99 #define DEFAULT_MAXAGGRNORMSCALE 0.0 /**< maximal allowed relative gain in maximum norm for constraint aggregation
101 #define DEFAULT_MAXCARDBOUNDDIST 0.0 /**< maximal relative distance from current node's dual bound to primal bound compared
103 #define DEFAULT_SEPARATEALL FALSE /**< should all constraints be subject to cardinality cut generation instead of only
105 #define DEFAULT_AGGREGATEVARIABLES TRUE /**< should presolving search for redundant variables in equations */
106 #define DEFAULT_SIMPLIFYINEQUALITIES TRUE /**< should presolving try to simplify inequalities */
108 #define DEFAULT_DETECTCUTOFFBOUND TRUE /**< should presolving try to detect constraints parallel to the objective
111 #define DEFAULT_DETECTLOWERBOUND TRUE /**< should presolving try to detect constraints parallel to the objective
114 #define DEFAULT_DETECTPARTIALOBJECTIVE TRUE/**< should presolving try to detect subsets of constraints parallel to the
119 #define MAXSCALEDCOEFINTEGER 1e+05 /**< maximal coefficient value after scaling if all variables are of integral
123 #define HASHSIZE_LINEARCONS 131101 /**< minimal size of hash table in linear constraint tables */
125 #define QUADCONSUPGD_PRIORITY 1000000 /**< priority of the constraint handler for upgrading of quadratic constraints */
126 #define NONLINCONSUPGD_PRIORITY 1000000 /**< priority of the constraint handler for upgrading of nonlinear constraints */
152 /* @todo add multi-aggregation of variables that are in exactly two equations (, if not numerically an issue),
163 SCIP_Real minactivity; /**< minimal value w.r.t. the variable's local bounds for the constraint's
165 SCIP_Real maxactivity; /**< maximal value w.r.t. the variable's local bounds for the constraint's
171 SCIP_Real glbminactivity; /**< minimal value w.r.t. the variable's global bounds for the constraint's
173 SCIP_Real glbmaxactivity; /**< maximal value w.r.t. the variable's global bounds for the constraint's
175 SCIP_Real lastglbminactivity; /**< last global minimal activity which was computed by complete summation
177 SCIP_Real lastglbmaxactivity; /**< last global maximal activity which was computed by complete summation
179 SCIP_Real maxactdelta; /**< maximal activity contribution of a single variable, or SCIP_INVALID if invalid */
186 int minactivityneginf; /**< number of coefficients contributing with neg. infinite value to minactivity */
187 int minactivityposinf; /**< number of coefficients contributing with pos. infinite value to minactivity */
188 int maxactivityneginf; /**< number of coefficients contributing with neg. infinite value to maxactivity */
189 int maxactivityposinf; /**< number of coefficients contributing with pos. infinite value to maxactivity */
190 int minactivityneghuge; /**< number of coefficients contributing with huge neg. value to minactivity */
191 int minactivityposhuge; /**< number of coefficients contributing with huge pos. value to minactivity */
192 int maxactivityneghuge; /**< number of coefficients contributing with huge neg. value to maxactivity */
193 int maxactivityposhuge; /**< number of coefficients contributing with huge pos. value to maxactivity */
194 int glbminactivityneginf;/**< number of coefficients contrib. with neg. infinite value to glbminactivity */
195 int glbminactivityposinf;/**< number of coefficients contrib. with pos. infinite value to glbminactivity */
196 int glbmaxactivityneginf;/**< number of coefficients contrib. with neg. infinite value to glbmaxactivity */
197 int glbmaxactivityposinf;/**< number of coefficients contrib. with pos. infinite value to glbmaxactivity */
198 int glbminactivityneghuge;/**< number of coefficients contrib. with huge neg. value to glbminactivity */
199 int glbminactivityposhuge;/**< number of coefficients contrib. with huge pos. value to glbminactivity */
200 int glbmaxactivityneghuge;/**< number of coefficients contrib. with huge neg. value to glbmaxactivity */
201 int glbmaxactivityposhuge;/**< number of coefficients contrib. with huge pos. value to glbmaxactivity */
218 unsigned int changed:1; /**< was constraint changed since last aggregation round in preprocessing? */
221 unsigned int upgraded:1; /**< is the constraint upgraded and will it be removed after preprocessing? */
226 unsigned int binvarssorted:1; /**< are binary variables sorted w.r.t. the absolute of their coefficient? */
242 SCIP_LINCONSUPGRADE** linconsupgrades; /**< linear constraint upgrade methods for specializing linear constraints */
243 SCIP_Real maxaggrnormscale; /**< maximal allowed relative gain in maximum norm for constraint aggregation
245 SCIP_Real maxcardbounddist; /**< maximal relative distance from current node's dual bound to primal bound compared
247 SCIP_Real mingainpernmincomp; /**< minimal gain per minimal pairwise presolving comparisons to repeat pairwise comparison round */
250 int tightenboundsfreq; /**< multiplier on propagation frequency, how often the bounds are tightened */
256 SCIP_Bool presolpairwise; /**< should pairwise constraint comparison be performed in presolving? */
257 SCIP_Bool presolusehashing; /**< should hash table be used for detecting redundant constraints in advance */
258 SCIP_Bool separateall; /**< should all constraints be subject to cardinality cut generation instead of only
260 SCIP_Bool aggregatevariables; /**< should presolving search for redundant variables in equations */
261 SCIP_Bool simplifyinequalities;/**< should presolving try to cancel down or delete coefficients in inequalities */
264 SCIP_Bool checkrelmaxabs; /**< should the violation for a constraint with side 0.0 be checked relative
266 SCIP_Bool detectcutoffbound; /**< should presolving try to detect constraints parallel to the objective
269 SCIP_Bool detectlowerbound; /**< should presolving try to detect constraints parallel to the objective
272 SCIP_Bool detectpartialobjective;/**< should presolving try to detect subsets of constraints parallel to
371 /** constructs an inference information out of a propagation rule and a position number, returns info as int */
432 SCIP_CALL( SCIPreallocBlockMemoryArray(scip, &consdata->eventdatas, consdata->varssize, newsize) );
547 SCIPwarningMessage(scip, "Try to add already known upgrade message %p for constraint handler %s.\n", linconsupgd, conshdlrname);
570 SCIP_CALL( conshdlrdataEnsureLinconsupgradesSize(scip, conshdlrdata, conshdlrdata->nlinconsupgrades+1) );
588 /** installs rounding locks for the given variable associated to the given coefficient in the linear constraint */
621 /** removes rounding locks for the given variable associated to the given coefficient in the linear constraint */
795 return (SCIPgetStage(scip) >= SCIP_STAGE_TRANSFORMED && SCIPgetStage(scip) < SCIP_STAGE_FREETRANS);
921 SCIP_CALL( SCIPgetTransformedVars(scip, (*consdata)->nvars, (*consdata)->vars, (*consdata)->vars) );
993 SCIP_CALL( SCIPwriteVarsLinearsum(scip, file, consdata->vars, consdata->vals, consdata->nvars, TRUE) );
1070 bound = (SCIPvarGetBestBoundType(consdata->vars[i]) == SCIP_BOUNDTYPE_LOWER) ? SCIPvarGetLbLocal(consdata->vars[i]) : SCIPvarGetUbLocal(consdata->vars[i]);
1114 bound = (consdata->vals[i] > 0.0 ) ? SCIPvarGetLbLocal(consdata->vars[i]) : SCIPvarGetUbLocal(consdata->vars[i]);
1116 && !SCIPisHugeValue(scip, consdata->vals[i] * bound) && !SCIPisHugeValue(scip, -consdata->vals[i] * bound) )
1141 bound = (consdata->vals[i] > 0.0 ) ? SCIPvarGetUbLocal(consdata->vars[i]) : SCIPvarGetLbLocal(consdata->vars[i]);
1143 && !SCIPisHugeValue(scip, consdata->vals[i] * bound) && !SCIPisHugeValue(scip, -consdata->vals[i] * bound) )
1168 bound = (consdata->vals[i] > 0.0 ) ? SCIPvarGetLbGlobal(consdata->vars[i]) : SCIPvarGetUbGlobal(consdata->vars[i]);
1194 bound = (consdata->vals[i] > 0.0 ) ? SCIPvarGetUbGlobal(consdata->vars[i]) : SCIPvarGetLbGlobal(consdata->vars[i]);
1251 SCIP_Bool checkreliability /**< should the reliability of the recalculated activity be checked? */
1299 * lower bound + neg. coef: update maxactivity, positive and negative infinity counters have to be switched
1301 * upper bound + neg. coef: update minactivity, positive and negative infinity counters have to be switched
1355 * lower bound + neg. coef: update maxactivity, positive and negative infinity counters have to be switched
1357 * upper bound + neg. coef: update minactivity, positive and negative infinity counters have to be switched
1418 /* if the bound changed to -infinity, increase the counter for negative infinite contributions */
1446 /* if the bound changed to +infinity, increase the counter for positive infinite contributions */
1469 * but checking here that the bound is not huge again would not handle a change from a huge to an infinite bound
1473 /* if the bound changed to +infinity, increase the counter for positive infinite contributions */
1476 /* if the bound changed to -infinity, increase the counter for negative infinite contributions */
1479 /* if the contribution of this variable is too large and positive, increase the corresponding counter */
1484 /* if the contribution of this variable is too large and negative, increase the corresponding counter */
1499 * but checking here that the bound is not huge again would not handle a change from a huge to an infinite bound
1503 /* if the bound changed to +infinity, increase the counter for positive infinite contributions */
1506 /* if the bound changed to -infinity, increase the counter for negative infinite contributions */
1509 /* if the contribution of this variable is too large and positive, increase the corresponding counter */
1514 /* if the contribution of this variable is too large and negative, increase the corresponding counter */
1558 /* update the activity, if the current value is valid and there was a change in the finite part */
1607 SCIP_Bool checkreliability /**< should the reliability of the recalculated activity be checked? */
1616 consdataUpdateActivities(scip, consdata, var, oldlb, newlb, val, SCIP_BOUNDTYPE_LOWER, FALSE, checkreliability);
1618 assert(!SCIPisInfinity(scip, -consdata->minactivity) && !SCIPisInfinity(scip, consdata->minactivity));
1619 assert(!SCIPisInfinity(scip, -consdata->maxactivity) && !SCIPisInfinity(scip, consdata->maxactivity));
1632 SCIP_Bool checkreliability /**< should the reliability of the recalculated activity be checked? */
1641 consdataUpdateActivities(scip, consdata, var, oldub, newub, val, SCIP_BOUNDTYPE_UPPER, FALSE, checkreliability);
1643 assert(!SCIPisInfinity(scip, -consdata->minactivity) && !SCIPisInfinity(scip, consdata->minactivity));
1644 assert(!SCIPisInfinity(scip, -consdata->maxactivity) && !SCIPisInfinity(scip, consdata->maxactivity));
1656 SCIP_Bool checkreliability /**< should the reliability of the recalculated activity be checked? */
1664 consdataUpdateActivities(scip, consdata, NULL, oldlb, newlb, val, SCIP_BOUNDTYPE_LOWER, TRUE, checkreliability);
1666 assert(!SCIPisInfinity(scip, -consdata->glbminactivity) && !SCIPisInfinity(scip, consdata->glbminactivity));
1667 assert(!SCIPisInfinity(scip, -consdata->glbmaxactivity) && !SCIPisInfinity(scip, consdata->glbmaxactivity));
1679 SCIP_Bool checkreliability /**< should the reliability of the recalculated activity be checked? */
1687 consdataUpdateActivities(scip, consdata, NULL, oldub, newub, val, SCIP_BOUNDTYPE_UPPER, TRUE, checkreliability);
1689 assert(!SCIPisInfinity(scip, -consdata->glbminactivity) && !SCIPisInfinity(scip, consdata->glbminactivity));
1690 assert(!SCIPisInfinity(scip, -consdata->glbmaxactivity) && !SCIPisInfinity(scip, consdata->glbmaxactivity));
1694 /** updates minimum and maximum activity and maximum absolute value for coefficient addition */
1701 SCIP_Bool checkreliability /**< should the reliability of the recalculated activity be checked? */
1727 consdataUpdateActivitiesLb(scip, consdata, var, 0.0, SCIPvarGetLbLocal(var), val, checkreliability);
1728 consdataUpdateActivitiesUb(scip, consdata, var, 0.0, SCIPvarGetUbLocal(var), val, checkreliability);
1729 consdataUpdateActivitiesGlbLb(scip, consdata, 0.0, SCIPvarGetLbGlobal(var), val, checkreliability);
1730 consdataUpdateActivitiesGlbUb(scip, consdata, 0.0, SCIPvarGetUbGlobal(var), val, checkreliability);
1734 /** updates minimum and maximum activity for coefficient deletion, invalidates maximum absolute value if necessary */
1741 SCIP_Bool checkreliability /**< should the reliability of the recalculated activity be checked? */
1770 consdataUpdateActivitiesLb(scip, consdata, var, SCIPvarGetLbLocal(var), 0.0, val, checkreliability);
1771 consdataUpdateActivitiesUb(scip, consdata, var, SCIPvarGetUbLocal(var), 0.0, val, checkreliability);
1772 consdataUpdateActivitiesGlbLb(scip, consdata, SCIPvarGetLbGlobal(var), 0.0, val, checkreliability);
1773 consdataUpdateActivitiesGlbUb(scip, consdata, SCIPvarGetUbGlobal(var), 0.0, val, checkreliability);
1777 /** updates minimum and maximum activity for coefficient change, invalidates maximum absolute value if necessary */
1785 SCIP_Bool checkreliability /**< should the reliability of the recalculated activity be checked? */
1820 /* @todo do something more clever here, e.g. if oldval * newval >= 0, do the update directly */
1924 /** gets minimal activity for constraint and given values of counters for infinite and huge contributions
1925 * and (if needed) delta to subtract from stored finite part of activity in case of a residual activity
1938 SCIP_Bool goodrelax, /**< should a good relaxation be computed or are relaxed acticities ignored, anyway? */
1942 SCIP_Bool* issettoinfinity /**< pointer to store whether minactivity was set to infinity or calculated */
1969 /* if we have neg. huge contributions, we only know that -infty is a relaxation of the minactivity */
1976 /* we do not need a good relaxation and we have positve huge contributions, so we just return -infty as activity */
2007 * times the minimum value counting as "huge" plus finite (and non-huge) part of minactivity - delta
2025 /** gets maximal activity for constraint and given values of counters for infinite and huge contributions
2026 * and (if needed) delta to subtract from stored finite part of activity in case of a residual activity
2039 SCIP_Bool goodrelax, /**< should a good relaxation be computed or are relaxed acticities ignored, anyway? */
2043 SCIP_Bool* issettoinfinity /**< pointer to store whether maxactivity was set to infinity or calculated */
2070 /* if we have pos. huge contributions, we only know that +infty is a relaxation of the maxactivity */
2077 /* we do not need a good relaxation and we have positve huge contributions, so we just return +infty as activity */
2108 * times the minimum value counting as "huge" plus the finite (and non-huge) part of maxactivity minus delta
2135 SCIP_Bool* minisrelax, /**< pointer to store whether the returned minactivity is just a relaxation,
2138 SCIP_Bool* maxisrelax /**< pointer to store whether the returned maxactivity is just a relaxation,
2264 SCIP_Bool* minisrelax, /**< pointer to store whether the returned residual minactivity is just a
2267 SCIP_Bool* maxisrelax, /**< pointer to store whether the returned residual maxactivity is just a
2270 SCIP_Bool* isminsettoinfinity, /**< pointer to store whether minresactivity was set to infinity or calculated */
2271 SCIP_Bool* ismaxsettoinfinity /**< pointer to store whether maxresactivity was set to infinity or calculated */
2319 /* get/compute minactivity by calling getMinActivity() with updated counters for infinite and huge values
2320 * and contribution of variable set to zero that has to be subtracted from finite part of activity
2357 consdata->minactivityposhuge, consdata->minactivityneghuge, absval * minactbound, FALSE, goodrelax,
2361 /* get/compute maxactivity by calling getMaxActivity() with updated counters for infinite and huge values
2362 * and contribution of variable set to zero that has to be subtracted from finite part of activity
2399 consdata->maxactivityposhuge, consdata->maxactivityneghuge, absval * maxactbound, FALSE, goodrelax,
2411 SCIP_Real* glbminactivity, /**< pointer to store the minimal activity, or NULL, if not needed */
2412 SCIP_Real* glbmaxactivity, /**< pointer to store the maximal activity, or NULL, if not needed */
2413 SCIP_Bool* minisrelax, /**< pointer to store whether the returned minactivity is just a relaxation,
2416 SCIP_Bool* maxisrelax, /**< pointer to store whether the returned maxactivity is just a relaxation,
2419 SCIP_Bool* isminsettoinfinity, /**< pointer to store whether minresactivity was set to infinity or calculated */
2420 SCIP_Bool* ismaxsettoinfinity /**< pointer to store whether maxresactivity was set to infinity or calculated */
2475 SCIP_Real* minresactivity, /**< pointer to store the minimal residual activity, or NULL, if not needed */
2476 SCIP_Real* maxresactivity, /**< pointer to store the maximal residual activity, or NULL, if not needed */
2477 SCIP_Bool* minisrelax, /**< pointer to store whether the returned residual minactivity is just a
2480 SCIP_Bool* maxisrelax, /**< pointer to store whether the returned residual maxactivity is just a
2483 SCIP_Bool* isminsettoinfinity, /**< pointer to store whether minresactivity was set to infinity or calculated */
2484 SCIP_Bool* ismaxsettoinfinity /**< pointer to store whether maxresactivity was set to infinity or calculated */
2526 /* get/compute minactivity by calling getMinActivity() with updated counters for infinite and huge values
2527 * and contribution of variable set to zero that has to be subtracted from finite part of activity
2533 getMinActivity(scip, consdata, consdata->glbminactivityposinf - 1, consdata->glbminactivityneginf,
2541 getMinActivity(scip, consdata, consdata->glbminactivityposinf, consdata->glbminactivityneginf - 1,
2574 /* get/compute maxactivity by calling getMaxActivity() with updated counters for infinite and huge values
2575 * and contribution of variable set to zero that has to be subtracted from finite part of activity
2581 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf, consdata->glbmaxactivityneginf - 1,
2589 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf - 1, consdata->glbmaxactivityneginf,
2657 else if( (SCIPisInfinity(scip, solval) && negsign) || (SCIPisInfinity(scip, -solval) && !negsign) )
2664 SCIPdebugMessage("activity of linear constraint: %.15g, %d positive infinity values, %d negative infinity values \n", activity, nposinf, nneginf);
2762 /** index comparison method of linear constraints: compares two indices of the variable set in the linear constraint */
2899 /* count binary variables and permute variables such that binaries appear first in the sorted vars array */
2948 assert((v >= consdata->nbinvars && !SCIPvarIsBinary(vars[v])) || (v < consdata->nbinvars && SCIPvarIsBinary(vars[v])));
3039 /* the left hand side switched from -infinity to a non-infinite value -> install rounding locks */
3064 /* the left hand side switched from a non-infinite value to -infinity -> remove rounding locks */
3085 /* check whether the left hand side is increased, if and only if that's the case we maybe can propagate, tighten and add more cliques */
3155 /* the right hand side switched from infinity to a non-infinite value -> install rounding locks */
3180 /* the right hand side switched from a non-infinite value to infinity -> remove rounding locks */
3201 /* check whether the right hand side is decreased, if and only if that's the case we maybe can propagate, tighten and add more cliques */
3319 && (SCIPvarCompare(consdata->vars[consdata->nvars-2], consdata->vars[consdata->nvars-1]) <= 0);
3392 consdata->sorted = consdata->sorted && (pos + 2 >= consdata->nvars || (SCIPvarCompare(consdata->vars[pos], consdata->vars[pos + 1]) <= 0));
3396 /* if at most one variable is left, the activities should be recalculated (to correspond exactly to the bounds
3517 /* because SCIPisScalingIntegral uses another integrality check as SCIPfeasFloor, we add an additional 0.5 before
3525 SCIPwarningMessage(scip, "coefficient %.15g of variable <%s> in linear constraint <%s> scaled to zero (scalar: %.15g)\n",
3547 /* because SCIPisScalingIntegral uses another integrality check as SCIPfeasFloor, we add an additional 0.5 before
3559 /* because SCIPisScalingIntegral uses another integrality check as SCIPfeasCeil, we subtract 0.5 before ceiling up
3621 * Apply the following rules in the given order, until the sign of the factor is determined. Later rules only apply,
3626 * 4. the number of positive coefficients must not be smaller than the number of negative coefficients
3629 * Try to identify a rational representation of the fractional coefficients, and multiply all coefficients
3714 SCIPdebugMessage("divide linear constraint with %g, because all coefficents are in absolute value the same\n", maxabsval);
3757 epsilon = SCIPepsilon(scip) * 0.9; /* slightly decrease epsilon to be safe in rational conversion below */
3813 /* 3. the absolute value of the right hand side must be greater than that of the left hand side */
3822 /* 4. the number of positive coefficients must not be smaller than the number of negative coefficients */
3875 /* it might be that we have really big coefficients, but all are integral, in that case we want to divide them by
3895 SCIPdebugMessage("scale linear constraint with %"SCIP_LONGINT_FORMAT" to make coefficients integral\n", scm);
3934 SCIPdebugMessage("divide linear constraint by greatest common divisor %"SCIP_LONGINT_FORMAT"\n", gcd);
4007 /* reset maximal activity delta, so that it will be recalculated on the next real propagation */
4205 if( SCIPisEQ(scip, lhssubtrahend, consdata->lhs) && SCIPisFeasGE(scip, REALABS(lhssubtrahend), 1.0) )
4222 if( SCIPisEQ(scip, rhssubtrahend, consdata->rhs ) && SCIPisFeasGE(scip, REALABS(rhssubtrahend), 1.0) )
4237 /* if aggregated variables have been replaced, multiple entries of the same variable are possible and we have
4256 /** for each variable in the linear constraint, except the inferred variable, adds one bound to the conflict analysis'
4257 * candidate store (bound depends on sign of coefficient and whether the left or right hand side was the reason for the
4258 * inference variable's bound change); the conflict analysis can be initialized with the linear constraint being the
4266 SCIP_BDCHGIDX* bdchgidx, /**< bound change index (time stamp of bound change), or NULL for current time */
4291 /* for each variable, add the bound to the conflict queue, that is responsible for the minimal or maximal
4292 * residual value, depending on whether the left or right hand side is responsible for the bound change:
4297 /* if the variable is integral we only need to add reason bounds until the propagation could be applied */
4310 /* calculate the minimal and maximal global activity of all other variables involved in the constraint */
4315 consdataGetGlbActivityResiduals(scip, consdata, infervar, vals[inferpos], FALSE, &minresactivity, NULL,
4318 consdataGetGlbActivityResiduals(scip, consdata, infervar, vals[inferpos], FALSE, NULL, &maxresactivity,
4332 if( (reasonisrhs && !isminsettoinfinity && !minisrelax) || (!reasonisrhs && !ismaxsettoinfinity && !maxisrelax) ) /*lint !e644*/
4339 /* calculate the residual capacity that would be left, if the variable would be set to one more / one less
4395 /* rhs is reason and coeff is positive, or lhs is reason and coeff is negative -> lower bound */
4397 rescap -= vals[i] * (SCIPvarGetLbAtIndex(vars[i], bdchgidx, FALSE) - SCIPvarGetLbGlobal(vars[i]));
4401 /* lhs is reason and coeff is positive, or rhs is reason and coeff is negative -> upper bound */
4403 rescap -= vals[i] * (SCIPvarGetUbAtIndex(vars[i], bdchgidx, FALSE) - SCIPvarGetUbGlobal(vars[i]));
4423 /* rhs is reason and coeff is positive, or lhs is reason and coeff is negative -> lower bound is responsible */
4428 /* lhs is reason and coeff is positive, or rhs is reason and coeff is negative -> upper bound is responsible */
4436 /** resolves a propagation on the given variable by supplying the variables needed for applying the corresponding
4447 SCIP_BDCHGIDX* bdchgidx, /**< bound change index (time stamp of bound change), or NULL for current time */
4448 SCIP_RESULT* result /**< pointer to store the result of the propagation conflict resolving call */
4489 /* the bound of the variable was tightened, because the minimal or maximal residual activity of the linear
4490 * constraint (only taking the other variables into account) didn't leave enough space for a larger
4499 /* the bound of the variable was tightened, because the minimal or maximal residual activity of the linear
4500 * constraint (only taking the other variables into account) didn't leave enough space for a larger
4510 SCIPerrorMessage("invalid inference information %d in linear constraint <%s> at position %d for %s bound of variable <%s>\n",
4521 /** analyzes conflicting bounds on given constraint, and adds conflict constraint to problem */
4530 if( (SCIPgetStage(scip) != SCIP_STAGE_SOLVING && !SCIPinProbing(scip)) || !SCIPisConflictAnalysisApplicable(scip) )
4536 /* add the conflicting bound for each variable of infeasible constraint to conflict candidate queue */
4585 SCIP_Bool force /**< should a possible bound change be forced even if below bound strengthening tolerance */
4609 SCIPdebugMessage("linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, activity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newub=%.15g\n",
4610 SCIPconsGetName(cons), SCIPvarGetName(var), lb, oldub, consdata->vals[pos], consdata->minactivity, consdata->maxactivity, consdata->lhs, consdata->rhs, newub);
4615 SCIP_CALL( SCIPinferVarUbCons(scip, var, newub, cons, getInferInt(proprule, pos), force, &infeasible, &tightened) );
4654 SCIP_Bool force /**< should a possible bound change be forced even if below bound strengthening tolerance */
4678 SCIPdebugMessage("linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, activity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newlb=%.15g\n",
4679 SCIPconsGetName(cons), SCIPvarGetName(var), oldlb, ub, consdata->vals[pos], consdata->minactivity, consdata->maxactivity, consdata->lhs, consdata->rhs, newlb);
4684 SCIP_CALL( SCIPinferVarLbCons(scip, var, newlb, cons, getInferInt(proprule, pos), force, &infeasible, &tightened) );
4720 SCIP_Bool force /**< should a possible bound change be forced even if below bound strengthening tolerance */
4783 /* if the minactivity is larger than the right hand side by feasibility epsilon, the constraint is infeasible */
4795 /* if the slack is zero in tolerances (or negative, but not enough to make the constraint infeasible), we set
4832 /* if the maxactivity is smaller than the left hand side by feasibility epsilon, the constraint is infeasible */
4844 /* if the slack is zero in tolerances (or negative, but not enough to make the constraint infeasible), we set
4880 /* if the minactivity is larger than the right hand side by feasibility epsilon, the constraint is infeasible */
4892 /* if the slack is zero in tolerances (or negative, but not enough to make the constraint infeasible), we set
4928 /* if the maxactivity is smaller than the left hand side by feasibility epsilon, the constraint is infeasible */
4940 /* if the slack is zero in tolerances (or negative, but not enough to make the constraint infeasible), we set
4980 SCIP_Bool force /**< should a possible bound change be forced even if below bound strengthening tolerance */
5023 consdataGetActivityResiduals(scip, consdata, var, val, FALSE, &minresactivity, &maxresactivity,
5044 ((force && SCIPisLT(scip, newub, ub)) || (SCIPvarIsIntegral(var) && SCIPisFeasLT(scip, newub, ub)) || SCIPisUbBetter(scip, newub, lb, ub)) )
5055 (!SCIPisUbBetter(scip, newub, lb, ub) && (!SCIPisFeasLT(scip, newub, ub) || !SCIPvarIsIntegral(var))
5062 SCIPdebugMessage("linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, resactivity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newub=%.15g\n",
5063 SCIPconsGetName(cons), SCIPvarGetName(var), lb, ub, val, minresactivity, maxresactivity, lhs, rhs, newub);
5079 ub = SCIPvarGetUbLocal(var); /* get bound again: it may be additionally modified due to integrality */
5096 ((force && SCIPisGT(scip, newlb, lb)) || (SCIPvarIsIntegral(var) && SCIPisFeasGT(scip, newlb, lb)) || SCIPisLbBetter(scip, newlb, lb, ub)) )
5111 SCIPdebugMessage("linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, resactivity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newlb=%.15g\n",
5112 SCIPconsGetName(cons), SCIPvarGetName(var), lb, ub, val, minresactivity, maxresactivity, lhs, rhs, newlb);
5128 lb = SCIPvarGetLbLocal(var); /* get bound again: it may be additionally modified due to integrality */
5146 ((force && SCIPisGT(scip, newlb, lb)) || (SCIPvarIsIntegral(var) && SCIPisFeasGT(scip, newlb, lb)) || SCIPisLbBetter(scip, newlb, lb, ub)) )
5157 || (!SCIPisLbBetter(scip, newlb, lb, ub) && (!SCIPisFeasGT(scip, newlb, lb) || !SCIPvarIsIntegral(var))
5164 SCIPdebugMessage("linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, resactivity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newlb=%.15g\n",
5165 SCIPconsGetName(cons), SCIPvarGetName(var), lb, ub, val, minresactivity, maxresactivity, lhs, rhs, newlb);
5181 lb = SCIPvarGetLbLocal(var); /* get bound again: it may be additionally modified due to integrality */
5197 ((force && SCIPisLT(scip, newub, ub)) || (SCIPvarIsIntegral(var) && SCIPisFeasLT(scip, newub, ub)) || SCIPisUbBetter(scip, newub, lb, ub)) )
5212 SCIPdebugMessage("linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, resactivity=[%.15g,%.15g], sides=[%.15g,%.15g], newub=%.15g\n",
5213 SCIPconsGetName(cons), SCIPvarGetName(var), lb, ub, val, minresactivity, maxresactivity, lhs, rhs, newub);
5229 ub = SCIPvarGetUbLocal(var); /* get bound again: it may be additionally modified due to integrality */
5321 consdataGetActivityBounds(scip, consdata, FALSE, &minactivity, &maxactivity, &minisrelax, &maxisrelax);
5325 slack = (SCIPisInfinity(scip, consdata->rhs) || SCIPisInfinity(scip, -minactivity)) ? SCIPinfinity(scip) : (consdata->rhs - minactivity);
5326 surplus = (SCIPisInfinity(scip, -consdata->lhs) || SCIPisInfinity(scip, maxactivity)) ? SCIPinfinity(scip) : (maxactivity - consdata->lhs);
5336 /* as long as the bounds might be tightened again, try to tighten them; abort after a maximal number of rounds */
5338 for( nrounds = 0; (force || !consdata->boundstightened) && nrounds < MAXTIGHTENROUNDS; ++nrounds )
5343 /* try to tighten the bounds of each variable in the constraint. During solving process, the binary variable
5369 && !SCIPisFeasEQ(scip, SCIPvarGetUbLocal(consdata->vars[v]), SCIPvarGetLbLocal(consdata->vars[v])) )
5377 assert(*cutoff || SCIPisFeasEQ(scip, SCIPvarGetLbLocal(consdata->vars[0]), SCIPvarGetUbLocal(consdata->vars[0])));
5389 SCIP_Bool checklprows, /**< has linear constraint to be checked, if it is already in current LP? */
5390 SCIP_Bool checkrelmaxabs, /**< should the violation for a constraint with side 0.0 be checked relative
5422 SCIPdebugMessage(" consdata activity=%.15g (lhs=%.15g, rhs=%.15g, row=%p, checklprows=%u, rowinlp=%u, sol=%p, hascurrentnodelp=%u)\n",
5427 if( SCIPisFeasLT(scip, activity, consdata->lhs) || SCIPisFeasGT(scip, activity, consdata->rhs) )
5440 /* the (much) more complicated check: we try to disregard random noise and violations of a 0.0 side which are
5489 SCIPdebugMessage(" lhs violated absolutely (violation=%16.9g), but feasible when using relative tolerance w.r.t. maximum absolute value (%16.9g)\n",
5543 SCIPdebugMessage(" rhs violated absolutely (violation=%16.9g), but feasible when using relative tolerance w.r.t. maximum absolute value (%16.9g)\n",
5605 SCIP_CALL( SCIPcreateEmptyRowCons(scip, &consdata->row, SCIPconsGetHdlr(cons), SCIPconsGetName(cons), consdata->lhs, consdata->rhs,
5608 SCIP_CALL( SCIPaddVarsToRow(scip, consdata->row, consdata->nvars, consdata->vars, consdata->vals) );
5660 /** separates linear constraint: adds linear constraint as cut, if violated by given solution */
5668 SCIP_Bool separateall, /**< should all constraints be subject to cardinality cut generation instead of only
5690 SCIP_CALL( checkCons(scip, cons, sol, (sol != NULL), conshdlrdata->checkrelmaxabs, &violated) );
5703 /* we only want to call the knapsack cardinality cut separator for rows that have a non-zero dual solution */
5789 /* increase age of constraint; age is reset to zero, if a conflict or a propagation was found */
5813 consdataGetActivityBounds(scip, consdata, TRUE, &minactivity, &maxactivity, &minactisrelax, &maxactisrelax);
5817 SCIPdebugMessage("linear constraint <%s> is infeasible (rhs): activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
5828 SCIPdebugMessage("linear constraint <%s> is infeasible (lhs): activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
5837 else if( SCIPisGE(scip, minactivity, consdata->lhs) && SCIPisLE(scip, maxactivity, consdata->rhs) )
5839 SCIPdebugMessage("linear constraint <%s> is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
5894 fixval = SCIPselectSimpleValue(lb - 0.9 * SCIPepsilon(scip), ub + 0.9 * SCIPepsilon(scip), MAXDNOM);
5895 SCIPdebugMessage("converting variable <%s> with fixed bounds [%.15g,%.15g] into fixed variable fixed at %.15g\n",
5932 * a) if the constraint has a finite right hand side and the negative infinity counters for the minactivity are zero
5933 * then add the variables as a clique for which all successive pairs of coefficients fullfill the following
5938 * and also add the binary to binary implication also for non-successive variables for which the same argument
5943 * e.g. 5.3 x1 + 3.6 x2 + 3.3 x3 + 2.1 x4 <= 5.5 (all x are binary) would lead to the clique (x1, x2, x3) and the
5946 * b) if the constraint has a finite left hand side and the positive infinity counters for the maxactivity are zero
5947 * then add the variables as a clique for which all successive pairs of coefficients fullfill the follwoing
5952 * and also add the binary to binary implication also for non-successive variables for which the same argument
5959 * c) the constraint has a finite right hand side and a finite minactivity then add the variables as a negated
5960 * clique(clique on the negated variables) for which all successive pairs of coefficients fullfill the following
5965 * and also add the binary to binary implication also for non-successive variables for which the
5970 * e.g. -4 x1 -3 x2 - 2 x3 + 2 x4 <= -4 would lead to the (negated) clique (~x1, ~x2) and the binary to binary
5973 * d) the constraint has a finite left hand side and a finite maxactivity then add the variables as a negated
5974 * clique(clique on the negated variables) for which all successive pairs of coefficients fullfill the following
5979 * and also add the binary to binary implication also for non-successive variables for which the same argument
5986 * 2. if the linear constraint represents a set-packing or set-partitioning constraint, the whole constraint is added
6037 * for now we only add binary to non-binary implications, and this is only done for the binary variable with the
6038 * maximal absolute contribution and also only if this variable would force all other variables to their bound
6046 /* @todo we might extract implications/cliques if SCIPvarIsBinary() variables exist and we have integer variables
6064 finitenegminact = (consdata->glbminactivityneginf == 0 && consdata->glbminactivityneghuge == 0);
6066 finiteposminact = (consdata->glbminactivityposinf == 0 && consdata->glbminactivityposhuge == 0);
6067 finiteposmaxact = (consdata->glbmaxactivityposinf == 0 && consdata->glbmaxactivityposhuge == 0);
6071 if( (finiterhs || finitelhs) && (finitenegminact || finiteposminact || finitenegmaxact || finiteposmaxact) )
6134 /* if the right hand side and the minimal activity are finite and changing the variable with the biggest
6135 * influence to their bound forces all other variables to be at their minimal contribution, we can add these
6138 if( finiterhs && finiteminact && SCIPisEQ(scip, consdata->glbminactivity, consdata->rhs - maxabscontrib) )
6150 SCIP_CALL( SCIPaddVarImplication(scip, vars[position], posval, vars[v], SCIP_BOUNDTYPE_UPPER, SCIPvarGetLbGlobal(vars[v]), &infeasible, &nbdchgs) );
6157 SCIP_CALL( SCIPaddVarImplication(scip, vars[position], posval, vars[v], SCIP_BOUNDTYPE_LOWER, SCIPvarGetUbGlobal(vars[v]), &infeasible, &nbdchgs) );
6169 /* stop when reaching a 'real' binary variable because the variables are sorted after their type */
6175 /* if the left hand side and the maximal activity are finite and changing the variable with the biggest
6176 * influence to their bound forces all other variables to be at their minimal contribution, we can add these
6179 if( finitelhs && finitemaxact && SCIPisEQ(scip, consdata->glbmaxactivity, consdata->lhs - maxabscontrib) )
6191 SCIP_CALL( SCIPaddVarImplication(scip, vars[position], posval, vars[v], SCIP_BOUNDTYPE_LOWER, SCIPvarGetUbGlobal(vars[v]), &infeasible, &nbdchgs) );
6198 SCIP_CALL( SCIPaddVarImplication(scip, vars[position], posval, vars[v], SCIP_BOUNDTYPE_UPPER, SCIPvarGetLbGlobal(vars[v]), &infeasible, &nbdchgs) );
6210 /* stop when reaching a 'real' binary variable because the variables are sorted after their type */
6219 SCIPdebugMessage("extracted %d implications from constraint %s which led to %d bound changes, %scutoff detetcted\n", nimpls, SCIPconsGetName(cons), *nchgbds - oldnchgbds, *cutoff ? "" : "no ");
6224 /* did we find some boundchanges, then we need to remove fixings and tighten the bounds further */
6273 finitenegminact = (consdata->glbminactivityneginf == 0 && consdata->glbminactivityneghuge == 0);
6275 finiteposminact = (consdata->glbminactivityposinf == 0 && consdata->glbminactivityposhuge == 0);
6276 finiteposmaxact = (consdata->glbmaxactivityposinf == 0 && consdata->glbmaxactivityposhuge == 0);
6280 /* 1. we wheck whether some variables do not fit together into this constraint and add the corresponding clique
6283 if( (finiterhs || finitelhs) && (finitenegminact || finiteposminact || finitenegmaxact || finiteposmaxact) )
6320 /* setppc constraints will be handled later; we need at least two binary variables with same sign to extract
6356 #if 0 /* assertion should only holds when constraints were fully propagated and boundstightened */
6357 /* check that it is possible to choose binvar[i], otherwise it should have been fixed to zero */
6395 /* iterate up to the end with j and up to the front with lastfit, and check for different cliques */
6432 /* did we find some boundchanges, then we need to remove fixings and tighten the bounds further */
6505 #if 0 /* assertion should only holds when constraints were fully propagated and boundstightened */
6506 /* check that it is possible to choose binvar[i], otherwise it should have been fixed to zero */
6546 /* iterate up to the front with j and up to the end with lastfit, and check for different cliques */
6557 SCIP_CALL( SCIPaddClique(scip, &(clqvars[lastfit - jstart - 2]), NULL, i - lastfit + 2, &infeasible, &nbdchgs) );
6585 /* did we find some boundchanges, then we need to remove fixings and tighten the bounds further */
6665 #if 0 /* assertion should only holds when constraints were fully propagated and boundstightened */
6706 /* iterate up to the front with j and up to the end with lastfit, and check for different cliques */
6717 SCIP_CALL( SCIPaddClique(scip, &(clqvars[lastfit - jstart - 2]), values, i - lastfit + 2, &infeasible, &nbdchgs) );
6747 /* did we find some boundchanges, then we need to remove fixings and tighten the bounds further */
6825 #if 0 /* assertion should only holds when constraints were fully propagated and boundstightened */
6864 /* iterate up to the end with j and up to the front with lastfit, and check for different cliques */
6910 /* check if all variables are binary, if the coefficients are +1 or -1, and if the right hand side is equal
6911 * to 1 - number of negative coefficients, or if the left hand side is equal to number of positive coefficients - 1
7007 /** tightens coefficients of binary, integer, and implicit integer variables due to activity bounds in presolving:
7014 * xi fixed to its bounds, but with a reduced ai and tightened sides to tighten the LP relaxation
7023 * xi fixed to its bounds, but with a reduced ai and tightened sides to tighten the LP relaxation
7031 * A deviation of only one from their bound makes the lhs/rhs feasible (i.e., redundant), even if all other
7032 * variables are set to their "worst" bound. If all variables which are not surely non-redundant cannot make
7033 * the lhs/rhs redundant, even if they are set to their "best" bound, they can be removed from the constraint.
7034 * E.g., for binary variables and an inequality x_1 +x_2 +10y_1 +10y_2 >= 5, setting either of the y_i to one
7035 * suffices to fulfill the inequality, whereas the x_i do not contribute to feasibility and can be removed.
7037 * @todo use also some tightening procedures for (knapsack) constraints with non-integer coefficients, see
7050 SCIP_Real minactivity; /* minimal value w.r.t. the variable's local bounds for the constraint's
7052 SCIP_Real maxactivity; /* maximal value w.r.t. the variable's local bounds for the constraint's
7087 consdataGetActivityBounds(scip, consdata, TRUE, &minactivity, &maxactivity, &minactisrelax, &maxactisrelax);
7109 SCIPisGE(scip, minactivity + val, consdata->lhs) && SCIPisLE(scip, maxactivity - val, consdata->rhs) )
7126 if( !SCIPisInfinity(scip, -consdata->lhs) && consdata->minactivityneginf + consdata->minactivityneginf == 0 )
7129 lval -= otherval > 0.0 ? otherval * SCIPvarGetLbLocal(consdata->vars[1-i]) : otherval * SCIPvarGetUbLocal(consdata->vars[1-i]);
7132 if( !SCIPisInfinity(scip,consdata->rhs) && consdata->maxactivityneginf + consdata->maxactivityneginf == 0 )
7135 rval += otherval > 0.0 ? otherval * SCIPvarGetUbLocal(consdata->vars[1-i]) : otherval * SCIPvarGetLbLocal(consdata->vars[1-i]);
7150 SCIPdebugMessage("linear constraint <%s>: change coefficient %+.15g<%s> to %+.15g<%s>, act=[%.15g,%.15g], side=[%.15g,%.15g]\n",
7167 consdataGetActivityBounds(scip, consdata, TRUE, &minactivity, &maxactivity, &minactisrelax, &maxactisrelax);
7171 SCIPdebugMessage("linear constraint <%s>: change lhs %.15g to %.15g\n", SCIPconsGetName(cons), consdata->lhs, newlhs);
7180 SCIPdebugMessage("linear constraint <%s>: change rhs %.15g to %.15g\n", SCIPconsGetName(cons), consdata->rhs, newrhs);
7215 SCIPisGE(scip, minactivity - val, consdata->lhs) && SCIPisLE(scip, maxactivity + val, consdata->rhs) )
7232 if( !SCIPisInfinity(scip,-consdata->lhs) && consdata->minactivityneginf + consdata->minactivityneginf == 0 )
7235 lval += otherval > 0.0 ? otherval * SCIPvarGetLbLocal(consdata->vars[1-i]) : otherval * SCIPvarGetUbLocal(consdata->vars[1-i]);
7238 if( !SCIPisInfinity(scip,consdata->rhs) && consdata->maxactivityneginf + consdata->maxactivityneginf == 0 )
7241 rval -= otherval > 0.0 ? otherval * SCIPvarGetUbLocal(consdata->vars[1-i]) : otherval * SCIPvarGetLbLocal(consdata->vars[1-i]);
7256 SCIPdebugMessage("linear constraint <%s>: change coefficient %+.15g<%s> to %+.15g<%s>, act=[%.15g,%.15g], side=[%.15g,%.15g]\n",
7273 consdataGetActivityBounds(scip, consdata, TRUE, &minactivity, &maxactivity, &minactisrelax, &maxactisrelax);
7277 SCIPdebugMessage("linear constraint <%s>: change lhs %.15g to %.15g\n", SCIPconsGetName(cons), consdata->lhs, newlhs);
7286 SCIPdebugMessage("linear constraint <%s>: change rhs %.15g to %.15g\n", SCIPconsGetName(cons), consdata->rhs, newrhs);
7329 /* if the lhs is finite, we will check in the following whether the not non-redundant variables can make lhs feasible;
7330 * this is not valid, if the minactivity is -\infty (aggrlhs would be minus infinity in the following computation)
7331 * or if huge values contributed to the minactivity, because the minactivity is then just a relaxation
7332 * (<= the exact minactivity), and we might falsely claim variables to be redundant in the following
7335 if( !SCIPisInfinity(scip, -consdata->lhs) && (SCIPisInfinity(scip, -minactivity) || minactisrelax) )
7338 /* if the rhs is finite, we will check in the following whether the not non-redundant variables can make rhs feasible;
7339 * this is not valid, if the maxactivity is \infty (aggrrhs would be infinity in the following computation)
7340 * or if huge values contributed to the maxactivity, because the maxactivity is then just a relaxation
7341 * (>= the exact maxactivity), and we might falsely claim variables to be redundant in the following
7344 if( !SCIPisInfinity(scip, consdata->rhs) && (SCIPisInfinity(scip, maxactivity) || maxactisrelax) )
7348 * surely non-redundant variables are all those where a deviation from the bound makes the lhs/rhs redundant
7353 /* check if the constraint contains variables which are redundant. The reasoning is the following:
7354 * Each non-redundant variable can make the lhs/rhs feasible with a deviation of only one in the bound.
7386 SCIPisLT(scip, minactivity + val, consdata->lhs) || SCIPisGT(scip, maxactivity - val, consdata->rhs) )
7390 SCIPdebugMessage("linear constraint <%s>: remove variable <%s> with coefficient <%g> from constraint since it is redundant\n",
7400 consdataGetActivityBounds(scip, consdata, FALSE, &minactivity, &maxactivity, &minactisrelax, &maxactisrelax);
7402 /* we return above if the condition does not hold and deleting a variable cannot increase the number of
7413 SCIPisLT(scip, minactivity - val, consdata->lhs) || SCIPisGT(scip, maxactivity + val, consdata->rhs) )
7415 SCIPdebugMessage("linear constraint <%s>: remove variable <%s> with coefficient <%g> from constraint since it is redundant\n",
7425 consdataGetActivityBounds(scip, consdata, FALSE, &minactivity, &maxactivity, &minactisrelax, &maxactisrelax);
7427 /* we return above if the condition does not hold and deleting a variable cannot increase the number of
7435 /* the following update step is needed in every iteration cause otherwise it is possible that the surely none-
7437 * e.g. y_1 + 16y_2 >= 25, y1 with bounds [9,12], y2 with bounds [0,2], minactivity would be 9, it follows that
7438 * y_2 is surely not redundant and y_1 is redundant so we would first delete y1 and without updating the sides
7446 SCIPdebugMessage("linear constraint <%s>: change lhs %.15g to %.15g\n", SCIPconsGetName(cons), consdata->lhs, newlhs);
7453 SCIPdebugMessage("linear constraint <%s>: change rhs %.15g to %.15g\n", SCIPconsGetName(cons), consdata->rhs, newrhs);
7465 /* processes equality with only one variable by fixing the variable and deleting the constraint */
7521 /* processes equality with exactly two variables by aggregating one of the variables and deleting the constraint */
7552 SCIP_CALL( SCIPaggregateVars(scip, consdata->vars[0], consdata->vars[1], consdata->vals[0], consdata->vals[1],
7579 /** calculates the new lhs and rhs of the constraint after the given variable is aggregated out */
7629 /* processes equality with more than two variables by multi-aggregating one of the variables and converting the equality
7630 * into an inequality; if multi-aggregation is not possible, tries to identify one continuous or integer variable that
7633 * @todo Check whether a more clever way of avoiding aggregation of variables containing implicitly integer variables
7688 SCIPdebugMessage("linear constraint <%s>: try to multi-aggregate equality\n", SCIPconsGetName(cons));
7692 * maxnlocksstay: maximal sum of lock numbers if the constraint does not become redundant after the aggregation
7693 * maxnlocksremove: maximal sum of lock numbers if the constraint can be deleted after the aggregation
7700 /* If the constraint becomes redundant, 3 non-zeros are removed, and we get 1 additional non-zero for each
7701 * constraint the variable appears in. Thus, the variable must appear in at most 3 other constraints.
7707 /* If the constraint becomes redundant, 4 non-zeros are removed, and we get 2 additional non-zeros for each
7708 * constraint the variable appears in. Thus, the variable must appear in at most 2 other constraints.
7714 /* If the constraint is redundant but has more than 4 variables, we can only accept one other constraint. */
7765 assert(!SCIPconsIsChecked(cons) || SCIPvarGetNLocksDown(var) >= 1); /* because variable is locked in this equality */
7810 /* check, if variable is used in too many other constraints, even if this constraint could be deleted */
7859 consdataGetActivityResiduals(scip, consdata, var, val, FALSE, &minresactivity, &maxresactivity,
7862 /* do not perform the multi-aggregation due to numerics, if we have huge contributions in the residual
7869 removescons = (SCIPisFeasLE(scip, newlhs, minresactivity) && SCIPisFeasLE(scip, maxresactivity, newrhs));
7874 if( !isminsettoinfinity && SCIPisUpdateUnreliable(scip, minresactivity, consdata->lastminactivity) )
7877 if( !ismaxsettoinfinity && SCIPisUpdateUnreliable(scip, maxresactivity, consdata->lastmaxactivity)
7881 removescons = (SCIPisFeasLE(scip, newlhs, minresactivity) && SCIPisFeasLE(scip, maxresactivity, newrhs));
7888 /* if the constraint does not become redundant, only accept the variable if it does not appear in
7907 /* if all coefficients and variables are integral, the right hand side must also be integral */
7920 /* check whether the the infimum and the supremum of the multi-aggregation can be get infinite */
7958 /* If the infimum and the supremum of a multi-aggregation are both infinite, then the multi-aggregation might not be resolvable.
7959 * E.g., consider the equality z = x-y. If x and y are both fixed to +infinity, the value for z is not determined */
7962 SCIPdebugMessage("do not perform multi-aggregation: infimum and supremum are both infinite\n");
7966 /* if the slack variable is of integer type, and the constraint itself may take fractional values,
8010 SCIPdebugMessage("linear constraint <%s>: multi-aggregate <%s> ==", SCIPconsGetName(cons), SCIPvarGetName(slackvar));
8016 SCIPdebugPrintf(" %+.15g, bounds of <%s>: [%.15g,%.15g], nlocks=%d, maxnlocks=%d, removescons=%u\n",
8017 aggrconst, SCIPvarGetName(slackvar), SCIPvarGetLbGlobal(slackvar), SCIPvarGetUbGlobal(slackvar),
8031 SCIPdebugMessage("linear constraint <%s>: infeasible multi-aggregation\n", SCIPconsGetName(cons));
8041 SCIPdebugMessage("linear constraint <%s>: redundant after multi-aggregation\n", SCIPconsGetName(cons));
8058 /* upgrade continuous variable to an implicit one, if the absolute value of the coefficient is one */
8062 SCIPdebugMessage("linear constraint <%s>: converting continuous variable <%s> to implicit integer variable\n",
8067 SCIPdebugMessage("infeasible upgrade of variable <%s> to integral type, domain is empty\n", SCIPvarGetName(var));
8073 /* aggregate continuous variable to an implicit one, if the absolute value of the coefficient is unequal to one */
8074 /* @todo check if the aggregation coefficient should be in some range(, which is not too big) */
8088 SCIP_CALL( SCIPcreateVar(scip, &newvar, newvarname, -SCIPinfinity(scip), SCIPinfinity(scip), 0.0,
8089 SCIP_VARTYPE_IMPLINT, SCIPvarIsInitial(var), SCIPvarIsRemovable(var), NULL, NULL, NULL, NULL, NULL) );
8104 SCIPdebugMessage("linear constraint <%s>: aggregating continuous variable <%s> to newly created implicit integer variable <%s>, aggregation factor = %g\n",
8108 SCIP_CALL( SCIPaggregateVars(scip, var, newvar, absval, -1.0, 0.0, &infeasible, &redundant, &aggregated) );
8112 SCIPdebugMessage("infeasible aggregation of variable <%s> to implicit variable <%s>, domain is empty\n",
8129 /* we do not have any event on vartype changes, so we need to manually force this constraint to be presolved
8140 /* this seems to help for rococo instances, but does not for rout (where all coefficients are +/- 1.0)
8153 SCIPdebugMessage("linear constraint <%s>: converting integer variable <%s> to implicit integer variable\n",
8158 SCIPdebugMessage("infeasible upgrade of variable <%s> to integral type, domain is empty\n", SCIPvarGetName(var));
8169 /** checks if the given variables and their coefficient are equal (w.r.t. scaling factor) to the objective function */
8208 /* if a variable has a zero objective coefficient the linear constraint is not a subset of the objective
8246 /** check if the linear equality constraint is equal to a subset of the objective function; if so we can remove the
8275 /* check if the linear equality constraints does not have more variables than the objective function */
8287 /* checks if the variables and their coefficients are equal (w.r.t. scaling factor) to the objective function */
8299 SCIPdebugMessage("linear equality constraint <%s> == %g (offset %g) is a subset of the objective function\n",
8315 /** updates the cutoff if the given primal bound (which is implied by the given constraint) is better */
8325 /* increase the cutoff bound value by an epsilon to ensue that solution with the value of the cutoff bound are still
8343 /* we cannot disable the enforcement and propagation on ranged rows, because the cutoffbound could only have
8348 /* in case the cutoff bound is worse then the currently known one, we additionally avoid enforcement and
8359 /** check if the linear constraint is parallel to objective function; if so update the cutoff bound and avoid that the
8390 /* check if the linear inequality constraints has the same number of variables as the objective function and if the
8399 /* checks if the variables and their coefficients are equal (w.r.t. scaling factor) to the objective function */
8415 SCIPdebugMessage("constraint <%s> is parallel to objective function and provides a cutoff bound <%g>\n",
8427 SCIPdebugMessage("constraint <%s> is parallel to objective function and provides a lower bound <%g>\n",
8436 /* avoid that the linear constraint enters the LP since it is parallel to the objective function */
8449 SCIPdebugMessage("constraint <%s> is parallel to objective function and provides a lower bound <%g>\n",
8461 SCIPdebugMessage("constraint <%s> is parallel to objective function and provides a cutoff bound <%g>\n",
8470 /* avoid that the linear constraint enters the LP since it is parallel to the objective function */
8533 /** returns whether the linear sum of all variables/coefficients except the given one divided by the given value is always
8552 if( v != pos && (!SCIPvarIsIntegral(consdata->vars[v]) || !SCIPisIntegral(scip, consdata->vals[v]/val)) )
8604 /* applies dual presolving for variables that are locked only once in a direction, and this locking is due to a
8634 * otherwise we would have to check for variables with nlocks == 0, and these are already processed by the
8646 /* search for a single-locked variable which can be multi-aggregated; if a valid continuous variable was found, we
8653 /* We only want to multi-aggregate variables, if they appear in maximal one additional constraint,
8655 * - If there are only two variables in the constraint from which the multi-aggregation arises, no fill-in will be
8657 * - If there are three variables in the constraint, multi-aggregation in three additional constraints will remove
8658 * six nonzeros (three from the constraint and the three entries of the multi-aggregated variable) and add
8660 * - If there at most four variables in the constraint, multi-aggregation in two additional constraints will remove
8661 * six nonzeros (four from the constraint and the two entries of the multi-aggregated variable) and add
8673 /* if this constraint has both sides, it also provides a lock for the other side and thus we can allow one more lock */
8689 isint = (SCIPvarGetType(var) == SCIP_VARTYPE_BINARY || SCIPvarGetType(var) == SCIP_VARTYPE_INTEGER);
8695 /* better do not multi-aggregate binary variables, since most plugins rely on their binary variables to be either
8713 * - fix x_i to the smallest value for this constraint: x_i := lhs/a_i - \sum_{j \neq i} a_j/a_i * x_j
8717 * - fix x_i to the largest value for this constraint: x_i := lhs/a_i - \sum_{j \neq i} a_j/a_i * x_j
8721 * - fix x_i to the largest value for this constraint: x_i := rhs/a_i - \sum_{j \neq i} a_j/a_i * x_j
8725 * - fix x_i to the smallest value for this constraint: x_i := rhs/a_i - \sum_{j \neq i} a_j/a_i * x_j
8727 * but: all this is only applicable, if the aggregated value is inside x_i's bounds for all possible values
8753 consdataGetActivityResiduals(scip, consdata, var, val, FALSE, &minresactivity, &maxresactivity,
8766 calculateMinvalAndMaxval(scip, consdata->lhs, val, minresactivity, maxresactivity, &minval, &maxval);
8781 if( !isminsettoinfinity && SCIPisUpdateUnreliable(scip, minresactivity, consdata->lastminactivity) )
8789 if( !ismaxsettoinfinity && SCIPisUpdateUnreliable(scip, maxresactivity, consdata->lastmaxactivity) )
8801 /* check again if lhs/a_i - \sum_{j \neq i} a_j/a_i * x_j is always inside the bounds of x_i */
8802 calculateMinvalAndMaxval(scip, consdata->lhs, val, minresactivity, maxresactivity, &minval, &maxval);
8809 /* if the variable is integer, we have to check whether the integrality condition would always be satisfied
8812 if( !isint || (SCIPisIntegral(scip, consdata->lhs/val) && consdataIsResidualIntegral(scip, consdata, i, val)) )
8826 calculateMinvalAndMaxval(scip, consdata->rhs, val, minresactivity, maxresactivity, &minval, &maxval);
8841 if( !isminsettoinfinity && SCIPisUpdateUnreliable(scip, minresactivity, consdata->lastminactivity) )
8848 if( !ismaxsettoinfinity && SCIPisUpdateUnreliable(scip, maxresactivity, consdata->lastmaxactivity) )
8857 /* check again if rhs/a_i - \sum_{j \neq i} a_j/a_i * x_j is always inside the bounds of x_i */
8858 calculateMinvalAndMaxval(scip, consdata->rhs, val, minresactivity, maxresactivity, &minval, &maxval);
8864 /* if the variable is integer, we have to check whether the integrality condition would always be satisfied
8867 if( !isint || (SCIPisIntegral(scip, consdata->rhs/val) && consdataIsResidualIntegral(scip, consdata, i, val)) )
8904 (SCIPvarGetType(bestvar) == SCIP_VARTYPE_BINARY || SCIPvarGetType(bestvar) == SCIP_VARTYPE_INTEGER));
8912 SCIPdebugMessage("linear constraint <%s> (dual): multi-aggregate <%s> ==", SCIPconsGetName(cons), SCIPvarGetName(bestvar));
8967 SCIPdebugPrintf(" %+.15g, bounds of <%s>: [%.15g,%.15g]\n", aggrconst, SCIPvarGetName(bestvar),
8984 /* @todo if multi-aggregate makes them numerical trouble, avoid them if the coefficients differ to much, see
8987 SCIP_CALL( SCIPmultiaggregateVar(scip, bestvar, naggrs, aggrvars, aggrcoefs, aggrconst, &infeasible, &aggregated) );
8991 /* If the infimum and the supremum of a multi-aggregation are both infinite, then the multi-aggregation might not be resolvable.
8992 * E.g., consider the equality z = x-y. If x and y are both fixed to +infinity, the value for z is not determined */
8993 SCIPdebugMessage("do not perform multi-aggregation: infimum and supremum are both infinite\n");
9002 SCIPdebugMessage("linear constraint <%s>: infeasible multi-aggregation\n", SCIPconsGetName(cons));
9225 /** sorting method for constraint data, compares two variables on given indices, continuous variables will be sorted to
9226 * the end and for all other variables the sortation will be in non-increasing order of their absolute value of the
9259 /* for all non-continuous variables, the variables are sorted after decreasing absolute coefficients */
9263 /** tries to simplify coefficients and delete variables in ranged row of the form lhs <= a^Tx <= rhs, e.g. using the greatest
9266 * 1. lhs <= a^Tx <= rhs, forall a_i >= lhs, a_i <= rhs, and forall pairs a_i + a_j > rhs then we can change this
9344 if( SCIPisGE(scip, minval, lhs) && SCIPisLE(scip, maxval, rhs) && SCIPisGT(scip, minval + secondminval, rhs) )
9363 /** tries to simplify coefficients and delete variables in constraints of the form lhs <= a^Tx <= rhs
9368 * 1. We try to determine parts of the constraint which will not change anything on (in-)feasibility of the constraint
9374 * e.g. 5.2x1 + 5.1x2 + 3x3 <= 8.3 => will be changed to 5x1 + 5x2 + 3x3 <= 8 if all x are binary
9378 * e.g. 10x1 + 5y2 + 5x3 + 3x4 <= 15 => will be changed to 2x1 + y2 + x3 + x4 <= 3 if all xi are binary and y2 is
9454 /* @todo the following might be to hard, check which steps can be applied and what code must be corrected
9461 /* @todo: change the following: due to vartype changes, the status of the normalization can be wrong, need an event
9498 /* if we have a normalized inequality (not ranged) the one side should be positive, @see normalizeCons() */
9505 /* call sorting method, order continuous variables to the end and all other variables after non-increasing absolute
9519 assert(consdata->validmaxabsval ? (SCIPisFeasEQ(scip, consdata->maxabsval, REALABS(vals[0])) || SCIPvarGetType(vars[nvars - 1]) == SCIP_VARTYPE_CONTINUOUS) : TRUE);
9529 if( SCIPisEQ(scip, REALABS(vals[0]), 1.0) && ((hasrhs && SCIPisIntegral(scip, rhs)) || (haslhs && SCIPisIntegral(scip, lhs))) )
9555 /* we now determine coefficients as large as the side of the constraint to might retrieve a better reduction were we
9559 * c1: +5x1 + 5x2 + 3x3 + 3x4 + x5 >= 5 (x5 is redundant and does not change (in-)feasibility of this constraint)
9560 * c2: +4x1 + 4x2 + 3x3 + 3x4 + x5 >= 4 (gcd (without the coefficient of x5) after the large coefficients is 3
9561 * c3: +30x1 + 29x2 + 14x3 + 14z1 + 7x5 + 7x6 <= 30 (gcd (without the coefficient of x2) after the large coefficients is 7
9566 * c2: +6x1 + 6x2 + 3x3 + 3x4 + 3x5 >= 6 (will be changed to c2: +2x1 + 2x2 + x3 + x4 + x5 >= 2)
9567 * c3: +28x1 + 28x2 + 14x3 + 14z1 + 7x5 + 7x6 <= 28 (will be changed to c3: +4x1 + 4x2 + 2x3 + 2z1 + x5 + x6 <= 4)
9570 /* if the minimal activity is negative and we found more than one variable with a coefficient bigger than the left
9573 * e.g. 7x1 + 7x2 - 4x3 - 4x4 >= 7 => xi = 1 forall i is not a solution, but if we would do a change on the
9574 * coeffcients due to the gcd on the "small" coeffcients we would get 8x1 + 8x2 - 4x3 - 4x4 >= 8 were xi = 1
9585 /* if we have integer variable with "side"-coefficients but also with a lower bound greater than 0 we stop this
9606 /* all but one variable are processed or the next variables is continuous we cannot perform the extra coefficient
9633 /* find and remove redundant variables which do not interact with the (in-)feasible of a constraints
9722 if( (offsetv == -1 && hasrhs && maxactsub <= siderest && SCIPisFeasGT(scip, minactsub, siderest - gcd)) || (haslhs && SCIPisFeasLT(scip, maxactsub, siderest) && minactsub >= siderest - gcd) )
9748 SCIPdebugMessage("stopped at pos %d (of %d), subactivities [%g, %g], redundant = %u, hasrhs = %u, siderest = %g, gcd = %"SCIP_LONGINT_FORMAT", offset position for 'side' coefficients = %d\n", v, nvars, minactsub, maxactsub, redundant, hasrhs, siderest, gcd, offsetv);
9752 (offsetv == -1 && hasrhs && maxactsub <= siderest && SCIPisFeasGT(scip, minactsub, siderest - gcd)) ||
9801 assert((hasrhs && SCIPisLE(scip, tmpmaxactsub, siderest) && tmpminactsub > siderest - gcd) || (haslhs && tmpmaxactsub < siderest && SCIPisGE(scip, tmpminactsub, siderest - gcd)));
9804 SCIPdebugMessage("removing %d last variables from constraint <%s>, because they never change anything on the feasibility of this constraint\n", nvars - v, SCIPconsGetName(cons));
9901 /* if the greatest commmon divisor has become 1, we might have found the possible coefficient to change or we
9986 /* new coeffcient must not be zero if we would loose the implication that a variable needs to be 0 if
10012 if( (!notchangable && hasrhs && ((!SCIPisFeasIntegral(scip, rhs) || SCIPcalcGreComDiv(gcd, (SCIP_Longint)(rhs + feastol)) < gcd) && (SCIPcalcGreComDiv(gcd, (SCIP_Longint)(REALABS(vals[candpos]) + feastol)) == gcd))) ||
10013 ( haslhs && (!SCIPisFeasIntegral(scip, lhs) || SCIPcalcGreComDiv(gcd, (SCIP_Longint)(lhs + feastol)) < gcd) && (SCIPcalcGreComDiv(gcd, (SCIP_Longint)(REALABS(vals[candpos]) + feastol)) == gcd)) )
10063 /* @todo we still can remove continuous variables if they are redundant due to the non-integrality argument */
10079 /* check if the non-integrality part of all integral variables is smaller than the non-inegrality part of the right
10080 * hand side or bigger than the left hand side respectively, so we can make all of them integral
10084 if( (hasrhs && !SCIPisFeasIntegral(scip, rhs)) || (haslhs && !SCIPisFeasIntegral(scip, lhs)) )
10131 /* if we exceed the fractional part of the right hand side, we cannot tighten the coefficients
10226 /* the fractional part on each variable need to exceed the fractional part on the left hand side */
10324 /* maximal absolute value of coefficients in constraint is one, so we cannot tighten it further */
10342 if( SCIPisEQ(scip, REALABS(vals[nvars - 1]), 1.0) && SCIPisEQ(scip, REALABS(vals[nvars - 2]), 1.0) )
10384 /* we need at least one binary variable and a gcd greater than 1 to try to perform further coefficient changes */
10393 /* calculate greatest common divisor over all integer and binary variables and determine the candidate where we might
10416 /* if the greatest commmon divisor has become 1, we might have found the possible coefficient to change or we
10427 /* if we have only binary variables and both first coefficients have a gcd of 1, both are candidates for
10461 /* we should have found one coefficient, that led to a gcd of 1, otherwise we could normalize the constraint
10469 /* check again, if we have a normalized inequality (not ranged) the one side should be positive,
10525 assert(SCIPisZero(scip, newcoef) || SCIPcalcGreComDiv(gcd, (SCIP_Longint)(REALABS(newcoef) + feastol)) == gcd);
10527 SCIPdebugMessage("gcd = %"SCIP_LONGINT_FORMAT", rest = %"SCIP_LONGINT_FORMAT", restcoef = %"SCIP_LONGINT_FORMAT"; changing coef of variable <%s> to %g and %s by %"SCIP_LONGINT_FORMAT"\n", gcd, rest, restcoef, SCIPvarGetName(vars[candpos]), newcoef, hasrhs ? "reduced rhs" : "increased lhs", hasrhs ? rest : (rest > 0 ? gcd - rest : 0));
10555 SCIPdebugMessage("we did %d coefficient changes and %d side changes on constraint %s when applying one round of the gcd algorithm\n", *nchgcoefs - oldnchgcoefs, *nchgsides - oldnchgsides, SCIPconsGetName(cons));
10563 /* tries to aggregate an (in)equality and an equality in order to decrease the number of variables in the (in)equality:
10565 * where a = val1[v] and b = -val0[v] for common variable v which removes most variable weight;
10567 * the variable weight is a weighted sum over all included variables, where each binary variable weighs BINWEIGHT,
10568 * each integer or implicit integer variable weighs INTWEIGHT and each continuous variable weighs CONTWEIGHT
10577 int* diffidx0minus1, /**< array with indices of variables in cons0, that don't appear in cons1 */
10578 int* diffidx1minus0, /**< array with indices of variables in cons1, that don't appear in cons0 */
10581 int diffidx0minus1weight, /**< variable weight sum of variables in cons0, that don't appear in cons1 */
10582 int diffidx1minus0weight, /**< variable weight sum of variables in cons1, that don't appear in cons0 */
10583 SCIP_Real maxaggrnormscale, /**< maximal allowed relative gain in maximum norm for constraint aggregation */
10596 SCIP_Bool commonvarlindependent; /* indicates whether coefficient vector of common variables in linearly dependent */
10620 SCIPdebugMessage("try aggregation of <%s> and <%s>\n", SCIPconsGetName(cons0), SCIPconsGetName(cons1));
10656 /* count the number of variables in the potential new constraint a * consdata0 + b * consdata1 */
10681 * v's common coefficient in cons1 / v's common coefficient in cons0 should be constant, i.e., equal 0's common coefficient in cons1 / 0's common coefficient in cons0
10749 /* setup best* variables that were not setup above because we are in the commonvarlindependent case */
10754 SCIPdebugMessage("aggregate linear constraints <%s> := %.15g*<%s> + %.15g*<%s> -> nvars: %d -> %d, weight: %d -> %d\n",
10785 /* if we recognized linear dependency of the common coefficients, then the aggregation coefficient should be 0.0 for every common variable */
10838 SCIP_CALL( SCIPcreateConsLinear(scip, &newcons, SCIPconsGetName(cons0), newnvars, newvars, newvals, newlhs, newrhs,
10856 if( consdataGetMaxAbsval(SCIPconsGetData(newcons)) <= maxaggrnormscale * consdataGetMaxAbsval(consdata0) )
10890 /** returns TRUE iff both keys are equal; two constraints are equal if they have the same variables and the
10991 hashval = (consdata->nvars << 29) + (minidx << 22) + (mididx << 11) + maxidx + addval; /*lint !e701*/
10996 /** compares each constraint with all other constraints for possible redundancy and removes or changes constraint
11051 /* get constraint from current hash table with same variables as cons0 and with coefficients either equal or negated
11069 /* constraint found: create a new constraint with same coefficients and best left and right hand side;
11084 SCIPdebugMessage("aggregate linear constraints <%s> and <%s> with equal coefficients into single ranged row\n",
11097 SCIPdebugMessage("aggregate linear constraints <%s> and <%s> with negated coefficients into single ranged row\n",
11108 SCIPdebugMessage("aggregated linear constraint <%s> is infeasible\n", SCIPconsGetName(cons1));
11113 /* ensure that lhs <= rhs holds without tolerances as we only allow such rows to enter the LP */
11145 /* update flags of constraint which caused the redundancy s.t. nonredundant information doesn't get lost */
11186 SCIP_Real maxaggrnormscale, /**< maximal allowed relative gain in maximum norm for constraint aggregation */
11250 for( c = (cons0changed ? 0 : firstchange); c < chkind && !(*cutoff) && conss[chkind] != NULL; ++c )
11289 /* SCIPdebugMessage("preprocess linear constraint pair <%s>[chgd:%d, upgd:%d] and <%s>[chgd:%d, upgd:%d]\n",
11316 && ((possignature0 | possignature1) == possignature1) /* possignature0 <= possignature1 (as bit vector) */
11317 && ((negsignature0 | negsignature1) == negsignature0); /* negsignature0 >= negsignature1 (as bit vector) */
11319 && ((possignature0 | possignature1) == possignature0) /* possignature0 >= possignature1 (as bit vector) */
11320 && ((negsignature0 | negsignature1) == negsignature1); /* negsignature0 <= negsignature1 (as bit vector) */
11322 && ((possignature0 | possignature1) == possignature0) /* possignature0 >= possignature1 (as bit vector) */
11323 && ((negsignature0 | negsignature1) == negsignature1); /* negsignature0 <= negsignature1 (as bit vector) */
11325 && ((possignature0 | possignature1) == possignature1) /* possignature0 <= possignature1 (as bit vector) */
11326 && ((negsignature0 | negsignature1) == negsignature0); /* negsignature0 >= negsignature1 (as bit vector) */
11341 * - if lhs0 >= lhs1 and for each variable v and each solution value x_v val0[v]*x_v <= val1[v]*x_v,
11343 * - if rhs0 <= rhs1 and for each variable v and each solution value x_v val0[v]*x_v >= val1[v]*x_v,
11345 * - if val0[v] == -val1[v] for all variables v, the two inequalities can be replaced by a single
11347 * - if at least one constraint is an equality, count the weighted number of common variables W_c
11348 * and the weighted number of variable in the difference sets W_0 = w(V_0 \ V_1), W_1 = w(V_1 \ V_0),
11349 * where the weight of each variable depends on its type, such that aggregations in order to remove the
11351 * - if W_c > W_1, try to aggregate consdata0 := a * consdata0 + b * consdata1 in order to decrease the
11352 * variable weight in consdata0, where a = +/- val1[v] and b = -/+ val0[v] for common v which leads to
11353 * the smallest weight; for numerical stability, we will only accept integral a and b; the sign of a has
11355 * - if W_c > W_0, try to aggregate consdata1 := a * consdata1 + b * consdata0 in order to decrease the
11356 * variable weight in consdata1, where a = +/- val0[v] and b = -/+ val1[v] for common v which leads to
11357 * the smallest weight; for numerical stability, we will only accept integral a and b; the sign of a has
11491 /* the coefficients in both rows are either equal or negated: create a new constraint with same coefficients and
11494 SCIPdebugMessage("aggregate linear constraints <%s> and <%s> with %s coefficients into single ranged row\n",
11513 SCIPdebugMessage("aggregated linear constraint <%s> is infeasible\n", SCIPconsGetName(cons0));
11554 /* update flags of constraint which caused the redundancy s.t. nonredundant information doesn't get lost */
11566 /* check for domination: remove dominated sides, but don't touch equalities as long as they are not totally
11569 if( cons1dominateslhs && (!cons0isequality || cons1dominatesrhs || SCIPisInfinity(scip, consdata0->rhs) ) )
11580 SCIPdebugMessage("linear constraints <%s> and <%s> are infeasible\n", SCIPconsGetName(cons0), SCIPconsGetName(cons1));
11593 /* update flags of constraint which caused the redundancy s.t. nonredundant information doesn't get lost */
11600 else if( cons0dominateslhs && (!cons1isequality || cons0dominatesrhs || SCIPisInfinity(scip, consdata1->rhs)) )
11611 SCIPdebugMessage("linear constraints <%s> and <%s> are infeasible\n", SCIPconsGetName(cons0), SCIPconsGetName(cons1));
11623 /* update flags of constraint which caused the redundancy s.t. nonredundant information doesn't get lost */
11630 if( cons1dominatesrhs && (!cons0isequality || cons1dominateslhs || SCIPisInfinity(scip, -consdata0->lhs)) )
11641 SCIPdebugMessage("linear constraints <%s> and <%s> are infeasible\n", SCIPconsGetName(cons0), SCIPconsGetName(cons1));
11654 /* update flags of constraint which caused the redundancy s.t. nonredundant information doesn't get lost */
11661 else if( cons0dominatesrhs && (!cons1isequality || cons0dominateslhs || SCIPisInfinity(scip, -consdata1->lhs)) )
11672 SCIPdebugMessage("linear constraints <%s> and <%s> are infeasible\n", SCIPconsGetName(cons0), SCIPconsGetName(cons1));
11684 /* update flags of constraint which caused the redundancy s.t. nonredundant information doesn't get lost */
11701 /* update flags of constraint which caused the redundancy s.t. nonredundant information doesn't get lost */
11716 /* update flags of constraint which caused the redundancy s.t. nonredundant information doesn't get lost */
11738 SCIP_CALL( aggregateConstraints(scip, cons0, cons1, commonidx0, commonidx1, diffidx0minus1, diffidx1minus0,
11750 if( !aggregated && cons0isequality && !consdata1->upgraded && commonidxweight > diffidx0minus1weight )
11753 SCIP_CALL( aggregateConstraints(scip, cons1, cons0, commonidx1, commonidx0, diffidx1minus0, diffidx0minus1,
11803 * redlb[v] == k : if x_v >= k, we can always round x_v down to x_v == k without violating any constraint
11804 * redub[v] == k : if x_v <= k, we can always round x_v up to x_v == k without violating any constraint
11817 * This is because then, the value of the variable is either determined by one of its bounds or
11839 /* copy the variable array since this array might change during the curse of this algorithm */
11880 /* we only need to consider constraints that have been locked (i.e., checked constraints or constraints that are
11914 assert(0 <= contv && contv < ncontvars); /* variable should be active due to applyFixings() */
11966 consdataGetGlbActivityResiduals(scip, consdata, var, val, FALSE, &minresactivity, &maxresactivity,
11976 if( !isminsettoinfinity && SCIPisUpdateUnreliable(scip, minresactivity, consdata->lastglbminactivity) )
11980 if( !ismaxsettoinfinity && SCIPisUpdateUnreliable(scip, maxresactivity, consdata->lastglbmaxactivity) )
11986 assert(0 <= arrayindex && arrayindex < nvars); /* variable should be active due to applyFixings() */
12055 /* there is more than one continuous variable or the integer variables have fractional coefficients:
12073 /* there is exactly one continuous variable and the integer variables have integral coefficients:
12074 * this is the interesting case, and we have to check whether the coefficient is +/-1 and the corresponding
12127 * if largest bound to make constraints redundant is -infinity, we better do nothing for numerical reasons
12135 /* if x_v >= redlb[v], we can always round x_v down to x_v == redlb[v] without violating any constraint
12138 SCIPdebugMessage("variable <%s> only locked down in linear constraints: dual presolve <%s>[%.15g,%.15g] <= %.15g\n",
12154 * if smallest bound to make constraints redundant is +infinity, we better do nothing for numerical reasons
12162 /* if x_v <= redub[v], we can always round x_v up to x_v == redub[v] without violating any constraint
12165 SCIPdebugMessage("variable <%s> only locked up in linear constraints: dual presolve <%s>[%.15g,%.15g] >= %.15g\n",
12204 SCIPdebugMessage("infeasible upgrade of variable <%s> to integral type, domain is empty\n", SCIPvarGetName(var));
12210 SCIPdebugMessage("dual presolve: converting continuous variable <%s>[%g,%g] to implicit integer\n",
12249 /** destructor of constraint handler to free constraint handler data (called when SCIP is exiting) */
12297 /** deinitialization method of constraint handler (called before transformed problem is freed) */
12345 || SCIPisInfinity(scip, -SCIPconsGetData(cons)->lhs) || SCIPisInfinity(scip, SCIPconsGetData(cons)->rhs) );
12360 /** presolving initialization method of constraint handler (called when presolving is about to begin) */
12439 /* is constraint of type SCIP_CONSTYPE_{SETPARTITION, SETPACKING, SETCOVERING, CARDINALITY, INVKNAPSACK}? */
12675 /** presolving deinitialization method of constraint handler (called after presolving has been finished) */
12718 SCIPstatisticMessage("below threshold: %d / %d ratio= %g\n", ngoodconss, nallconss, (100.0 * ngoodconss / nallconss));
12734 /* this is no problem reduction, because the upgraded constraint was added to the problem before, and the
12735 * (redundant) linear constraint was only kept in order to support presolving the the linear constraint handler
12741 /* since we are not allowed to detect infeasibility in the exitpre stage, we dont give an infeasible pointer */
12750 /** solving process deinitialization method of constraint handler (called before branch and bound process data is freed) */
12785 "(restart) converted %d cuts from the global cut pool into linear constraints\n", ncutsadded);
12786 /* an extra blank line should be printed separately since the buffer message handler only handles up to one
12854 SCIP_CALL( consdataCreate(scip, &targetdata, sourcedata->nvars, sourcedata->vars, sourcedata->vals, sourcedata->lhs, sourcedata->rhs) );
12857 SCIP_CALL( SCIPcreateCons(scip, targetcons, SCIPconsGetName(sourcecons), conshdlr, targetdata,
12858 SCIPconsIsInitial(sourcecons), SCIPconsIsSeparated(sourcecons), SCIPconsIsEnforced(sourcecons),
12861 SCIPconsIsDynamic(sourcecons), SCIPconsIsRemovable(sourcecons), SCIPconsIsStickingAtNode(sourcecons)) );
12874 /** LP initialization method of constraint handler (called before the initial LP relaxation at a node is solved) */
12927 if( (depth == 0 && conshdlrdata->maxroundsroot >= 0 && nrounds >= conshdlrdata->maxroundsroot)
12950 SCIP_CALL( separateCons(scip, conss[c], conshdlrdata, NULL, separatecards, conshdlrdata->separateall, &ncuts, &cutoff) );
12993 if( (depth == 0 && conshdlrdata->maxroundsroot >= 0 && nrounds >= conshdlrdata->maxroundsroot)
13008 SCIP_CALL( separateCons(scip, conss[c], conshdlrdata, sol, TRUE, conshdlrdata->separateall, &ncuts, &cutoff) );
13129 SCIPdebugMessage("-> constraints checked, %s\n", *result == SCIP_FEASIBLE ? "all constraints feasible" : "infeasibility detected");
13181 SCIPinfoMessage(scip, NULL, "violation: left hand side is violated by %.15g\n", consdata->lhs - activity);
13184 SCIPinfoMessage(scip, NULL, "violation: right hand side is violated by %.15g\n", activity - consdata->rhs);
13214 /* check, if we want to tighten variable's bounds (in probing, we always want to tighten the bounds) */
13227 && ((tightenboundsfreq == 0 && depth == 0) || (tightenboundsfreq >= 1 && (depth % tightenboundsfreq == 0)));
13237 SCIP_CALL( propagateCons(scip, conss[i], tightenbounds, conshdlrdata->sortvars, &cutoff, &nchgbds) );
13340 /* remember the first constraint that was not yet tried to be upgraded, to begin the next upgrading round with */
13353 /* apply presolving as long as possible on the single constraint (however, abort after a certain number of rounds
13392 consdataGetActivityBounds(scip, consdata, TRUE, &minactivity, &maxactivity, &minactisrelax, &maxactisrelax);
13393 if( SCIPisFeasGT(scip, minactivity, consdata->rhs) || SCIPisFeasLT(scip, maxactivity, consdata->lhs) )
13395 SCIPdebugMessage("linear constraint <%s> is infeasible: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
13400 else if( SCIPisFeasGE(scip, minactivity, consdata->lhs) && SCIPisFeasLE(scip, maxactivity, consdata->rhs) )
13402 SCIPdebugMessage("linear constraint <%s> is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
13411 else if( !SCIPisInfinity(scip, -consdata->lhs) && SCIPisFeasGE(scip, minactivity, consdata->lhs) )
13413 SCIPdebugMessage("linear constraint <%s> left hand side is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
13419 else if( !SCIPisInfinity(scip, consdata->rhs) && SCIPisFeasLE(scip, maxactivity, consdata->rhs) )
13421 SCIPdebugMessage("linear constraint <%s> right hand side is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
13451 /* reduce big-M coefficients, that make the constraint redundant if the variable is on a bound */
13474 SCIP_CALL( extractCliques(scip, cons, conshdlrdata->sortvars, nfixedvars, nchgbds, &cutoff) );
13501 SCIP_CALL( convertEquality(scip, cons, conshdlrdata, &cutoff, nfixedvars, naggrvars, ndelconss) );
13520 /* remember the first constraint that was not yet tried to be upgraded, to begin the next upgrading round with */
13527 * only apply this expensive procedure, if the single constraint preprocessing did not find any reductions
13530 if( !cutoff && (conshdlrdata->presolusehashing || conshdlrdata->presolpairwise) && !SCIPisStopped(scip) )
13532 if( *nfixedvars == oldnfixedvars && *naggrvars == oldnaggrvars && *nchgbds == oldnchgbds && *ndelconss == oldndelconss
13539 /* detect redundant constraints; fast version with hash table instead of pairwise comparison */
13540 SCIP_CALL( detectRedundantConstraints(scip, SCIPblkmem(scip), conss, nconss, &firstchange, &cutoff,
13583 npaircomparisons += (SCIPconsGetData(conss[c])->changed) ? c : (c - firstchange); /*lint !e776*/
13586 SCIP_CALL( preprocessConstraintPairs(scip, usefulconss, firstchange, c, conshdlrdata->maxaggrnormscale,
13592 if( ((*ndelconss - oldndelconss) + (*nchgsides - oldnchgsides)/2.0 + (*nchgcoefs - oldnchgcoefs)/10.0) / ((SCIP_Real) npaircomparisons) < conshdlrdata->mingainpernmincomp )
13608 /* before upgrading, check whether we can apply some additional dual presolving, because a variable only appears
13612 && *nfixedvars == oldnfixedvars && *naggrvars == oldnaggrvars && *nchgbds == oldnchgbds && *ndelconss == oldndelconss
13623 * only upgrade constraints, if no reductions were found in this round (otherwise, the linear constraint handler
13624 * may find additional reductions before giving control away to other (less intelligent?) constraint handlers)
13627 && *nfixedvars == oldnfixedvars && *naggrvars == oldnaggrvars && *nchgbds == oldnchgbds && *ndelconss == oldndelconss
13642 /* only upgrade completely presolved constraints, that changed since the last upgrading call */
13671 * delete upgraded equalities, if we don't need it anymore for aggregation and redundancy checking
13691 else if( *nfixedvars > oldnfixedvars || *naggrvars > oldnaggrvars || *nchgbds > oldnchgbds || *ndelconss > oldndelconss
13710 SCIP_CALL( resolvePropagation(scip, cons, infervar, intToInferInfo(inferinfo), boundtype, bdchgidx, result) );
13816 SCIP_CALL( SCIPcopyConsLinear(scip, cons, sourcescip, consname, nvars, sourcevars, sourcecoefs,
13817 SCIPgetLhsLinear(sourcescip, sourcecons), SCIPgetRhsLinear(sourcescip, sourcecons), varmap, consmap,
13818 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, global, valid) );
13858 if( isdigit((unsigned char)str[0]) || ((str[0] == '-' || str[0] == '+') && isdigit((unsigned char)str[1])) )
13893 SCIP_CALL( SCIPparseVarsLinearsum(scip, str, vars, coefs, &nvars, coefssize, &requsize, &endptr, success) );
13902 SCIP_CALL( SCIPparseVarsLinearsum(scip, str, vars, coefs, &nvars, coefssize, &requsize, &endptr, success) );
13903 assert(!*success || requsize <= coefssize); /* if successful, then should have had enough space now */
13971 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
14004 /** constraint method of constraint handler which returns the number of variables (if possible) */
14060 /* reset maximal activity delta, so that it will be recalculated on the next real propagation */
14074 /* bound change can turn the constraint infeasible or redundant only if it was a tightening */
14081 /* check whether bound tightening might now be successful (if the current bound was relaxed, it might be
14110 /* reset maximal activity delta, so that it will be recalculated on the next real propagation */
14116 /* there is only one lock left: we may multi-aggregate the variable as slack of an equation */
14182 /* create array of variables and coefficients: sum_{i \in P} x_i - sum_{i \in N} x_i >= 1 - |N| */
14214 (void) SCIPsnprintf(consname, SCIP_MAXSTRLEN, "cf%"SCIP_LONGINT_FORMAT, SCIPgetNConflictConssApplied(scip));
14215 SCIP_CALL( SCIPcreateConsLinear(scip, &cons, consname, nbdchginfos, vars, vals, lhs, SCIPinfinity(scip),
14218 /* try to automatically convert a linear constraint into a more specific and more specialized constraint */
14246 /** upgrades quadratic constraints with only and at least one linear variables into a linear constraint
14315 SCIPgetNLinearVarsNonlinear(scip, cons), SCIPgetLinearVarsNonlinear(scip, cons), SCIPgetLinearCoefsNonlinear(scip, cons),
14346 SCIP_CALL( SCIPincludeConflicthdlrBasic(scip, &conflicthdlr, CONFLICTHDLR_NAME, CONFLICTHDLR_DESC, CONFLICTHDLR_PRIORITY,
14376 SCIP_CALL( SCIPsetConshdlrPresol(scip, conshdlr, consPresolLinear, CONSHDLR_MAXPREROUNDS, CONSHDLR_DELAYPRESOL) );
14378 SCIP_CALL( SCIPsetConshdlrProp(scip, conshdlr, consPropLinear, CONSHDLR_PROPFREQ, CONSHDLR_DELAYPROP,
14381 SCIP_CALL( SCIPsetConshdlrSepa(scip, conshdlr, consSepalpLinear, consSepasolLinear, CONSHDLR_SEPAFREQ,
14388 SCIP_CALL( SCIPincludeQuadconsUpgrade(scip, upgradeConsQuadratic, QUADCONSUPGD_PRIORITY, TRUE, CONSHDLR_NAME) );
14394 SCIP_CALL( SCIPincludeNonlinconsUpgrade(scip, upgradeConsNonlinear, NULL, NONLINCONSUPGD_PRIORITY, TRUE, CONSHDLR_NAME) );
14400 "multiplier on propagation frequency, how often the bounds are tightened (-1: never, 0: only at root)",
14401 &conshdlrdata->tightenboundsfreq, TRUE, DEFAULT_TIGHTENBOUNDSFREQ, -1, INT_MAX, NULL, NULL) );
14436 "maximal allowed relative gain in maximum norm for constraint aggregation (0.0: disable constraint aggregation)",
14437 &conshdlrdata->maxaggrnormscale, TRUE, DEFAULT_MAXAGGRNORMSCALE, 0.0, SCIP_REAL_MAX, NULL, NULL) );
14440 "maximal relative distance from current node's dual bound to primal bound compared to best node's dual bound for separating knapsack cardinality cuts",
14444 "should all constraints be subject to cardinality cut generation instead of only the ones with non-zero dual value?",
14459 "constraints/"CONSHDLR_NAME"/sortvars", "apply binaries sorting in decr. order of coeff abs value?",
14463 "should the violation for a constraint with side 0.0 be checked relative to 1.0 (FALSE) or to the maximum absolute value in the activity (TRUE)?",
14467 "should presolving try to detect constraints parallel to the objective function defining an upper bound and prevent these constraints from entering the LP?",
14471 "should presolving try to detect constraints parallel to the objective function defining a lower bound and prevent these constraints from entering the LP?",
14520 (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/linear/upgrade/%s", conshdlrname);
14521 (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "enable linear upgrading for constraint handler <%s>", conshdlrname);
14532 * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
14561 SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
14563 SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
14588 /* for the solving process we need linear rows, containing only active variables; therefore when creating a linear
14604 SCIP_CALL( SCIPgetProbvarLinearSum(scip, consvars, consvals, &nconsvars, nconsvars, &constant, &requiredsize, TRUE) );
14612 SCIP_CALL( SCIPgetProbvarLinearSum(scip, consvars, consvals, &nconsvars, requiredsize, &constant, &requiredsize, TRUE) );
14626 SCIPerrorMessage("try to generate inconsistent constraint <%s>, active variables leads to a infinite constant constradict the infinite left hand side of the constraint\n", name);
14636 SCIPerrorMessage("try to generate inconsistent constraint <%s>, active variables leads to a infinite constant constradict the infinite right hand side of the constraint\n", name);
14652 SCIPerrorMessage("try to generate inconsistent constraint <%s>, active variables leads to a infinite constant constradict the infinite left hand side of the constraint\n", name);
14662 SCIPerrorMessage("try to generate inconsistent constraint <%s>, active variables leads to a infinite constant constradict the infinite right hand side of the constraint\n", name);
14705 SCIP_CALL( SCIPcreateCons(scip, cons, name, conshdlr, consdata, initial, separate, enforce, check, propagate,
14719 * in its most basic version, i. e., all constraint flags are set to their basic value as explained for the
14720 * method SCIPcreateConsLinear(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h
14724 * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
14753 SCIP_Real* sourcecoefs, /**< coefficient array of the linear constraint, or NULL if all coefficients are one */
14756 SCIP_HASHMAP* varmap, /**< a SCIP_HASHMAP mapping variables of the source SCIP to corresponding
14758 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
14768 SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup? */
14769 SCIP_Bool stickingatnode, /**< should the constraint always be kept at the node where it was added, even
14793 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
14814 /* transform source variable to active variables of the source SCIP since only these can be mapped to variables of
14819 SCIP_CALL( SCIPgetProbvarLinearSum(sourcescip, vars, coefs, &nvars, nvars, &constant, &requiredsize, TRUE) );
14826 SCIP_CALL( SCIPgetProbvarLinearSum(sourcescip, vars, coefs, &nvars, requiredsize, &constant, &requiredsize, TRUE) );
14860 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
14888 /* for the solving process we need linear rows, containing only active variables; therefore when creating a linear
14910 SCIP_CALL( SCIPgetProbvarLinearSum(scip, consvars, consvals, &nconsvars, nconsvars, &constant, &requiredsize, TRUE) );
14918 SCIP_CALL( SCIPgetProbvarLinearSum(scip, consvars, consvals, &nconsvars, requiredsize, &constant, &requiredsize, TRUE) );
14939 SCIPerrorMessage("adding variable <%s> leads to inconsistent constraint <%s>, active variables leads to a infinite constant constradict the infinite left hand side of the constraint\n", SCIPvarGetName(var), SCIPconsGetName(cons));
14949 SCIPerrorMessage("adding variable <%s> leads to inconsistent constraint <%s>, active variables leads to a infinite constant constradict the infinite right hand side of the constraint\n", SCIPvarGetName(var), SCIPconsGetName(cons));
14965 SCIPerrorMessage("adding variable <%s> leads to inconsistent constraint <%s>, active variables leads to a infinite constant constradict the infinite left hand side of the constraint\n", SCIPvarGetName(var), SCIPconsGetName(cons));
14975 SCIPerrorMessage("adding variable <%s> leads to inconsistent constraint <%s>, active variables leads to a infinite constant constradict the infinite right hand side of the constraint\n", SCIPvarGetName(var), SCIPconsGetName(cons));
15136 /** gets the array of variables in the linear constraint; the user must not modify this array! */
15160 /** gets the array of coefficient values in the linear constraint; the user must not modify this array! */
15294 /** returns the linear relaxation of the given linear constraint; may return NULL if no LP row was yet created;
15320 /** tries to automatically convert a linear constraint into a more specific and more specialized constraint */
15361 /* we cannot upgrade a modifiable linear constraint, since we don't know what additional coefficients to expect */
15383 /* check, if the constraint was already upgraded and will be deleted anyway after preprocessing */
15392 SCIPerrorMessage("cannot upgrade linear constraint that is already stored as row in the LP\n");
15512 SCIPdebugMessage(" +bin=%d -bin=%d +int=%d -int=%d +impl=%d -impl=%d +cont=%d -cont=%d +1=%d -1=%d +I=%d -I=%d +F=%d -F=%d possum=%.15g negsum=%.15g integral=%u\n",
15524 nposbin, nnegbin, nposint, nnegint, nposimpl, nnegimpl, nposimplbin, nnegimplbin, nposcont, nnegcont,
15535 SCIPdebugMessage(" -> upgraded to constraint type <%s>\n", SCIPconshdlrGetName(SCIPconsGetHdlr(*upgdcons)));
|