|
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_NEEDSCONS TRUE /**< should the constraint handler be skipped, if no constraints are available? */
75 #define CONSHDLR_PRESOLTIMING (SCIP_PRESOLTIMING_FAST | SCIP_PRESOLTIMING_EXHAUSTIVE) /**< presolving timing of the constraint handler (fast, medium, or exhaustive) */
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_MAXEASYACTIVITYDELTA 1e6 /**< maximum activity delta to run easy propagation on linear constraint
103 #define DEFAULT_MAXCARDBOUNDDIST 0.0 /**< maximal relative distance from current node's dual bound to primal bound compared
105 #define DEFAULT_SEPARATEALL FALSE /**< should all constraints be subject to cardinality cut generation instead of only
107 #define DEFAULT_AGGREGATEVARIABLES TRUE /**< should presolving search for redundant variables in equations */
108 #define DEFAULT_SIMPLIFYINEQUALITIES TRUE /**< should presolving try to simplify inequalities */
110 #define DEFAULT_DETECTCUTOFFBOUND TRUE /**< should presolving try to detect constraints parallel to the objective
113 #define DEFAULT_DETECTLOWERBOUND TRUE /**< should presolving try to detect constraints parallel to the objective
116 #define DEFAULT_DETECTPARTIALOBJECTIVE TRUE/**< should presolving try to detect subsets of constraints parallel to the
119 #define DEFAULT_RANGEDROWARTCONS TRUE /**< should presolving and propagation extract sub-constraints from ranged rows and equations? */
123 #define DEFAULT_MULTAGGRREMOVE FALSE /**< should multi-aggregations only be performed if the constraint can be
128 #define MAXSCALEDCOEFINTEGER 1e+05 /**< maximal coefficient value after scaling if all variables are of integral
132 #define HASHSIZE_LINEARCONS 131101 /**< minimal size of hash table in linear constraint tables */
134 #define QUADCONSUPGD_PRIORITY 1000000 /**< priority of the constraint handler for upgrading of quadratic constraints */
135 #define NONLINCONSUPGD_PRIORITY 1000000 /**< priority of the constraint handler for upgrading of nonlinear constraints */
140 {
161 /* @todo add multi-aggregation of variables that are in exactly two equations (, if not numerically an issue),
172 SCIP_Real minactivity; /**< minimal value w.r.t. the variable's local bounds for the constraint's
174 SCIP_Real maxactivity; /**< maximal value w.r.t. the variable's local bounds for the constraint's
180 SCIP_Real glbminactivity; /**< minimal value w.r.t. the variable's global bounds for the constraint's
182 SCIP_Real glbmaxactivity; /**< maximal value w.r.t. the variable's global bounds for the constraint's
184 SCIP_Real lastglbminactivity; /**< last global minimal activity which was computed by complete summation
186 SCIP_Real lastglbmaxactivity; /**< last global maximal activity which was computed by complete summation
188 SCIP_Real maxactdelta; /**< maximal activity contribution of a single variable, or SCIP_INVALID if invalid */
189 SCIP_VAR* maxactdeltavar; /**< variable with maximal activity contribution, or NULL if invalid */
196 int minactivityneginf; /**< number of coefficients contributing with neg. infinite value to minactivity */
197 int minactivityposinf; /**< number of coefficients contributing with pos. infinite value to minactivity */
198 int maxactivityneginf; /**< number of coefficients contributing with neg. infinite value to maxactivity */
199 int maxactivityposinf; /**< number of coefficients contributing with pos. infinite value to maxactivity */
200 int minactivityneghuge; /**< number of coefficients contributing with huge neg. value to minactivity */
201 int minactivityposhuge; /**< number of coefficients contributing with huge pos. value to minactivity */
202 int maxactivityneghuge; /**< number of coefficients contributing with huge neg. value to maxactivity */
203 int maxactivityposhuge; /**< number of coefficients contributing with huge pos. value to maxactivity */
204 int glbminactivityneginf;/**< number of coefficients contrib. with neg. infinite value to glbminactivity */
205 int glbminactivityposinf;/**< number of coefficients contrib. with pos. infinite value to glbminactivity */
206 int glbmaxactivityneginf;/**< number of coefficients contrib. with neg. infinite value to glbmaxactivity */
207 int glbmaxactivityposinf;/**< number of coefficients contrib. with pos. infinite value to glbmaxactivity */
208 int glbminactivityneghuge;/**< number of coefficients contrib. with huge neg. value to glbminactivity */
209 int glbminactivityposhuge;/**< number of coefficients contrib. with huge pos. value to glbminactivity */
210 int glbmaxactivityneghuge;/**< number of coefficients contrib. with huge neg. value to glbmaxactivity */
211 int glbmaxactivityposhuge;/**< number of coefficients contrib. with huge pos. value to glbmaxactivity */
228 unsigned int changed:1; /**< was constraint changed since last aggregation round in preprocessing? */
231 unsigned int upgraded:1; /**< is the constraint upgraded and will it be removed after preprocessing? */
236 unsigned int binvarssorted:1; /**< are binary variables sorted w.r.t. the absolute of their coefficient? */
238 unsigned int hascontvar:1; /**< does the constraint contain at least one continuous variable? */
239 unsigned int hasnonbinvar:1; /**< does the constraint contain at least one non-binary variable? */
240 unsigned int hasnonbinvalid:1; /**< is the information stored in hasnonbinvar and hascontvar valid? */
241 unsigned int rangedrowpropagation:1; /**< did we perform ranged row propagation on this constraint? */
256 SCIP_LINCONSUPGRADE** linconsupgrades; /**< linear constraint upgrade methods for specializing linear constraints */
257 SCIP_Real maxaggrnormscale; /**< maximal allowed relative gain in maximum norm for constraint aggregation
259 SCIP_Real maxcardbounddist; /**< maximal relative distance from current node's dual bound to primal bound compared
261 SCIP_Real mingainpernmincomp; /**< minimal gain per minimal pairwise presolving comparisons to repeat pairwise comparison round */
262 SCIP_Real maxeasyactivitydelta;/**< maximum activity delta to run easy propagation on linear constraint
266 int tightenboundsfreq; /**< multiplier on propagation frequency, how often the bounds are tightened */
273 SCIP_Bool presolpairwise; /**< should pairwise constraint comparison be performed in presolving? */
274 SCIP_Bool presolusehashing; /**< should hash table be used for detecting redundant constraints in advance */
275 SCIP_Bool separateall; /**< should all constraints be subject to cardinality cut generation instead of only
277 SCIP_Bool aggregatevariables; /**< should presolving search for redundant variables in equations */
278 SCIP_Bool simplifyinequalities;/**< should presolving try to cancel down or delete coefficients in inequalities */
281 SCIP_Bool checkrelmaxabs; /**< should the violation for a constraint with side 0.0 be checked relative
283 SCIP_Bool detectcutoffbound; /**< should presolving try to detect constraints parallel to the objective
286 SCIP_Bool detectlowerbound; /**< should presolving try to detect constraints parallel to the objective
289 SCIP_Bool detectpartialobjective;/**< should presolving try to detect subsets of constraints parallel to
291 SCIP_Bool rangedrowpropagation;/**< should presolving and propagation try to improve bounds, detect
294 SCIP_Bool rangedrowartcons; /**< should presolving and propagation extract sub-constraints from ranged rows and equations?*/
297 SCIP_Bool multaggrremove; /**< should multi-aggregations only be performed if the constraint can be
320 PROPRULE_1_RANGEDROW = 3, /**< fixed variables and gcd of all left variables tighten bounds of a
330 {
332 {
338 };
359 {
390 assert(pos >= 0);
400 /** constructs an inference information out of a propagation rule and a position number, returns info as int */
433 conshdlrdata->linconsupgradessize = newsize;
461 SCIP_CALL( SCIPreallocBlockMemoryArray(scip, &consdata->eventdata, consdata->varssize, newsize) );
577 SCIPwarningMessage(scip, "Try to add already known upgrade message %p for constraint handler %s.\n", linconsupgd, conshdlrname);
600 SCIP_CALL( conshdlrdataEnsureLinconsupgradesSize(scip, conshdlrdata, conshdlrdata->nlinconsupgrades+1) );
604 {
618 /** installs rounding locks for the given variable associated to the given coefficient in the linear constraint */
651 /** removes rounding locks for the given variable associated to the given coefficient in the linear constraint */
825 return (SCIPgetStage(scip) >= SCIP_STAGE_TRANSFORMED && SCIPgetStage(scip) < SCIP_STAGE_FREETRANS);
969 SCIP_CALL( SCIPgetTransformedVars(scip, (*consdata)->nvars, (*consdata)->vars, (*consdata)->vars) );
1001 }
1041 SCIP_CALL( SCIPwriteVarsLinearsum(scip, file, consdata->vars, consdata->vals, consdata->nvars, TRUE) );
1122 bound = (SCIPvarGetBestBoundType(consdata->vars[i]) == SCIP_BOUNDTYPE_LOWER) ? SCIPvarGetLbLocal(consdata->vars[i]) : SCIPvarGetUbLocal(consdata->vars[i]);
1168 bound = (consdata->vals[i] > 0.0 ) ? SCIPvarGetLbLocal(consdata->vars[i]) : SCIPvarGetUbLocal(consdata->vars[i]);
1170 && !SCIPisHugeValue(scip, consdata->vals[i] * bound) && !SCIPisHugeValue(scip, -consdata->vals[i] * bound) )
1172 }
1195 bound = (consdata->vals[i] > 0.0 ) ? SCIPvarGetUbLocal(consdata->vars[i]) : SCIPvarGetLbLocal(consdata->vars[i]);
1197 && !SCIPisHugeValue(scip, consdata->vals[i] * bound) && !SCIPisHugeValue(scip, -consdata->vals[i] * bound) )
1199 }
1222 bound = (consdata->vals[i] > 0.0 ) ? SCIPvarGetLbGlobal(consdata->vars[i]) : SCIPvarGetUbGlobal(consdata->vars[i]);
1248 bound = (consdata->vals[i] > 0.0 ) ? SCIPvarGetUbGlobal(consdata->vars[i]) : SCIPvarGetLbGlobal(consdata->vars[i]);
1284 /** checks the type of all variables of the constraint and sets hasnonbinvar and hascontvar flags accordingly */
1433 SCIP_Bool checkreliability /**< should the reliability of the recalculated activity be checked? */
1481 * lower bound + neg. coef: update maxactivity, positive and negative infinity counters have to be switched
1483 * upper bound + neg. coef: update minactivity, positive and negative infinity counters have to be switched
1537 * lower bound + neg. coef: update maxactivity, positive and negative infinity counters have to be switched
1539 * upper bound + neg. coef: update minactivity, positive and negative infinity counters have to be switched
1600 /* if the bound changed to -infinity, increase the counter for negative infinite contributions */
1628 /* if the bound changed to +infinity, increase the counter for positive infinite contributions */
1651 * but checking here that the bound is not huge again would not handle a change from a huge to an infinite bound
1655 /* if the bound changed to +infinity, increase the counter for positive infinite contributions */
1658 /* if the bound changed to -infinity, increase the counter for negative infinite contributions */
1661 /* if the contribution of this variable is too large and positive, increase the corresponding counter */
1666 /* if the contribution of this variable is too large and negative, increase the corresponding counter */
1681 * but checking here that the bound is not huge again would not handle a change from a huge to an infinite bound
1685 /* if the bound changed to +infinity, increase the counter for positive infinite contributions */
1688 /* if the bound changed to -infinity, increase the counter for negative infinite contributions */
1691 /* if the contribution of this variable is too large and positive, increase the corresponding counter */
1696 /* if the contribution of this variable is too large and negative, increase the corresponding counter */
1740 /* update the activity, if the current value is valid and there was a change in the finite part */
1789 SCIP_Bool checkreliability /**< should the reliability of the recalculated activity be checked? */
1798 consdataUpdateActivities(scip, consdata, var, oldlb, newlb, val, SCIP_BOUNDTYPE_LOWER, FALSE, checkreliability);
1800 assert(!SCIPisInfinity(scip, -consdata->minactivity) && !SCIPisInfinity(scip, consdata->minactivity));
1801 assert(!SCIPisInfinity(scip, -consdata->maxactivity) && !SCIPisInfinity(scip, consdata->maxactivity));
1814 SCIP_Bool checkreliability /**< should the reliability of the recalculated activity be checked? */
1823 consdataUpdateActivities(scip, consdata, var, oldub, newub, val, SCIP_BOUNDTYPE_UPPER, FALSE, checkreliability);
1825 assert(!SCIPisInfinity(scip, -consdata->minactivity) && !SCIPisInfinity(scip, consdata->minactivity));
1826 assert(!SCIPisInfinity(scip, -consdata->maxactivity) && !SCIPisInfinity(scip, consdata->maxactivity));
1838 SCIP_Bool checkreliability /**< should the reliability of the recalculated activity be checked? */
1846 consdataUpdateActivities(scip, consdata, NULL, oldlb, newlb, val, SCIP_BOUNDTYPE_LOWER, TRUE, checkreliability);
1848 assert(!SCIPisInfinity(scip, -consdata->glbminactivity) && !SCIPisInfinity(scip, consdata->glbminactivity));
1849 assert(!SCIPisInfinity(scip, -consdata->glbmaxactivity) && !SCIPisInfinity(scip, consdata->glbmaxactivity));
1861 SCIP_Bool checkreliability /**< should the reliability of the recalculated activity be checked? */
1869 consdataUpdateActivities(scip, consdata, NULL, oldub, newub, val, SCIP_BOUNDTYPE_UPPER, TRUE, checkreliability);
1871 assert(!SCIPisInfinity(scip, -consdata->glbminactivity) && !SCIPisInfinity(scip, consdata->glbminactivity));
1872 assert(!SCIPisInfinity(scip, -consdata->glbmaxactivity) && !SCIPisInfinity(scip, consdata->glbmaxactivity));
1876 /** updates minimum and maximum activity and maximum absolute value for coefficient addition */
1883 SCIP_Bool checkreliability /**< should the reliability of the recalculated activity be checked? */
1909 consdataUpdateActivitiesLb(scip, consdata, var, 0.0, SCIPvarGetLbLocal(var), val, checkreliability);
1910 consdataUpdateActivitiesUb(scip, consdata, var, 0.0, SCIPvarGetUbLocal(var), val, checkreliability);
1911 consdataUpdateActivitiesGlbLb(scip, consdata, 0.0, SCIPvarGetLbGlobal(var), val, checkreliability);
1912 consdataUpdateActivitiesGlbUb(scip, consdata, 0.0, SCIPvarGetUbGlobal(var), val, checkreliability);
1916 /** updates minimum and maximum activity for coefficient deletion, invalidates maximum absolute value if necessary */
1923 SCIP_Bool checkreliability /**< should the reliability of the recalculated activity be checked? */
1952 consdataUpdateActivitiesLb(scip, consdata, var, SCIPvarGetLbLocal(var), 0.0, val, checkreliability);
1953 consdataUpdateActivitiesUb(scip, consdata, var, SCIPvarGetUbLocal(var), 0.0, val, checkreliability);
1954 consdataUpdateActivitiesGlbLb(scip, consdata, SCIPvarGetLbGlobal(var), 0.0, val, checkreliability);
1955 consdataUpdateActivitiesGlbUb(scip, consdata, SCIPvarGetUbGlobal(var), 0.0, val, checkreliability);
1959 /** updates minimum and maximum activity for coefficient change, invalidates maximum absolute value if necessary */
1967 SCIP_Bool checkreliability /**< should the reliability of the recalculated activity be checked? */
2023 /* reset maximal activity delta, so that it will be recalculated on the next real propagation */
2029 /* @todo do something more clever here, e.g. if oldval * newval >= 0, do the update directly */
2110 /** gets minimal activity for constraint and given values of counters for infinite and huge contributions
2111 * and (if needed) delta to subtract from stored finite part of activity in case of a residual activity
2124 SCIP_Bool goodrelax, /**< should a good relaxation be computed or are relaxed acticities ignored, anyway? */
2128 SCIP_Bool* issettoinfinity /**< pointer to store whether minactivity was set to infinity or calculated */
2130 {
2155 /* if we have neg. huge contributions, we only know that -infty is a relaxation of the minactivity */
2162 /* we do not need a good relaxation and we have positve huge contributions, so we just return -infty as activity */
2193 * times the minimum value counting as "huge" plus finite (and non-huge) part of minactivity - delta
2211 /** gets maximal activity for constraint and given values of counters for infinite and huge contributions
2212 * and (if needed) delta to subtract from stored finite part of activity in case of a residual activity
2225 SCIP_Bool goodrelax, /**< should a good relaxation be computed or are relaxed acticities ignored, anyway? */
2229 SCIP_Bool* issettoinfinity /**< pointer to store whether maxactivity was set to infinity or calculated */
2231 {
2256 /* if we have pos. huge contributions, we only know that +infty is a relaxation of the maxactivity */
2263 /* we do not need a good relaxation and we have positve huge contributions, so we just return +infty as activity */
2294 * times the minimum value counting as "huge" plus the finite (and non-huge) part of maxactivity minus delta
2321 SCIP_Bool* minisrelax, /**< pointer to store whether the returned minactivity is just a relaxation,
2324 SCIP_Bool* maxisrelax /**< pointer to store whether the returned maxactivity is just a relaxation,
2450 SCIP_Bool* minisrelax, /**< pointer to store whether the returned residual minactivity is just a
2453 SCIP_Bool* maxisrelax, /**< pointer to store whether the returned residual maxactivity is just a
2456 SCIP_Bool* isminsettoinfinity, /**< pointer to store whether minresactivity was set to infinity or calculated */
2457 SCIP_Bool* ismaxsettoinfinity /**< pointer to store whether maxresactivity was set to infinity or calculated */
2505 /* get/compute minactivity by calling getMinActivity() with updated counters for infinite and huge values
2506 * and contribution of variable set to zero that has to be subtracted from finite part of activity
2543 consdata->minactivityposhuge, consdata->minactivityneghuge, absval * minactbound, FALSE, goodrelax,
2547 /* get/compute maxactivity by calling getMaxActivity() with updated counters for infinite and huge values
2548 * and contribution of variable set to zero that has to be subtracted from finite part of activity
2585 consdata->maxactivityposhuge, consdata->maxactivityneghuge, absval * maxactbound, FALSE, goodrelax,
2597 SCIP_Real* glbminactivity, /**< pointer to store the minimal activity, or NULL, if not needed */
2598 SCIP_Real* glbmaxactivity, /**< pointer to store the maximal activity, or NULL, if not needed */
2599 SCIP_Bool* minisrelax, /**< pointer to store whether the returned minactivity is just a relaxation,
2602 SCIP_Bool* maxisrelax, /**< pointer to store whether the returned maxactivity is just a relaxation,
2605 SCIP_Bool* isminsettoinfinity, /**< pointer to store whether minresactivity was set to infinity or calculated */
2606 SCIP_Bool* ismaxsettoinfinity /**< pointer to store whether maxresactivity was set to infinity or calculated */
2608 {
2661 SCIP_Real* minresactivity, /**< pointer to store the minimal residual activity, or NULL, if not needed */
2662 SCIP_Real* maxresactivity, /**< pointer to store the maximal residual activity, or NULL, if not needed */
2663 SCIP_Bool* minisrelax, /**< pointer to store whether the returned residual minactivity is just a
2666 SCIP_Bool* maxisrelax, /**< pointer to store whether the returned residual maxactivity is just a
2669 SCIP_Bool* isminsettoinfinity, /**< pointer to store whether minresactivity was set to infinity or calculated */
2670 SCIP_Bool* ismaxsettoinfinity /**< pointer to store whether maxresactivity was set to infinity or calculated */
2712 /* get/compute minactivity by calling getMinActivity() with updated counters for infinite and huge values
2713 * and contribution of variable set to zero that has to be subtracted from finite part of activity
2719 getMinActivity(scip, consdata, consdata->glbminactivityposinf - 1, consdata->glbminactivityneginf,
2727 getMinActivity(scip, consdata, consdata->glbminactivityposinf, consdata->glbminactivityneginf - 1,
2760 /* get/compute maxactivity by calling getMaxActivity() with updated counters for infinite and huge values
2761 * and contribution of variable set to zero that has to be subtracted from finite part of activity
2767 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf, consdata->glbmaxactivityneginf - 1,
2775 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf - 1, consdata->glbmaxactivityneginf,
2843 else if( (SCIPisInfinity(scip, solval) && negsign) || (SCIPisInfinity(scip, -solval) && !negsign) )
2850 SCIPdebugMessage("activity of linear constraint: %.15g, %d positive infinity values, %d negative infinity values \n", activity, nposinf, nneginf);
2926 val = consdata->vals[pos];
2951 }
2953 /** index comparison method of linear constraints: compares two indices of the variable set in the linear constraint */
3090 /* count binary variables and permute variables such that binaries appear first in the sorted vars array */
3139 assert((v >= consdata->nbinvars && !SCIPvarIsBinary(vars[v])) || (v < consdata->nbinvars && SCIPvarIsBinary(vars[v])));
3230 /* the left hand side switched from -infinity to a non-infinite value -> install rounding locks */
3255 /* the left hand side switched from a non-infinite value to -infinity -> remove rounding locks */
3276 /* 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 */
3347 /* the right hand side switched from infinity to a non-infinite value -> install rounding locks */
3372 /* the right hand side switched from a non-infinite value to infinity -> remove rounding locks */
3393 /* 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 */
3540 && (SCIPvarCompare(consdata->vars[consdata->nvars-2], consdata->vars[consdata->nvars-1]) <= 0);
3627 consdata->sorted = consdata->sorted && (pos + 2 >= consdata->nvars || (SCIPvarCompare(consdata->vars[pos], consdata->vars[pos + 1]) <= 0));
3631 /* if at most one variable is left, the activities should be recalculated (to correspond exactly to the bounds
3643 /* if the variable defining the maximal activity delta was removed from the constraint, the maximal activity
3771 /* because SCIPisScalingIntegral uses another integrality check as SCIPfeasFloor, we add an additional 0.5 before
3779 SCIPwarningMessage(scip, "coefficient %.15g of variable <%s> in linear constraint <%s> scaled to zero (scalar: %.15g)\n",
3801 /* because SCIPisScalingIntegral uses another integrality check as SCIPfeasFloor, we add an additional 0.5 before
3813 /* because SCIPisScalingIntegral uses another integrality check as SCIPfeasCeil, we subtract 0.5 before ceiling up
3875 * Apply the following rules in the given order, until the sign of the factor is determined. Later rules only apply,
3880 * 4. the number of positive coefficients must not be smaller than the number of negative coefficients
3883 * Try to identify a rational representation of the fractional coefficients, and multiply all coefficients
3968 SCIPdebugMessage("divide linear constraint with %g, because all coefficents are in absolute value the same\n", maxabsval);
4011 epsilon = SCIPepsilon(scip) * 0.9; /* slightly decrease epsilon to be safe in rational conversion below */
4070 /* 3. the absolute value of the right hand side must be greater than that of the left hand side */
4079 /* 4. the number of positive coefficients must not be smaller than the number of negative coefficients */
4132 /* it might be that we have really big coefficients, but all are integral, in that case we want to divide them by
4152 SCIPdebugMessage("scale linear constraint with %" SCIP_LONGINT_FORMAT " to make coefficients integral\n", scm);
4191 SCIPdebugMessage("divide linear constraint by greatest common divisor %" SCIP_LONGINT_FORMAT "\n", gcd);
4260 /* if the variable defining the maximal activity delta was removed from the constraint, the maximal activity
4468 if( SCIPisEQ(scip, lhssubtrahend, consdata->lhs) && SCIPisFeasGE(scip, REALABS(lhssubtrahend), 1.0) )
4485 if( SCIPisEQ(scip, rhssubtrahend, consdata->rhs ) && SCIPisFeasGE(scip, REALABS(rhssubtrahend), 1.0) )
4500 /* if aggregated variables have been replaced, multiple entries of the same variable are possible and we have
4519 /** for each variable in the linear constraint, except the inferred variable, adds one bound to the conflict analysis'
4520 * candidate store (bound depends on sign of coefficient and whether the left or right hand side was the reason for the
4521 * inference variable's bound change); the conflict analysis can be initialized with the linear constraint being the
4529 SCIP_BDCHGIDX* bdchgidx, /**< bound change index (time stamp of bound change), or NULL for current time */
4554 /* for each variable, add the bound to the conflict queue, that is responsible for the minimal or maximal
4555 * residual value, depending on whether the left or right hand side is responsible for the bound change:
4560 /* if the variable is integral we only need to add reason bounds until the propagation could be applied */
4573 /* calculate the minimal and maximal global activity of all other variables involved in the constraint */
4578 consdataGetGlbActivityResiduals(scip, consdata, infervar, vals[inferpos], FALSE, &minresactivity, NULL,
4581 consdataGetGlbActivityResiduals(scip, consdata, infervar, vals[inferpos], FALSE, NULL, &maxresactivity,
4595 if( (reasonisrhs && !isminsettoinfinity && !minisrelax) || (!reasonisrhs && !ismaxsettoinfinity && !maxisrelax) ) /*lint !e644*/
4602 /* calculate the residual capacity that would be left, if the variable would be set to one more / one less
4658 /* rhs is reason and coeff is positive, or lhs is reason and coeff is negative -> lower bound */
4660 rescap -= vals[i] * (SCIPvarGetLbAtIndex(vars[i], bdchgidx, FALSE) - SCIPvarGetLbGlobal(vars[i]));
4664 /* lhs is reason and coeff is positive, or rhs is reason and coeff is negative -> upper bound */
4666 rescap -= vals[i] * (SCIPvarGetUbAtIndex(vars[i], bdchgidx, FALSE) - SCIPvarGetUbGlobal(vars[i]));
4686 /* rhs is reason and coeff is positive, or lhs is reason and coeff is negative -> lower bound is responsible */
4691 /* lhs is reason and coeff is positive, or rhs is reason and coeff is negative -> upper bound is responsible */
4699 /** for each variable in the linear ranged row constraint, except the inferred variable, adds the bounds of all fixed
4700 * variables to the conflict analysis' candidate store; the conflict analysis can be initialized
4701 * with the linear constraint being the conflict detecting constraint by using NULL as inferred variable
4708 SCIP_BDCHGIDX* bdchgidx, /**< bound change index (time stamp of bound change), or NULL for current time */
4739 if( !SCIPisEQ(scip, SCIPvarGetLbAtIndex(vars[v], bdchgidx, FALSE), SCIPvarGetLbGlobal(vars[v])) )
4745 if( !SCIPisEQ(scip, SCIPvarGetUbAtIndex(vars[v], bdchgidx, FALSE), SCIPvarGetUbGlobal(vars[v])) )
4755 if( SCIPisEQ(scip, SCIPvarGetLbAtIndex(vars[v], bdchgidx, FALSE), SCIPvarGetUbAtIndex(vars[v], bdchgidx, FALSE)) )
4757 /* add all bounds of fixed variables which lead to the boundchange of the given inference variable */
4814 /** resolves a propagation on the given variable by supplying the variables needed for applying the corresponding
4825 SCIP_BDCHGIDX* bdchgidx, /**< bound change index (time stamp of bound change), or NULL for current time */
4826 SCIP_RESULT* result /**< pointer to store the result of the propagation conflict resolving call */
4867 /* the bound of the variable was tightened, because the minimal or maximal residual activity of the linear
4868 * constraint (only taking the other variables into account) didn't leave enough space for a larger
4877 /* the bound of the variable was tightened, because the minimal or maximal residual activity of the linear
4878 * constraint (only taking the other variables into account) didn't leave enough space for a larger
4887 /* the bound of the variable was tightened, because some variables were already fixed and the leftover only allow
4899 SCIPerrorMessage("invalid inference information %d in linear constraint <%s> at position %d for %s bound of variable <%s>\n",
4910 /** analyzes conflicting bounds on given constraint, and adds conflict constraint to problem */
4919 if( (SCIPgetStage(scip) != SCIP_STAGE_SOLVING && !SCIPinProbing(scip)) || !SCIPisConflictAnalysisApplicable(scip) )
4925 /* add the conflicting bound for each variable of infeasible constraint to conflict candidate queue */
4952 infcountmax = consdata->maxactivityneginf
4974 SCIP_Bool force /**< should a possible bound change be forced even if below bound strengthening tolerance */
4998 SCIPdebugMessage("linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, activity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newub=%.15g\n",
4999 SCIPconsGetName(cons), SCIPvarGetName(var), lb, oldub, consdata->vals[pos], consdata->minactivity, consdata->maxactivity, consdata->lhs, consdata->rhs, newub);
5004 SCIP_CALL( SCIPinferVarUbCons(scip, var, newub, cons, getInferInt(proprule, pos), force, &infeasible, &tightened) );
5043 SCIP_Bool force /**< should a possible bound change be forced even if below bound strengthening tolerance */
5067 SCIPdebugMessage("linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, activity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newlb=%.15g\n",
5068 SCIPconsGetName(cons), SCIPvarGetName(var), oldlb, ub, consdata->vals[pos], consdata->minactivity, consdata->maxactivity, consdata->lhs, consdata->rhs, newlb);
5073 SCIP_CALL( SCIPinferVarLbCons(scip, var, newlb, cons, getInferInt(proprule, pos), force, &infeasible, &tightened) );
5109 SCIP_Bool force /**< should a possible bound change be forced even if below bound strengthening tolerance */
5172 /* if the minactivity is larger than the right hand side by feasibility epsilon, the constraint is infeasible */
5184 /* if the slack is zero in tolerances (or negative, but not enough to make the constraint infeasible), we set
5221 /* if the maxactivity is smaller than the left hand side by feasibility epsilon, the constraint is infeasible */
5233 /* if the slack is zero in tolerances (or negative, but not enough to make the constraint infeasible), we set
5269 /* if the minactivity is larger than the right hand side by feasibility epsilon, the constraint is infeasible */
5281 /* if the slack is zero in tolerances (or negative, but not enough to make the constraint infeasible), we set
5317 /* if the maxactivity is smaller than the left hand side by feasibility epsilon, the constraint is infeasible */
5329 /* if the slack is zero in tolerances (or negative, but not enough to make the constraint infeasible), we set
5361 /** analyzes conflicting bounds on given ranged row constraint, and adds conflict constraint to problem */
5384 if( (SCIPgetStage(scip) != SCIP_STAGE_SOLVING && !SCIPinProbing(scip)) || !SCIPisConflictAnalysisApplicable(scip) )
5390 /* add the conflicting fixed variables of this ranged row constraint to conflict candidate queue */
5402 /* checks ranged rows for possible solutions, it may detect infeasibility, fixings due to having only one possible
5403 * solution, boundtightening if having only two possible solutions or adds constraints which propagate a subset of
5482 if( (consdata->sorted || consdata->binvarssorted) && SCIPvarGetType(consdata->vars[1]) == SCIP_VARTYPE_CONTINUOUS )
5505 if( SCIPisEQ(scip, SCIPvarGetLbLocal(consdata->vars[v]), SCIPvarGetUbLocal(consdata->vars[v])) )
5537 * coefficient so that all variables in this group will have a gcd greater than 1, this group will be implicitly
5540 * the second group will contain all left unfixed variables and will be saved as infcheckvars with corresponding
5541 * coefficients as infcheckvals, the order of these variables should be the same as in the consdata object
5544 /* find first integral variables with integral coefficient greater than 1, thereby collecting all other unfixed
5554 /* partition the variables, do not change the order of collection, because it might be used later on */
5558 if( !SCIPisEQ(scip, SCIPvarGetLbLocal(consdata->vars[v]), SCIPvarGetUbLocal(consdata->vars[v])) )
5589 } while( v < consdata->nvars && SCIPisEQ(scip, SCIPvarGetLbLocal(consdata->vars[v]), SCIPvarGetUbLocal(consdata->vars[v])) );
5599 assert(!SCIPisEQ(scip, SCIPvarGetLbLocal(consdata->vars[v]), SCIPvarGetUbLocal(consdata->vars[v])));
5600 assert(SCIPisIntegral(scip, consdata->vals[v]) && SCIPvarGetType(consdata->vars[v]) != SCIP_VARTYPE_CONTINUOUS && REALABS(consdata->vals[v]) > 1.5);
5606 /* go on to partition the variables, do not change the order of collection, because it might be used later on;
5611 if( SCIPisEQ(scip, SCIPvarGetLbLocal(consdata->vars[v]), SCIPvarGetUbLocal(consdata->vars[v])) )
5627 if( !SCIPisIntegral(scip, consdata->vals[v]) || SCIPvarGetType(consdata->vars[v]) == SCIP_VARTYPE_CONTINUOUS ||
5669 /* it should not happen that all variables are of integral type and have a gcd >= 2, this should be done by
5729 SCIPdebugMessage("minactinfvarsinvalid = %u, minactinfvars = %g, maxactinfvarsinvalid = %u, maxactinfvars = %g, gcd = %lld, ninfcheckvars = %d, ncontvars = %d\n", minactinfvarsinvalid, minactinfvars, maxactinfvarsinvalid, maxactinfvars, gcd, ninfcheckvars, ncontvars);
5731 /* @todo maybe we took the wrong variables as infcheckvars we could try to exchange integer variables */
5732 /* @todo if minactinfvarsinvalid or maxactinfvarsinvalid are true, try to exchange both partitions to maybe get valid
5734 /* @todo calculate minactivity and maxactivity for all non-intcheckvars, and use this for better bounding,
5736 * that therefore the conflict variables in addConflictFixedVars() need to be extended by all variables which
5740 /* check if between left hand side and right hand side exist a feasible point, if not the constraint leads to
5745 SCIPdebugMessage("no feasible value exist, constraint <%s> lead to infeasibility", SCIPconsGetName(cons));
5750 SCIP_CALL( analyzeConflictRangedRow(scip, cons, infcheckvars, ninfcheckvars, NULL, SCIP_INVALID) );
5769 gcdinfvars = SCIPcalcGreComDiv(gcdinfvars, (SCIP_Longint)(REALABS(infcheckvals[v]) + feastol));
5777 /* compute solutions for this ranged row, if all variables are of integral type with integral coefficients */
5833 SCIPdebugMessage("here nsols %s %d, minsolvalue = %g, maxsolvalue = %g, ninfcheckvars = %d, nunfixedvars = %d\n",
5841 SCIPdebugMessage("no solution found; constraint <%s> lead to infeasibility\n", SCIPconsGetName(cons));
5846 SCIP_CALL( analyzeConflictRangedRow(scip, cons, infcheckvars, ninfcheckvars, NULL, SCIP_INVALID) );
5874 SCIP_CALL( analyzeConflictRangedRow(scip, cons, infcheckvars, ninfcheckvars, NULL, SCIP_INVALID) );
5898 if( !SCIPisEQ(scip, SCIPvarGetLbLocal(consdata->vars[v]), SCIPvarGetUbLocal(consdata->vars[v])) )
5910 if( SCIPisEQ(scip, SCIPvarGetLbLocal(consdata->vars[v2]), SCIPvarGetUbLocal(consdata->vars[v2])) )
5992 else if( !SCIPinProbing(scip) && SCIPgetDepth(scip) < 1 && !SCIPinRepropagation(scip) && addartconss &&
6000 (void)SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_artcons_%d", SCIPconsGetName(cons), conshdlrdata->naddconss);
6005 SCIP_CALL( SCIPcreateConsLinear(scip, &newcons, name, ninfcheckvars, infcheckvars, infcheckvals,
6057 SCIP_CALL( analyzeConflictRangedRow(scip, cons, infcheckvars, ninfcheckvars, NULL, SCIP_INVALID) );
6078 SCIP_CALL( analyzeConflictRangedRow(scip, cons, infcheckvars, ninfcheckvars, NULL, SCIP_INVALID) );
6103 if( !SCIPisEQ(scip, SCIPvarGetLbLocal(consdata->vars[v]), SCIPvarGetUbLocal(consdata->vars[v])) )
6115 if( SCIPisEQ(scip, SCIPvarGetLbLocal(consdata->vars[v2]), SCIPvarGetUbLocal(consdata->vars[v2])) )
6222 SCIP_CALL( analyzeConflictRangedRow(scip, cons, infcheckvars, ninfcheckvars, consdata->vars[v],
6244 SCIP_CALL( analyzeConflictRangedRow(scip, cons, infcheckvars, ninfcheckvars, consdata->vars[v],
6253 /* at least two solutions and more than one variable, so we add a new constraint which bounds the feasible
6256 else if( !SCIPinProbing(scip) && SCIPgetDepth(scip) < 1 && !SCIPinRepropagation(scip) && addartconss &&
6279 (void)SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_artcons1_%d", SCIPconsGetName(cons), conshdlrdata->naddconss);
6284 SCIP_CALL( SCIPcreateConsLinear(scip, &newcons, name, ninfcheckvars, infcheckvars, infcheckvals, newlhs, newrhs,
6293 /* @todo maybe add constraint for all variables which are not infcheckvars, lhs should be minvalue, rhs
6330 /* convert representation to: lhs <= sum_i=1^n a_i*x_i - by <= rhs, b > 0, for all i : a_i > 0 */
6335 if( v != contvarpos && !SCIPisEQ(scip, SCIPvarGetLbLocal(consdata->vars[v]), SCIPvarGetUbLocal(consdata->vars[v])) )
6356 SCIP_Real newlb = SCIPisFeasNegative(scip, SCIPvarGetLbLocal(contvar) + lhs) ? -lhs : absminbincoef - lhs;
6383 if( v != contvarpos && !SCIPisEQ(scip, SCIPvarGetLbLocal(consdata->vars[v]), SCIPvarGetUbLocal(consdata->vars[v])) )
6433 if( !SCIPisEQ(scip, SCIPvarGetLbLocal(consdata->vars[v]), SCIPvarGetUbLocal(consdata->vars[v])) )
6483 if( !SCIPinProbing(scip) && SCIPgetDepth(scip) < 1 && !SCIPinRepropagation(scip) && v == consdata->nvars
6499 (void)SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_artcons2_%d", SCIPconsGetName(cons), conshdlrdata->naddconss);
6504 SCIP_CALL( SCIPcreateConsLinear(scip, &newcons, name, ninfcheckvars, infcheckvars, infcheckvals, newlhs, newrhs,
6532 SCIP_Bool force /**< should a possible bound change be forced even if below bound strengthening tolerance */
6575 consdataGetActivityResiduals(scip, consdata, var, val, FALSE, &minresactivity, &maxresactivity,
6596 ((force && SCIPisLT(scip, newub, ub)) || (SCIPvarIsIntegral(var) && SCIPisFeasLT(scip, newub, ub)) || SCIPisUbBetter(scip, newub, lb, ub)) )
6607 (!SCIPisUbBetter(scip, newub, lb, ub) && (!SCIPisFeasLT(scip, newub, ub) || !SCIPvarIsIntegral(var))
6614 SCIPdebugMessage("linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, resactivity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newub=%.15g\n",
6615 SCIPconsGetName(cons), SCIPvarGetName(var), lb, ub, val, minresactivity, maxresactivity, lhs, rhs, newub);
6631 ub = SCIPvarGetUbLocal(var); /* get bound again: it may be additionally modified due to integrality */
6648 ((force && SCIPisGT(scip, newlb, lb)) || (SCIPvarIsIntegral(var) && SCIPisFeasGT(scip, newlb, lb)) || SCIPisLbBetter(scip, newlb, lb, ub)) )
6663 SCIPdebugMessage("linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, resactivity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newlb=%.15g\n",
6664 SCIPconsGetName(cons), SCIPvarGetName(var), lb, ub, val, minresactivity, maxresactivity, lhs, rhs, newlb);
6680 lb = SCIPvarGetLbLocal(var); /* get bound again: it may be additionally modified due to integrality */
6698 ((force && SCIPisGT(scip, newlb, lb)) || (SCIPvarIsIntegral(var) && SCIPisFeasGT(scip, newlb, lb)) || SCIPisLbBetter(scip, newlb, lb, ub)) )
6709 || (!SCIPisLbBetter(scip, newlb, lb, ub) && (!SCIPisFeasGT(scip, newlb, lb) || !SCIPvarIsIntegral(var))
6716 SCIPdebugMessage("linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, resactivity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newlb=%.15g\n",
6717 SCIPconsGetName(cons), SCIPvarGetName(var), lb, ub, val, minresactivity, maxresactivity, lhs, rhs, newlb);
6733 lb = SCIPvarGetLbLocal(var); /* get bound again: it may be additionally modified due to integrality */
6749 ((force && SCIPisLT(scip, newub, ub)) || (SCIPvarIsIntegral(var) && SCIPisFeasLT(scip, newub, ub)) || SCIPisUbBetter(scip, newub, lb, ub)) )
6764 SCIPdebugMessage("linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, resactivity=[%.15g,%.15g], sides=[%.15g,%.15g], newub=%.15g\n",
6765 SCIPconsGetName(cons), SCIPvarGetName(var), lb, ub, val, minresactivity, maxresactivity, lhs, rhs, newub);
6781 ub = SCIPvarGetUbLocal(var); /* get bound again: it may be additionally modified due to integrality */
6801 SCIP_Real maxeasyactivitydelta,/**< maximum activity delta to run easy propagation on linear constraint */
6874 consdataGetActivityBounds(scip, consdata, FALSE, &minactivity, &maxactivity, &minisrelax, &maxisrelax);
6878 slack = (SCIPisInfinity(scip, consdata->rhs) || SCIPisInfinity(scip, -minactivity)) ? SCIPinfinity(scip) : (consdata->rhs - minactivity);
6879 surplus = (SCIPisInfinity(scip, -consdata->lhs) || SCIPisInfinity(scip, maxactivity)) ? SCIPinfinity(scip) : (maxactivity - consdata->lhs);
6889 /* as long as the bounds might be tightened again, try to tighten them; abort after a maximal number of rounds */
6891 for( nrounds = 0; (force || !consdata->boundstightened) && nrounds < MAXTIGHTENROUNDS; ++nrounds )
6896 /* try to tighten the bounds of each variable in the constraint. During solving process, the binary variable
6922 && !SCIPisFeasEQ(scip, SCIPvarGetUbLocal(consdata->vars[v]), SCIPvarGetLbLocal(consdata->vars[v])) )
6931 assert(*cutoff || SCIPisFeasEQ(scip, SCIPvarGetLbLocal(consdata->vars[0]), SCIPvarGetUbLocal(consdata->vars[0])));
6943 SCIP_Bool checklprows, /**< has linear constraint to be checked, if it is already in current LP? */
6944 SCIP_Bool checkrelmaxabs, /**< should the violation for a constraint with side 0.0 be checked relative
6976 SCIPdebugMessage(" consdata activity=%.15g (lhs=%.15g, rhs=%.15g, row=%p, checklprows=%u, rowinlp=%u, sol=%p, hascurrentnodelp=%u)\n",
6981 /* the activity of pseudo solutions may be invalid if it comprises positive and negative infinity contributions; we
6992 else if( SCIPisFeasLT(scip, activity, consdata->lhs) || SCIPisFeasGT(scip, activity, consdata->rhs) )
7005 /* the (much) more complicated check: we try to disregard random noise and violations of a 0.0 side which are
7054 SCIPdebugMessage(" lhs violated absolutely (violation=%16.9g), but feasible when using relative tolerance w.r.t. maximum absolute value (%16.9g)\n",
7108 SCIPdebugMessage(" rhs violated absolutely (violation=%16.9g), but feasible when using relative tolerance w.r.t. maximum absolute value (%16.9g)\n",
7170 SCIP_CALL( SCIPcreateEmptyRowCons(scip, &consdata->row, SCIPconsGetHdlr(cons), SCIPconsGetName(cons), consdata->lhs, consdata->rhs,
7173 SCIP_CALL( SCIPaddVarsToRow(scip, consdata->row, consdata->nvars, consdata->vars, consdata->vals) );
7196 {
7227 /** separates linear constraint: adds linear constraint as cut, if violated by given solution */
7235 SCIP_Bool separateall, /**< should all constraints be subject to cardinality cut generation instead of only
7257 SCIP_CALL( checkCons(scip, cons, sol, (sol != NULL), conshdlrdata->checkrelmaxabs, &violated) );
7270 /* we only want to call the knapsack cardinality cut separator for rows that have a non-zero dual solution */
7324 SCIP_Real maxeasyactivitydelta,/**< maximum activity delta to run easy propagation on linear constraint */
7358 /* increase age of constraint; age is reset to zero, if a conflict or a propagation was found */
7398 SCIPdebugMessage("linear constraint <%s> found %d bound changes and %d fixings\n", SCIPconsGetName(cons), *nchgbds - oldnchgbds, nfixedvars);
7408 consdataGetActivityBounds(scip, consdata, TRUE, &minactivity, &maxactivity, &minactisrelax, &maxactisrelax);
7412 SCIPdebugMessage("linear constraint <%s> is infeasible (rhs): activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
7423 SCIPdebugMessage("linear constraint <%s> is infeasible (lhs): activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
7432 else if( SCIPisGE(scip, minactivity, consdata->lhs) && SCIPisLE(scip, maxactivity, consdata->rhs) )
7434 SCIPdebugMessage("linear constraint <%s> is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
7489 fixval = SCIPselectSimpleValue(lb - 0.9 * SCIPepsilon(scip), ub + 0.9 * SCIPepsilon(scip), MAXDNOM);
7490 SCIPdebugMessage("converting variable <%s> with fixed bounds [%.15g,%.15g] into fixed variable fixed at %.15g\n",
7527 * a) if the constraint has a finite right hand side and the negative infinity counters for the minactivity are zero
7528 * then add the variables as a clique for which all successive pairs of coefficients fullfill the following
7533 * and also add the binary to binary implication also for non-successive variables for which the same argument
7538 * 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
7541 * b) if the constraint has a finite left hand side and the positive infinity counters for the maxactivity are zero
7542 * then add the variables as a clique for which all successive pairs of coefficients fullfill the follwoing
7547 * and also add the binary to binary implication also for non-successive variables for which the same argument
7554 * c) the constraint has a finite right hand side and a finite minactivity then add the variables as a negated
7555 * clique(clique on the negated variables) for which all successive pairs of coefficients fullfill the following
7560 * and also add the binary to binary implication also for non-successive variables for which the
7565 * e.g. -4 x1 -3 x2 - 2 x3 + 2 x4 <= -4 would lead to the (negated) clique (~x1, ~x2) and the binary to binary
7568 * d) the constraint has a finite left hand side and a finite maxactivity then add the variables as a negated
7569 * clique(clique on the negated variables) for which all successive pairs of coefficients fullfill the following
7574 * and also add the binary to binary implication also for non-successive variables for which the same argument
7581 * 2. if the linear constraint represents a set-packing or set-partitioning constraint, the whole constraint is added
7589 SCIP_Real maxeasyactivitydelta,/**< maximum activity delta to run easy propagation on linear constraint */
7633 * for now we only add binary to non-binary implications, and this is only done for the binary variable with the
7634 * maximal absolute contribution and also only if this variable would force all other variables to their bound
7642 /* @todo we might extract implications/cliques if SCIPvarIsBinary() variables exist and we have integer variables
7660 finitenegminact = (consdata->glbminactivityneginf == 0 && consdata->glbminactivityneghuge == 0);
7662 finiteposminact = (consdata->glbminactivityposinf == 0 && consdata->glbminactivityposhuge == 0);
7663 finiteposmaxact = (consdata->glbmaxactivityposinf == 0 && consdata->glbmaxactivityposhuge == 0);
7667 if( (finiterhs || finitelhs) && (finitenegminact || finiteposminact || finitenegmaxact || finiteposmaxact) )
7730 /* if the right hand side and the minimal activity are finite and changing the variable with the biggest
7731 * influence to their bound forces all other variables to be at their minimal contribution, we can add these
7734 if( finiterhs && finiteminact && SCIPisEQ(scip, consdata->glbminactivity, consdata->rhs - maxabscontrib) )
7746 SCIP_CALL( SCIPaddVarImplication(scip, vars[position], posval, vars[v], SCIP_BOUNDTYPE_UPPER, SCIPvarGetLbGlobal(vars[v]), &infeasible, &nbdchgs) );
7753 SCIP_CALL( SCIPaddVarImplication(scip, vars[position], posval, vars[v], SCIP_BOUNDTYPE_LOWER, SCIPvarGetUbGlobal(vars[v]), &infeasible, &nbdchgs) );
7765 /* stop when reaching a 'real' binary variable because the variables are sorted after their type */
7771 /* if the left hand side and the maximal activity are finite and changing the variable with the biggest
7772 * influence to their bound forces all other variables to be at their minimal contribution, we can add these
7775 if( finitelhs && finitemaxact && SCIPisEQ(scip, consdata->glbmaxactivity, consdata->lhs - maxabscontrib) )
7787 SCIP_CALL( SCIPaddVarImplication(scip, vars[position], posval, vars[v], SCIP_BOUNDTYPE_LOWER, SCIPvarGetUbGlobal(vars[v]), &infeasible, &nbdchgs) );
7794 SCIP_CALL( SCIPaddVarImplication(scip, vars[position], posval, vars[v], SCIP_BOUNDTYPE_UPPER, SCIPvarGetLbGlobal(vars[v]), &infeasible, &nbdchgs) );
7806 /* stop when reaching a 'real' binary variable because the variables are sorted after their type */
7815 SCIPdebugMessage("extracted %d implications from constraint %s which led to %d bound changes, %scutoff detetcted\n", nimpls, SCIPconsGetName(cons), *nchgbds - oldnchgbds, *cutoff ? "" : "no ");
7820 /* did we find some boundchanges, then we need to remove fixings and tighten the bounds further */
7869 finitenegminact = (consdata->glbminactivityneginf == 0 && consdata->glbminactivityneghuge == 0);
7871 finiteposminact = (consdata->glbminactivityposinf == 0 && consdata->glbminactivityposhuge == 0);
7872 finiteposmaxact = (consdata->glbmaxactivityposinf == 0 && consdata->glbmaxactivityposhuge == 0);
7876 /* 1. we wheck whether some variables do not fit together into this constraint and add the corresponding clique
7879 if( (finiterhs || finitelhs) && (finitenegminact || finiteposminact || finitenegmaxact || finiteposmaxact) )
7916 /* setppc constraints will be handled later; we need at least two binary variables with same sign to extract
7952 #if 0 /* assertion should only holds when constraints were fully propagated and boundstightened */
7953 /* check that it is possible to choose binvar[i], otherwise it should have been fixed to zero */
7991 /* iterate up to the end with j and up to the front with lastfit, and check for different cliques */
8000 SCIP_CALL( SCIPaddClique(scip, clqvars, NULL, lastfit - i + 2, FALSE, &infeasible, &nbdchgs) );
8028 /* did we find some boundchanges, then we need to remove fixings and tighten the bounds further */
8101 #if 0 /* assertion should only holds when constraints were fully propagated and boundstightened */
8102 /* check that it is possible to choose binvar[i], otherwise it should have been fixed to zero */
8142 /* iterate up to the front with j and up to the end with lastfit, and check for different cliques */
8153 SCIP_CALL( SCIPaddClique(scip, &(clqvars[lastfit - jstart - 2]), NULL, i - lastfit + 2, FALSE, &infeasible, &nbdchgs) );
8181 /* did we find some boundchanges, then we need to remove fixings and tighten the bounds further */
8261 #if 0 /* assertion should only holds when constraints were fully propagated and boundstightened */
8280 SCIP_CALL( SCIPaddClique(scip, &(binvars[j+1]), values, i - j, FALSE, &infeasible, &nbdchgs) );
8302 /* iterate up to the front with j and up to the end with lastfit, and check for different cliques */
8313 SCIP_CALL( SCIPaddClique(scip, &(clqvars[lastfit - jstart - 2]), values, i - lastfit + 2, FALSE, &infeasible, &nbdchgs) );
8343 /* did we find some boundchanges, then we need to remove fixings and tighten the bounds further */
8421 #if 0 /* assertion should only holds when constraints were fully propagated and boundstightened */
8460 /* iterate up to the end with j and up to the front with lastfit, and check for different cliques */
8469 SCIP_CALL( SCIPaddClique(scip, clqvars, values, lastfit - i + 2, FALSE, &infeasible, &nbdchgs) );
8506 /* check if all variables are binary, if the coefficients are +1 or -1, and if the right hand side is equal
8507 * to 1 - number of negative coefficients, or if the left hand side is equal to number of positive coefficients - 1
8538 SCIP_CALL( SCIPaddClique(scip, vars, values, nvars, SCIPisEQ(scip, consdata->lhs, consdata->rhs), &infeasible, &nbdchgs) );
8603 /** tightens coefficients of binary, integer, and implicit integer variables due to activity bounds in presolving:
8610 * xi fixed to its bounds, but with a reduced ai and tightened sides to tighten the LP relaxation
8619 * xi fixed to its bounds, but with a reduced ai and tightened sides to tighten the LP relaxation
8627 * A deviation of only one from their bound makes the lhs/rhs feasible (i.e., redundant), even if all other
8628 * variables are set to their "worst" bound. If all variables which are not surely non-redundant cannot make
8629 * the lhs/rhs redundant, even if they are set to their "best" bound, they can be removed from the constraint.
8630 * 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
8631 * suffices to fulfill the inequality, whereas the x_i do not contribute to feasibility and can be removed.
8633 * @todo use also some tightening procedures for (knapsack) constraints with non-integer coefficients, see
8646 SCIP_Real minactivity; /* minimal value w.r.t. the variable's local bounds for the constraint's
8648 SCIP_Real maxactivity; /* maximal value w.r.t. the variable's local bounds for the constraint's
8683 consdataGetActivityBounds(scip, consdata, TRUE, &minactivity, &maxactivity, &minactisrelax, &maxactisrelax);
8705 SCIPisGE(scip, minactivity + val, consdata->lhs) && SCIPisLE(scip, maxactivity - val, consdata->rhs) )
8722 if( !SCIPisInfinity(scip, -consdata->lhs) && consdata->minactivityneginf + consdata->minactivityneginf == 0 )
8725 lval -= otherval > 0.0 ? otherval * SCIPvarGetLbLocal(consdata->vars[1-i]) : otherval * SCIPvarGetUbLocal(consdata->vars[1-i]);
8728 if( !SCIPisInfinity(scip,consdata->rhs) && consdata->maxactivityneginf + consdata->maxactivityneginf == 0 )
8731 rval += otherval > 0.0 ? otherval * SCIPvarGetUbLocal(consdata->vars[1-i]) : otherval * SCIPvarGetLbLocal(consdata->vars[1-i]);
8746 SCIPdebugMessage("linear constraint <%s>: change coefficient %+.15g<%s> to %+.15g<%s>, act=[%.15g,%.15g], side=[%.15g,%.15g]\n",
8763 consdataGetActivityBounds(scip, consdata, TRUE, &minactivity, &maxactivity, &minactisrelax, &maxactisrelax);
8767 SCIPdebugMessage("linear constraint <%s>: change lhs %.15g to %.15g\n", SCIPconsGetName(cons), consdata->lhs, newlhs);
8776 SCIPdebugMessage("linear constraint <%s>: change rhs %.15g to %.15g\n", SCIPconsGetName(cons), consdata->rhs, newrhs);
8811 SCIPisGE(scip, minactivity - val, consdata->lhs) && SCIPisLE(scip, maxactivity + val, consdata->rhs) )
8828 if( !SCIPisInfinity(scip,-consdata->lhs) && consdata->minactivityneginf + consdata->minactivityneginf == 0 )
8831 lval += otherval > 0.0 ? otherval * SCIPvarGetLbLocal(consdata->vars[1-i]) : otherval * SCIPvarGetUbLocal(consdata->vars[1-i]);
8834 if( !SCIPisInfinity(scip,consdata->rhs) && consdata->maxactivityneginf + consdata->maxactivityneginf == 0 )
8837 rval -= otherval > 0.0 ? otherval * SCIPvarGetUbLocal(consdata->vars[1-i]) : otherval * SCIPvarGetLbLocal(consdata->vars[1-i]);
8852 SCIPdebugMessage("linear constraint <%s>: change coefficient %+.15g<%s> to %+.15g<%s>, act=[%.15g,%.15g], side=[%.15g,%.15g]\n",
8869 consdataGetActivityBounds(scip, consdata, TRUE, &minactivity, &maxactivity, &minactisrelax, &maxactisrelax);
8873 SCIPdebugMessage("linear constraint <%s>: change lhs %.15g to %.15g\n", SCIPconsGetName(cons), consdata->lhs, newlhs);
8882 SCIPdebugMessage("linear constraint <%s>: change rhs %.15g to %.15g\n", SCIPconsGetName(cons), consdata->rhs, newrhs);
8925 /* if the lhs is finite, we will check in the following whether the not non-redundant variables can make lhs feasible;
8926 * this is not valid, if the minactivity is -\infty (aggrlhs would be minus infinity in the following computation)
8927 * or if huge values contributed to the minactivity, because the minactivity is then just a relaxation
8928 * (<= the exact minactivity), and we might falsely claim variables to be redundant in the following
8931 if( !SCIPisInfinity(scip, -consdata->lhs) && (SCIPisInfinity(scip, -minactivity) || minactisrelax) )
8934 /* if the rhs is finite, we will check in the following whether the not non-redundant variables can make rhs feasible;
8935 * this is not valid, if the maxactivity is \infty (aggrrhs would be infinity in the following computation)
8936 * or if huge values contributed to the maxactivity, because the maxactivity is then just a relaxation
8937 * (>= the exact maxactivity), and we might falsely claim variables to be redundant in the following
8940 if( !SCIPisInfinity(scip, consdata->rhs) && (SCIPisInfinity(scip, maxactivity) || maxactisrelax) )
8944 * surely non-redundant variables are all those where a deviation from the bound makes the lhs/rhs redundant
8949 /* check if the constraint contains variables which are redundant. The reasoning is the following:
8950 * Each non-redundant variable can make the lhs/rhs feasible with a deviation of only one in the bound.
8982 SCIPisLT(scip, minactivity + val, consdata->lhs) || SCIPisGT(scip, maxactivity - val, consdata->rhs) )
8986 SCIPdebugMessage("linear constraint <%s>: remove variable <%s> with coefficient <%g> from constraint since it is redundant\n",
8996 consdataGetActivityBounds(scip, consdata, FALSE, &minactivity, &maxactivity, &minactisrelax, &maxactisrelax);
8998 /* we return above if the condition does not hold and deleting a variable cannot increase the number of
9009 SCIPisLT(scip, minactivity - val, consdata->lhs) || SCIPisGT(scip, maxactivity + val, consdata->rhs) )
9011 SCIPdebugMessage("linear constraint <%s>: remove variable <%s> with coefficient <%g> from constraint since it is redundant\n",
9021 consdataGetActivityBounds(scip, consdata, FALSE, &minactivity, &maxactivity, &minactisrelax, &maxactisrelax);
9023 /* we return above if the condition does not hold and deleting a variable cannot increase the number of
9031 /* the following update step is needed in every iteration cause otherwise it is possible that the surely none-
9033 * e.g. y_1 + 16y_2 >= 25, y1 with bounds [9,12], y2 with bounds [0,2], minactivity would be 9, it follows that
9034 * y_2 is surely not redundant and y_1 is redundant so we would first delete y1 and without updating the sides
9042 SCIPdebugMessage("linear constraint <%s>: change lhs %.15g to %.15g\n", SCIPconsGetName(cons), consdata->lhs, newlhs);
9049 SCIPdebugMessage("linear constraint <%s>: change rhs %.15g to %.15g\n", SCIPconsGetName(cons), consdata->rhs, newrhs);
9061 /* processes equality with only one variable by fixing the variable and deleting the constraint */
9117 /* processes equality with exactly two variables by aggregating one of the variables and deleting the constraint */
9148 SCIP_CALL( SCIPaggregateVars(scip, consdata->vars[0], consdata->vars[1], consdata->vals[0], consdata->vals[1],
9175 /** calculates the new lhs and rhs of the constraint after the given variable is aggregated out */
9225 /* processes equality with more than two variables by multi-aggregating one of the variables and converting the equality
9226 * into an inequality; if multi-aggregation is not possible, tries to identify one continuous or integer variable that
9229 * @todo Check whether a more clever way of avoiding aggregation of variables containing implicitly integer variables
9285 SCIPdebugMessage("linear constraint <%s>: try to multi-aggregate equality\n", SCIPconsGetName(cons));
9289 * maxnlocksstay: maximal sum of lock numbers if the constraint does not become redundant after the aggregation
9290 * maxnlocksremove: maximal sum of lock numbers if the constraint can be deleted after the aggregation
9297 /* If the constraint becomes redundant, 3 non-zeros are removed, and we get 1 additional non-zero for each
9298 * constraint the variable appears in. Thus, the variable must appear in at most 3 other constraints.
9304 /* If the constraint becomes redundant, 4 non-zeros are removed, and we get 2 additional non-zeros for each
9305 * constraint the variable appears in. Thus, the variable must appear in at most 2 other constraints.
9311 /* If the constraint is redundant but has more than 4 variables, we can only accept one other constraint. */
9362 assert(!SCIPconsIsChecked(cons) || SCIPvarGetNLocksDown(var) >= 1); /* because variable is locked in this equality */
9407 /* check, if variable is used in too many other constraints, even if this constraint could be deleted */
9456 consdataGetActivityResiduals(scip, consdata, var, val, FALSE, &minresactivity, &maxresactivity,
9459 /* do not perform the multi-aggregation due to numerics, if we have huge contributions in the residual
9466 removescons = (SCIPisFeasLE(scip, newlhs, minresactivity) && SCIPisFeasLE(scip, maxresactivity, newrhs));
9471 if( !isminsettoinfinity && SCIPisUpdateUnreliable(scip, minresactivity, consdata->lastminactivity) )
9474 if( !ismaxsettoinfinity && SCIPisUpdateUnreliable(scip, maxresactivity, consdata->lastmaxactivity)
9478 removescons = (SCIPisFeasLE(scip, newlhs, minresactivity) && SCIPisFeasLE(scip, maxresactivity, newrhs));
9489 /* if the constraint does not become redundant, only accept the variable if it does not appear in
9508 /* if all coefficients and variables are integral, the right hand side must also be integral */
9521 /* check whether the the infimum and the supremum of the multi-aggregation can be get infinite */
9559 /* If the infimum and the supremum of a multi-aggregation are both infinite, then the multi-aggregation might not be resolvable.
9560 * E.g., consider the equality z = x-y. If x and y are both fixed to +infinity, the value for z is not determined */
9563 SCIPdebugMessage("do not perform multi-aggregation: infimum and supremum are both infinite\n");
9567 /* if the slack variable is of integer type, and the constraint itself may take fractional values,
9611 SCIPdebugMessage("linear constraint <%s>: multi-aggregate <%s> ==", SCIPconsGetName(cons), SCIPvarGetName(slackvar));
9617 SCIPdebugPrintf(" %+.15g, bounds of <%s>: [%.15g,%.15g], nlocks=%d, maxnlocks=%d, removescons=%u\n",
9618 aggrconst, SCIPvarGetName(slackvar), SCIPvarGetLbGlobal(slackvar), SCIPvarGetUbGlobal(slackvar),
9632 SCIPdebugMessage("linear constraint <%s>: infeasible multi-aggregation\n", SCIPconsGetName(cons));
9642 SCIPdebugMessage("linear constraint <%s>: redundant after multi-aggregation\n", SCIPconsGetName(cons));
9659 /* upgrade continuous variable to an implicit one, if the absolute value of the coefficient is one */
9663 SCIPdebugMessage("linear constraint <%s>: converting continuous variable <%s> to implicit integer variable\n",
9668 SCIPdebugMessage("infeasible upgrade of variable <%s> to integral type, domain is empty\n", SCIPvarGetName(var));
9674 /* aggregate continuous variable to an implicit one, if the absolute value of the coefficient is unequal to one */
9675 /* @todo check if the aggregation coefficient should be in some range(, which is not too big) */
9689 SCIP_CALL( SCIPcreateVar(scip, &newvar, newvarname, -SCIPinfinity(scip), SCIPinfinity(scip), 0.0,
9690 SCIP_VARTYPE_IMPLINT, SCIPvarIsInitial(var), SCIPvarIsRemovable(var), NULL, NULL, NULL, NULL, NULL) );
9705 SCIPdebugMessage("linear constraint <%s>: aggregating continuous variable <%s> to newly created implicit integer variable <%s>, aggregation factor = %g\n",
9709 SCIP_CALL( SCIPaggregateVars(scip, var, newvar, absval, -1.0, 0.0, &infeasible, &redundant, &aggregated) );
9713 SCIPdebugMessage("infeasible aggregation of variable <%s> to implicit variable <%s>, domain is empty\n",
9730 /* we do not have any event on vartype changes, so we need to manually force this constraint to be presolved
9741 /* this seems to help for rococo instances, but does not for rout (where all coefficients are +/- 1.0)
9754 SCIPdebugMessage("linear constraint <%s>: converting integer variable <%s> to implicit integer variable\n",
9759 SCIPdebugMessage("infeasible upgrade of variable <%s> to integral type, domain is empty\n", SCIPvarGetName(var));
9770 /** checks if the given variables and their coefficient are equal (w.r.t. scaling factor) to the objective function */
9809 /* if a variable has a zero objective coefficient the linear constraint is not a subset of the objective
9847 /** check if the linear equality constraint is equal to a subset of the objective function; if so we can remove the
9876 /* check if the linear equality constraints does not have more variables than the objective function */
9888 /* checks if the variables and their coefficients are equal (w.r.t. scaling factor) to the objective function */
9900 SCIPdebugMessage("linear equality constraint <%s> == %g (offset %g) is a subset of the objective function\n",
9916 /** updates the cutoff if the given primal bound (which is implied by the given constraint) is better */
9926 /* increase the cutoff bound value by an epsilon to ensue that solution with the value of the cutoff bound are still
9944 /* we cannot disable the enforcement and propagation on ranged rows, because the cutoffbound could only have
9949 /* in case the cutoff bound is worse then the currently known one, we additionally avoid enforcement and
9960 /** check if the linear constraint is parallel to objective function; if so update the cutoff bound and avoid that the
9991 /* check if the linear inequality constraints has the same number of variables as the objective function and if the
10000 /* checks if the variables and their coefficients are equal (w.r.t. scaling factor) to the objective function */
10016 SCIPdebugMessage("constraint <%s> is parallel to objective function and provides a cutoff bound <%g>\n",
10028 SCIPdebugMessage("constraint <%s> is parallel to objective function and provides a lower bound <%g>\n",
10037 /* avoid that the linear constraint enters the LP since it is parallel to the objective function */
10050 SCIPdebugMessage("constraint <%s> is parallel to objective function and provides a lower bound <%g>\n",
10062 SCIPdebugMessage("constraint <%s> is parallel to objective function and provides a cutoff bound <%g>\n",
10071 /* avoid that the linear constraint enters the LP since it is parallel to the objective function */
10134 /** returns whether the linear sum of all variables/coefficients except the given one divided by the given value is always
10153 if( v != pos && (!SCIPvarIsIntegral(consdata->vars[v]) || !SCIPisIntegral(scip, consdata->vals[v]/val)) )
10205 /* applies dual presolving for variables that are locked only once in a direction, and this locking is due to a
10235 * otherwise we would have to check for variables with nlocks == 0, and these are already processed by the
10247 /* search for a single-locked variable which can be multi-aggregated; if a valid continuous variable was found, we
10254 /* We only want to multi-aggregate variables, if they appear in maximal one additional constraint,
10256 * - If there are only two variables in the constraint from which the multi-aggregation arises, no fill-in will be
10258 * - If there are three variables in the constraint, multi-aggregation in three additional constraints will remove
10259 * six nonzeros (three from the constraint and the three entries of the multi-aggregated variable) and add
10261 * - If there at most four variables in the constraint, multi-aggregation in two additional constraints will remove
10262 * six nonzeros (four from the constraint and the two entries of the multi-aggregated variable) and add
10274 /* if this constraint has both sides, it also provides a lock for the other side and thus we can allow one more lock */
10290 isint = (SCIPvarGetType(var) == SCIP_VARTYPE_BINARY || SCIPvarGetType(var) == SCIP_VARTYPE_INTEGER);
10296 /* better do not multi-aggregate binary variables, since most plugins rely on their binary variables to be either
10314 * - 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
10318 * - 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
10322 * - 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
10326 * - 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
10328 * but: all this is only applicable, if the aggregated value is inside x_i's bounds for all possible values
10354 consdataGetActivityResiduals(scip, consdata, var, val, FALSE, &minresactivity, &maxresactivity,
10367 calculateMinvalAndMaxval(scip, consdata->lhs, val, minresactivity, maxresactivity, &minval, &maxval);
10382 if( !isminsettoinfinity && SCIPisUpdateUnreliable(scip, minresactivity, consdata->lastminactivity) )
10390 if( !ismaxsettoinfinity && SCIPisUpdateUnreliable(scip, maxresactivity, consdata->lastmaxactivity) )
10402 /* check again if lhs/a_i - \sum_{j \neq i} a_j/a_i * x_j is always inside the bounds of x_i */
10403 calculateMinvalAndMaxval(scip, consdata->lhs, val, minresactivity, maxresactivity, &minval, &maxval);
10410 /* if the variable is integer, we have to check whether the integrality condition would always be satisfied
10413 if( !isint || (SCIPisIntegral(scip, consdata->lhs/val) && consdataIsResidualIntegral(scip, consdata, i, val)) )
10427 calculateMinvalAndMaxval(scip, consdata->rhs, val, minresactivity, maxresactivity, &minval, &maxval);
10442 if( !isminsettoinfinity && SCIPisUpdateUnreliable(scip, minresactivity, consdata->lastminactivity) )
10449 if( !ismaxsettoinfinity && SCIPisUpdateUnreliable(scip, maxresactivity, consdata->lastmaxactivity) )
10458 /* check again if rhs/a_i - \sum_{j \neq i} a_j/a_i * x_j is always inside the bounds of x_i */
10459 calculateMinvalAndMaxval(scip, consdata->rhs, val, minresactivity, maxresactivity, &minval, &maxval);
10465 /* if the variable is integer, we have to check whether the integrality condition would always be satisfied
10468 if( !isint || (SCIPisIntegral(scip, consdata->rhs/val) && consdataIsResidualIntegral(scip, consdata, i, val)) )
10505 (SCIPvarGetType(bestvar) == SCIP_VARTYPE_BINARY || SCIPvarGetType(bestvar) == SCIP_VARTYPE_INTEGER));
10513 SCIPdebugMessage("linear constraint <%s> (dual): multi-aggregate <%s> ==", SCIPconsGetName(cons), SCIPvarGetName(bestvar));
10568 SCIPdebugPrintf(" %+.15g, bounds of <%s>: [%.15g,%.15g]\n", aggrconst, SCIPvarGetName(bestvar),
10585 /* @todo if multi-aggregate makes them numerical trouble, avoid them if the coefficients differ to much, see
10588 SCIP_CALL( SCIPmultiaggregateVar(scip, bestvar, naggrs, aggrvars, aggrcoefs, aggrconst, &infeasible, &aggregated) );
10592 /* If the infimum and the supremum of a multi-aggregation are both infinite, then the multi-aggregation might not be resolvable.
10593 * E.g., consider the equality z = x-y. If x and y are both fixed to +infinity, the value for z is not determined */
10594 SCIPdebugMessage("do not perform multi-aggregation: infimum and supremum are both infinite\n");
10603 SCIPdebugMessage("linear constraint <%s>: infeasible multi-aggregation\n", SCIPconsGetName(cons));
10826 /** sorting method for constraint data, compares two variables on given indices, continuous variables will be sorted to
10827 * the end and for all other variables the sortation will be in non-increasing order of their absolute value of the
10860 /* for all non-continuous variables, the variables are sorted after decreasing absolute coefficients */
10864 /** tries to simplify coefficients and delete variables in ranged row of the form lhs <= a^Tx <= rhs, e.g. using the greatest
10867 * 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
10945 if( SCIPisGE(scip, minval, lhs) && SCIPisLE(scip, maxval, rhs) && SCIPisGT(scip, minval + secondminval, rhs) )
10964 /** tries to simplify coefficients and delete variables in constraints of the form lhs <= a^Tx <= rhs
10969 * 1. We try to determine parts of the constraint which will not change anything on (in-)feasibility of the constraint
10975 * e.g. 5.2x1 + 5.1x2 + 3x3 <= 8.3 => will be changed to 5x1 + 5x2 + 3x3 <= 8 if all x are binary
10979 * e.g. 10x1 + 5y2 + 5x3 + 3x4 <= 15 => will be changed to 2x1 + y2 + x3 + x4 <= 3 if all xi are binary and y2 is
11056 /* @todo the following might be too hard, check which steps can be applied and what code must be corrected
11063 /* @todo: change the following: due to vartype changes, the status of the normalization can be wrong, need an event
11100 /* if we have a normalized inequality (not ranged) the one side should be positive, @see normalizeCons() */
11107 /* call sorting method, order continuous variables to the end and all other variables after non-increasing absolute
11121 assert(consdata->validmaxabsval ? (SCIPisFeasEQ(scip, consdata->maxabsval, REALABS(vals[0])) || SCIPvarGetType(vars[nvars - 1]) == SCIP_VARTYPE_CONTINUOUS) : TRUE);
11131 if( SCIPisEQ(scip, REALABS(vals[0]), 1.0) && ((hasrhs && SCIPisIntegral(scip, rhs)) || (haslhs && SCIPisIntegral(scip, lhs))) )
11157 /* we now determine coefficients as large as the side of the constraint to might retrieve a better reduction were we
11161 * c1: +5x1 + 5x2 + 3x3 + 3x4 + x5 >= 5 (x5 is redundant and does not change (in-)feasibility of this constraint)
11162 * c2: +4x1 + 4x2 + 3x3 + 3x4 + x5 >= 4 (gcd (without the coefficient of x5) after the large coefficients is 3
11163 * c3: +30x1 + 29x2 + 14x3 + 14z1 + 7x5 + 7x6 <= 30 (gcd (without the coefficient of x2) after the large coefficients is 7
11168 * c2: +6x1 + 6x2 + 3x3 + 3x4 + 3x5 >= 6 (will be changed to c2: +2x1 + 2x2 + x3 + x4 + x5 >= 2)
11169 * c3: +28x1 + 28x2 + 14x3 + 14z1 + 7x5 + 7x6 <= 28 (will be changed to c3: +4x1 + 4x2 + 2x3 + 2z1 + x5 + x6 <= 4)
11172 /* if the minimal activity is negative and we found more than one variable with a coefficient bigger than the left
11175 * e.g. 7x1 + 7x2 - 4x3 - 4x4 >= 7 => xi = 1 forall i is not a solution, but if we would do a change on the
11176 * coeffcients due to the gcd on the "small" coeffcients we would get 8x1 + 8x2 - 4x3 - 4x4 >= 8 were xi = 1
11187 /* if we have integer variable with "side"-coefficients but also with a lower bound greater than 0 we stop this
11208 /* all but one variable are processed or the next variables is continuous we cannot perform the extra coefficient
11235 /* find and remove redundant variables which do not interact with the (in-)feasible of a constraints
11324 if( (offsetv == -1 && hasrhs && maxactsub <= siderest && SCIPisFeasGT(scip, minactsub, siderest - gcd)) || (haslhs && SCIPisFeasLT(scip, maxactsub, siderest) && minactsub >= siderest - gcd) )
11350 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);
11354 (offsetv == -1 && hasrhs && maxactsub <= siderest && SCIPisFeasGT(scip, minactsub, siderest - gcd)) ||
11403 assert((hasrhs && SCIPisLE(scip, tmpmaxactsub, siderest) && tmpminactsub > siderest - gcd) || (haslhs && tmpmaxactsub < siderest && SCIPisGE(scip, tmpminactsub, siderest - gcd)));
11406 SCIPdebugMessage("removing %d last variables from constraint <%s>, because they never change anything on the feasibility of this constraint\n", nvars - v, SCIPconsGetName(cons));
11503 /* if the greatest commmon divisor has become 1, we might have found the possible coefficient to change or we
11591 /* new coeffcient must not be zero if we would loose the implication that a variable needs to be 0 if
11617 if( (!notchangable && hasrhs && ((!SCIPisFeasIntegral(scip, rhs) || SCIPcalcGreComDiv(gcd, (SCIP_Longint)(rhs + feastol)) < gcd) && (SCIPcalcGreComDiv(gcd, (SCIP_Longint)(REALABS(vals[candpos]) + feastol)) == gcd))) ||
11618 ( haslhs && (!SCIPisFeasIntegral(scip, lhs) || SCIPcalcGreComDiv(gcd, (SCIP_Longint)(lhs + feastol)) < gcd) && (SCIPcalcGreComDiv(gcd, (SCIP_Longint)(REALABS(vals[candpos]) + feastol)) == gcd)) )
11668 /* @todo we still can remove continuous variables if they are redundant due to the non-integrality argument */
11684 /* check if the non-integrality part of all integral variables is smaller than the non-inegrality part of the right
11685 * hand side or bigger than the left hand side respectively, so we can make all of them integral
11689 if( (hasrhs && !SCIPisFeasIntegral(scip, rhs)) || (haslhs && !SCIPisFeasIntegral(scip, lhs)) )
11736 /* if we exceed the fractional part of the right hand side, we cannot tighten the coefficients
11831 /* the fractional part on each variable need to exceed the fractional part on the left hand side */
11929 /* maximal absolute value of coefficients in constraint is one, so we cannot tighten it further */
11947 if( SCIPisEQ(scip, REALABS(vals[nvars - 1]), 1.0) && SCIPisEQ(scip, REALABS(vals[nvars - 2]), 1.0) )
11989 /* we need at least one binary variable and a gcd greater than 1 to try to perform further coefficient changes */
11998 /* calculate greatest common divisor over all integer and binary variables and determine the candidate where we might
12021 /* if the greatest commmon divisor has become 1, we might have found the possible coefficient to change or we
12032 /* if we have only binary variables and both first coefficients have a gcd of 1, both are candidates for
12066 /* we should have found one coefficient, that led to a gcd of 1, otherwise we could normalize the constraint
12074 /* check again, if we have a normalized inequality (not ranged) the one side should be positive,
12130 assert(SCIPisZero(scip, newcoef) || SCIPcalcGreComDiv(gcd, (SCIP_Longint)(REALABS(newcoef) + feastol)) == gcd);
12132 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));
12160 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));
12168 /* tries to aggregate an (in)equality and an equality in order to decrease the number of variables in the (in)equality:
12170 * where a = val1[v] and b = -val0[v] for common variable v which removes most variable weight;
12172 * the variable weight is a weighted sum over all included variables, where each binary variable weighs BINWEIGHT,
12173 * each integer or implicit integer variable weighs INTWEIGHT and each continuous variable weighs CONTWEIGHT
12182 int* diffidx0minus1, /**< array with indices of variables in cons0, that don't appear in cons1 */
12183 int* diffidx1minus0, /**< array with indices of variables in cons1, that don't appear in cons0 */
12186 int diffidx0minus1weight, /**< variable weight sum of variables in cons0, that don't appear in cons1 */
12187 int diffidx1minus0weight, /**< variable weight sum of variables in cons1, that don't appear in cons0 */
12188 SCIP_Real maxaggrnormscale, /**< maximal allowed relative gain in maximum norm for constraint aggregation */
12192 {
12201 SCIP_Bool commonvarlindependent; /* indicates whether coefficient vector of common variables in linearly dependent */
12225 SCIPdebugMessage("try aggregation of <%s> and <%s>\n", SCIPconsGetName(cons0), SCIPconsGetName(cons1));
12261 /* count the number of variables in the potential new constraint a * consdata0 + b * consdata1 */
12286 * 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
12354 /* setup best* variables that were not setup above because we are in the commonvarlindependent case */
12359 SCIPdebugMessage("aggregate linear constraints <%s> := %.15g*<%s> + %.15g*<%s> -> nvars: %d -> %d, weight: %d -> %d\n",
12390 /* if we recognized linear dependency of the common coefficients, then the aggregation coefficient should be 0.0 for every common variable */
12443 SCIP_CALL( SCIPcreateConsLinear(scip, &newcons, SCIPconsGetName(cons0), newnvars, newvars, newvals, newlhs, newrhs,
12461 if( consdataGetMaxAbsval(SCIPconsGetData(newcons)) <= maxaggrnormscale * consdataGetMaxAbsval(consdata0) )
12495 /** returns TRUE iff both keys are equal; two constraints are equal if they have the same variables and the
12596 hashval = (consdata->nvars << 29) + (minidx << 22) + (mididx << 11) + maxidx + addval; /*lint !e701*/
12601 /** compares each constraint with all other constraints for possible redundancy and removes or changes constraint
12656 /* get constraint from current hash table with same variables as cons0 and with coefficients either equal or negated
12674 /* constraint found: create a new constraint with same coefficients and best left and right hand side;
12689 SCIPdebugMessage("aggregate linear constraints <%s> and <%s> with equal coefficients into single ranged row\n",
12702 SCIPdebugMessage("aggregate linear constraints <%s> and <%s> with negated coefficients into single ranged row\n",
12713 SCIPdebugMessage("aggregated linear constraint <%s> is infeasible\n", SCIPconsGetName(cons1));
12718 /* ensure that lhs <= rhs holds without tolerances as we only allow such rows to enter the LP */
12750 /* update flags of constraint which caused the redundancy s.t. nonredundant information doesn't get lost */
12791 SCIP_Real maxaggrnormscale, /**< maximal allowed relative gain in maximum norm for constraint aggregation */
12855 for( c = (cons0changed ? 0 : firstchange); c < chkind && !(*cutoff) && conss[chkind] != NULL; ++c )
12894 /* SCIPdebugMessage("preprocess linear constraint pair <%s>[chgd:%d, upgd:%d] and <%s>[chgd:%d, upgd:%d]\n",
12921 && ((possignature0 | possignature1) == possignature1) /* possignature0 <= possignature1 (as bit vector) */
12922 && ((negsignature0 | negsignature1) == negsignature0); /* negsignature0 >= negsignature1 (as bit vector) */
12924 && ((possignature0 | possignature1) == possignature0) /* possignature0 >= possignature1 (as bit vector) */
12925 && ((negsignature0 | negsignature1) == negsignature1); /* negsignature0 <= negsignature1 (as bit vector) */
12927 && ((possignature0 | possignature1) == possignature0) /* possignature0 >= possignature1 (as bit vector) */
12928 && ((negsignature0 | negsignature1) == negsignature1); /* negsignature0 <= negsignature1 (as bit vector) */
12930 && ((possignature0 | possignature1) == possignature1) /* possignature0 <= possignature1 (as bit vector) */
12931 && ((negsignature0 | negsignature1) == negsignature0); /* negsignature0 >= negsignature1 (as bit vector) */
12946 * - if lhs0 >= lhs1 and for each variable v and each solution value x_v val0[v]*x_v <= val1[v]*x_v,
12948 * - if rhs0 <= rhs1 and for each variable v and each solution value x_v val0[v]*x_v >= val1[v]*x_v,
12950 * - if val0[v] == -val1[v] for all variables v, the two inequalities can be replaced by a single
12952 * - if at least one constraint is an equality, count the weighted number of common variables W_c
12953 * and the weighted number of variable in the difference sets W_0 = w(V_0 \ V_1), W_1 = w(V_1 \ V_0),
12954 * where the weight of each variable depends on its type, such that aggregations in order to remove the
12956 * - if W_c > W_1, try to aggregate consdata0 := a * consdata0 + b * consdata1 in order to decrease the
12957 * variable weight in consdata0, where a = +/- val1[v] and b = -/+ val0[v] for common v which leads to
12958 * the smallest weight; for numerical stability, we will only accept integral a and b; the sign of a has
12960 * - if W_c > W_0, try to aggregate consdata1 := a * consdata1 + b * consdata0 in order to decrease the
12961 * variable weight in consdata1, where a = +/- val0[v] and b = -/+ val1[v] for common v which leads to
12962 * the smallest weight; for numerical stability, we will only accept integral a and b; the sign of a has
13096 /* the coefficients in both rows are either equal or negated: create a new constraint with same coefficients and
13099 SCIPdebugMessage("aggregate linear constraints <%s> and <%s> with %s coefficients into single ranged row\n",
13118 SCIPdebugMessage("aggregated linear constraint <%s> is infeasible\n", SCIPconsGetName(cons0));
13159 /* update flags of constraint which caused the redundancy s.t. nonredundant information doesn't get lost */
13171 /* check for domination: remove dominated sides, but don't touch equalities as long as they are not totally
13174 if( cons1dominateslhs && (!cons0isequality || cons1dominatesrhs || SCIPisInfinity(scip, consdata0->rhs) ) )
13185 SCIPdebugMessage("linear constraints <%s> and <%s> are infeasible\n", SCIPconsGetName(cons0), SCIPconsGetName(cons1));
13198 /* update flags of constraint which caused the redundancy s.t. nonredundant information doesn't get lost */
13205 else if( cons0dominateslhs && (!cons1isequality || cons0dominatesrhs || SCIPisInfinity(scip, consdata1->rhs)) )
13216 SCIPdebugMessage("linear constraints <%s> and <%s> are infeasible\n", SCIPconsGetName(cons0), SCIPconsGetName(cons1));
13228 /* update flags of constraint which caused the redundancy s.t. nonredundant information doesn't get lost */
13235 if( cons1dominatesrhs && (!cons0isequality || cons1dominateslhs || SCIPisInfinity(scip, -consdata0->lhs)) )
13246 SCIPdebugMessage("linear constraints <%s> and <%s> are infeasible\n", SCIPconsGetName(cons0), SCIPconsGetName(cons1));
13259 /* update flags of constraint which caused the redundancy s.t. nonredundant information doesn't get lost */
13266 else if( cons0dominatesrhs && (!cons1isequality || cons0dominateslhs || SCIPisInfinity(scip, -consdata1->lhs)) )
13277 SCIPdebugMessage("linear constraints <%s> and <%s> are infeasible\n", SCIPconsGetName(cons0), SCIPconsGetName(cons1));
13289 /* update flags of constraint which caused the redundancy s.t. nonredundant information doesn't get lost */
13306 /* update flags of constraint which caused the redundancy s.t. nonredundant information doesn't get lost */
13321 /* update flags of constraint which caused the redundancy s.t. nonredundant information doesn't get lost */
13343 SCIP_CALL( aggregateConstraints(scip, cons0, cons1, commonidx0, commonidx1, diffidx0minus1, diffidx1minus0,
13355 if( !aggregated && cons0isequality && !consdata1->upgraded && commonidxweight > diffidx0minus1weight )
13358 SCIP_CALL( aggregateConstraints(scip, cons1, cons0, commonidx1, commonidx0, diffidx1minus0, diffidx0minus1,
13408 * redlb[v] == k : if x_v >= k, we can always round x_v down to x_v == k without violating any constraint
13409 * redub[v] == k : if x_v <= k, we can always round x_v up to x_v == k without violating any constraint
13422 * This is because then, the value of the variable is either determined by one of its bounds or
13444 /* copy the variable array since this array might change during the curse of this algorithm */
13466 /* Initialize isimplint array: variable may be implied integer if rounded to their best bound they are integral.
13482 isimplint[v] = (SCIPisInfinity(scip, -lb) || SCIPisIntegral(scip, lb)) && (SCIPisInfinity(scip, ub) || SCIPisIntegral(scip, ub));
13498 /* we only need to consider constraints that have been locked (i.e., checked constraints or constraints that are
13532 assert(0 <= contv && contv < ncontvars); /* variable should be active due to applyFixings() */
13584 consdataGetGlbActivityResiduals(scip, consdata, var, val, FALSE, &minresactivity, &maxresactivity,
13594 if( !isminsettoinfinity && SCIPisUpdateUnreliable(scip, minresactivity, consdata->lastglbminactivity) )
13598 if( !ismaxsettoinfinity && SCIPisUpdateUnreliable(scip, maxresactivity, consdata->lastglbmaxactivity) )
13604 assert(0 <= arrayindex && arrayindex < nvars); /* variable should be active due to applyFixings() */
13673 /* there is more than one continuous variable or the integer variables have fractional coefficients:
13691 /* there is exactly one continuous variable and the integer variables have integral coefficients:
13692 * this is the interesting case, and we have to check whether the coefficient is +/-1 and the corresponding
13745 * if largest bound to make constraints redundant is -infinity, we better do nothing for numerical reasons
13753 /* if x_v >= redlb[v], we can always round x_v down to x_v == redlb[v] without violating any constraint
13756 SCIPdebugMessage("variable <%s> only locked down in linear constraints: dual presolve <%s>[%.15g,%.15g] <= %.15g\n",
13772 * if smallest bound to make constraints redundant is +infinity, we better do nothing for numerical reasons
13780 /* if x_v <= redub[v], we can always round x_v up to x_v == redub[v] without violating any constraint
13783 SCIPdebugMessage("variable <%s> only locked up in linear constraints: dual presolve <%s>[%.15g,%.15g] >= %.15g\n",
13822 SCIPdebugMessage("infeasible upgrade of variable <%s> to integral type, domain is empty\n", SCIPvarGetName(var));
13828 SCIPdebugMessage("dual presolve: converting continuous variable <%s>[%g,%g] to implicit integer\n",
13867 /** destructor of constraint handler to free constraint handler data (called when SCIP is exiting) */
13915 /** deinitialization method of constraint handler (called before transformed problem is freed) */
13963 || SCIPisInfinity(scip, -SCIPconsGetData(cons)->lhs) || SCIPisInfinity(scip, SCIPconsGetData(cons)->rhs) );
13978 /** presolving initialization method of constraint handler (called when presolving is about to begin) */
14057 /* is constraint of type SCIP_CONSTYPE_{SETPARTITION, SETPACKING, SETCOVERING, CARDINALITY, INVKNAPSACK}? */
14293 /** presolving deinitialization method of constraint handler (called after presolving has been finished) */
14339 SCIPstatisticMessage("below threshold: %d / %d ratio= %g\n", ngoodconss, nallconss, (100.0 * ngoodconss / nallconss));
14355 /* this is no problem reduction, because the upgraded constraint was added to the problem before, and the
14356 * (redundant) linear constraint was only kept in order to support presolving the the linear constraint handler
14362 /* since we are not allowed to detect infeasibility in the exitpre stage, we dont give an infeasible pointer */
14371 /** solving process deinitialization method of constraint handler (called before branch and bound process data is freed) */
14406 "(restart) converted %d cuts from the global cut pool into linear constraints\n", ncutsadded);
14407 /* an extra blank line should be printed separately since the buffer message handler only handles up to one
14475 SCIP_CALL( consdataCreate(scip, &targetdata, sourcedata->nvars, sourcedata->vars, sourcedata->vals, sourcedata->lhs, sourcedata->rhs) );
14478 SCIP_CALL( SCIPcreateCons(scip, targetcons, SCIPconsGetName(sourcecons), conshdlr, targetdata,
14479 SCIPconsIsInitial(sourcecons), SCIPconsIsSeparated(sourcecons), SCIPconsIsEnforced(sourcecons),
14482 SCIPconsIsDynamic(sourcecons), SCIPconsIsRemovable(sourcecons), SCIPconsIsStickingAtNode(sourcecons)) );
14495 /** LP initialization method of constraint handler (called before the initial LP relaxation at a node is solved) */
14513 }
14548 if( (depth == 0 && conshdlrdata->maxroundsroot >= 0 && nrounds >= conshdlrdata->maxroundsroot)
14571 SCIP_CALL( separateCons(scip, conss[c], conshdlrdata, NULL, separatecards, conshdlrdata->separateall, &ncuts, &cutoff) );
14614 if( (depth == 0 && conshdlrdata->maxroundsroot >= 0 && nrounds >= conshdlrdata->maxroundsroot)
14629 SCIP_CALL( separateCons(scip, conss[c], conshdlrdata, sol, TRUE, conshdlrdata->separateall, &ncuts, &cutoff) );
14663 checkrelmaxabs = conshdlrdata->checkrelmaxabs;
14750 SCIPdebugMessage("-> constraints checked, %s\n", *result == SCIP_FEASIBLE ? "all constraints feasible" : "infeasibility detected");
14802 SCIPinfoMessage(scip, NULL, "activity invalid due to positive and negative infinity contributions\n");
14804 SCIPinfoMessage(scip, NULL, "violation: left hand side is violated by %.15g\n", consdata->lhs - activity);
14806 SCIPinfoMessage(scip, NULL, "violation: right hand side is violated by %.15g\n", activity - consdata->rhs);
14838 /* check, if we want to tighten variable's bounds (in probing, we always want to tighten the bounds) */
14852 && ((tightenboundsfreq == 0 && depth == 0) || (tightenboundsfreq >= 1 && (depth % tightenboundsfreq == 0)));
14972 /* remember the first constraint that was not yet tried to be upgraded, to begin the next upgrading round with */
14985 /* apply presolving as long as possible on the single constraint (however, abort after a certain number of rounds
15014 SCIP_CALL( tightenBounds(scip, cons, conshdlrdata->maxeasyactivitydelta, conshdlrdata->sortvars, &cutoff, nchgbds) );
15024 consdataGetActivityBounds(scip, consdata, TRUE, &minactivity, &maxactivity, &minactisrelax, &maxactisrelax);
15025 if( SCIPisFeasGT(scip, minactivity, consdata->rhs) || SCIPisFeasLT(scip, maxactivity, consdata->lhs) )
15027 SCIPdebugMessage("linear constraint <%s> is infeasible: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
15032 else if( SCIPisFeasGE(scip, minactivity, consdata->lhs) && SCIPisFeasLE(scip, maxactivity, consdata->rhs) )
15034 SCIPdebugMessage("linear constraint <%s> is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
15043 else if( !SCIPisInfinity(scip, -consdata->lhs) && SCIPisFeasGE(scip, minactivity, consdata->lhs) )
15045 SCIPdebugMessage("linear constraint <%s> left hand side is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
15051 else if( !SCIPisInfinity(scip, consdata->rhs) && SCIPisFeasLE(scip, maxactivity, consdata->rhs) )
15053 SCIPdebugMessage("linear constraint <%s> right hand side is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
15083 /* reduce big-M coefficients, that make the constraint redundant if the variable is on a bound */
15119 SCIP_CALL( extractCliques(scip, cons, conshdlrdata->maxeasyactivitydelta, conshdlrdata->sortvars,
15147 SCIP_CALL( convertEquality(scip, cons, conshdlrdata, &cutoff, nfixedvars, naggrvars, ndelconss) );
15151 if( !cutoff && SCIPconsIsActive(cons) && conshdlrdata->dualpresolving && SCIPallowDualReds(scip) )
15166 /* remember the first constraint that was not yet tried to be upgraded, to begin the next upgrading round with */
15175 if( !cutoff && (presoltiming & SCIP_PRESOLTIMING_EXHAUSTIVE) != 0 && (conshdlrdata->presolusehashing || conshdlrdata->presolpairwise) && !SCIPisStopped(scip) )
15181 /* detect redundant constraints; fast version with hash table instead of pairwise comparison */
15182 SCIP_CALL( detectRedundantConstraints(scip, SCIPblkmem(scip), conss, nconss, &firstchange, &cutoff,
15225 npaircomparisons += (SCIPconsGetData(conss[c])->changed) ? c : (c - firstchange); /*lint !e776*/
15228 SCIP_CALL( preprocessConstraintPairs(scip, usefulconss, firstchange, c, conshdlrdata->maxaggrnormscale,
15234 if( ((*ndelconss - oldndelconss) + (*nchgsides - oldnchgsides)/2.0 + (*nchgcoefs - oldnchgcoefs)/10.0) / ((SCIP_Real) npaircomparisons) < conshdlrdata->mingainpernmincomp )
15247 /* before upgrading, check whether we can apply some additional dual presolving, because a variable only appears
15251 && *nfixedvars == oldnfixedvars && *naggrvars == oldnaggrvars && *nchgbds == oldnchgbds && *ndelconss == oldndelconss
15262 * only upgrade constraints, if no reductions were found in this round (otherwise, the linear constraint handler
15263 * may find additional reductions before giving control away to other (less intelligent?) constraint handlers)
15265 if( !cutoff && (presoltiming & SCIP_PRESOLTIMING_EXHAUSTIVE) != 0 && SCIPisPresolveFinished(scip) )
15278 /* only upgrade completely presolved constraints, that changed since the last upgrading call */
15305 * delete upgraded equalities, if we don't need it anymore for aggregation and redundancy checking
15321 else if( *nfixedvars > oldnfixedvars || *naggrvars > oldnaggrvars || *nchgbds > oldnchgbds || *ndelconss > oldndelconss
15340 SCIP_CALL( resolvePropagation(scip, cons, infervar, intToInferInfo(inferinfo), boundtype, bdchgidx, result) );
15446 SCIP_CALL( SCIPcopyConsLinear(scip, cons, sourcescip, consname, nvars, sourcevars, sourcecoefs,
15447 SCIPgetLhsLinear(sourcescip, sourcecons), SCIPgetRhsLinear(sourcescip, sourcecons), varmap, consmap,
15448 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, global, valid) );
15488 if( isdigit((unsigned char)str[0]) || ((str[0] == '-' || str[0] == '+') && isdigit((unsigned char)str[1])) )
15523 SCIP_CALL( SCIPparseVarsLinearsum(scip, str, vars, coefs, &nvars, coefssize, &requsize, &endptr, success) );
15532 SCIP_CALL( SCIPparseVarsLinearsum(scip, str, vars, coefs, &nvars, coefssize, &requsize, &endptr, success) );
15533 assert(!*success || requsize <= coefssize); /* if successful, then should have had enough space now */
15601 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
15634 /** constraint method of constraint handler which returns the number of variables (if possible) */
15702 /* bound change can turn the constraint infeasible or redundant only if it was a tightening */
15708 /* reset maximal activity delta, so that it will be recalculated on the next real propagation */
15716 else if( (eventtype & SCIP_EVENTTYPE_BOUNDRELAXED) != 0 && !SCIPisInfinity(scip, consdata->maxactdelta) )
15736 /* check whether bound tightening might now be successful (if the current bound was relaxed, it might be
15766 /* reset maximal activity delta, so that it will be recalculated on the next real propagation */
15776 /* there is only one lock left: we may multi-aggregate the variable as slack of an equation */
15844 /* create array of variables and coefficients: sum_{i \in P} x_i - sum_{i \in N} x_i >= 1 - |N| */
15876 (void) SCIPsnprintf(consname, SCIP_MAXSTRLEN, "cf%"SCIP_LONGINT_FORMAT, SCIPgetNConflictConssApplied(scip));
15877 SCIP_CALL( SCIPcreateConsLinear(scip, &cons, consname, nbdchginfos, vars, vals, lhs, SCIPinfinity(scip),
15880 /* try to automatically convert a linear constraint into a more specific and more specialized constraint */
15908 /** upgrades quadratic constraints with only and at least one linear variables into a linear constraint
15969 {
15977 SCIPgetNLinearVarsNonlinear(scip, cons), SCIPgetLinearVarsNonlinear(scip, cons), SCIPgetLinearCoefsNonlinear(scip, cons),
16008 SCIP_CALL( SCIPincludeConflicthdlrBasic(scip, &conflicthdlr, CONFLICTHDLR_NAME, CONFLICTHDLR_DESC, CONFLICTHDLR_PRIORITY,
16038 SCIP_CALL( SCIPsetConshdlrPresol(scip, conshdlr, consPresolLinear, CONSHDLR_MAXPREROUNDS, CONSHDLR_PRESOLTIMING) );
16040 SCIP_CALL( SCIPsetConshdlrProp(scip, conshdlr, consPropLinear, CONSHDLR_PROPFREQ, CONSHDLR_DELAYPROP,
16043 SCIP_CALL( SCIPsetConshdlrSepa(scip, conshdlr, consSepalpLinear, consSepasolLinear, CONSHDLR_SEPAFREQ,
16050 SCIP_CALL( SCIPincludeQuadconsUpgrade(scip, upgradeConsQuadratic, QUADCONSUPGD_PRIORITY, TRUE, CONSHDLR_NAME) );
16056 SCIP_CALL( SCIPincludeNonlinconsUpgrade(scip, upgradeConsNonlinear, NULL, NONLINCONSUPGD_PRIORITY, TRUE, CONSHDLR_NAME) );
16062 "multiplier on propagation frequency, how often the bounds are tightened (-1: never, 0: only at root)",
16063 &conshdlrdata->tightenboundsfreq, TRUE, DEFAULT_TIGHTENBOUNDSFREQ, -1, INT_MAX, NULL, NULL) );
16098 "maximal allowed relative gain in maximum norm for constraint aggregation (0.0: disable constraint aggregation)",
16099 &conshdlrdata->maxaggrnormscale, TRUE, DEFAULT_MAXAGGRNORMSCALE, 0.0, SCIP_REAL_MAX, NULL, NULL) );
16102 "maximum activity delta to run easy propagation on linear constraint (faster, but numerically less stable)",
16103 &conshdlrdata->maxeasyactivitydelta, TRUE, DEFAULT_MAXEASYACTIVITYDELTA, 0.0, SCIP_REAL_MAX, NULL, NULL) );
16106 "maximal relative distance from current node's dual bound to primal bound compared to best node's dual bound for separating knapsack cardinality cuts",
16110 "should all constraints be subject to cardinality cut generation instead of only the ones with non-zero dual value?",
16125 "constraints/" CONSHDLR_NAME "/sortvars", "apply binaries sorting in decr. order of coeff abs value?",
16129 "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)?",
16133 "should presolving try to detect constraints parallel to the objective function defining an upper bound and prevent these constraints from entering the LP?",
16137 "should presolving try to detect constraints parallel to the objective function defining a lower bound and prevent these constraints from entering the LP?",
16145 "should presolving and propagation try to improve bounds, detect infeasibility, and extract sub-constraints from ranged rows and equations?",
16206 (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/linear/upgrade/%s", conshdlrname);
16207 (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "enable linear upgrading for constraint handler <%s>", conshdlrname);
16218 * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
16247 SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
16249 SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
16274 /* for the solving process we need linear rows, containing only active variables; therefore when creating a linear
16290 SCIP_CALL( SCIPgetProbvarLinearSum(scip, consvars, consvals, &nconsvars, nconsvars, &constant, &requiredsize, TRUE) );
16298 SCIP_CALL( SCIPgetProbvarLinearSum(scip, consvars, consvals, &nconsvars, requiredsize, &constant, &requiredsize, TRUE) );
16312 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);
16322 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);
16338 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);
16348 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);
16391 SCIP_CALL( SCIPcreateCons(scip, cons, name, conshdlr, consdata, initial, separate, enforce, check, propagate,
16405 * in its most basic version, i. e., all constraint flags are set to their basic value as explained for the
16406 * method SCIPcreateConsLinear(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h
16410 * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
16439 SCIP_Real* sourcecoefs, /**< coefficient array of the linear constraint, or NULL if all coefficients are one */
16442 SCIP_HASHMAP* varmap, /**< a SCIP_HASHMAP mapping variables of the source SCIP to corresponding
16444 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
16454 SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup? */
16455 SCIP_Bool stickingatnode, /**< should the constraint always be kept at the node where it was added, even
16479 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
16500 /* transform source variable to active variables of the source SCIP since only these can be mapped to variables of
16505 SCIP_CALL( SCIPgetProbvarLinearSum(sourcescip, vars, coefs, &nvars, nvars, &constant, &requiredsize, TRUE) );
16512 SCIP_CALL( SCIPgetProbvarLinearSum(sourcescip, vars, coefs, &nvars, requiredsize, &constant, &requiredsize, TRUE) );
16546 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
16574 /* for the solving process we need linear rows, containing only active variables; therefore when creating a linear
16596 SCIP_CALL( SCIPgetProbvarLinearSum(scip, consvars, consvals, &nconsvars, nconsvars, &constant, &requiredsize, TRUE) );
16604 SCIP_CALL( SCIPgetProbvarLinearSum(scip, consvars, consvals, &nconsvars, requiredsize, &constant, &requiredsize, TRUE) );
16625 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));
16635 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));
16651 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));
16661 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));
16711 /** changes coefficient of variable in linear constraint; deletes the variable if coefficient is zero; adds variable if
16714 * @note This method may only be called during problem creation stage for an original constraint and variable.
16716 * @note This method requires linear time to search for occurences of the variable in the constraint data.
16740 if( SCIPgetStage(scip) > SCIP_STAGE_PROBLEM || !SCIPconsIsOriginal(cons) || !SCIPvarIsOriginal(var) )
16742 SCIPerrorMessage("method may only be called during problem creation stage for original constraints and variables\n");
16760 /* decrease i by one since otherwise we would skip the coefficient which has been switched to position i */
16782 * @note This method may only be called during problem creation stage for an original constraint and variable.
16784 * @note This method requires linear time to search for occurences of the variable in the constraint data.
16912 /** gets the array of variables in the linear constraint; the user must not modify this array! */
16936 /** gets the array of coefficient values in the linear constraint; the user must not modify this array! */
16962 * @note if the solution contains values at infinity, this method will return SCIP_INVALID in case the activity
16981 }
17009 }
17074 /** returns the linear relaxation of the given linear constraint; may return NULL if no LP row was yet created;
17100 /** tries to automatically convert a linear constraint into a more specific and more specialized constraint */
17141 /* we cannot upgrade a modifiable linear constraint, since we don't know what additional coefficients to expect */
17163 /* check, if the constraint was already upgraded and will be deleted anyway after preprocessing */
17172 SCIPerrorMessage("cannot upgrade linear constraint that is already stored as row in the LP\n");
17292 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",
17304 nposbin, nnegbin, nposint, nnegint, nposimpl, nnegimpl, nposimplbin, nnegimplbin, nposcont, nnegcont,
17315 SCIPdebugMessage(" -> upgraded to constraint type <%s>\n", SCIPconshdlrGetName(SCIPconsGetHdlr(*upgdcons)));
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed) Definition: scip.c:22764 SCIP_RETCODE SCIPcreateConsBasicLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs) Definition: cons_linear.c:16428 SCIP_Real SCIPvarGetMultaggrConstant(SCIP_VAR *var) Definition: var.c:16759 Definition: type_result.h:33 SCIP_Real SCIPgetRowSolFeasibility(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol) Definition: scip.c:28295 SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name) Definition: scip.c:5847 Definition: type_result.h:37 SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSTRANS((*constrans))) Definition: scip.c:5557 static SCIP_RETCODE tightenVarBounds(SCIP *scip, SCIP_CONS *cons, int pos, SCIP_Bool *cutoff, int *nchgbds, SCIP_Bool force) Definition: cons_linear.c:6542 Definition: struct_var.h:97 static SCIP_RETCODE consdataCreate(SCIP *scip, SCIP_CONSDATA **consdata, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs) Definition: cons_linear.c:846 static SCIP_RETCODE consCatchEvent(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, int pos) Definition: cons_linear.c:702 static SCIP_RETCODE chgCoefPos(SCIP *scip, SCIP_CONS *cons, int pos, SCIP_Real newval) Definition: cons_linear.c:3701 static SCIP_RETCODE simplifyInequalities(SCIP *scip, SCIP_CONS *cons, int *nchgcoefs, int *nchgsides) Definition: cons_linear.c:10999 SCIP_Real SCIPgetRowSolActivity(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol) Definition: scip.c:28272 static SCIP_Real consdataGetFeasibility(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_SOL *sol) Definition: cons_linear.c:2891 SCIP_RETCODE SCIPaggregateVars(SCIP *scip, SCIP_VAR *varx, SCIP_VAR *vary, SCIP_Real scalarx, SCIP_Real scalary, SCIP_Real rhs, SCIP_Bool *infeasible, SCIP_Bool *redundant, SCIP_Bool *aggregated) Definition: scip.c:22873 SCIP_RETCODE SCIPgetProbvarLinearSum(SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, int varssize, SCIP_Real *constant, int *requiredsize, SCIP_Bool mergemultiples) Definition: scip.c:17456 Definition: type_var.h:40 Definition: struct_scip.h:53 SCIP_RETCODE SCIPvarGetOrigvarSum(SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant) Definition: var.c:11991 static void calculateMinvalAndMaxval(SCIP *scip, SCIP_Real side, SCIP_Real val, SCIP_Real minresactivity, SCIP_Real maxresactivity, SCIP_Real *minval, SCIP_Real *maxval) Definition: cons_linear.c:10180 static void consdataUpdateSignatures(SCIP_CONSDATA *consdata, int pos) Definition: cons_linear.c:2926 SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element) Definition: misc.c:1562 static void consdataUpdateActivities(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR *var, SCIP_Real oldbound, SCIP_Real newbound, SCIP_Real val, SCIP_BOUNDTYPE boundtype, SCIP_Bool global, SCIP_Bool checkreliability) Definition: cons_linear.c:1440 static void consdataRecomputeMaxActivityDelta(SCIP *scip, SCIP_CONSDATA *consdata) Definition: cons_linear.c:1378 static SCIP_Bool checkEqualObjective(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_Real *scale, SCIP_Real *offset) Definition: cons_linear.c:9788 static SCIP_RETCODE fixVariables(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff, int *nfixedvars) Definition: cons_linear.c:7467 static SCIP_RETCODE convertUnaryEquality(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff, int *nfixedvars, int *ndelconss) Definition: cons_linear.c:9079 void SCIPwarningMessage(SCIP *scip, const char *formatstr,...) Definition: scip.c:1220 SCIP_RETCODE SCIPcreateVar(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype, SCIP_Bool initial, SCIP_Bool removable, SCIP_DECL_VARDELORIG((*vardelorig)), SCIP_DECL_VARTRANS((*vartrans)), SCIP_DECL_VARDELTRANS((*vardeltrans)), SCIP_DECL_VARCOPY((*varcopy)), SCIP_VARDATA *vardata) Definition: scip.c:15823 static SCIP_RETCODE tightenVarLb(SCIP *scip, SCIP_CONS *cons, int pos, PROPRULE proprule, SCIP_Real newlb, SCIP_Real oldlb, SCIP_Bool *cutoff, int *nchgbds, SCIP_Bool force) Definition: cons_linear.c:5050 SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:41528 SCIP_RETCODE SCIPsetConshdlrResprop(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSRESPROP((*consresprop))) Definition: scip.c:5603 SCIP_RETCODE SCIPsetConshdlrSepa(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), int sepafreq, int sepapriority, SCIP_Bool delaysepa) Definition: scip.c:5215 static SCIP_RETCODE consDropAllEvents(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr) Definition: cons_linear.c:804 Definition: type_result.h:49 static void consdataUpdateActivitiesGlbUb(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_Real oldub, SCIP_Real newub, SCIP_Real val, SCIP_Bool checkreliability) Definition: cons_linear.c:1871 Definition: type_set.h:35 SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy))) Definition: scip.c:5303 SCIP_RETCODE SCIPupdateCutoffbound(SCIP *scip, SCIP_Real cutoffbound) Definition: scip.c:38171 static SCIP_Real consdataGetMaxAbsval(SCIP_CONSDATA *consdata) Definition: cons_linear.c:2052 static SCIP_RETCODE linconsupgradeCreate(SCIP *scip, SCIP_LINCONSUPGRADE **linconsupgrade, SCIP_DECL_LINCONSUPGD((*linconsupgd)), int priority) Definition: cons_linear.c:493 void SCIPsortDownRealPtr(SCIP_Real *realarray, void **ptrarray, int len) SCIP_RETCODE SCIPseparateRelaxedKnapsack(SCIP *scip, SCIP_CONS *cons, SCIP_SEPA *sepa, int nknapvars, SCIP_VAR **knapvars, SCIP_Real *knapvals, SCIP_Real valscale, SCIP_Real rhs, SCIP_SOL *sol, SCIP_Bool *cutoff, int *ncuts) Definition: cons_knapsack.c:5737 Definition: struct_var.h:196 SCIP_RETCODE SCIPupdateLocalLowerbound(SCIP *scip, SCIP_Real newbound) Definition: scip.c:12339 static void consdataRecomputeMinactivity(SCIP *scip, SCIP_CONSDATA *consdata) Definition: cons_linear.c:1172 SCIP_Bool SCIPisConflictAnalysisApplicable(SCIP *scip) Definition: scip.c:24307 SCIP_RETCODE SCIPgetProbvarSum(SCIP *scip, SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant) Definition: scip.c:17512 SCIP_Real SCIPgetDualfarkasLinear(SCIP *scip, SCIP_CONS *cons) Definition: cons_linear.c:17064 SCIP_RETCODE SCIPsetConshdlrGetVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETVARS((*consgetvars))) Definition: scip.c:5787 static void consdataGetGlbActivityBounds(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_Bool goodrelax, SCIP_Real *glbminactivity, SCIP_Real *glbmaxactivity, SCIP_Bool *minisrelax, SCIP_Bool *maxisrelax, SCIP_Bool *isminsettoinfinity, SCIP_Bool *ismaxsettoinfinity) Definition: cons_linear.c:2608 Definition: type_message.h:45 static void permSortConsdata(SCIP_CONSDATA *consdata, int *perm, int nvars) Definition: cons_linear.c:2984 Definition: cons_linear.c:338 static SCIP_DECL_HASHGETKEY(hashGetKeyLinearcons) Definition: cons_linear.c:12505 static void consdataInvalidateActivities(SCIP_CONSDATA *consdata) Definition: cons_linear.c:1075 SCIP_DECL_LINCONSUPGD((*linconsupgd)) SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata) Definition: scip.c:7747 int SCIPgetNVarsLinear(SCIP *scip, SCIP_CONS *cons) Definition: cons_linear.c:16905 SCIP_RETCODE SCIPincludeConshdlrLinear(SCIP *scip) Definition: cons_linear.c:16008 static void consdataGetGlbActivityResiduals(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR *var, SCIP_Real val, SCIP_Bool goodrelax, SCIP_Real *minresactivity, SCIP_Real *maxresactivity, SCIP_Bool *minisrelax, SCIP_Bool *maxisrelax, SCIP_Bool *isminsettoinfinity, SCIP_Bool *ismaxsettoinfinity) Definition: cons_linear.c:2670 static SCIP_Bool conshdlrdataHasUpgrade(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_DECL_LINCONSUPGD((*linconsupgd)), const char *conshdlrname) Definition: cons_linear.c:574 SCIP_Real SCIPbdchginfoGetNewbound(SCIP_BDCHGINFO *bdchginfo) Definition: var.c:17546 Definition: type_var.h:53 SCIP_RETCODE SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPARSE((*consparse))) Definition: scip.c:5764 static SCIP_RETCODE separateCons(SCIP *scip, SCIP_CONS *cons, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_SOL *sol, SCIP_Bool separatecards, SCIP_Bool separateall, int *ncuts, SCIP_Bool *cutoff) Definition: cons_linear.c:7245 static SCIP_Bool consdataIsResidualIntegral(SCIP *scip, SCIP_CONSDATA *consdata, int pos, SCIP_Real val) Definition: cons_linear.c:10154 static SCIP_RETCODE preprocessConstraintPairs(SCIP *scip, SCIP_CONS **conss, int firstchange, int chkind, SCIP_Real maxaggrnormscale, SCIP_Bool *cutoff, int *ndelconss, int *nchgsides, int *nchgcoefs) Definition: cons_linear.c:12802 Definition: cons_linear.c:336 SCIP_RETCODE SCIPconvertCutsToConss(SCIP *scip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, int *ncutsadded) Definition: scip.c:2792 SCIP_RETCODE SCIPchgVarObj(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj) Definition: scip.c:19656 SCIP_VAR ** SCIPgetLinearVarsNonlinear(SCIP *scip, SCIP_CONS *cons) Definition: cons_nonlinear.c:9549 SCIP_RETCODE SCIPparseVarsLinearsum(SCIP *scip, const char *str, SCIP_VAR **vars, SCIP_Real *vals, int *nvars, int varssize, int *requiredsize, char **endptr, SCIP_Bool *success) Definition: scip.c:16416 SCIP_RETCODE SCIPmarkConsPropagate(SCIP *scip, SCIP_CONS *cons) Definition: scip.c:25773 SCIP_RETCODE SCIPaddVarsToRow(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real *vals) Definition: scip.c:27875 SCIP_Bool SCIPisSumGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:41453 static SCIP_RETCODE tightenSides(SCIP *scip, SCIP_CONS *cons, int *nchgsides) Definition: cons_linear.c:8568 SCIP_Real SCIPvarGetLbAtIndex(SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after) Definition: var.c:15695 SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var) Definition: scip.c:34593 SCIP_Real SCIPselectSimpleValue(SCIP_Real lb, SCIP_Real ub, SCIP_Longint maxdnom) Definition: misc.c:7615 Definition: type_result.h:40 SCIP_Bool SCIPisSumRelLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:41982 int SCIPgetNLinearVarsNonlinear(SCIP *scip, SCIP_CONS *cons) Definition: cons_nonlinear.c:9537 SCIP_Real SCIPgetRhsNonlinear(SCIP *scip, SCIP_CONS *cons) Definition: cons_nonlinear.c:9636 void SCIPsortDownRealInt(SCIP_Real *realarray, int *intarray, int len) static SCIP_RETCODE detectRedundantConstraints(SCIP *scip, BMS_BLKMEM *blkmem, SCIP_CONS **conss, int nconss, int *firstchange, SCIP_Bool *cutoff, int *ndelconss, int *nchgsides) Definition: cons_linear.c:12621 SCIP_RETCODE SCIPchgRowRhs(SCIP *scip, SCIP_ROW *row, SCIP_Real rhs) Definition: scip.c:27770 SCIP_RETCODE SCIPsetConsPropagated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool propagate) Definition: scip.c:25134 static SCIP_RETCODE rangedRowPropagation(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff, int *nfixedvars, int *nchgbds, int *naddconss) Definition: cons_linear.c:5435 SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file) Definition: scip.c:26224 SCIP_RETCODE SCIPaddCut(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut, SCIP_Bool forcecut, SCIP_Bool *infeasible) Definition: scip.c:30577 static SCIP_RETCODE consDropEvent(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, int pos) Definition: cons_linear.c:738 static SCIP_RETCODE addConflictFixedVars(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *infervar, SCIP_BDCHGIDX *bdchgidx, int inferpos) Definition: cons_linear.c:4720 SCIP_Real SCIPgetLhsNonlinear(SCIP *scip, SCIP_CONS *cons) Definition: cons_nonlinear.c:9624 SCIP_Bool SCIPisLbBetter(SCIP *scip, SCIP_Real newlb, SCIP_Real oldlb, SCIP_Real oldub) Definition: scip.c:41863 SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSFREE((*consfree))) Definition: scip.c:5328 SCIP_RETCODE SCIPinferVarUbCons(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_CONS *infercons, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened) Definition: scip.c:20638 Definition: struct_conflict.h:39 static SCIP_RETCODE rangedRowSimplify(SCIP *scip, SCIP_CONS *cons, int *nchgcoefs, int *nchgsides) Definition: cons_linear.c:10887 SCIP_RETCODE SCIPhashtableCreate(SCIP_HASHTABLE **hashtable, BMS_BLKMEM *blkmem, int tablesize, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr) Definition: misc.c:1475 SCIP_RETCODE SCIPanalyzeConflictCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success) Definition: scip.c:24707 Definition: struct_sol.h:50 SCIP_RETCODE SCIPsetConshdlrInit(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINIT((*consinit))) Definition: scip.c:5352 SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata) Definition: scip.c:3516 SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata) Definition: scip.c:3542 SCIP_Bool SCIPdoNotMultaggrVar(SCIP *scip, SCIP_VAR *var) Definition: scip.c:23057 SCIP_Bool SCIPisUpdateUnreliable(SCIP *scip, SCIP_Real newvalue, SCIP_Real oldvalue) Definition: scip.c:42063 SCIP_Bool SCIPrealToRational(SCIP_Real val, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Longint *nominator, SCIP_Longint *denominator) Definition: misc.c:7210 SCIP_CONSHDLRDATA * SCIPconshdlrGetData(SCIP_CONSHDLR *conshdlr) Definition: cons.c:3921 static void linconsupgradeFree(SCIP *scip, SCIP_LINCONSUPGRADE **linconsupgrade) Definition: cons_linear.c:514 static SCIP_RETCODE analyzeConflict(SCIP *scip, SCIP_CONS *cons, SCIP_Bool reasonisrhs) Definition: cons_linear.c:4928 static SCIP_RETCODE checkCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool checklprows, SCIP_Bool checkrelmaxabs, SCIP_Bool *violated) Definition: cons_linear.c:6955 SCIP_RETCODE SCIPcatchVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos) Definition: scip.c:36232 static SCIP_RETCODE checkParallelObjective(SCIP *scip, SCIP_CONS *cons, SCIP_CONSHDLRDATA *conshdlrdata) Definition: cons_linear.c:9980 static SCIP_RETCODE aggregateConstraints(SCIP *scip, SCIP_CONS *cons0, SCIP_CONS *cons1, int *commonidx0, int *commonidx1, int *diffidx0minus1, int *diffidx1minus0, int nvarscommon, int commonidxweight, int diffidx0minus1weight, int diffidx1minus0weight, SCIP_Real maxaggrnormscale, int *nchgcoefs, SCIP_Bool *aggregated) Definition: cons_linear.c:12192 Definition: struct_misc.h:101 Constraint handler for knapsack constraints of the form , x binary and . SCIP_RETCODE SCIPincludeNonlinconsUpgrade(SCIP *scip, SCIP_DECL_NONLINCONSUPGD((*nonlinconsupgd)), SCIP_DECL_EXPRGRAPHNODEREFORM((*nodereform)), int priority, SCIP_Bool active, const char *conshdlrname) Definition: cons_nonlinear.c:9123 static SCIP_RETCODE updateCutoffbound(SCIP *scip, SCIP_CONS *cons, SCIP_Real primalbound) Definition: cons_linear.c:9934 SCIP_RETCODE SCIPgetVarCopy(SCIP *sourcescip, SCIP *targetscip, SCIP_VAR *sourcevar, SCIP_VAR **targetvar, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, SCIP_Bool *success) Definition: scip.c:1750 static SCIP_RETCODE addRelaxation(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *cutoff) Definition: cons_linear.c:7196 SCIP_Real * SCIPgetLinearCoefsNonlinear(SCIP *scip, SCIP_CONS *cons) Definition: cons_nonlinear.c:9561 static SCIP_RETCODE tightenVarUb(SCIP *scip, SCIP_CONS *cons, int pos, PROPRULE proprule, SCIP_Real newub, SCIP_Real oldub, SCIP_Bool *cutoff, int *nchgbds, SCIP_Bool force) Definition: cons_linear.c:4981 SCIP_ROW * SCIPgetRowLinear(SCIP *scip, SCIP_CONS *cons) Definition: cons_linear.c:17093 static void getMaxActivity(SCIP *scip, SCIP_CONSDATA *consdata, int posinf, int neginf, int poshuge, int neghuge, SCIP_Real delta, SCIP_Bool global, SCIP_Bool goodrelax, SCIP_Real *maxactivity, SCIP_Bool *isrelax, SCIP_Bool *issettoinfinity) Definition: cons_linear.c:2231 SCIP_RETCODE SCIPgetTransformedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **transvar) Definition: scip.c:17159 int SCIPgetNLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons) Definition: cons_quadratic.c:13634 Definition: type_result.h:35 Definition: struct_cons.h:36 #define SCIPfreeBlockMemoryArrayNull(scip, ptr, num) Definition: scip.h:20403 SCIP_RETCODE SCIPunlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup) Definition: scip.c:19592 SCIP_RETCODE SCIPupdateConsFlags(SCIP *scip, SCIP_CONS *cons0, SCIP_CONS *cons1) Definition: scip.c:25287 static SCIP_DECL_QUADCONSUPGD(upgradeConsQuadratic) Definition: cons_linear.c:15927 Definition: struct_cons.h:116 static void consdataGetActivityBounds(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_Bool goodrelax, SCIP_Real *minactivity, SCIP_Real *maxactivity, SCIP_Bool *minisrelax, SCIP_Bool *maxisrelax) Definition: cons_linear.c:2330 SCIP_Real SCIPvarGetUbAtIndex(SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after) Definition: var.c:15787 Definition: type_lp.h:47 static void consdataCalcMaxAbsval(SCIP_CONSDATA *consdata) Definition: cons_linear.c:1278 SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming) Definition: scip.c:5496 static SCIP_RETCODE chgRhs(SCIP *scip, SCIP_CONS *cons, SCIP_Real rhs) Definition: cons_linear.c:3320 Definition: type_result.h:36 SCIP_Real SCIPadjustedVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real ub) Definition: scip.c:19783 static SCIP_RETCODE conshdlrdataEnsureLinconsupgradesSize(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, int num) Definition: cons_linear.c:433 static void consdataUpdateDelCoef(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR *var, SCIP_Real val, SCIP_Bool checkreliability) Definition: cons_linear.c:1934 static SCIP_RETCODE consdataSort(SCIP *scip, SCIP_CONSDATA *consdata) Definition: cons_linear.c:3057 static void consdataUpdateAddCoef(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR *var, SCIP_Real val, SCIP_Bool checkreliability) Definition: cons_linear.c:1894 static int inferInfoGetProprule(INFERINFO inferinfo) Definition: cons_linear.c:381 static SCIP_RETCODE consdataTightenCoefs(SCIP *scip, SCIP_CONS *cons, int *nchgcoefs, int *nchgsides) Definition: cons_linear.c:8653 SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:41515 Definition: type_set.h:45 constraint handler for quadratic constraints Definition: type_var.h:42 SCIP_RETCODE SCIPsetConshdlrExitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITPRE((*consexitpre))) Definition: scip.c:5472 SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons) Definition: cons_linear.c:16842 #define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum) Definition: scip.h:20391 SCIP_Bool SCIPisScalingIntegral(SCIP *scip, SCIP_Real val, SCIP_Real scalar) Definition: scip.c:41341 Definition: type_var.h:44 SCIP_RETCODE SCIPincludeConflicthdlrBasic(SCIP *scip, SCIP_CONFLICTHDLR **conflicthdlrptr, const char *name, const char *desc, int priority, SCIP_DECL_CONFLICTEXEC((*conflictexec)), SCIP_CONFLICTHDLRDATA *conflicthdlrdata) Definition: scip.c:5931 static SCIP_RETCODE addConflictReasonVars(SCIP *scip, SCIP_VAR **vars, int nvars, SCIP_VAR *var, SCIP_Real bound) Definition: cons_linear.c:4784 static SCIP_RETCODE delCoefPos(SCIP *scip, SCIP_CONS *cons, int pos) Definition: cons_linear.c:3585 static SCIP_RETCODE resolvePropagation(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *infervar, INFERINFO inferinfo, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_RESULT *result) Definition: cons_linear.c:4835 SCIP_Real SCIPgetFeasibilityLinear(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol) Definition: cons_linear.c:17009 static SCIP_RETCODE checkPartialObjective(SCIP *scip, SCIP_CONS *cons, SCIP_CONSHDLRDATA *conshdlrdata) Definition: cons_linear.c:9867 static SCIP_RETCODE conshdlrdataIncludeUpgrade(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_LINCONSUPGRADE *linconsupgrade) Definition: cons_linear.c:604 Definition: type_set.h:41 Definition: type_retcode.h:33 SCIP_RETCODE SCIPsetConshdlrProp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING proptiming) Definition: scip.c:5261 static SCIP_Bool canTightenBounds(SCIP *scip, SCIP_CONS *cons) Definition: cons_linear.c:4952 static SCIP_RETCODE tightenVarBoundsEasy(SCIP *scip, SCIP_CONS *cons, int pos, SCIP_Bool *cutoff, int *nchgbds, SCIP_Bool force) Definition: cons_linear.c:5119 SCIP_RETCODE SCIPincludeConshdlrBasic(SCIP *scip, SCIP_CONSHDLR **conshdlrptr, const char *name, const char *desc, int enfopriority, int chckpriority, int eagerfreq, SCIP_Bool needscons, SCIP_DECL_CONSENFOLP((*consenfolp)), SCIP_DECL_CONSENFOPS((*consenfops)), SCIP_DECL_CONSCHECK((*conscheck)), SCIP_DECL_CONSLOCK((*conslock)), SCIP_CONSHDLRDATA *conshdlrdata) Definition: scip.c:5161 SCIP_RETCODE SCIPhashtableRemove(SCIP_HASHTABLE *hashtable, void *element) Definition: misc.c:1714 static void getMinActivity(SCIP *scip, SCIP_CONSDATA *consdata, int posinf, int neginf, int poshuge, int neghuge, SCIP_Real delta, SCIP_Bool global, SCIP_Bool goodrelax, SCIP_Real *minactivity, SCIP_Bool *isrelax, SCIP_Bool *issettoinfinity) Definition: cons_linear.c:2130 Definition: type_result.h:42 static SCIP_RETCODE scaleCons(SCIP *scip, SCIP_CONS *cons, SCIP_Real scalar) Definition: cons_linear.c:3763 SCIP_VAR ** SCIPgetLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons) Definition: cons_quadratic.c:13648 SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:41554 SCIP_EXPRGRAPHNODE * SCIPgetExprgraphNodeNonlinear(SCIP *scip, SCIP_CONS *cons) Definition: cons_nonlinear.c:9612 const char * SCIPconflicthdlrGetName(SCIP_CONFLICTHDLR *conflicthdlr) Definition: conflict.c:706 SCIP_RETCODE SCIPmultiaggregateVar(SCIP *scip, SCIP_VAR *var, int naggvars, SCIP_VAR **aggvars, SCIP_Real *scalars, SCIP_Real constant, SCIP_Bool *infeasible, SCIP_Bool *aggregated) Definition: scip.c:23007 static SCIP_DECL_HASHKEYVAL(hashKeyValLinearcons) Definition: cons_linear.c:12570 SCIP_RETCODE SCIPaddConsNode(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons, SCIP_NODE *validnode) Definition: scip.c:11966 SCIP_RETCODE SCIPaddVarImplication(SCIP *scip, SCIP_VAR *var, SCIP_Bool varfixing, SCIP_VAR *implvar, SCIP_BOUNDTYPE impltype, SCIP_Real implbound, SCIP_Bool *infeasible, int *nbdchgs) Definition: scip.c:21688 static SCIP_RETCODE propagateCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool tightenbounds, SCIP_Bool rangedrowpropagation, SCIP_Real maxeasyactivitydelta, SCIP_Bool sortvars, SCIP_Bool *cutoff, int *nchgbds) Definition: cons_linear.c:7335 static void consdataUpdateChgCoef(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR *var, SCIP_Real oldval, SCIP_Real newval, SCIP_Bool checkreliability) Definition: cons_linear.c:1977 SCIP_RETCODE SCIPgetTransformedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars) Definition: scip.c:17200 static SCIP_RETCODE consdataPrint(SCIP *scip, SCIP_CONSDATA *consdata, FILE *file) Definition: cons_linear.c:1036 SCIP_RETCODE SCIPsetConshdlrDelvars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELVARS((*consdelvars))) Definition: scip.c:5718 SCIP_RETCODE SCIPchgVarType(SCIP *scip, SCIP_VAR *var, SCIP_VARTYPE vartype, SCIP_Bool *infeasible) Definition: scip.c:22668 void SCIPhashtablePrintStatistics(SCIP_HASHTABLE *hashtable, SCIP_MESSAGEHDLR *messagehdlr) Definition: misc.c:1789 SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened) Definition: scip.c:20259 public data structures and miscellaneous methods static SCIP_RETCODE chgLhs(SCIP *scip, SCIP_CONS *cons, SCIP_Real lhs) Definition: cons_linear.c:3205 SCIP_RETCODE SCIPsetConshdlrInitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITPRE((*consinitpre))) Definition: scip.c:5448 SCIP_RETCODE SCIPcreateCons(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_CONSHDLR *conshdlr, SCIP_CONSDATA *consdata, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode) Definition: scip.c:24759 SCIP_RETCODE SCIPaddClique(SCIP *scip, SCIP_VAR **vars, SCIP_Bool *values, int nvars, SCIP_Bool isequation, SCIP_Bool *infeasible, int *nbdchgs) Definition: scip.c:21797 SCIP_RETCODE SCIPsetConsEnforced(SCIP *scip, SCIP_CONS *cons, SCIP_Bool enforce) Definition: scip.c:25084 SCIP_RETCODE SCIPchgCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val) Definition: cons_linear.c:16734 Definition: type_var.h:55 static SCIP_RETCODE performVarDeletions(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss) Definition: cons_linear.c:3847 static void consdataRecomputeGlbMaxactivity(SCIP *scip, SCIP_CONSDATA *consdata) Definition: cons_linear.c:1252 static SCIP_Real consdataGetActivity(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_SOL *sol) Definition: cons_linear.c:2822 constraint handler for nonlinear constraints static void conshdlrdataFree(SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata) Definition: cons_linear.c:552 Definition: type_var.h:54 Definition: type_var.h:46 SCIP_Bool SCIPstrToRealValue(const char *str, SCIP_Real *value, char **endptr) Definition: misc.c:8240 SCIP_RETCODE SCIPaddConflictLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx) Definition: scip.c:24356 static SCIP_RETCODE mergeMultiples(SCIP *scip, SCIP_CONS *cons) Definition: cons_linear.c:4229 Definition: struct_lp.h:189 SCIP_RETCODE SCIPflattenVarAggregationGraph(SCIP *scip, SCIP_VAR *var) Definition: scip.c:17412 methods for debugging static void consdataUpdateActivitiesGlbLb(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_Real oldlb, SCIP_Real newlb, SCIP_Real val, SCIP_Bool checkreliability) Definition: cons_linear.c:1848 SCIP_Real * SCIPgetCoefsLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons) Definition: cons_quadratic.c:13662 Definition: type_set.h:39 static SCIP_Real consdataComputePseudoActivity(SCIP *scip, SCIP_CONSDATA *consdata) Definition: cons_linear.c:1119 SCIP_Real SCIPvarGetNegationConstant(SCIP_VAR *var) Definition: var.c:16792 static void consdataCalcActivities(SCIP *scip, SCIP_CONSDATA *consdata) Definition: cons_linear.c:2070 int SCIPgetNQuadVarTermsQuadratic(SCIP *scip, SCIP_CONS *cons) Definition: cons_quadratic.c:13675 Definition: type_var.h:41 Definition: type_var.h:45 SCIP_RETCODE SCIPsetConshdlrInitlp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITLP((*consinitlp))) Definition: scip.c:5580 SCIP_Real * SCIPvarGetMultaggrScalars(SCIP_VAR *var) Definition: var.c:16747 Constraint handler for linear constraints in their most general form, . SCIP_RETCODE SCIPdelCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var) Definition: cons_linear.c:16802 void * SCIPhashtableRetrieve(SCIP_HASHTABLE *hashtable, void *key) Definition: misc.c:1622 static SCIP_RETCODE aggregateVariables(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff, int *nfixedvars, int *naggrvars, int *ndelconss) Definition: cons_linear.c:10681 void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...) Definition: scip.c:1270 SCIP_RETCODE SCIPaddCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val) Definition: cons_linear.c:16573 SCIP_RETCODE SCIPwriteVarsLinearsum(SCIP *scip, FILE *file, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SCIP_Bool type) Definition: scip.c:16052 SCIP_RETCODE SCIPinferVarLbCons(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_CONS *infercons, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened) Definition: scip.c:20535 SCIP_RETCODE SCIPinferVarFixCons(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_CONS *infercons, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened) Definition: scip.c:20466 static void consdataGetReliableResidualActivity(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR *cancelvar, SCIP_Real *resactivity, SCIP_Bool isminresact, SCIP_Bool useglobalbounds) Definition: cons_linear.c:2376 static void consdataRecomputeMaxactivity(SCIP *scip, SCIP_CONSDATA *consdata) Definition: cons_linear.c:1199 SCIP_Bool SCIPisSumRelEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:41956 SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos) Definition: scip.c:36278 SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete))) Definition: scip.c:5534 Definition: type_set.h:34 static SCIP_RETCODE conshdlrdataCreate(SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata, SCIP_EVENTHDLR *eventhdlr) Definition: cons_linear.c:528 static void consdataCalcSignatures(SCIP_CONSDATA *consdata) Definition: cons_linear.c:2951 Definition: struct_misc.h:80 SCIP_RETCODE SCIPchgLhsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_Real lhs) Definition: cons_linear.c:16866 static SCIP_RETCODE analyzeConflictRangedRow(SCIP *scip, SCIP_CONS *cons, SCIP_VAR **vars, int nvars, SCIP_VAR *var, SCIP_Real bound) Definition: cons_linear.c:5379 static SCIP_RETCODE lockRounding(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val) Definition: cons_linear.c:636 SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRINT((*consprint))) Definition: scip.c:5741 void SCIPsort(int *perm, SCIP_DECL_SORTINDCOMP((*indcomp)), void *dataptr, int len) Definition: misc.c:3824 static void consdataGetActivityResiduals(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR *var, SCIP_Real val, SCIP_Bool goodrelax, SCIP_Real *minresactivity, SCIP_Real *maxresactivity, SCIP_Bool *minisrelax, SCIP_Bool *maxisrelax, SCIP_Bool *isminsettoinfinity, SCIP_Bool *ismaxsettoinfinity) Definition: cons_linear.c:2457 static SCIP_RETCODE fullDualPresolve(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_Bool *cutoff, int *nchgbds) Definition: cons_linear.c:13400 SCIP_RETCODE SCIPsetConsSeparated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool separate) Definition: scip.c:25059 void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...) Definition: scip.c:1253 static void consdataCheckNonbinvar(SCIP_CONSDATA *consdata) Definition: cons_linear.c:1302 static SCIP_RETCODE consCatchAllEvents(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr) Definition: cons_linear.c:772 Definition: type_lp.h:48 static SCIP_RETCODE extractCliques(SCIP *scip, SCIP_CONS *cons, SCIP_Real maxeasyactivitydelta, SCIP_Bool sortvars, int *nfixedvars, int *nchgbds, SCIP_Bool *cutoff) Definition: cons_linear.c:7602 SCIP_RETCODE SCIPcreateConsLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode) Definition: cons_linear.c:16236 static SCIP_DECL_CONSHDLRCOPY(conshdlrCopyLinear) Definition: cons_linear.c:13869 #define SCIPduplicateBufferArray(scip, ptr, source, num) Definition: scip.h:20422 SCIP_RETCODE SCIPsetConshdlrExitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITSOL((*consexitsol))) Definition: scip.c:5424 const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr) Definition: event.c:278 Definition: type_result.h:43 SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:41541 SCIP_RETCODE SCIPlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup) Definition: scip.c:19519 static SCIP_RETCODE convertBinaryEquality(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff, int *naggrvars, int *ndelconss) Definition: cons_linear.c:9135 static SCIP_RETCODE normalizeCons(SCIP *scip, SCIP_CONS *cons) Definition: cons_linear.c:3906 SCIP_RETCODE SCIPunmarkConsPropagate(SCIP *scip, SCIP_CONS *cons) Definition: scip.c:25799 static SCIP_RETCODE tightenBounds(SCIP *scip, SCIP_CONS *cons, SCIP_Real maxeasyactivitydelta, SCIP_Bool sortvars, SCIP_Bool *cutoff, int *nchgbds) Definition: cons_linear.c:6814 SCIP_RETCODE SCIPsetConsInitial(SCIP *scip, SCIP_CONS *cons, SCIP_Bool initial) Definition: scip.c:25034 SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened) Definition: scip.c:20365 static void getNewSidesAfterAggregation(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR *slackvar, SCIP_Real slackcoef, SCIP_Real *newlhs, SCIP_Real *newrhs) Definition: cons_linear.c:9193 SCIP_Bool SCIPisSumRelGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:42008 SCIP_RETCODE SCIPchgRhsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_Real rhs) Definition: cons_linear.c:16887 SCIP_RETCODE SCIPcreateEmptyRowCons(SCIP *scip, SCIP_ROW **row, SCIP_CONSHDLR *conshdlr, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable) Definition: scip.c:27587 SCIP_Real SCIPgetDualsolLinear(SCIP *scip, SCIP_CONS *cons) Definition: cons_linear.c:17037 static SCIP_RETCODE convertEquality(SCIP *scip, SCIP_CONS *cons, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_Bool *cutoff, int *nfixedvars, int *naggrvars, int *ndelconss) Definition: cons_linear.c:10099 static SCIP_RETCODE applyFixings(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *infeasible) Definition: cons_linear.c:4300 SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file) Definition: scip.c:28321 SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:41567 SCIP_RETCODE SCIPincludeQuadconsUpgrade(SCIP *scip, SCIP_DECL_QUADCONSUPGD((*quadconsupgd)), int priority, SCIP_Bool active, const char *conshdlrname) Definition: cons_quadratic.c:12975 #define SCIPduplicateBlockMemoryArray(scip, ptr, source, num) Definition: scip.h:20397 SCIP_Longint SCIPgetNConflictConssApplied(SCIP *scip) Definition: scip.c:37724 SCIP_Real SCIPgetLhsLinear(SCIP *scip, SCIP_CONS *cons) Definition: cons_linear.c:16818 static SCIP_RETCODE addCoef(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val) Definition: cons_linear.c:3437 static SCIP_DECL_CONFLICTEXEC(conflictExecLinear) Definition: cons_linear.c:15838 Definition: type_retcode.h:45 SCIP_RETCODE SCIPupgradeConsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_CONS **upgdcons) Definition: cons_linear.c:17117 SCIP_RETCODE SCIPgetIntParam(SCIP *scip, const char *name, int *value) Definition: scip.c:3728 static SCIP_RETCODE consdataEnsureVarsSize(SCIP *scip, SCIP_CONSDATA *consdata, int num) Definition: cons_linear.c:458 SCIP_Real SCIPadjustedVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real lb) Definition: scip.c:19751 Definition: type_set.h:42 Definition: cons_linear.c:318 static SCIP_DECL_NONLINCONSUPGD(upgradeConsNonlinear) Definition: cons_linear.c:15969 Definition: cons_linear.c:332 SCIP_RETCODE SCIPsetConshdlrExit(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXIT((*consexit))) Definition: scip.c:5376 SCIP_RETCODE SCIPaddVarLocks(SCIP *scip, SCIP_VAR *var, int nlocksdown, int nlocksup) Definition: scip.c:19465 SCIP_Real SCIPgetActivityLinear(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol) Definition: cons_linear.c:16981 static void consdataRecomputeGlbMinactivity(SCIP *scip, SCIP_CONSDATA *consdata) Definition: cons_linear.c:1226 SCIP_RETCODE SCIPincludeLinconsUpgrade(SCIP *scip, SCIP_DECL_LINCONSUPGD((*linconsupgd)), int priority, const char *conshdlrname) Definition: cons_linear.c:16184 static SCIP_RETCODE convertLongEquality(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_CONS *cons, SCIP_Bool *cutoff, int *naggrvars, int *ndelconss) Definition: cons_linear.c:9249 SCIP_RETCODE SCIPaddConsLocal(SCIP *scip, SCIP_CONS *cons, SCIP_NODE *validnode) Definition: scip.c:12036 SCIP_VAR ** SCIPgetVarsLinear(SCIP *scip, SCIP_CONS *cons) Definition: cons_linear.c:16929 static SCIP_RETCODE unlockRounding(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val) Definition: cons_linear.c:669 SCIP_RETCODE SCIPaddConflictUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx) Definition: scip.c:24423 SCIP_Real SCIPgetLhsQuadratic(SCIP *scip, SCIP_CONS *cons) Definition: cons_quadratic.c:13762 Definition: type_retcode.h:43 static SCIP_DECL_CONSGETNVARS(consGetNVarsLinear) Definition: cons_linear.c:15652 SCIP_RETCODE SCIPaddRealParam(SCIP *scip, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata) Definition: scip.c:3598 SCIP_RETCODE SCIPsetConshdlrGetNVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETNVARS((*consgetnvars))) Definition: scip.c:5810 SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val) Definition: scip.c:27851 Definition: type_var.h:43 SCIP_Longint SCIPcalcGreComDiv(SCIP_Longint val1, SCIP_Longint val2) Definition: misc.c:7078 Definition: type_set.h:36 SCIP_RETCODE SCIPcopyConsLinear(SCIP *scip, SCIP_CONS **cons, SCIP *sourcescip, const char *name, int nvars, SCIP_VAR **sourcevars, SCIP_Real *sourcecoefs, SCIP_Real lhs, SCIP_Real rhs, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode, SCIP_Bool global, SCIP_Bool *valid) Definition: cons_linear.c:16448 void SCIPconshdlrSetData(SCIP_CONSHDLR *conshdlr, SCIP_CONSHDLRDATA *conshdlrdata) Definition: cons.c:3931 SCIP_Real SCIPgetRhsQuadratic(SCIP *scip, SCIP_CONS *cons) Definition: cons_quadratic.c:13774 SCIP_Real * SCIPgetValsLinear(SCIP *scip, SCIP_CONS *cons) Definition: cons_linear.c:16953 SCIP_RETCODE SCIPchgRowLhs(SCIP *scip, SCIP_ROW *row, SCIP_Real lhs) Definition: scip.c:27746 static SCIP_RETCODE addConflictBounds(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *infervar, SCIP_BDCHGIDX *bdchgidx, int inferpos, SCIP_Bool reasonisrhs) Definition: cons_linear.c:4541 SCIP_Longint SCIPcalcSmaComMul(SCIP_Longint val1, SCIP_Longint val2) Definition: misc.c:7189 Definition: cons_linear.c:334 Definition: type_result.h:39 Definition: struct_event.h:185 static void consdataUpdateActivitiesLb(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR *var, SCIP_Real oldlb, SCIP_Real newlb, SCIP_Real val, SCIP_Bool checkreliability) Definition: cons_linear.c:1798 SCIP_Bool SCIPisUbBetter(SCIP *scip, SCIP_Real newub, SCIP_Real oldlb, SCIP_Real oldub) Definition: scip.c:41878 static void consdataUpdateActivitiesUb(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR *var, SCIP_Real oldub, SCIP_Real newub, SCIP_Real val, SCIP_Bool checkreliability) Definition: cons_linear.c:1823 static SCIP_RETCODE consdataFree(SCIP *scip, SCIP_CONSDATA **consdata) Definition: cons_linear.c:1001 Definition: type_var.h:56 static SCIP_RETCODE dualPresolve(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff, int *nfixedvars, int *naggrvars, int *ndelconss) Definition: cons_linear.c:10225 |