61 #define CONSHDLR_NAME "linear" 62 #define CONSHDLR_DESC "linear constraints of the form lhs <= a^T x <= rhs" 63 #define CONSHDLR_SEPAPRIORITY +100000 64 #define CONSHDLR_ENFOPRIORITY -1000000 65 #define CONSHDLR_CHECKPRIORITY -1000000 66 #define CONSHDLR_SEPAFREQ 0 67 #define CONSHDLR_PROPFREQ 1 68 #define CONSHDLR_EAGERFREQ 100 70 #define CONSHDLR_MAXPREROUNDS -1 71 #define CONSHDLR_DELAYSEPA FALSE 72 #define CONSHDLR_DELAYPROP FALSE 73 #define CONSHDLR_NEEDSCONS TRUE 75 #define CONSHDLR_PRESOLTIMING (SCIP_PRESOLTIMING_FAST | SCIP_PRESOLTIMING_EXHAUSTIVE) 76 #define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP 78 #define EVENTHDLR_NAME "linear" 79 #define EVENTHDLR_DESC "bound change event handler for linear constraints" 81 #define CONFLICTHDLR_NAME "linear" 82 #define CONFLICTHDLR_DESC "conflict handler creating linear constraints" 83 #define CONFLICTHDLR_PRIORITY -1000000 85 #define DEFAULT_TIGHTENBOUNDSFREQ 1 86 #define DEFAULT_MAXROUNDS 5 87 #define DEFAULT_MAXROUNDSROOT -1 88 #define DEFAULT_MAXSEPACUTS 50 89 #define DEFAULT_MAXSEPACUTSROOT 200 90 #define DEFAULT_PRESOLPAIRWISE TRUE 91 #define DEFAULT_PRESOLUSEHASHING TRUE 92 #define DEFAULT_NMINCOMPARISONS 200000 93 #define DEFAULT_MINGAINPERNMINCOMP 1e-06 95 #define DEFAULT_SORTVARS TRUE 97 #define DEFAULT_CHECKRELMAXABS FALSE 99 #define DEFAULT_MAXAGGRNORMSCALE 0.0 101 #define DEFAULT_MAXEASYACTIVITYDELTA 1e6 103 #define DEFAULT_MAXCARDBOUNDDIST 0.0 105 #define DEFAULT_SEPARATEALL FALSE 107 #define DEFAULT_AGGREGATEVARIABLES TRUE 108 #define DEFAULT_SIMPLIFYINEQUALITIES TRUE 109 #define DEFAULT_DUALPRESOLVING TRUE 110 #define DEFAULT_SINGLETONSTUFFING TRUE 111 #define DEFAULT_SINGLEVARSTUFFING FALSE 113 #define DEFAULT_DETECTCUTOFFBOUND TRUE 116 #define DEFAULT_DETECTLOWERBOUND TRUE 119 #define DEFAULT_DETECTPARTIALOBJECTIVE TRUE 121 #define DEFAULT_RANGEDROWPROPAGATION TRUE 122 #define DEFAULT_RANGEDROWARTCONS TRUE 123 #define DEFAULT_RANGEDROWMAXDEPTH INT_MAX 124 #define DEFAULT_RANGEDROWFREQ 1 126 #define DEFAULT_MULTAGGRREMOVE FALSE 129 #define MAXDNOM 10000LL 130 #define MAXSCALEDCOEF 1e+03 131 #define MAXSCALEDCOEFINTEGER 1e+05 135 #define HASHSIZE_LINEARCONS 500 136 #define MAXVALRECOMP 1e+06 137 #define MINVALRECOMP 1e-05 140 #define QUADCONSUPGD_PRIORITY 1000000 141 #define NONLINCONSUPGD_PRIORITY 1000000 143 #ifdef WITH_PRINTORIGCONSTYPES 147 SCIP_CONSTYPE_EMPTY = 0,
148 SCIP_CONSTYPE_FREE = 1,
149 SCIP_CONSTYPE_SINGLETON = 2,
150 SCIP_CONSTYPE_AGGREGATION = 3,
151 SCIP_CONSTYPE_VARBOUND = 4,
152 SCIP_CONSTYPE_SETPARTITION = 5,
153 SCIP_CONSTYPE_SETPACKING = 6,
154 SCIP_CONSTYPE_SETCOVERING = 7,
155 SCIP_CONSTYPE_CARDINALITY = 8,
156 SCIP_CONSTYPE_INVKNAPSACK = 9,
157 SCIP_CONSTYPE_EQKNAPSACK = 10,
158 SCIP_CONSTYPE_BINPACKING = 11,
159 SCIP_CONSTYPE_KNAPSACK = 12,
160 SCIP_CONSTYPE_INTKNAPSACK = 13,
161 SCIP_CONSTYPE_MIXEDBINARY = 14,
162 SCIP_CONSTYPE_GENERAL = 15
164 typedef enum SCIP_Constype SCIP_CONSTYPE;
197 uint64_t possignature;
198 uint64_t negsignature;
203 int minactivityneginf;
204 int minactivityposinf;
205 int maxactivityneginf;
206 int maxactivityposinf;
207 int minactivityneghuge;
208 int minactivityposhuge;
209 int maxactivityneghuge;
210 int maxactivityposhuge;
211 int glbminactivityneginf;
212 int glbminactivityposinf;
213 int glbmaxactivityneginf;
214 int glbmaxactivityposinf;
215 int glbminactivityneghuge;
216 int glbminactivityposhuge;
217 int glbmaxactivityneghuge;
218 int glbmaxactivityposhuge;
224 unsigned int boundstightened:2;
225 unsigned int rangedrowpropagated:2;
227 unsigned int validmaxabsval:1;
228 unsigned int validminabsval:1;
229 unsigned int validactivities:1;
230 unsigned int validminact:1;
231 unsigned int validmaxact:1;
232 unsigned int validglbminact:1;
233 unsigned int validglbmaxact:1;
234 unsigned int presolved:1;
235 unsigned int removedfixings:1;
236 unsigned int validsignature:1;
237 unsigned int changed:1;
238 unsigned int normalized:1;
239 unsigned int upgradetried:1;
240 unsigned int upgraded:1;
241 unsigned int sorted:1;
242 unsigned int merged:1;
243 unsigned int cliquesadded:1;
244 unsigned int implsadded:1;
245 unsigned int binvarssorted:1;
246 unsigned int varsdeleted:1;
247 unsigned int hascontvar:1;
248 unsigned int hasnonbinvar:1;
249 unsigned int hasnonbinvalid:1;
253 struct SCIP_EventData
261 struct SCIP_ConshdlrData
272 int linconsupgradessize;
273 int nlinconsupgrades;
274 int tightenboundsfreq;
306 int rangedrowmaxdepth;
344 unsigned int proprule:8;
360 inferinfo.val.asint = i;
371 return inferinfo.val.asint;
380 return (
int) inferinfo.val.asbits.proprule;
389 return (
int) inferinfo.val.asbits.pos;
403 assert(pos < (1<<24));
405 inferinfo.val.asbits.proprule = (
unsigned int) proprule;
406 inferinfo.val.asbits.pos = (
unsigned int) pos;
434 assert(scip !=
NULL);
435 assert(conshdlrdata !=
NULL);
436 assert(conshdlrdata->nlinconsupgrades <= conshdlrdata->linconsupgradessize);
438 if( num > conshdlrdata->linconsupgradessize )
444 conshdlrdata->linconsupgradessize = newsize;
446 assert(num <= conshdlrdata->linconsupgradessize);
459 assert(scip !=
NULL);
460 assert(consdata !=
NULL);
461 assert(consdata->nvars <= consdata->varssize);
463 if( num > consdata->varssize )
470 if( consdata->eventdata !=
NULL )
474 consdata->varssize = newsize;
476 assert(num <= consdata->varssize);
495 assert(scip !=
NULL);
496 assert(linconsupgrade !=
NULL);
497 assert(linconsupgd !=
NULL);
500 (*linconsupgrade)->linconsupgd = linconsupgd;
501 (*linconsupgrade)->priority = priority;
502 (*linconsupgrade)->active =
TRUE;
514 assert(scip !=
NULL);
515 assert(linconsupgrade !=
NULL);
516 assert(*linconsupgrade !=
NULL);
529 assert(scip !=
NULL);
530 assert(conshdlrdata !=
NULL);
531 assert(eventhdlr !=
NULL);
534 (*conshdlrdata)->linconsupgrades =
NULL;
535 (*conshdlrdata)->linconsupgradessize = 0;
536 (*conshdlrdata)->nlinconsupgrades = 0;
537 (*conshdlrdata)->naddconss = 0;
540 (*conshdlrdata)->eventhdlr = eventhdlr;
554 assert(scip !=
NULL);
555 assert(conshdlrdata !=
NULL);
556 assert(*conshdlrdata !=
NULL);
558 for( i = 0; i < (*conshdlrdata)->nlinconsupgrades; ++i )
573 const char* conshdlrname
578 assert(scip !=
NULL);
579 assert(conshdlrdata !=
NULL);
580 assert(linconsupgd !=
NULL);
581 assert(conshdlrname !=
NULL);
583 for( i = conshdlrdata->nlinconsupgrades - 1; i >= 0; --i )
585 if( conshdlrdata->linconsupgrades[i]->linconsupgd == linconsupgd )
588 SCIPwarningMessage(scip,
"Try to add already known upgrade message %p for constraint handler %s.\n", linconsupgd, conshdlrname);
607 assert(scip !=
NULL);
608 assert(conshdlrdata !=
NULL);
609 assert(linconsupgrade !=
NULL);
613 for( i = conshdlrdata->nlinconsupgrades;
614 i > 0 && conshdlrdata->linconsupgrades[i-1]->priority < linconsupgrade->
priority; --i )
616 conshdlrdata->linconsupgrades[i] = conshdlrdata->linconsupgrades[i-1];
618 assert(0 <= i && i <= conshdlrdata->nlinconsupgrades);
619 conshdlrdata->linconsupgrades[i] = linconsupgrade;
620 conshdlrdata->nlinconsupgrades++;
640 assert(scip !=
NULL);
641 assert(cons !=
NULL);
645 assert(consdata !=
NULL);
673 assert(scip !=
NULL);
674 assert(cons !=
NULL);
678 assert(consdata !=
NULL);
706 assert(scip !=
NULL);
707 assert(cons !=
NULL);
708 assert(eventhdlr !=
NULL);
711 assert(consdata !=
NULL);
713 assert(0 <= pos && pos < consdata->nvars);
714 assert(consdata->vars !=
NULL);
715 assert(consdata->vars[pos] !=
NULL);
717 assert(consdata->eventdata !=
NULL);
718 assert(consdata->eventdata[pos] ==
NULL);
721 consdata->eventdata[pos]->cons = cons;
722 consdata->eventdata[pos]->varpos = pos;
727 eventhdlr, consdata->eventdata[pos], &consdata->eventdata[pos]->filterpos) );
743 assert(scip !=
NULL);
744 assert(cons !=
NULL);
745 assert(eventhdlr !=
NULL);
748 assert(consdata !=
NULL);
750 assert(0 <= pos && pos < consdata->nvars);
751 assert(consdata->vars[pos] !=
NULL);
752 assert(consdata->eventdata !=
NULL);
753 assert(consdata->eventdata[pos] !=
NULL);
754 assert(consdata->eventdata[pos]->cons == cons);
755 assert(consdata->eventdata[pos]->varpos == pos);
760 eventhdlr, consdata->eventdata[pos], consdata->eventdata[pos]->filterpos) );
778 assert(scip !=
NULL);
779 assert(cons !=
NULL);
782 assert(consdata !=
NULL);
783 assert(consdata->eventdata ==
NULL);
787 assert(consdata->eventdata !=
NULL);
791 for( i = 0; i < consdata->nvars; ++i )
810 assert(scip !=
NULL);
811 assert(cons !=
NULL);
814 assert(consdata !=
NULL);
815 assert(consdata->eventdata !=
NULL);
818 for( i = consdata->nvars - 1; i >= 0; --i )
825 assert(consdata->eventdata ==
NULL);
836 assert(scip !=
NULL);
856 assert(scip !=
NULL);
857 assert(consdata !=
NULL);
858 assert(nvars == 0 || vars !=
NULL);
859 assert(nvars == 0 || vals !=
NULL);
873 SCIPwarningMessage(scip,
"left hand side of linear constraint greater than right hand side\n");
879 (*consdata)->varssize = 0;
880 (*consdata)->nvars = nvars;
881 (*consdata)->hascontvar =
FALSE;
882 (*consdata)->hasnonbinvar =
FALSE;
883 (*consdata)->hasnonbinvalid =
TRUE;
884 (*consdata)->vars =
NULL;
885 (*consdata)->vals =
NULL;
901 for( v = 0; v < nvars; ++v )
924 if( !(*consdata)->hascontvar )
930 (*consdata)->hasnonbinvar =
TRUE;
933 (*consdata)->hascontvar =
TRUE;
939 (*consdata)->nvars = k;
946 (*consdata)->varssize = k;
953 (*consdata)->eventdata =
NULL;
965 (*consdata)->row =
NULL;
966 (*consdata)->lhs = lhs;
967 (*consdata)->rhs = rhs;
975 (*consdata)->maxactdeltavar =
NULL;
976 (*consdata)->minactivityneginf = -1;
977 (*consdata)->minactivityposinf = -1;
978 (*consdata)->maxactivityneginf = -1;
979 (*consdata)->maxactivityposinf = -1;
980 (*consdata)->minactivityneghuge = -1;
981 (*consdata)->minactivityposhuge = -1;
982 (*consdata)->maxactivityneghuge = -1;
983 (*consdata)->maxactivityposhuge = -1;
988 (*consdata)->glbminactivityneginf = -1;
989 (*consdata)->glbminactivityposinf = -1;
990 (*consdata)->glbmaxactivityneginf = -1;
991 (*consdata)->glbmaxactivityposinf = -1;
992 (*consdata)->glbminactivityneghuge = -1;
993 (*consdata)->glbminactivityposhuge = -1;
994 (*consdata)->glbmaxactivityneghuge = -1;
995 (*consdata)->glbmaxactivityposhuge = -1;
996 (*consdata)->possignature = 0;
997 (*consdata)->negsignature = 0;
998 (*consdata)->validmaxabsval =
FALSE;
999 (*consdata)->validminabsval =
FALSE;
1000 (*consdata)->validactivities =
FALSE;
1001 (*consdata)->validminact =
FALSE;
1002 (*consdata)->validmaxact =
FALSE;
1003 (*consdata)->validglbminact =
FALSE;
1004 (*consdata)->validglbmaxact =
FALSE;
1005 (*consdata)->boundstightened = 0;
1006 (*consdata)->presolved =
FALSE;
1007 (*consdata)->removedfixings =
FALSE;
1008 (*consdata)->validsignature =
FALSE;
1009 (*consdata)->changed =
TRUE;
1010 (*consdata)->normalized =
FALSE;
1011 (*consdata)->upgradetried =
FALSE;
1012 (*consdata)->upgraded =
FALSE;
1013 (*consdata)->sorted = (nvars <= 1);
1014 (*consdata)->merged = (nvars <= 1);
1015 (*consdata)->cliquesadded =
FALSE;
1016 (*consdata)->implsadded =
FALSE;
1017 (*consdata)->binvarssorted =
FALSE;
1018 (*consdata)->nbinvars = -1;
1019 (*consdata)->varsdeleted =
FALSE;
1020 (*consdata)->rangedrowpropagated = 0;
1029 for( v = 0; v < (*consdata)->nvars; v++ )
1031 assert((*consdata)->vars[v] !=
NULL);
1032 assert(!
SCIPisZero(scip, (*consdata)->vals[v]));
1048 assert(scip !=
NULL);
1049 assert(consdata !=
NULL);
1050 assert(*consdata !=
NULL);
1051 assert((*consdata)->varssize >= 0);
1054 if( (*consdata)->row !=
NULL )
1060 for( v = 0; v < (*consdata)->nvars; v++ )
1062 assert((*consdata)->vars[v] !=
NULL);
1063 assert(!
SCIPisZero(scip, (*consdata)->vals[v]));
1082 assert(scip !=
NULL);
1083 assert(consdata !=
NULL);
1088 && !
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
1092 if( consdata->nvars == 0 )
1101 if(
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
1119 assert(consdata !=
NULL);
1121 consdata->validactivities =
FALSE;
1122 consdata->validminact =
FALSE;
1123 consdata->validmaxact =
FALSE;
1124 consdata->validglbminact =
FALSE;
1125 consdata->validglbmaxact =
FALSE;
1126 consdata->validmaxabsval =
FALSE;
1127 consdata->validminabsval =
FALSE;
1128 consdata->hasnonbinvalid =
FALSE;
1136 consdata->maxactdeltavar =
NULL;
1137 consdata->minactivityneginf = -1;
1138 consdata->minactivityposinf = -1;
1139 consdata->maxactivityneginf = -1;
1140 consdata->maxactivityposinf = -1;
1141 consdata->minactivityneghuge = -1;
1142 consdata->minactivityposhuge = -1;
1143 consdata->maxactivityneghuge = -1;
1144 consdata->maxactivityposhuge = -1;
1149 consdata->glbminactivityneginf = -1;
1150 consdata->glbminactivityposinf = -1;
1151 consdata->glbmaxactivityneginf = -1;
1152 consdata->glbmaxactivityposinf = -1;
1153 consdata->glbminactivityneghuge = -1;
1154 consdata->glbminactivityposhuge = -1;
1155 consdata->glbmaxactivityneghuge = -1;
1156 consdata->glbmaxactivityposhuge = -1;
1167 int pseudoactivityposinf;
1168 int pseudoactivityneginf;
1174 pseudoactivityposinf = 0;
1175 pseudoactivityneginf = 0;
1177 for( i = consdata->nvars - 1; i >= 0; --i )
1179 val = consdata->vals[i];
1184 pseudoactivityposinf++;
1186 pseudoactivityneginf++;
1193 pseudoactivityneginf++;
1195 pseudoactivityposinf++;
1198 pseudoactivity += val *
bound;
1202 if( pseudoactivityneginf > 0 && pseudoactivityposinf > 0 )
1204 else if( pseudoactivityneginf > 0 )
1206 else if( pseudoactivityposinf > 0 )
1209 return pseudoactivity;
1222 consdata->minactivity = 0;
1224 for( i = consdata->nvars - 1; i >= 0; --i )
1229 consdata->minactivity += consdata->vals[i] *
bound;
1233 consdata->validminact =
TRUE;
1236 consdata->lastminactivity = consdata->minactivity;
1249 consdata->maxactivity = 0;
1251 for( i = consdata->nvars - 1; i >= 0; --i )
1256 consdata->maxactivity += consdata->vals[i] *
bound;
1260 consdata->validmaxact =
TRUE;
1263 consdata->lastmaxactivity = consdata->maxactivity;
1276 consdata->glbminactivity = 0;
1278 for( i = consdata->nvars - 1; i >= 0; --i )
1282 consdata->glbminactivity += consdata->vals[i] *
bound;
1286 consdata->validglbminact =
TRUE;
1289 consdata->lastglbminactivity = consdata->glbminactivity;
1302 consdata->glbmaxactivity = 0;
1304 for( i = consdata->nvars - 1; i >= 0; --i )
1308 consdata->glbmaxactivity += consdata->vals[i] *
bound;
1312 consdata->validglbmaxact =
TRUE;
1315 consdata->lastglbmaxactivity = consdata->glbmaxactivity;
1327 assert(consdata !=
NULL);
1328 assert(!consdata->validmaxabsval);
1331 consdata->validmaxabsval =
TRUE;
1332 consdata->maxabsval = 0.0;
1333 for( i = 0; i < consdata->nvars; ++i )
1335 absval = consdata->vals[i];
1337 if( absval > consdata->maxabsval )
1338 consdata->maxabsval = absval;
1351 assert(consdata !=
NULL);
1352 assert(!consdata->validminabsval);
1355 consdata->validminabsval =
TRUE;
1357 if( consdata->nvars > 0 )
1358 consdata->minabsval =
REALABS(consdata->vals[0]);
1360 consdata->minabsval = 0.0;
1362 for( i = 1; i < consdata->nvars; ++i )
1364 absval = consdata->vals[i];
1366 if( absval < consdata->minabsval )
1367 consdata->minabsval = absval;
1379 assert(!consdata->hasnonbinvalid);
1380 consdata->hasnonbinvar =
FALSE;
1381 consdata->hascontvar =
FALSE;
1383 for( v = consdata->nvars - 1; v >= 0; --v )
1389 consdata->hasnonbinvar =
TRUE;
1393 consdata->hascontvar =
TRUE;
1398 assert(consdata->hascontvar || v < 0);
1400 consdata->hasnonbinvalid =
TRUE;
1404 #ifdef CHECKMAXACTDELTA 1421 for( v = consdata->nvars - 1; v >= 0; --v )
1433 delta =
REALABS(consdata->vals[v]) * domain;
1435 if( delta > maxactdelta )
1437 maxactdelta = delta;
1440 assert(
SCIPisFeasEQ(scip, maxactdelta, consdata->maxactdelta));
1444 #define checkMaxActivityDelta(scip, consdata) 1457 consdata->maxactdelta = 0.0;
1459 if( !consdata->hasnonbinvalid )
1463 if( !consdata->hasnonbinvar )
1465 for( v = consdata->nvars - 1; v >= 0; --v )
1469 delta =
REALABS(consdata->vals[v]);
1471 if( delta > consdata->maxactdelta )
1473 consdata->maxactdelta = delta;
1474 consdata->maxactdeltavar = consdata->vars[v];
1481 for( v = consdata->nvars - 1; v >= 0; --v )
1493 consdata->maxactdeltavar = consdata->vars[v];
1498 delta =
REALABS(consdata->vals[v]) * domain;
1500 if( delta > consdata->maxactdelta )
1502 consdata->maxactdelta = delta;
1503 consdata->maxactdeltavar = consdata->vars[v];
1525 int* activityposinf;
1526 int* activityneginf;
1527 int* activityposhuge;
1528 int* activityneghuge;
1536 assert(scip !=
NULL);
1537 assert(consdata !=
NULL);
1538 assert(global || (var !=
NULL));
1539 assert(consdata->validactivities);
1544 assert(consdata->minactivityneginf >= 0);
1545 assert(consdata->minactivityposinf >= 0);
1546 assert(consdata->maxactivityneginf >= 0);
1547 assert(consdata->maxactivityposinf >= 0);
1548 assert(consdata->minactivityneghuge >= 0);
1549 assert(consdata->minactivityposhuge >= 0);
1550 assert(consdata->maxactivityneghuge >= 0);
1551 assert(consdata->maxactivityposhuge >= 0);
1556 assert(consdata->glbminactivityneginf >= 0);
1557 assert(consdata->glbminactivityposinf >= 0);
1558 assert(consdata->glbmaxactivityneginf >= 0);
1559 assert(consdata->glbmaxactivityposinf >= 0);
1560 assert(consdata->glbminactivityneghuge >= 0);
1561 assert(consdata->glbminactivityposhuge >= 0);
1562 assert(consdata->glbmaxactivityneghuge >= 0);
1563 assert(consdata->glbmaxactivityposhuge >= 0);
1580 activity = &(consdata->glbminactivity);
1581 lastactivity = &(consdata->lastglbminactivity);
1582 activityposinf = &(consdata->glbminactivityposinf);
1583 activityneginf = &(consdata->glbminactivityneginf);
1584 activityposhuge = &(consdata->glbminactivityposhuge);
1585 activityneghuge = &(consdata->glbminactivityneghuge);
1586 validact = consdata->validglbminact;
1590 activity = &(consdata->glbmaxactivity);
1591 lastactivity = &(consdata->lastglbmaxactivity);
1592 activityposinf = &(consdata->glbmaxactivityneginf);
1593 activityneginf = &(consdata->glbmaxactivityposinf);
1594 activityposhuge = &(consdata->glbmaxactivityposhuge);
1595 activityneghuge = &(consdata->glbmaxactivityneghuge);
1596 validact = consdata->validglbmaxact;
1603 activity = &(consdata->glbmaxactivity);
1604 lastactivity = &(consdata->lastglbmaxactivity);
1605 activityposinf = &(consdata->glbmaxactivityposinf);
1606 activityneginf = &(consdata->glbmaxactivityneginf);
1607 activityposhuge = &(consdata->glbmaxactivityposhuge);
1608 activityneghuge = &(consdata->glbmaxactivityneghuge);
1609 validact = consdata->validglbmaxact;
1613 activity = &(consdata->glbminactivity);
1614 lastactivity = &(consdata->lastglbminactivity);
1615 activityposinf = &(consdata->glbminactivityneginf);
1616 activityneginf = &(consdata->glbminactivityposinf);
1617 activityposhuge = &(consdata->glbminactivityposhuge);
1618 activityneghuge = &(consdata->glbminactivityneghuge);
1619 validact = consdata->validglbminact;
1636 activity = &(consdata->minactivity);
1637 lastactivity = &(consdata->lastminactivity);
1638 activityposinf = &(consdata->minactivityposinf);
1639 activityneginf = &(consdata->minactivityneginf);
1640 activityposhuge = &(consdata->minactivityposhuge);
1641 activityneghuge = &(consdata->minactivityneghuge);
1642 validact = consdata->validminact;
1646 activity = &(consdata->maxactivity);
1647 lastactivity = &(consdata->lastmaxactivity);
1648 activityposinf = &(consdata->maxactivityneginf);
1649 activityneginf = &(consdata->maxactivityposinf);
1650 activityposhuge = &(consdata->maxactivityposhuge);
1651 activityneghuge = &(consdata->maxactivityneghuge);
1652 validact = consdata->validmaxact;
1659 activity = &(consdata->maxactivity);
1660 lastactivity = &(consdata->lastmaxactivity);
1661 activityposinf = &(consdata->maxactivityposinf);
1662 activityneginf = &(consdata->maxactivityneginf);
1663 activityposhuge = &(consdata->maxactivityposhuge);
1664 activityneghuge = &(consdata->maxactivityneghuge);
1665 validact = consdata->validmaxact;
1669 activity = &(consdata->minactivity);
1670 lastactivity = &(consdata->lastminactivity);
1671 activityposinf = &(consdata->minactivityneginf);
1672 activityneginf = &(consdata->minactivityposinf);
1673 activityposhuge = &(consdata->minactivityposhuge);
1674 activityneghuge = &(consdata->minactivityneghuge);
1675 validact = consdata->validminact;
1680 oldcontribution = val * oldbound;
1681 newcontribution = val * newbound;
1688 if( oldbound > 0.0 )
1690 assert((*activityposinf) >= 1);
1693 if( finitenewbound || newbound < 0.0 )
1696 (*activityposinf)--;
1699 if( !finitenewbound && newbound < 0.0 )
1700 (*activityneginf)++;
1701 else if( hugevalnewcont )
1704 if( newcontribution > 0.0 )
1705 (*activityposhuge)++;
1707 (*activityneghuge)++;
1711 delta = newcontribution;
1717 assert(oldbound < 0.0);
1718 assert((*activityneginf) >= 1);
1721 if( finitenewbound || newbound > 0.0 )
1724 (*activityneginf)--;
1727 if( !finitenewbound && newbound > 0.0 )
1728 (*activityposinf)++;
1729 else if( hugevalnewcont )
1732 if( newcontribution > 0.0 )
1733 (*activityposhuge)++;
1735 (*activityneghuge)++;
1739 delta = newcontribution;
1746 if( oldcontribution > 0.0 )
1748 assert((*activityposhuge) >= 1);
1753 (*activityposhuge)--;
1755 if( !finitenewbound )
1758 if( newbound > 0.0 )
1759 (*activityposinf)++;
1762 (*activityneginf)++;
1764 else if( hugevalnewcont )
1767 if( newcontribution > 0.0 )
1768 (*activityposhuge)++;
1771 (*activityneghuge)++;
1775 delta = newcontribution;
1780 assert(oldcontribution < 0.0);
1781 assert((*activityneghuge) >= 1);
1786 (*activityneghuge)--;
1788 if( !finitenewbound )
1791 if( newbound > 0.0 )
1792 (*activityposinf)++;
1795 (*activityneginf)++;
1797 else if( hugevalnewcont )
1800 if( newcontribution > 0.0 )
1801 (*activityposhuge)++;
1804 (*activityneghuge)++;
1808 delta = newcontribution;
1814 if( !finitenewbound )
1819 if( newbound > 0.0 )
1821 (*activityposinf)++;
1822 delta = -oldcontribution;
1829 assert(newbound < 0.0 );
1831 (*activityneginf)++;
1832 delta = -oldcontribution;
1836 else if( hugevalnewcont )
1838 if( newcontribution > 0.0 )
1840 (*activityposhuge)++;
1841 delta = -oldcontribution;
1845 (*activityneghuge)++;
1846 delta = -oldcontribution;
1851 delta = newcontribution - oldcontribution;
1855 if( validact && (delta != 0.0) )
1860 (*activity) = (*activity) + delta;
1865 (*lastactivity) = (*activity);
1871 SCIPdebugMsg(scip,
"%s activity of linear constraint unreliable after update: %16.9g\n",
1872 (global ?
"global " :
""), (*activity));
1878 consdata->validglbminact =
FALSE;
1880 consdata->validglbmaxact =
FALSE;
1885 consdata->validminact =
FALSE;
1887 consdata->validmaxact =
FALSE;
1906 assert(scip !=
NULL);
1907 assert(consdata !=
NULL);
1908 assert(var !=
NULL);
1910 if( consdata->validactivities )
1931 assert(scip !=
NULL);
1932 assert(consdata !=
NULL);
1933 assert(var !=
NULL);
1935 if( consdata->validactivities )
1955 assert(scip !=
NULL);
1956 assert(consdata !=
NULL);
1958 if( consdata->validactivities )
1978 assert(scip !=
NULL);
1979 assert(consdata !=
NULL);
1981 if( consdata->validactivities )
2000 assert(scip !=
NULL);
2001 assert(consdata !=
NULL);
2002 assert(var !=
NULL);
2005 if( consdata->validmaxabsval )
2012 consdata->maxabsval =
MAX(consdata->maxabsval, absval);
2015 if( consdata->validminabsval )
2022 consdata->minabsval =
MIN(consdata->minabsval, absval);
2026 if( consdata->validactivities )
2050 assert(scip !=
NULL);
2051 assert(consdata !=
NULL);
2052 assert(var !=
NULL);
2055 if( consdata->validmaxabsval )
2061 if(
SCIPisEQ(scip, absval, consdata->maxabsval) )
2063 consdata->validmaxabsval =
FALSE;
2069 if( consdata->validminabsval )
2075 if(
SCIPisEQ(scip, absval, consdata->minabsval) )
2077 consdata->validminabsval =
FALSE;
2083 if( consdata->validactivities )
2108 assert(scip !=
NULL);
2109 assert(consdata !=
NULL);
2110 assert(var !=
NULL);
2119 if( consdata->validmaxabsval )
2125 if(
SCIPisGE(scip, absval, consdata->maxabsval) )
2127 consdata->maxabsval = absval;
2134 if(
SCIPisEQ(scip, absval, consdata->maxabsval) )
2136 consdata->validmaxabsval =
FALSE;
2143 if( consdata->validminabsval )
2149 if(
SCIPisLE(scip, absval, consdata->minabsval) )
2151 consdata->minabsval = absval;
2158 if(
SCIPisEQ(scip, absval, consdata->minabsval) )
2160 consdata->validminabsval =
FALSE;
2177 delta =
REALABS(newval) * domain;
2179 if( delta > consdata->maxactdelta )
2181 consdata->maxactdelta = delta;
2182 consdata->maxactdeltavar = var;
2187 if( consdata->maxactdeltavar == var )
2203 assert(consdata !=
NULL);
2205 if( !consdata->validmaxabsval )
2207 assert(consdata->validmaxabsval);
2210 return consdata->maxabsval;
2219 assert(consdata !=
NULL);
2221 if( !consdata->validminabsval )
2223 assert(consdata->validminabsval);
2226 return consdata->minabsval;
2240 assert(scip !=
NULL);
2241 assert(consdata !=
NULL);
2242 assert(!consdata->validactivities);
2243 assert(consdata->minactivity >=
SCIP_INVALID || consdata->validminact);
2244 assert(consdata->maxactivity >=
SCIP_INVALID || consdata->validmaxact);
2245 assert(consdata->glbminactivity >=
SCIP_INVALID || consdata->validglbminact);
2246 assert(consdata->glbmaxactivity >=
SCIP_INVALID || consdata->validglbmaxact);
2248 consdata->validmaxabsval =
TRUE;
2249 consdata->validminabsval =
TRUE;
2251 consdata->validminact =
TRUE;
2252 consdata->validmaxact =
TRUE;
2253 consdata->validglbminact =
TRUE;
2254 consdata->validglbmaxact =
TRUE;
2255 consdata->maxabsval = 0.0;
2256 consdata->minabsval = (consdata->nvars == 0 ? 0.0 :
REALABS(consdata->vals[0]));
2257 consdata->minactivity = 0.0;
2258 consdata->maxactivity = 0.0;
2259 consdata->lastminactivity = 0.0;
2260 consdata->lastmaxactivity = 0.0;
2261 consdata->minactivityneginf = 0;
2262 consdata->minactivityposinf = 0;
2263 consdata->maxactivityneginf = 0;
2264 consdata->maxactivityposinf = 0;
2265 consdata->minactivityneghuge = 0;
2266 consdata->minactivityposhuge = 0;
2267 consdata->maxactivityneghuge = 0;
2268 consdata->maxactivityposhuge = 0;
2269 consdata->glbminactivity = 0.0;
2270 consdata->glbmaxactivity = 0.0;
2271 consdata->lastglbminactivity = 0.0;
2272 consdata->lastglbmaxactivity = 0.0;
2273 consdata->glbminactivityneginf = 0;
2274 consdata->glbminactivityposinf = 0;
2275 consdata->glbmaxactivityneginf = 0;
2276 consdata->glbmaxactivityposinf = 0;
2277 consdata->glbminactivityneghuge = 0;
2278 consdata->glbminactivityposhuge = 0;
2279 consdata->glbmaxactivityneghuge = 0;
2280 consdata->glbmaxactivityposhuge = 0;
2282 for( i = 0; i < consdata->nvars; ++i )
2285 consdata->lastminactivity = consdata->minactivity;
2286 consdata->lastmaxactivity = consdata->maxactivity;
2287 consdata->lastglbminactivity = consdata->glbminactivity;
2288 consdata->lastglbmaxactivity = consdata->glbmaxactivity;
2313 assert(consdata !=
NULL);
2314 assert(posinf >= 0);
2315 assert(neginf >= 0);
2316 assert(poshuge >= 0);
2317 assert(neghuge >= 0);
2318 assert(minactivity !=
NULL);
2319 assert(isrelax !=
NULL);
2320 assert(issettoinfinity !=
NULL);
2326 *issettoinfinity =
TRUE;
2330 else if( neginf > 0 )
2333 *issettoinfinity =
TRUE;
2337 else if( neghuge > 0 )
2340 *issettoinfinity =
TRUE;
2344 else if( !goodrelax && poshuge > 0 )
2347 *issettoinfinity =
TRUE;
2357 if( !consdata->validglbminact )
2359 assert(consdata->validglbminact);
2361 tmpactivity = consdata->glbminactivity;
2365 if( !consdata->validminact )
2367 assert(consdata->validminact);
2369 tmpactivity = consdata->minactivity;
2378 *minactivity = 1.0 * poshuge *
SCIPgetHugeValue(scip) + (tmpactivity - delta);
2379 *issettoinfinity =
FALSE;
2385 *minactivity = tmpactivity - delta;
2386 *issettoinfinity =
FALSE;
2414 assert(consdata !=
NULL);
2415 assert(posinf >= 0);
2416 assert(neginf >= 0);
2417 assert(poshuge >= 0);
2418 assert(neghuge >= 0);
2419 assert(maxactivity !=
NULL);
2420 assert(isrelax !=
NULL);
2421 assert(issettoinfinity !=
NULL);
2427 *issettoinfinity =
TRUE;
2431 else if( posinf > 0 )
2434 *issettoinfinity =
TRUE;
2438 else if( poshuge > 0 )
2441 *issettoinfinity =
TRUE;
2445 else if( !goodrelax && neghuge > 0 )
2448 *issettoinfinity =
TRUE;
2458 if( !consdata->validglbmaxact )
2460 assert(consdata->validglbmaxact);
2462 tmpactivity = consdata->glbmaxactivity;
2466 if( !consdata->validmaxact )
2468 assert(consdata->validmaxact);
2470 tmpactivity = consdata->maxactivity;
2479 *maxactivity = -1.0 * neghuge *
SCIPgetHugeValue(scip) + tmpactivity - delta;
2480 *issettoinfinity =
FALSE;
2486 *maxactivity = tmpactivity - delta;
2487 *issettoinfinity =
FALSE;
2513 assert(consdata !=
NULL);
2514 assert(minactivity !=
NULL);
2515 assert(maxactivity !=
NULL);
2517 if( !consdata->validactivities )
2520 assert(consdata->validminact);
2521 assert(consdata->validmaxact);
2525 assert(consdata->minactivityneginf >= 0);
2526 assert(consdata->minactivityposinf >= 0);
2527 assert(consdata->maxactivityneginf >= 0);
2528 assert(consdata->maxactivityposinf >= 0);
2530 getMinActivity(scip, consdata, consdata->minactivityposinf, consdata->minactivityneginf,
2531 consdata->minactivityposhuge, consdata->minactivityneghuge, 0.0,
FALSE, goodrelax,
2532 minactivity, minisrelax, &issettoinfinity);
2534 getMaxActivity(scip, consdata, consdata->maxactivityposinf, consdata->maxactivityneginf,
2535 consdata->maxactivityposhuge, consdata->maxactivityneghuge, 0.0,
FALSE, goodrelax,
2536 maxactivity, maxisrelax, &issettoinfinity);
2556 assert(scip !=
NULL);
2557 assert(consdata !=
NULL);
2559 assert(resactivity !=
NULL);
2563 for( v = 0; v < consdata->nvars; ++v )
2565 var = consdata->vars[v];
2566 assert(var !=
NULL);
2567 if( var == cancelvar )
2570 val = consdata->vals[v];
2572 if( useglobalbounds )
2592 *resactivity += val*lb;
2598 *resactivity += val*ub;
2607 *resactivity += val*ub;
2613 *resactivity += val*lb;
2645 assert(scip !=
NULL);
2646 assert(consdata !=
NULL);
2647 assert(var !=
NULL);
2648 assert(minresactivity !=
NULL);
2649 assert(maxresactivity !=
NULL);
2650 assert(minisrelax !=
NULL);
2651 assert(maxisrelax !=
NULL);
2652 assert(isminsettoinfinity !=
NULL);
2653 assert(ismaxsettoinfinity !=
NULL);
2656 if( !consdata->validactivities )
2659 assert(consdata->validminact);
2660 assert(consdata->validmaxact);
2664 assert(consdata->minactivityneginf >= 0);
2665 assert(consdata->minactivityposinf >= 0);
2666 assert(consdata->maxactivityneginf >= 0);
2667 assert(consdata->maxactivityposinf >= 0);
2668 assert(consdata->minactivityneghuge >= 0);
2669 assert(consdata->minactivityposhuge >= 0);
2670 assert(consdata->maxactivityneghuge >= 0);
2671 assert(consdata->maxactivityposhuge >= 0);
2691 assert(consdata->minactivityposinf >= 1);
2693 getMinActivity(scip, consdata, consdata->minactivityposinf - 1, consdata->minactivityneginf,
2694 consdata->minactivityposhuge, consdata->minactivityneghuge, 0.0,
FALSE, goodrelax,
2695 minresactivity, minisrelax, isminsettoinfinity);
2699 assert(consdata->minactivityneginf >= 1);
2701 getMinActivity(scip, consdata, consdata->minactivityposinf, consdata->minactivityneginf - 1,
2702 consdata->minactivityposhuge, consdata->minactivityneghuge, 0.0,
FALSE, goodrelax,
2703 minresactivity, minisrelax, isminsettoinfinity);
2707 assert(consdata->minactivityposhuge >= 1);
2709 getMinActivity(scip, consdata, consdata->minactivityposinf, consdata->minactivityneginf,
2710 consdata->minactivityposhuge - 1, consdata->minactivityneghuge, 0.0,
FALSE, goodrelax,
2711 minresactivity, minisrelax, isminsettoinfinity);
2715 assert(consdata->minactivityneghuge >= 1);
2717 getMinActivity(scip, consdata, consdata->minactivityposinf, consdata->minactivityneginf,
2718 consdata->minactivityposhuge, consdata->minactivityneghuge - 1, 0.0,
FALSE, goodrelax,
2719 minresactivity, minisrelax, isminsettoinfinity);
2723 getMinActivity(scip, consdata, consdata->minactivityposinf, consdata->minactivityneginf,
2724 consdata->minactivityposhuge, consdata->minactivityneghuge, absval * minactbound,
FALSE, goodrelax,
2725 minresactivity, minisrelax, isminsettoinfinity);
2733 assert(consdata->maxactivityneginf >= 1);
2735 getMaxActivity(scip, consdata, consdata->maxactivityposinf, consdata->maxactivityneginf - 1,
2736 consdata->maxactivityposhuge, consdata->maxactivityneghuge, 0.0,
FALSE, goodrelax,
2737 maxresactivity, maxisrelax, ismaxsettoinfinity);
2741 assert(consdata->maxactivityposinf >= 1);
2743 getMaxActivity(scip, consdata, consdata->maxactivityposinf - 1, consdata->maxactivityneginf,
2744 consdata->maxactivityposhuge, consdata->maxactivityneghuge, 0.0,
FALSE, goodrelax,
2745 maxresactivity, maxisrelax, ismaxsettoinfinity);
2749 assert(consdata->maxactivityposhuge >= 1);
2751 getMaxActivity(scip, consdata, consdata->maxactivityposinf, consdata->maxactivityneginf,
2752 consdata->maxactivityposhuge - 1, consdata->maxactivityneghuge, 0.0,
FALSE, goodrelax,
2753 maxresactivity, maxisrelax, ismaxsettoinfinity);
2757 assert(consdata->maxactivityneghuge >= 1);
2759 getMaxActivity(scip, consdata, consdata->maxactivityposinf, consdata->maxactivityneginf,
2760 consdata->maxactivityposhuge, consdata->maxactivityneghuge - 1, 0.0,
FALSE, goodrelax,
2761 maxresactivity, maxisrelax, ismaxsettoinfinity);
2765 getMaxActivity(scip, consdata, consdata->maxactivityposinf, consdata->maxactivityneginf,
2766 consdata->maxactivityposhuge, consdata->maxactivityneghuge, absval * maxactbound,
FALSE, goodrelax,
2767 maxresactivity, maxisrelax, ismaxsettoinfinity);
2791 assert(consdata !=
NULL);
2792 assert((glbminactivity !=
NULL && minisrelax !=
NULL && isminsettoinfinity !=
NULL)
2793 || (glbmaxactivity !=
NULL && maxisrelax !=
NULL && ismaxsettoinfinity !=
NULL));
2795 if( !consdata->validactivities )
2798 assert(consdata->validglbminact);
2799 assert(consdata->validglbmaxact);
2803 assert(consdata->glbminactivityneginf >= 0);
2804 assert(consdata->glbminactivityposinf >= 0);
2805 assert(consdata->glbmaxactivityneginf >= 0);
2806 assert(consdata->glbmaxactivityposinf >= 0);
2807 assert(consdata->glbminactivityneghuge >= 0);
2808 assert(consdata->glbminactivityposhuge >= 0);
2809 assert(consdata->glbmaxactivityneghuge >= 0);
2810 assert(consdata->glbmaxactivityposhuge >= 0);
2812 if( glbminactivity !=
NULL )
2814 assert(isminsettoinfinity !=
NULL);
2815 assert(minisrelax !=
NULL);
2817 getMinActivity(scip, consdata, consdata->glbminactivityposinf, consdata->glbminactivityneginf,
2818 consdata->glbminactivityposhuge, consdata->glbminactivityneghuge, 0.0,
TRUE, goodrelax,
2819 glbminactivity, minisrelax, isminsettoinfinity);
2822 if( glbmaxactivity !=
NULL )
2824 assert(ismaxsettoinfinity !=
NULL);
2825 assert(maxisrelax !=
NULL);
2827 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf, consdata->glbmaxactivityneginf,
2828 consdata->glbmaxactivityposhuge, consdata->glbmaxactivityneghuge, 0.0,
TRUE, goodrelax,
2829 glbmaxactivity, maxisrelax, ismaxsettoinfinity);
2858 assert(scip !=
NULL);
2859 assert(consdata !=
NULL);
2860 assert(var !=
NULL);
2861 assert((minresactivity !=
NULL && minisrelax !=
NULL && isminsettoinfinity !=
NULL )
2862 || (maxresactivity !=
NULL && maxisrelax !=
NULL && ismaxsettoinfinity !=
NULL));
2865 if( !consdata->validactivities )
2870 assert(consdata->glbminactivityneginf >= 0);
2871 assert(consdata->glbminactivityposinf >= 0);
2872 assert(consdata->glbmaxactivityneginf >= 0);
2873 assert(consdata->glbmaxactivityposinf >= 0);
2888 if( minresactivity !=
NULL )
2890 assert(isminsettoinfinity !=
NULL);
2891 assert(minisrelax !=
NULL);
2898 assert(consdata->glbminactivityposinf >= 1);
2900 getMinActivity(scip, consdata, consdata->glbminactivityposinf - 1, consdata->glbminactivityneginf,
2901 consdata->glbminactivityposhuge, consdata->glbminactivityneghuge, 0.0,
TRUE, goodrelax,
2902 minresactivity, minisrelax, isminsettoinfinity);
2906 assert(consdata->glbminactivityneginf >= 1);
2908 getMinActivity(scip, consdata, consdata->glbminactivityposinf, consdata->glbminactivityneginf - 1,
2909 consdata->glbminactivityposhuge, consdata->glbminactivityneghuge, 0.0,
TRUE, goodrelax,
2910 minresactivity, minisrelax, isminsettoinfinity);
2914 assert(consdata->glbminactivityposhuge >= 1);
2916 getMinActivity(scip, consdata, consdata->glbminactivityposinf, consdata->glbminactivityneginf,
2917 consdata->glbminactivityposhuge - 1, consdata->glbminactivityneghuge, 0.0,
TRUE, goodrelax,
2918 minresactivity, minisrelax, isminsettoinfinity);
2922 assert(consdata->glbminactivityneghuge >= 1);
2924 getMinActivity(scip, consdata, consdata->glbminactivityposinf, consdata->glbminactivityneginf,
2925 consdata->glbminactivityposhuge, consdata->glbminactivityneghuge - 1, 0.0,
TRUE, goodrelax,
2926 minresactivity, minisrelax, isminsettoinfinity);
2930 getMinActivity(scip, consdata, consdata->glbminactivityposinf, consdata->glbminactivityneginf,
2931 consdata->glbminactivityposhuge, consdata->glbminactivityneghuge, absval * minactbound,
TRUE,
2932 goodrelax, minresactivity, minisrelax, isminsettoinfinity);
2936 if( maxresactivity !=
NULL )
2938 assert(ismaxsettoinfinity !=
NULL);
2939 assert(maxisrelax !=
NULL);
2946 assert(consdata->glbmaxactivityneginf >= 1);
2948 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf, consdata->glbmaxactivityneginf - 1,
2949 consdata->glbmaxactivityposhuge, consdata->glbmaxactivityneghuge, 0.0,
TRUE, goodrelax,
2950 maxresactivity, maxisrelax, ismaxsettoinfinity);
2954 assert(consdata->glbmaxactivityposinf >= 1);
2956 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf - 1, consdata->glbmaxactivityneginf,
2957 consdata->glbmaxactivityposhuge, consdata->glbmaxactivityneghuge, 0.0,
TRUE, goodrelax,
2958 maxresactivity, maxisrelax, ismaxsettoinfinity);
2962 assert(consdata->glbmaxactivityposhuge >= 1);
2964 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf, consdata->glbmaxactivityneginf,
2965 consdata->glbmaxactivityposhuge - 1, consdata->glbmaxactivityneghuge, 0.0,
TRUE, goodrelax,
2966 maxresactivity, maxisrelax, ismaxsettoinfinity);
2970 assert(consdata->glbmaxactivityneghuge >= 1);
2972 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf, consdata->glbmaxactivityneginf,
2973 consdata->glbmaxactivityposhuge, consdata->glbmaxactivityneghuge - 1, 0.0,
TRUE, goodrelax,
2974 maxresactivity, maxisrelax, ismaxsettoinfinity);
2978 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf, consdata->glbmaxactivityneginf,
2979 consdata->glbmaxactivityposhuge, consdata->glbmaxactivityneghuge, absval * maxactbound,
TRUE,
2980 goodrelax, maxresactivity, maxisrelax, ismaxsettoinfinity);
2995 assert(scip !=
NULL);
2996 assert(consdata !=
NULL);
3012 for( v = 0; v < consdata->nvars; ++v )
3016 if( consdata->vals[v] < 0 )
3026 activity += consdata->vals[v] * solval;
3028 assert(nneginf >= 0 && nposinf >= 0);
3030 SCIPdebugMsg(scip,
"activity of linear constraint: %.15g, %d positive infinity values, %d negative infinity values \n", activity, nposinf, nneginf);
3033 if( nposinf > 0 && nneginf > 0 )
3034 activity = (consdata->rhs + consdata->lhs) / 2;
3035 else if( nposinf > 0 )
3037 else if( nneginf > 0 )
3040 SCIPdebugMsg(scip,
"corrected activity of linear constraint: %.15g\n", activity);
3045 else if( activity < 0 )
3063 assert(scip !=
NULL);
3064 assert(consdata !=
NULL);
3071 return MIN(consdata->rhs - activity, activity - consdata->lhs);
3081 uint64_t varsignature;
3086 assert(consdata !=
NULL);
3087 assert(consdata->validsignature);
3092 val = consdata->vals[pos];
3093 if( (val > 0.0 && ub > 0.0) || (val < 0.0 && lb < 0.0) )
3094 consdata->possignature |= varsignature;
3095 if( (val > 0.0 && lb < 0.0) || (val < 0.0 && ub > 0.0) )
3096 consdata->negsignature |= varsignature;
3105 assert(consdata !=
NULL);
3107 if( !consdata->validsignature )
3111 consdata->validsignature =
TRUE;
3112 consdata->possignature = 0;
3113 consdata->negsignature = 0;
3114 for( i = 0; i < consdata->nvars; ++i )
3125 assert(consdata !=
NULL);
3126 assert(0 <= ind1 && ind1 < consdata->nvars);
3127 assert(0 <= ind2 && ind2 < consdata->nvars);
3129 return SCIPvarCompare(consdata->vars[ind1], consdata->vars[ind2]);
3147 assert(perm !=
NULL);
3148 assert(consdata !=
NULL);
3152 for( v = 0; v < nvars; ++v )
3156 varv = consdata->vars[v];
3157 valv = consdata->vals[v];
3158 if( consdata->eventdata !=
NULL )
3159 eventdatav = consdata->eventdata[v];
3163 assert(0 <= perm[i] && perm[i] < nvars);
3164 assert(perm[i] != i);
3165 consdata->vars[i] = consdata->vars[perm[i]];
3166 consdata->vals[i] = consdata->vals[perm[i]];
3167 if( consdata->eventdata !=
NULL )
3169 consdata->eventdata[i] = consdata->eventdata[perm[i]];
3170 consdata->eventdata[i]->varpos = i;
3176 while( perm[i] != v );
3177 consdata->vars[i] = varv;
3178 consdata->vals[i] = valv;
3179 if( consdata->eventdata !=
NULL )
3181 consdata->eventdata[i] = eventdatav;
3182 consdata->eventdata[i]->varpos = i;
3189 for( v = 0; v < nvars; ++v )
3191 assert(perm[v] == v);
3192 assert(consdata->eventdata ==
NULL || consdata->eventdata[v]->varpos == v);
3212 assert(scip !=
NULL);
3213 assert(consdata !=
NULL);
3216 if( consdata->nvars <= 1 )
3218 consdata->sorted =
TRUE;
3219 consdata->binvarssorted =
TRUE;
3229 SCIPsort(perm, consdataCompVar, (
void*)consdata, consdata->nvars);
3236 consdata->sorted =
TRUE;
3237 consdata->binvarssorted =
FALSE;
3248 nvars = consdata->nvars;
3249 vars = consdata->vars;
3250 vals = consdata->vals;
3251 eventdata = consdata->eventdata;
3252 assert(vars !=
NULL || nvars == 0);
3253 assert(vals !=
NULL || nvars == 0);
3257 for( v = 0; v < nvars; ++v )
3259 assert( vars !=
NULL);
3260 assert( vals !=
NULL);
3269 tmpvar = vars[lastbin];
3270 tmpval = vals[lastbin];
3272 vars[lastbin] = vars[v];
3273 vals[lastbin] = vals[v];
3278 if( eventdata !=
NULL )
3282 tmpeventdata = eventdata[lastbin];
3283 eventdata[lastbin] = eventdata[v];
3284 eventdata[lastbin]->varpos = lastbin;
3285 eventdata[v] = tmpeventdata;
3286 eventdata[v]->varpos = v;
3292 assert(lastbin == v);
3297 consdata->nbinvars = lastbin;
3301 for( v = 0; v < nvars; ++v )
3303 assert(vars !=
NULL);
3304 assert(eventdata ==
NULL || eventdata[v]->varpos == v);
3309 if( consdata->nbinvars > 1 )
3314 assert(lastbin == consdata->nbinvars);
3315 assert(lastbin <= nvars);
3316 assert(vals !=
NULL);
3322 for( v = 0; v < lastbin; ++v )
3324 absvals[v] = ABS(vals[v]);
3337 consdata->binvarssorted =
TRUE;
3340 consdata->sorted = (consdata->sorted && consdata->nbinvars == 0);
3363 assert(scip !=
NULL);
3364 assert(cons !=
NULL);
3373 assert(consdata->nvars == 0 || (consdata->vars !=
NULL && consdata->vals !=
NULL));
3377 if(
SCIPisEQ(scip, consdata->lhs, lhs) )
3381 if(
SCIPisEQ(scip, lhs, consdata->rhs) )
3383 consdata->rhs = lhs;
3384 assert(consdata->row ==
NULL);
3397 vars = consdata->vars;
3398 vals = consdata->vals;
3400 for( v = 0; v < consdata->nvars; ++v )
3402 assert(vars[v] !=
NULL);
3422 vars = consdata->vars;
3423 vals = consdata->vals;
3425 for( v = 0; v < consdata->nvars; ++v )
3427 assert(vars[v] !=
NULL);
3445 consdata->boundstightened = 0;
3446 consdata->presolved =
FALSE;
3447 consdata->cliquesadded =
FALSE;
3448 consdata->implsadded =
FALSE;
3458 consdata->lhs = lhs;
3459 consdata->changed =
TRUE;
3460 consdata->normalized =
FALSE;
3461 consdata->upgradetried =
FALSE;
3462 consdata->rangedrowpropagated = 0;
3466 if( consdata->row !=
NULL )
3484 assert(scip !=
NULL);
3485 assert(cons !=
NULL);
3494 assert(consdata->nvars == 0 || (consdata->vars !=
NULL && consdata->vals !=
NULL));
3498 if(
SCIPisEQ(scip, consdata->rhs, rhs) )
3502 if(
SCIPisEQ(scip, rhs, consdata->lhs) )
3504 consdata->lhs = rhs;
3505 assert(consdata->row ==
NULL);
3520 vars = consdata->vars;
3521 vals = consdata->vals;
3523 for( v = 0; v < consdata->nvars; ++v )
3525 assert(vars[v] !=
NULL);
3545 vars = consdata->vars;
3546 vals = consdata->vals;
3548 for( v = 0; v < consdata->nvars; ++v )
3550 assert(vars[v] !=
NULL);
3568 consdata->boundstightened = 0;
3569 consdata->presolved =
FALSE;
3570 consdata->cliquesadded =
FALSE;
3571 consdata->implsadded =
FALSE;
3581 consdata->rhs = rhs;
3582 consdata->changed =
TRUE;
3583 consdata->normalized =
FALSE;
3584 consdata->upgradetried =
FALSE;
3585 consdata->rangedrowpropagated = 0;
3588 if( consdata->row !=
NULL )
3608 assert(scip !=
NULL);
3609 assert(cons !=
NULL);
3610 assert(var !=
NULL);
3617 assert(consdata !=
NULL);
3627 assert(var !=
NULL);
3631 consdata->vars[consdata->nvars] = var;
3632 consdata->vals[consdata->nvars] = val;
3641 if( consdata->eventdata !=
NULL )
3649 assert(conshdlrdata !=
NULL);
3650 assert(conshdlrdata->eventhdlr !=
NULL);
3653 consdata->eventdata[consdata->nvars-1] =
NULL;
3674 consdata->maxactdeltavar = var;
3681 if( delta > consdata->maxactdelta )
3683 consdata->maxactdelta = delta;
3684 consdata->maxactdeltavar = var;
3699 consdata->boundstightened = 0;
3700 consdata->presolved =
FALSE;
3701 consdata->removedfixings = consdata->removedfixings &&
SCIPvarIsActive(var);
3703 if( consdata->validsignature )
3706 consdata->changed =
TRUE;
3707 consdata->normalized =
FALSE;
3708 consdata->upgradetried =
FALSE;
3709 consdata->cliquesadded =
FALSE;
3710 consdata->implsadded =
FALSE;
3711 consdata->rangedrowpropagated = 0;
3713 if( consdata->nvars == 1 )
3715 consdata->binvarssorted =
TRUE;
3716 consdata->sorted =
TRUE;
3717 consdata->merged =
TRUE;
3721 consdata->binvarssorted = consdata->binvarssorted && !
SCIPvarIsBinary(var);
3722 consdata->sorted = consdata->sorted
3723 && (
SCIPvarCompare(consdata->vars[consdata->nvars-2], consdata->vars[consdata->nvars-1]) <= 0);
3724 consdata->merged =
FALSE;
3728 if( consdata->hasnonbinvalid && !consdata->hascontvar )
3734 consdata->hasnonbinvar =
TRUE;
3737 consdata->hascontvar =
TRUE;
3742 if( consdata->row !=
NULL )
3762 assert(scip !=
NULL);
3763 assert(cons !=
NULL);
3766 assert(consdata !=
NULL);
3767 assert(0 <= pos && pos < consdata->nvars);
3769 var = consdata->vars[pos];
3770 val = consdata->vals[pos];
3771 assert(var !=
NULL);
3785 assert(conshdlrdata !=
NULL);
3786 assert(conshdlrdata->eventhdlr !=
NULL);
3789 if( consdata->eventdata !=
NULL )
3792 assert(consdata->eventdata[pos] ==
NULL);
3797 if( pos != consdata->nvars-1 )
3799 consdata->binvarssorted = consdata->binvarssorted && !
SCIPvarIsBinary(consdata->vars[pos]);
3801 consdata->vars[pos] = consdata->vars[consdata->nvars-1];
3802 consdata->vals[pos] = consdata->vals[consdata->nvars-1];
3804 if( consdata->eventdata !=
NULL )
3806 consdata->eventdata[pos] = consdata->eventdata[consdata->nvars-1];
3807 assert(consdata->eventdata[pos] !=
NULL);
3808 consdata->eventdata[pos]->varpos = pos;
3810 consdata->sorted = consdata->sorted && (pos + 2 >= consdata->nvars || (
SCIPvarCompare(consdata->vars[pos], consdata->vars[pos + 1]) <= 0));
3817 if( consdata->nvars <= 1 )
3829 if( consdata->maxactdeltavar == var )
3832 consdata->maxactdeltavar =
NULL;
3843 consdata->boundstightened = 0;
3844 consdata->presolved =
FALSE;
3845 consdata->validsignature =
FALSE;
3846 consdata->changed =
TRUE;
3847 consdata->normalized =
FALSE;
3848 consdata->upgradetried =
FALSE;
3849 consdata->cliquesadded =
FALSE;
3850 consdata->implsadded =
FALSE;
3851 consdata->rangedrowpropagated = 0;
3856 consdata->hasnonbinvalid =
FALSE;
3860 if( consdata->row !=
NULL )
3884 assert(scip !=
NULL);
3885 assert(cons !=
NULL);
3889 assert(consdata !=
NULL);
3890 assert(0 <= pos && pos < consdata->nvars);
3893 var = consdata->vars[pos];
3894 val = consdata->vals[pos];
3895 assert(var !=
NULL);
3911 consdata->vals[pos] = newval;
3913 consdata->binvarssorted = consdata->binvarssorted && !
SCIPvarIsBinary(var);
3925 consdata->boundstightened = 0;
3926 consdata->presolved =
FALSE;
3927 consdata->validsignature = consdata->validsignature && (newval * val > 0.0);
3928 consdata->changed =
TRUE;
3929 consdata->normalized =
FALSE;
3930 consdata->upgradetried =
FALSE;
3931 consdata->cliquesadded =
FALSE;
3932 consdata->implsadded =
FALSE;
3933 consdata->rangedrowpropagated = 0;
3951 assert(scip !=
NULL);
3952 assert(cons !=
NULL);
3955 assert(consdata !=
NULL);
3956 assert(consdata->row ==
NULL);
3960 for( i = consdata->nvars - 1; i >= 0; --i )
3962 newval = scalar * consdata->vals[i];
3972 SCIPwarningMessage(scip,
"coefficient %.15g of variable <%s> in linear constraint <%s> scaled to zero (scalar: %.15g)\n",
3977 consdata->vals[i] = newval;
3985 lhs = consdata->lhs;
3986 consdata->lhs = -consdata->rhs;
3987 consdata->rhs = -lhs;
3992 newval = absscalar * consdata->lhs;
4000 consdata->lhs = newval;
4004 newval = absscalar * consdata->rhs;
4012 consdata->rhs = newval;
4016 consdata->cliquesadded =
FALSE;
4017 consdata->implsadded =
FALSE;
4035 assert(scip !=
NULL);
4036 assert(conshdlr !=
NULL);
4037 assert(conss !=
NULL);
4038 assert(nconss >= 0);
4042 for( i = 0; i < nconss; i++ )
4047 if( consdata->varsdeleted )
4050 for( v = consdata->nvars - 1; v >= 0; --v )
4057 consdata->varsdeleted =
FALSE;
4109 assert(scip !=
NULL);
4110 assert(cons !=
NULL);
4118 assert(consdata !=
NULL);
4121 if( consdata->normalized )
4125 vals = consdata->vals;
4126 nvars = consdata->nvars;
4127 vars = consdata->vars;
4128 assert(nvars == 0 || vars !=
NULL);
4129 assert(nvars == 0 || vals !=
NULL);
4133 consdata->normalized =
TRUE;
4137 assert(vars !=
NULL);
4138 assert(vals !=
NULL);
4149 if( !
SCIPisEQ(scip, maxabsval, 1.0) )
4155 for( v = nvars - 1; v >= 0; --v )
4159 abscoefsequ =
FALSE;
4167 SCIPdebugMsg(scip,
"divide linear constraint with %g, because all coefficents are in absolute value the same\n", maxabsval);
4171 if( consdata->validmaxabsval )
4173 if( !
SCIPisEQ(scip, consdata->maxabsval, 1.0) )
4174 consdata->maxabsval = 1.0;
4175 if( !
SCIPisEQ(scip, consdata->minabsval, 1.0) )
4176 consdata->minabsval = 1.0;
4187 vals = consdata->vals;
4188 nvars = consdata->nvars;
4189 vars = consdata->vars;
4191 assert(nvars == 0 || vars !=
NULL);
4192 assert(nvars == 0 || vals !=
NULL);
4199 consdata->normalized =
TRUE;
4203 assert(vars !=
NULL);
4204 assert(vals !=
NULL);
4217 if( !consdata->hasnonbinvalid )
4221 if( !consdata->hascontvar )
4234 for( v = nvars - 1; v >= 0; --v )
4283 for( i = 0; i < nvars; ++i )
4290 if( nposcoeffs > nnegcoeffs )
4292 else if( nposcoeffs < nnegcoeffs )
4302 assert(mult == +1 || mult == -1);
4306 SCIPdebugMsg(scip,
"multiply linear constraint with -1.0\n");
4311 assert(nvars == consdata->nvars);
4321 for( i = 0; i < nvars && success && scm <= maxmult; ++i )
4326 success =
SCIPrealToRational(vals[i], -epsilon, epsilon , maxmult, &nominator, &denominator);
4336 onlyintegral =
TRUE;
4339 for( i = nvars - 1; i >= 0; --i )
4343 onlyintegral =
FALSE;
4349 success = success && (scm <= maxmult || (scm == 1 && onlyintegral));
4350 if( success && scm != 1 )
4353 SCIPdebugMsg(scip,
"scale linear constraint with %" SCIP_LONGINT_FORMAT
" to make coefficients integral\n", scm);
4357 if( consdata->validmaxabsval )
4362 consdata->validmaxabsval =
FALSE;
4368 if( consdata->validminabsval )
4373 consdata->validminabsval =
FALSE;
4380 vals = consdata->vals;
4381 nvars = consdata->nvars;
4382 assert(nvars == 0 || vals !=
NULL);
4388 if( success && nvars >= 1 )
4394 for( i = 1; i < nvars && gcd > 1; ++i )
4403 SCIPdebugMsg(scip,
"divide linear constraint by greatest common divisor %" SCIP_LONGINT_FORMAT
"\n", gcd);
4407 if( consdata->validmaxabsval )
4411 if( consdata->validminabsval )
4419 consdata->normalized =
TRUE;
4439 assert(scip !=
NULL);
4440 assert(cons !=
NULL);
4443 assert(consdata !=
NULL);
4445 if( consdata->merged )
4455 v = consdata->nvars-1;
4458 var = consdata->vars[v];
4459 if( consdata->vars[v-1] == var )
4461 valsum = consdata->vals[v];
4466 valsum += consdata->vals[v];
4468 while( v >= 1 && consdata->vars[v-1] == var );
4471 assert(consdata->vars[v] == var);
4479 if( consdata->maxactdeltavar == var )
4482 consdata->maxactdeltavar =
NULL;
4493 consdata->merged =
TRUE;
4519 assert(scip !=
NULL);
4520 assert(cons !=
NULL);
4522 if( infeasible !=
NULL )
4523 *infeasible =
FALSE;
4526 assert(consdata !=
NULL);
4528 if( !consdata->removedfixings )
4533 lhssubtrahend = 0.0;
4534 rhssubtrahend = 0.0;
4540 while( v < consdata->nvars )
4542 var = consdata->vars[v];
4543 val = consdata->vals[v];
4564 if( val * fixedval > 0.0 )
4570 if( infeasible !=
NULL )
4583 lhssubtrahend += val * fixedval;
4589 if( val * fixedval > 0.0 )
4591 if( infeasible !=
NULL )
4608 rhssubtrahend += val * fixedval;
4619 assert(activevar !=
NULL);
4621 assert(activevar !=
NULL);
4631 lhssubtrahend += activeconstant;
4633 rhssubtrahend += activeconstant;
4644 for( i = 0; i < naggrvars; ++i )
4651 lhssubtrahend += val * aggrconst;
4653 rhssubtrahend += val * aggrconst;
4663 lhssubtrahend += val * aggrconst;
4665 rhssubtrahend += val * aggrconst;
4711 consdata->removedfixings =
TRUE;
4724 assert(consdata->removedfixings);
4728 for( v = 0; v < consdata->nvars; ++v )
4756 assert(scip !=
NULL);
4757 assert(cons !=
NULL);
4761 assert(consdata !=
NULL);
4763 vars = consdata->vars;
4764 vals = consdata->vals;
4765 nvars = consdata->nvars;
4767 assert(vars !=
NULL || nvars == 0);
4768 assert(vals !=
NULL || nvars == 0);
4770 assert(-1 <= inferpos && inferpos < nvars);
4771 assert((infervar ==
NULL) == (inferpos == -1));
4772 assert(inferpos == -1 || vars[inferpos] == infervar);
4794 if( infervar !=
NULL )
4796 assert(vals !=
NULL);
4799 &minisrelax,
NULL, &isminsettoinfinity,
NULL);
4802 NULL, &maxisrelax,
NULL, &ismaxsettoinfinity);
4808 &minisrelax,
NULL, &isminsettoinfinity,
NULL);
4811 NULL, &maxisrelax,
NULL, &ismaxsettoinfinity);
4815 if( (reasonisrhs && !isminsettoinfinity && !minisrelax) || (!reasonisrhs && !ismaxsettoinfinity && !maxisrelax) )
4820 resactisinf =
FALSE;
4825 if( infervar !=
NULL )
4827 assert(vals !=
NULL);
4837 rescap = consdata->rhs - minresactivity;
4847 rescap = consdata->lhs - maxresactivity;
4850 if( reasonisrhs == (vals[inferpos] > 0.0) )
4856 rescap = (reasonisrhs ? consdata->rhs - minresactivity : consdata->lhs - maxresactivity);
4861 for( i = 0; i < nvars; ++i )
4863 assert( vars !=
NULL && vals !=
NULL );
4866 if( vars[i] == infervar ||
SCIPisZero(scip, vals[i]) )
4875 if( reasonisrhs == (vals[i] > 0.0) )
4894 for( i = 0; i < nvars; ++i )
4896 assert(vars !=
NULL);
4897 assert(vals !=
NULL);
4900 if( vars[i] == infervar ||
SCIPisZero(scip, vals[i]) )
4903 if( reasonisrhs == (vals[i] > 0.0) )
4936 assert(scip !=
NULL);
4937 assert(cons !=
NULL);
4941 vars = consdata->vars;
4942 nvars = consdata->nvars;
4943 assert(vars !=
NULL || nvars == 0);
4944 assert(-1 <= inferpos && inferpos < nvars);
4945 assert((infervar ==
NULL) == (inferpos == -1));
4946 assert(inferpos == -1 || vars !=
NULL);
4947 assert(inferpos == -1 || vars[inferpos] == infervar);
4950 for( v = nvars - 1; v >= 0; --v )
4952 assert(vars !=
NULL);
4955 if( vars[v] == infervar )
4957 assert(vars[v] !=
NULL);
4998 assert(scip !=
NULL);
5001 for( v = nvars - 1; v >= 0; --v )
5003 assert(vars !=
NULL);
5057 assert(scip !=
NULL);
5058 assert(cons !=
NULL);
5059 assert(result !=
NULL);
5062 assert(consdata !=
NULL);
5063 vars = consdata->vars;
5064 nvars = consdata->nvars;
5066 vals = consdata->vals;
5067 assert(vars !=
NULL);
5068 assert(vals !=
NULL);
5073 if( inferpos >= nvars || vars[inferpos] != infervar )
5077 for( inferpos = 0; inferpos < nvars && vars[inferpos] != infervar; ++inferpos )
5080 assert(inferpos < nvars);
5081 assert(vars[inferpos] == infervar);
5119 SCIPerrorMessage(
"invalid inference information %d in linear constraint <%s> at position %d for %s bound of variable <%s>\n",
5166 assert(consdata !=
NULL);
5168 infcountmin = consdata->minactivityneginf
5169 + consdata->minactivityposinf
5170 + consdata->minactivityneghuge
5171 + consdata->minactivityposhuge;
5172 infcountmax = consdata->maxactivityneginf
5173 + consdata->maxactivityposinf
5174 + consdata->maxactivityneghuge
5175 + consdata->maxactivityposhuge;
5177 if( infcountmin > 1 && infcountmax > 1 )
5203 assert(cons !=
NULL);
5207 assert(consdata !=
NULL);
5208 var = consdata->vars[pos];
5209 assert(var !=
NULL);
5218 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, activity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newub=%.15g\n",
5219 SCIPconsGetName(cons),
SCIPvarGetName(var), lb, oldub, consdata->vals[pos], consdata->minactivity, consdata->maxactivity, consdata->lhs, consdata->rhs, newub);
5228 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
5236 else if( tightened )
5239 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, new bds=[%.15g,%.15g]\n",
5246 consdata->upgradetried =
FALSE;
5272 assert(cons !=
NULL);
5276 assert(consdata !=
NULL);
5277 var = consdata->vars[pos];
5278 assert(var !=
NULL);
5287 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, activity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newlb=%.15g\n",
5288 SCIPconsGetName(cons),
SCIPvarGetName(var), oldlb, ub, consdata->vals[pos], consdata->minactivity, consdata->maxactivity, consdata->lhs, consdata->rhs, newlb);
5297 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
5305 else if( tightened )
5308 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, new bds=[%.15g,%.15g]\n",
5315 consdata->upgradetried =
FALSE;
5341 assert(cons !=
NULL);
5342 assert(cutoff !=
NULL);
5343 assert(nchgbds !=
NULL);
5350 assert(consdata !=
NULL);
5351 assert(0 <= pos && pos < consdata->nvars);
5355 var = consdata->vars[pos];
5356 assert(var !=
NULL);
5362 val = consdata->vals[pos];
5363 lhs = consdata->lhs;
5364 rhs = consdata->rhs;
5374 if( !consdata->validactivities )
5376 assert(consdata->validactivities);
5377 if( !consdata->validminact )
5379 assert(consdata->validminact);
5380 if( !consdata->validmaxact )
5382 assert(consdata->validmaxact);
5395 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, minactivity=%.15g > rhs=%.15g\n",
5402 slack = rhs - consdata->minactivity;
5410 alpha = val * (ub - lb);
5418 newub = lb + (slack / val);
5424 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
5444 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, maxactivity=%.15g < lhs=%.15g\n",
5451 slack = consdata->maxactivity - lhs;
5459 alpha = val * (ub - lb);
5467 newlb = ub - (slack / val);
5473 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
5492 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, minactivity=%.15g > rhs=%.15g\n",
5499 slack = rhs - consdata->minactivity;
5507 alpha = val * (lb - ub);
5515 newlb = ub + slack / val;
5521 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
5540 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, maxactivity=%.15g < lhs=%.15g\n",
5547 slack = consdata->maxactivity - lhs;
5555 alpha = val * (lb - ub);
5563 newub = lb - (slack / val);
5569 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
5595 assert(scip !=
NULL);
5596 assert(cons !=
NULL);
5599 assert(consdata !=
NULL);
5678 assert(scip !=
NULL);
5679 assert(cons !=
NULL);
5680 assert(cutoff !=
NULL);
5681 assert(nfixedvars !=
NULL);
5682 assert(nchgbds !=
NULL);
5683 assert(naddconss !=
NULL);
5690 assert(consdata !=
NULL);
5693 if( consdata->rangedrowpropagated == 2 )
5697 if( consdata->nvars < 3 )
5706 assert(conshdlr !=
NULL);
5708 assert(conshdlrdata !=
NULL);
5714 consdata->rangedrowpropagated = 2;
5721 if( consdata->rangedrowpropagated > 0 )
5724 consdata->rangedrowpropagated = 1;
5729 for( v = consdata->nvars - 1; v >= 0; --v )
5732 assert(!
SCIPisZero(scip, consdata->vals[v]));
5747 lhs = consdata->lhs - fixedact;
5748 rhs = consdata->rhs - fixedact;
5749 nunfixedvars = consdata->nvars - nfixedconsvars;
5794 absval =
REALABS(consdata->vals[v]);
5796 if( absminbincoef > absval )
5797 absminbincoef = absval;
5800 gcdisone = gcdisone &&
SCIPisEQ(scip,
REALABS(consdata->vals[v]), 1.0);
5801 possiblegcd =
FALSE;
5802 infcheckvars[ninfcheckvars] = consdata->vars[v];
5803 infcheckvals[ninfcheckvars] = consdata->vals[v];
5819 if( v == consdata->nvars )
5823 if( ncontvars + 2 > nunfixedvars )
5836 for( ; v < consdata->nvars; ++v )
5845 absval =
REALABS(consdata->vals[v]);
5847 if( absminbincoef > absval )
5848 absminbincoef = absval;
5857 gcdisone = gcdisone &&
SCIPisEQ(scip,
REALABS(consdata->vals[v]), 1.0);
5858 possiblegcd =
FALSE;
5859 infcheckvars[ninfcheckvars] = consdata->vars[v];
5860 infcheckvals[ninfcheckvars] = consdata->vals[v];
5869 assert(
REALABS(consdata->vals[v]) > 1.5);
5872 assert(gcdtmp >= 1);
5876 infcheckvars[ninfcheckvars] = consdata->vars[v];
5877 infcheckvals[ninfcheckvars] = consdata->vals[v];
5892 if( ninfcheckvars == 0 )
5897 minactinfvarsinvalid =
FALSE;
5898 maxactinfvarsinvalid =
FALSE;
5899 maxactinfvars = 0.0;
5900 minactinfvars = 0.0;
5903 for( v = ninfcheckvars - 1; v >= 0; --v )
5910 if( infcheckvals[v] < 0.0 )
5911 maxactinfvarsinvalid =
TRUE;
5913 minactinfvarsinvalid =
TRUE;
5917 if( infcheckvals[v] < 0.0 )
5918 maxactinfvars += infcheckvals[v] * lb;
5920 minactinfvars += infcheckvals[v] * lb;
5925 if( infcheckvals[v] > 0.0 )
5926 maxactinfvarsinvalid =
TRUE;
5928 minactinfvarsinvalid =
TRUE;
5932 if( infcheckvals[v] > 0.0 )
5933 maxactinfvars += infcheckvals[v] * ub;
5935 minactinfvars += infcheckvals[v] * ub;
5940 minactinfvarsinvalid =
TRUE;
5942 maxactinfvarsinvalid =
TRUE;
5944 if( minactinfvarsinvalid || maxactinfvarsinvalid )
5947 assert(!minactinfvarsinvalid && !maxactinfvarsinvalid);
5949 SCIPdebugMsg(scip,
"minactinfvarsinvalid = %u, minactinfvars = %g, maxactinfvarsinvalid = %u, maxactinfvars = %g, gcd = %lld, ninfcheckvars = %d, ncontvars = %d\n",
5950 minactinfvarsinvalid, minactinfvars, maxactinfvarsinvalid, maxactinfvars, gcd, ninfcheckvars, ncontvars);
5964 SCIPisGT(scip,
SCIPceil(scip, (lhs - maxactinfvars) / gcd) * gcd, rhs - minactinfvars) )
5975 else if( ncontvars == 0 )
5982 v = ninfcheckvars - 1;
5984 assert(gcdinfvars >= 2);
5986 for( ; v >= 0 && gcdinfvars >= 2; --v )
5994 SCIPdebugMsg(scip,
"gcdinfvars =%lld, possiblegcd = %u\n", gcdinfvars, possiblegcd);
5997 if( gcdinfvars >= 1 )
6008 while(
SCIPisLE(scip, value, maxactinfvars) )
6010 value2 = value + gcd * (
SCIPceil(scip, (lhs - value) / gcd));
6025 value += gcdinfvars;
6027 assert(nsols < 2 || minvalue <= maxvalue);
6038 while(
SCIPisGE(scip, value, minactinfvars) )
6040 value2 = value + gcd * (
SCIPfloor(scip, (rhs - value) / gcd));
6045 assert(maxvalue > minvalue);
6048 value -= gcdinfvars;
6050 assert(maxvalue > secondsolval);
6053 SCIPdebugMsg(scip,
"here nsols %s %d, minsolvalue = %g, maxsolvalue = %g, ninfcheckvars = %d, nunfixedvars = %d\n",
6054 nsols > 2 ?
">=" :
"=", nsols, minvalue, maxvalue, ninfcheckvars, nunfixedvars);
6059 SCIPdebugMsg(scip,
"gcdinfvars = %lld, gcd = %lld, correctedlhs = %g, correctedrhs = %g\n",
6060 gcdinfvars, gcd, lhs, rhs);
6071 else if( nsols == 1 )
6073 assert(minvalue == maxvalue);
6076 if( ninfcheckvars == 1 )
6082 SCIPdebugMsg(scip,
"fixing single variable <%s> with bounds [%.15g,%.15g] to %.15g\n",
6103 if( ninfcheckvars == nunfixedvars - 1 )
6110 assert(ninfcheckvars > 0);
6113 for( v = 0; v < consdata->nvars - 1; ++v )
6117 if( w >= ninfcheckvars || consdata->vars[v] != infcheckvars[w] )
6123 assert((nfixedconsvars == 0) ? (consdata->nvars - v - 1 == ninfcheckvars - w) :
TRUE);
6125 for( ; v2 < consdata->nvars && w2 < ninfcheckvars; ++v2 )
6130 assert(consdata->vars[v2] == infcheckvars[w2]);
6133 assert(w2 == ninfcheckvars);
6139 if( consdata->vals[v] < 0 )
6141 bound =
SCIPfloor(scip, (lhs - maxvalue) / consdata->vals[v]);
6145 bound =
SCIPceil(scip, (lhs - maxvalue) / consdata->vals[v]);
6148 SCIPdebugMsg(scip,
"fixing variable <%s> with bounds [%.15g,%.15g] to %.15g\n",
6161 consdata->vars[v], bound) );
6177 assert(v == consdata->nvars - 1);
6180 if( consdata->vals[v] < 0 )
6182 bound =
SCIPfloor(scip, (lhs - maxvalue) / consdata->vals[v]);
6186 bound =
SCIPceil(scip, (lhs - maxvalue) / consdata->vals[v]);
6189 SCIPdebugMsg(scip,
"fixing variable <%s> with bounds [%.15g,%.15g] to %.15g\n",
6202 consdata->vars[v], bound) );
6209 else if( addartconss && (
SCIPisGT(scip, minvalue, minactinfvars) ||
SCIPisLT(scip, maxvalue, maxactinfvars)) )
6217 ++conshdlrdata->naddconss;
6219 SCIPdebugMsg(scip,
"adding artificial constraint %s\n", name);
6222 maxvalue, maxvalue,
TRUE,
TRUE,
TRUE,
FALSE,
TRUE,
TRUE,
FALSE,
FALSE,
TRUE,
FALSE) );
6239 if( ninfcheckvars == 1 )
6247 if( infcheckvals[0] < 0 )
6249 newlb = maxvalue/infcheckvals[0];
6250 newub = minvalue/infcheckvals[0];
6254 newlb = minvalue/infcheckvals[0];
6255 newub = maxvalue/infcheckvals[0];
6257 assert(newlb < newub);
6262 SCIPdebugMsg(scip,
"tightening lower bound of variable <%s> from %g to %g\n",
6283 SCIPdebugMsg(scip,
"tightening upper bound of variable <%s> from %g to %g\n",
6302 else if( ninfcheckvars == nunfixedvars - 1 )
6310 assert(ninfcheckvars > 0);
6311 assert(minvalue < maxvalue);
6314 for( v = 0; v < consdata->nvars - 1; ++v )
6318 if( w >= ninfcheckvars || consdata->vars[v] != infcheckvars[w] )
6324 assert((nfixedconsvars == 0) ? (consdata->nvars - v - 1 == ninfcheckvars - w) :
TRUE);
6326 for( ; v2 < consdata->nvars && w2 < ninfcheckvars; ++v2 )
6331 assert(consdata->vars[v2] == infcheckvars[w2]);
6334 assert(w2 == ninfcheckvars);
6340 if( consdata->vals[v] < 0 )
6342 newlb =
SCIPfloor(scip, (rhs - minvalue) / consdata->vals[v]);
6343 newub =
SCIPfloor(scip, (lhs - maxvalue) / consdata->vals[v]);
6347 newlb =
SCIPceil(scip, (lhs - maxvalue) / consdata->vals[v]);
6348 newub =
SCIPceil(scip, (rhs - minvalue) / consdata->vals[v]);
6350 assert(
SCIPisLE(scip, newlb, newub));
6355 SCIPdebugMsg(scip,
"tightening lower bound of variable <%s> from %g to %g\n",
6367 consdata->vars[v], newlb) );
6377 SCIPdebugMsg(scip,
"tightening upper bound of variable <%s> from %g to %g\n",
6389 consdata->vars[v], newub) );
6406 assert(v == consdata->nvars - 1);
6409 if( consdata->vals[v] < 0 )
6411 newlb =
SCIPfloor(scip, (rhs - minvalue) / consdata->vals[v]);
6412 newub =
SCIPfloor(scip, (lhs - maxvalue) / consdata->vals[v]);
6416 newlb =
SCIPceil(scip, (lhs - maxvalue) / consdata->vals[v]);
6417 newub =
SCIPceil(scip, (rhs - minvalue) / consdata->vals[v]);
6419 assert(
SCIPisLE(scip, newlb, newub));
6424 SCIPdebugMsg(scip,
"tightening lower bound of variable <%s> from %g to %g\n",
6445 SCIPdebugMsg(scip,
"tightening upper bound of variable <%s> from %g to %g\n",
6467 else if( addartconss && (
SCIPisGT(scip, minvalue, minactinfvars) ||
SCIPisLT(scip, maxvalue, maxactinfvars)) )
6474 assert(maxvalue > minvalue);
6476 if(
SCIPisGT(scip, minvalue, minactinfvars) )
6481 if(
SCIPisLT(scip, maxvalue, maxactinfvars) )
6490 ++conshdlrdata->naddconss;
6492 SCIPdebugMsg(scip,
"adding artificial constraint %s\n", name);
6509 else if( addartconss && ncontvars < ninfcheckvars )
6516 for( v = 0; v < consdata->nvars; ++v )
6518 if( w < ninfcheckvars && consdata->vars[v] == infcheckvars[w] )
6528 if( consdata->vals[v] > 0.0 )
6529 maxact += consdata->vals[v];
6531 minact += consdata->vals[v];
6539 if( consdata->vals[v] > 0.0 )
6581 assert(maxact > minact);
6582 assert(w == ninfcheckvars);
6584 newlhs = lhs - maxact;
6585 newrhs = rhs - minact;
6586 assert(newlhs < newrhs);
6590 ++conshdlrdata->naddconss;
6592 SCIPdebugMsg(scip,
"adding artificial constraint %s\n", name);
6639 assert(scip !=
NULL);
6640 assert(cons !=
NULL);
6641 assert(cutoff !=
NULL);
6642 assert(nchgbds !=
NULL);
6649 assert(consdata !=
NULL);
6650 assert(0 <= pos && pos < consdata->nvars);
6654 var = consdata->vars[pos];
6660 val = consdata->vals[pos];
6661 lhs = consdata->lhs;
6662 rhs = consdata->rhs;
6664 &minisrelax, &maxisrelax, &isminsettoinfinity, &ismaxsettoinfinity);
6665 assert(var !=
NULL);
6677 if( !isminsettoinfinity && !
SCIPisInfinity(scip, rhs) && !minisrelax )
6681 newub = (rhs - minresactivity)/val;
6690 if( activityunreliable )
6693 newub = (rhs - minresactivity)/val;
6696 && (!force || !
SCIPisLT(scip, newub, ub)));
6699 if( !activityunreliable )
6702 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, resactivity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newub=%.15g\n",
6705 &infeasible, &tightened) );
6708 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
6723 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, new bds=[%.15g,%.15g]\n",
6730 if( !ismaxsettoinfinity && !
SCIPisInfinity(scip, -lhs) && !maxisrelax )
6734 newlb = (lhs - maxresactivity)/val;
6742 newlb = (lhs - maxresactivity)/val;
6746 && (!force || !
SCIPisGT(scip, newlb, lb))) )
6751 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, resactivity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newlb=%.15g\n",
6754 &infeasible, &tightened) );
6757 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
6771 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, new bds=[%.15g,%.15g]\n",
6780 if( !isminsettoinfinity && !
SCIPisInfinity(scip, rhs) && !minisrelax )
6784 newlb = (rhs - minresactivity)/val;
6791 if( activityunreliable )
6794 newlb = (rhs - minresactivity)/val;
6798 && (!force || !
SCIPisGT(scip, newlb, lb)));
6801 if( !activityunreliable )
6804 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, resactivity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newlb=%.15g\n",
6807 &infeasible, &tightened) );
6810 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
6824 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, new bds=[%.15g,%.15g]\n",
6831 if( !ismaxsettoinfinity && !
SCIPisInfinity(scip, -lhs) && !maxisrelax )
6835 newub = (lhs - maxresactivity)/val;
6843 newub = (lhs - maxresactivity)/val;
6847 && (!force || !
SCIPisLT(scip, newub, ub))) )
6852 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, resactivity=[%.15g,%.15g], sides=[%.15g,%.15g], newub=%.15g\n",
6855 &infeasible, &tightened) );
6858 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
6872 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, new bds=[%.15g,%.15g]\n",
6882 #define MAXTIGHTENROUNDS 10 6896 unsigned int tightenmode;
6902 int oldnchgbdstotal;
6908 assert(scip !=
NULL);
6909 assert(cons !=
NULL);
6910 assert(nchgbds !=
NULL);
6911 assert(cutoff !=
NULL);
6932 assert(consdata !=
NULL);
6934 nvars = consdata->nvars;
6944 if( !force && (consdata->boundstightened >= tightenmode) )
6951 assert(consdata->binvarssorted);
6984 if(
SCIPisLE(scip, consdata->maxactdelta,
MIN(slack, surplus)) )
6989 easycase =
SCIPisLT(scip, consdata->maxactdelta, maxeasyactivitydelta);
6996 oldnchgbdstotal = *nchgbds;
6999 for( nrounds = 0; (force || consdata->boundstightened < tightenmode) && nrounds <
MAXTIGHTENROUNDS; ++nrounds )
7002 consdata->boundstightened = (
unsigned int)tightenmode;
7008 while( v < nvars && v != lastchange && !(*cutoff) )
7010 oldnchgbds = *nchgbds;
7024 if( *nchgbds > oldnchgbds )
7029 else if( consdata->binvarssorted && v < consdata->nbinvars - 1
7031 v = consdata->nbinvars;
7038 *nchgbds - oldnchgbdstotal, nrounds);
7039 oldnchgbdstotal += oldnchgbds;
7044 if( force &&
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
7066 assert(scip !=
NULL);
7067 assert(cons !=
NULL);
7068 assert(violated !=
NULL);
7074 assert(consdata !=
NULL);
7078 if( consdata->row !=
NULL )
7090 SCIPdebugMsg(scip,
" consdata activity=%.15g (lhs=%.15g, rhs=%.15g, row=%p, checklprows=%u, rowinlp=%u, sol=%p, hascurrentnodelp=%u)\n",
7091 activity, consdata->lhs, consdata->rhs, (
void*)consdata->row, checklprows,
7100 assert(sol ==
NULL);
7109 if( !checkrelmaxabs )
7133 for( v = 0; v < consdata->nvars; ++v )
7135 if( consdata->vals !=
NULL )
7137 coef = consdata->vals[v];
7143 absval =
REALABS( coef * solval );
7144 maxabs =
MAX( maxabs, absval );
7151 if( (consdata->lhs - activity) <= (1e-15 * maxabs) )
7153 SCIPdebugMsg(scip,
" lhs violated due to random noise: violation=%16.9g, maxabs=%16.9g\n",
7154 consdata->lhs - activity, maxabs);
7166 if( (consdata->lhs - activity) <= (
SCIPfeastol(scip) * maxabs) )
7168 SCIPdebugMsg(scip,
" lhs violated absolutely (violation=%16.9g), but feasible when using relative tolerance w.r.t. maximum absolute value (%16.9g)\n",
7169 consdata->lhs - activity, maxabs);
7205 if( (activity - consdata->rhs) <= (1e-15 * maxabs) )
7207 SCIPdebugMsg(scip,
" rhs violated due to random noise: violation=%16.9g, maxabs=%16.9g\n",
7208 activity - consdata->rhs, maxabs);
7220 if( (activity - consdata->rhs) <= (
SCIPfeastol(scip) * maxabs) )
7222 SCIPdebugMsg(scip,
" rhs violated absolutely (violation=%16.9g), but feasible when using relative tolerance w.r.t. maximum absolute value (%16.9g)\n",
7223 activity - consdata->rhs, maxabs);
7277 assert(scip !=
NULL);
7278 assert(cons !=
NULL);
7281 assert(consdata !=
NULL);
7282 assert(consdata->row ==
NULL);
7303 assert(scip !=
NULL);
7304 assert(cons !=
NULL);
7307 assert(consdata !=
NULL);
7309 if( consdata->row ==
NULL )
7314 assert(consdata->row !=
NULL);
7333 assert( pr == 0 || cr == 0 );
7359 assert(scip !=
NULL);
7361 assert(cons !=
NULL);
7362 assert(cutoff !=
NULL);
7365 assert(ncuts !=
NULL);
7366 assert(consdata !=
NULL);
7382 if( !separateall && sol ==
NULL )
7395 consdata->vals, +1.0, consdata->rhs, sol, cutoff, ncuts) );
7403 consdata->vals, -1.0, -consdata->lhs, sol, cutoff, ncuts) );
7413 consdata->vals, +1.0, consdata->rhs, sol, cutoff, ncuts) );
7418 consdata->vals, -1.0, -consdata->lhs, sol, cutoff, ncuts) );
7423 if( *ncuts > oldncuts )
7451 assert(cons !=
NULL);
7452 assert(cutoff !=
NULL);
7453 assert(nchgbds !=
NULL);
7458 assert(consdata !=
NULL);
7476 oldnchgbds = *nchgbds;
7480 if( *nchgbds > oldnchgbds )
7487 if( rangedrowpropagation && tightenbounds && !(*cutoff) )
7506 SCIPdebugMsg(scip,
"linear constraint <%s> found %d bound changes and %d fixings\n",
SCIPconsGetName(cons), *nchgbds - oldnchgbds, nfixedvars);
7509 if( nfixedvars > 0 )
7510 *nchgbds += 2*nfixedvars;
7520 SCIPdebugMsg(scip,
"linear constraint <%s> is infeasible (rhs): activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
7521 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
7529 else if(
SCIPisFeasLT(scip, maxactivity, consdata->lhs) )
7531 SCIPdebugMsg(scip,
"linear constraint <%s> is infeasible (lhs): activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
7532 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
7540 else if(
SCIPisGE(scip, minactivity, consdata->lhs) &&
SCIPisLE(scip, maxactivity, consdata->rhs) )
7542 SCIPdebugMsg(scip,
"linear constraint <%s> is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
7543 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
7575 assert(scip !=
NULL);
7577 assert(cutoff !=
NULL);
7578 assert(nfixedvars !=
NULL);
7581 assert(consdata !=
NULL);
7583 for( v = 0; v < consdata->nvars; ++v )
7585 assert(consdata->vars !=
NULL);
7586 var = consdata->vars[v];
7598 SCIPdebugMsg(scip,
"converting variable <%s> with fixed bounds [%.15g,%.15g] into fixed variable fixed at %.15g\n",
7622 assert(consdata->removedfixings);
7627 #define MAX_CLIQUE_NONZEROS_PER_CONS 1000000 7719 int cliquenonzerosadded;
7726 assert(scip !=
NULL);
7727 assert(cons !=
NULL);
7728 assert(nfixedvars !=
NULL);
7729 assert(nchgbds !=
NULL);
7730 assert(cutoff !=
NULL);
7734 assert(consdata !=
NULL);
7736 if( consdata->nvars < 2 )
7745 if( !consdata->implsadded )
7757 nvars = consdata->nvars;
7758 vars = consdata->vars;
7759 vals = consdata->vals;
7762 if( !consdata->validactivities )
7764 assert(consdata->validactivities);
7768 finitenegminact = (consdata->glbminactivityneginf == 0 && consdata->glbminactivityneghuge == 0);
7769 finitenegmaxact = (consdata->glbmaxactivityneginf == 0 && consdata->maxactivityneghuge == 0);
7770 finiteposminact = (consdata->glbminactivityposinf == 0 && consdata->glbminactivityposhuge == 0);
7771 finiteposmaxact = (consdata->glbmaxactivityposinf == 0 && consdata->glbmaxactivityposhuge == 0);
7772 finiteminact = (finitenegminact && finiteposminact);
7773 finitemaxact = (finitenegmaxact && finiteposmaxact);
7775 if( (finiterhs || finitelhs) && (finitenegminact || finiteposminact || finitenegmaxact || finiteposmaxact) )
7780 int oldnchgbds = *nchgbds;
7786 if( (finitenegminact || finiteposminact) && !consdata->validglbminact )
7789 assert(consdata->validglbminact);
7792 if( (finitenegmaxact || finiteposmaxact) && !consdata->validglbmaxact )
7795 assert(consdata->validglbmaxact);
7797 assert(consdata->validglbminact || consdata->validglbmaxact);
7802 for( v = nvars - 1; v >= 0; --v )
7810 if( value > maxabscontrib )
7812 maxabscontrib = value;
7823 if( value > maxabscontrib )
7825 maxabscontrib = value;
7834 assert(0 <= position && position < nvars);
7836 if( !
SCIPisEQ(scip, maxabscontrib, 1.0) && !allbinary )
7842 if( finiterhs && finiteminact &&
SCIPisEQ(scip, consdata->glbminactivity, consdata->rhs - maxabscontrib) )
7844 for( v = nvars - 1; v >= 0; --v )
7856 *nchgbds += nbdchgs;
7863 *nchgbds += nbdchgs;
7883 if( finitelhs && finitemaxact &&
SCIPisEQ(scip, consdata->glbmaxactivity, consdata->lhs - maxabscontrib) )
7885 for( v = nvars - 1; v >= 0; --v )
7897 *nchgbds += nbdchgs;
7904 *nchgbds += nbdchgs;
7923 SCIPdebugMsg(scip,
"extracted %d implications from constraint %s which led to %d bound changes, %scutoff detetcted\n", nimpls,
SCIPconsGetName(cons), *nchgbds - oldnchgbds, *cutoff ?
"" :
"no ");
7929 if( *nchgbds - oldnchgbds > 0 )
7950 consdata->implsadded =
TRUE;
7954 if( consdata->cliquesadded )
7957 consdata->cliquesadded =
TRUE;
7958 cliquenonzerosadded = 0;
7964 nvars = consdata->nvars;
7965 vars = consdata->vars;
7966 vals = consdata->vals;
7971 if( !consdata->validactivities )
7973 assert(consdata->validactivities);
7977 finitenegminact = (consdata->glbminactivityneginf == 0 && consdata->glbminactivityneghuge == 0);
7978 finitenegmaxact = (consdata->glbmaxactivityneginf == 0 && consdata->maxactivityneghuge == 0);
7979 finiteposminact = (consdata->glbminactivityposinf == 0 && consdata->glbminactivityposhuge == 0);
7980 finiteposmaxact = (consdata->glbmaxactivityposinf == 0 && consdata->glbmaxactivityposhuge == 0);
7981 finiteminact = (finitenegminact && finiteposminact);
7982 finitemaxact = (finitenegmaxact && finiteposmaxact);
7987 if( (finiterhs || finitelhs) && (finitenegminact || finiteposminact || finitenegmaxact || finiteposmaxact) )
7991 int nposbinvars = 0;
7992 int nnegbinvars = 0;
7993 int allonebinary = 0;
7999 for( i = 0; i < nvars; ++i )
8008 binvars[nposbinvars + nnegbinvars] = vars[i];
8009 binvarvals[nposbinvars + nnegbinvars] = vals[i];
8016 assert(nposbinvars + nnegbinvars <= nvars);
8022 assert(nposbinvars + nnegbinvars <= nvars);
8027 if( allonebinary < nvars && (nposbinvars >= 2 || nnegbinvars >= 2) )
8030 int oldnchgbds = *nchgbds;
8036 if( (finitenegminact || finiteposminact) && !consdata->validglbminact )
8039 assert(consdata->validglbminact);
8042 if( (finitenegmaxact || finiteposmaxact) && !consdata->validglbmaxact )
8045 assert(consdata->validglbmaxact);
8047 assert(consdata->validglbminact || consdata->validglbmaxact);
8053 if( finiterhs && finitenegminact && nposbinvars >= 2 )
8056 threshold = consdata->rhs - consdata->glbminactivity;
8065 if(
SCIPisFeasGT(scip, binvarvals[i] + binvarvals[j], threshold) )
8069 while( j < nposbinvars )
8071 if( !
SCIPisFeasGT(scip, binvarvals[j-1] + binvarvals[j], threshold) )
8083 *nchgbds += nbdchgs;
8085 cliquenonzerosadded += j;
8090 if( !stopped && !(*cutoff) && j < nposbinvars )
8093 int lastfit = j - 2;
8094 assert(lastfit >= i);
8100 while( lastfit >= i && j < nposbinvars )
8103 if(
SCIPisFeasGT(scip, binvarvals[lastfit] + binvarvals[j], threshold) )
8105 clqvars[lastfit + 1] = binvars[j];
8116 *nchgbds += nbdchgs;
8118 cliquenonzerosadded += (lastfit - i + 2);
8137 if( !stopped && !*cutoff && *nchgbds - oldnchgbds > 0 )
8158 if( !consdata->validactivities )
8160 assert(consdata->validactivities);
8162 nvars = consdata->nvars;
8163 vars = consdata->vars;
8164 vals = consdata->vals;
8170 for( i = 0; i < nvars; ++i )
8179 binvars[nposbinvars + nnegbinvars] = vars[i];
8180 binvarvals[nposbinvars + nnegbinvars] = vals[i];
8187 assert(nposbinvars + nnegbinvars <= nvars);
8193 assert(nposbinvars + nnegbinvars <= nvars);
8198 oldnchgbds = *nchgbds;
8202 if( !stopped && !(*cutoff) && finitelhs && finiteposmaxact && nnegbinvars >= 2 )
8205 threshold = consdata->lhs - consdata->glbmaxactivity;
8207 i = nposbinvars + nnegbinvars - 1;
8214 if(
SCIPisFeasLT(scip, binvarvals[i] + binvarvals[j], threshold) )
8218 while( j >= nposbinvars )
8220 if( !
SCIPisFeasLT(scip, binvarvals[j+1] + binvarvals[j], threshold) )
8233 *nchgbds += nbdchgs;
8235 cliquenonzerosadded += (i - j);
8240 if( !stopped && !(*cutoff) && jstart >= nposbinvars )
8243 int lastfit = jstart + 1;
8244 assert(lastfit < i);
8251 while( lastfit <= i && j >= nposbinvars )
8254 if(
SCIPisFeasLT(scip, binvarvals[lastfit] + binvarvals[j], threshold) )
8256 assert(lastfit - jstart - 2 >= 0 && lastfit - jstart - 2 < i);
8257 clqvars[lastfit - jstart - 2] = binvars[j];
8259 assert(i - lastfit + 2 >= 2);
8269 *nchgbds += nbdchgs;
8271 cliquenonzerosadded += (i - lastfit + 2);
8290 if( !stopped && !*cutoff && *nchgbds - oldnchgbds > 0 )
8311 if( !consdata->validactivities )
8313 assert(consdata->validactivities);
8315 nvars = consdata->nvars;
8316 vars = consdata->vars;
8317 vals = consdata->vals;
8323 for( i = 0; i < nvars; ++i )
8332 binvars[nposbinvars + nnegbinvars] = vars[i];
8333 binvarvals[nposbinvars + nnegbinvars] = vals[i];
8340 assert(nposbinvars + nnegbinvars <= nvars);
8346 assert(nposbinvars + nnegbinvars <= nvars);
8351 oldnchgbds = *nchgbds;
8355 if( !(*cutoff) && finiterhs && finiteminact && nnegbinvars >= 2 )
8364 threshold = consdata->rhs - consdata->glbminactivity;
8366 i = nposbinvars + nnegbinvars - 1;
8374 if(
SCIPisFeasGT(scip, -binvarvals[i] - binvarvals[j], threshold) )
8378 while( j >= nposbinvars )
8380 if( !
SCIPisFeasGT(scip, -binvarvals[j+1] - binvarvals[j], threshold) )
8393 *nchgbds += nbdchgs;
8395 cliquenonzerosadded += (i - j);
8400 if( !stopped && !(*cutoff) && jstart >= nposbinvars )
8403 int lastfit = j + 1;
8404 assert(lastfit < i);
8411 while( lastfit <= i && j >= nposbinvars )
8414 if(
SCIPisFeasGT(scip, -binvarvals[lastfit] - binvarvals[j], threshold) )
8416 assert(lastfit - jstart - 2 >= 0 && lastfit - jstart - 2 < i);
8417 clqvars[lastfit - jstart - 2] = binvars[j];
8419 assert(i - lastfit + 2 >= 2);
8429 *nchgbds += nbdchgs;
8431 cliquenonzerosadded += (i - lastfit + 2);
8452 if( !stopped && !*cutoff && *nchgbds - oldnchgbds > 0 )
8473 if( !consdata->validactivities )
8475 assert(consdata->validactivities);
8477 nvars = consdata->nvars;
8478 vars = consdata->vars;
8479 vals = consdata->vals;
8485 for( i = 0; i < nvars; ++i )
8494 binvars[nposbinvars + nnegbinvars] = vars[i];
8495 binvarvals[nposbinvars + nnegbinvars] = vals[i];
8502 assert(nposbinvars + nnegbinvars <= nvars);
8508 assert(nposbinvars + nnegbinvars <= nvars);
8515 if( !stopped && !(*cutoff) && finitelhs && finitemaxact && nposbinvars >= 2 )
8524 threshold = consdata->lhs - consdata->glbmaxactivity;
8531 assert(!
SCIPisFeasLT(scip, -binvarvals[i], threshold));
8534 if(
SCIPisFeasLT(scip, -binvarvals[i] - binvarvals[j], threshold) )
8538 while( j < nposbinvars )
8540 if( !
SCIPisFeasLT(scip, -binvarvals[j-1] - binvarvals[j], threshold) )
8552 *nchgbds += nbdchgs;
8554 cliquenonzerosadded += j;
8559 if( !stopped && !(*cutoff) && j < nposbinvars )
8562 int lastfit = j - 2;
8563 assert(lastfit >= i);
8569 while( lastfit >= i && j < nposbinvars )
8572 if(
SCIPisFeasLT(scip, -binvarvals[lastfit] - binvarvals[j], threshold) )
8574 clqvars[lastfit + 1] = binvars[j];
8585 *nchgbds += nbdchgs;
8587 cliquenonzerosadded += (lastfit - i + 2);
8619 for( i = 0; i < nvars; ++i )
8623 else if(
SCIPisEQ(scip, vals[i], +1.0) )
8625 else if(
SCIPisEQ(scip, vals[i], -1.0) )
8634 if( lhsclique || rhsclique )
8639 SCIPdebugMsg(scip,
"linear constraint <%s>: adding clique with %d vars (%d pos, %d neg)\n",
8643 for( i = 0; i < nvars; ++i )
8644 values[i] = (rhsclique == (vals[i] > 0.0));
8651 *nchgbds += nbdchgs;
8670 assert(scip !=
NULL);
8671 assert(cons !=
NULL);
8672 assert(nchgsides !=
NULL);
8675 assert(consdata !=
NULL);
8680 for( i = 0; i < consdata->nvars && integral; ++i )
8687 SCIPdebugMsg(scip,
"linear constraint <%s>: make sides integral: sides=[%.15g,%.15g]\n",
8692 if( !consdata->upgraded )
8698 if( !consdata->upgraded )
8701 SCIPdebugMsg(scip,
"linear constraint <%s>: new integral sides: sides=[%.15g,%.15g]\n",
8772 assert(scip !=
NULL);
8773 assert(cons !=
NULL);
8774 assert(nchgcoefs !=
NULL);
8775 assert(nchgsides !=
NULL);
8778 assert(consdata !=
NULL);
8782 if( (consdata->validmaxabsval && consdata->maxabsval >
MAXVALRECOMP)
8783 || (consdata->validminabsval && consdata->minabsval <
MINVALRECOMP) )
8792 minleftactivity = 0.0;
8793 maxleftactivity = 0.0;
8797 while( i < consdata->nvars )
8799 var = consdata->vars[i];
8804 val = consdata->vals[i];
8812 SCIPisGE(scip, minactivity + val, consdata->lhs) &&
SCIPisLE(scip, maxactivity - val, consdata->rhs) )
8820 lval = consdata->lhs - minactivity;
8821 rval = maxactivity - consdata->rhs;
8824 if( consdata->nvars == 2 )
8827 otherval = consdata->vals[1-i];
8829 if( !
SCIPisInfinity(scip, -consdata->lhs) && consdata->minactivityneginf + consdata->minactivityneginf == 0 )
8831 lval = consdata->lhs - val*lb;
8835 if( !
SCIPisInfinity(scip,consdata->rhs) && consdata->maxactivityneginf + consdata->maxactivityneginf == 0 )
8837 rval = val*ub - consdata->rhs;
8842 newval =
MAX(lval, rval);
8846 newlhs = consdata->lhs - val * lb;
8847 newlhs += newval * lb;
8848 newrhs = consdata->rhs - val * ub;
8849 newrhs += newval * ub;
8853 SCIPdebugMsg(scip,
"linear constraint <%s>: change coefficient %+.15g<%s> to %+.15g<%s>, act=[%.15g,%.15g], side=[%.15g,%.15g]\n",
8855 minactivity, maxactivity, consdata->lhs, consdata->rhs);
8878 assert(
SCIPisEQ(scip, consdata->lhs, newlhs));
8887 assert(
SCIPisEQ(scip, consdata->rhs, newrhs));
8900 minleftactivity += val * lb;
8910 maxleftactivity += val * ub;
8918 SCIPisGE(scip, minactivity - val, consdata->lhs) &&
SCIPisLE(scip, maxactivity + val, consdata->rhs) )
8926 lval = minactivity - consdata->lhs;
8927 rval = consdata->rhs - maxactivity;
8930 if( consdata->nvars == 2 )
8933 otherval = consdata->vals[1-i];
8935 if( !
SCIPisInfinity(scip,-consdata->lhs) && consdata->minactivityneginf + consdata->minactivityneginf == 0 )
8937 lval = val*ub - consdata->lhs;
8941 if( !
SCIPisInfinity(scip,consdata->rhs) && consdata->maxactivityneginf + consdata->maxactivityneginf == 0 )
8943 rval = consdata->rhs - val*lb;
8948 newval =
MIN(lval, rval);
8952 newlhs = consdata->lhs - val * ub;
8953 newlhs += newval * ub;
8954 newrhs = consdata->rhs - val * lb;
8955 newrhs += newval * lb;
8959 SCIPdebugMsg(scip,
"linear constraint <%s>: change coefficient %+.15g<%s> to %+.15g<%s>, act=[%.15g,%.15g], side=[%.15g,%.15g]\n",
8961 minactivity, maxactivity, consdata->lhs, consdata->rhs);
8984 assert(
SCIPisEQ(scip, consdata->lhs, newlhs));
8993 assert(
SCIPisEQ(scip, consdata->rhs, newrhs));
9006 minleftactivity += val * ub;
9016 maxleftactivity += val * lb;
9023 SCIPdebugMsg(scip,
"minleftactivity = %.15g, rhs = %.15g\n",
9024 minleftactivity, consdata->rhs);
9025 SCIPdebugMsg(scip,
"maxleftactivity = %.15g, lhs = %.15g\n",
9026 maxleftactivity, consdata->lhs);
9053 aggrlhs = consdata->lhs - minactivity + minleftactivity;
9054 aggrrhs = consdata->rhs - maxactivity + maxleftactivity;
9072 while( i < consdata->nvars )
9074 var = consdata->vars[i];
9075 minleftactivitypart = 0.0;
9076 maxleftactivitypart = 0.0;
9081 val = consdata->vals[i];
9089 SCIPisLT(scip, minactivity + val, consdata->lhs) ||
SCIPisGT(scip, maxactivity - val, consdata->rhs) )
9091 SCIPdebugMsg(scip,
"minactivity = %g\tval = %g\tlhs = %g\n", minactivity, val, consdata->lhs);
9092 SCIPdebugMsg(scip,
"maxactivity = %g\tval = %g\trhs = %g\n", maxactivity, val, consdata->rhs);
9093 SCIPdebugMsg(scip,
"linear constraint <%s>: remove variable <%s> with coefficient <%g> from constraint since it is redundant\n",
9096 minleftactivitypart = val * lb;
9097 maxleftactivitypart = val * ub;
9116 SCIPisLT(scip, minactivity - val, consdata->lhs) ||
SCIPisGT(scip, maxactivity + val, consdata->rhs) )
9118 SCIPdebugMsg(scip,
"linear constraint <%s>: remove variable <%s> with coefficient <%g> from constraint since it is redundant\n",
9121 minleftactivitypart = val * ub;
9122 maxleftactivitypart = val * lb;
9144 newlhs = consdata->lhs - minleftactivitypart;
9145 newrhs = consdata->rhs - maxleftactivitypart;
9152 assert(
SCIPisEQ(scip, consdata->lhs, newlhs));
9159 assert(
SCIPisEQ(scip, consdata->rhs, newrhs));
9185 assert(scip !=
NULL);
9186 assert(cons !=
NULL);
9188 assert(nfixedvars !=
NULL);
9189 assert(ndelconss !=
NULL);
9192 assert(consdata !=
NULL);
9193 assert(consdata->nvars == 1);
9194 assert(
SCIPisEQ(scip, consdata->lhs, consdata->rhs));
9197 var = consdata->vars[0];
9198 val = consdata->vals[0];
9202 SCIPdebugMsg(scip,
"linear equality <%s>: fix <%s> == %.15g\n",
9218 if( !consdata->upgraded )
9239 assert(scip !=
NULL);
9240 assert(cons !=
NULL);
9241 assert(cutoff !=
NULL);
9242 assert(naggrvars !=
NULL);
9246 assert(consdata !=
NULL);
9247 assert(consdata->nvars == 2);
9248 assert(
SCIPisEQ(scip, consdata->lhs, consdata->rhs));
9250 SCIPdebugMsg(scip,
"linear constraint <%s>: aggregate %.15g<%s> + %.15g<%s> == %.15g\n",
9252 consdata->vals[1],
SCIPvarGetName(consdata->vars[1]), consdata->rhs);
9256 consdata->rhs, &infeasible, &redundant, &aggregated) );
9275 if( !consdata->upgraded )
9296 assert(scip !=
NULL);
9297 assert(consdata !=
NULL);
9298 assert(newlhs !=
NULL);
9299 assert(newrhs !=
NULL);
9305 if( slackcoef > 0.0 )
9310 *newrhs = consdata->rhs - slackcoef * slackvarlb;
9314 *newlhs = consdata->lhs - slackcoef * slackvarub;
9321 *newlhs = consdata->rhs - slackcoef * slackvarlb;
9325 *newrhs = consdata->lhs - slackcoef * slackvarub;
9327 assert(
SCIPisLE(scip, *newlhs, *newrhs));
9330 #define MAXMULTIAGGRQUOTIENT 1e+03 9372 int maxnlocksremove;
9382 assert(scip !=
NULL);
9383 assert(cons !=
NULL);
9384 assert(cutoff !=
NULL);
9385 assert(naggrvars !=
NULL);
9388 assert(consdata !=
NULL);
9389 assert(consdata->nvars > 2);
9390 assert(
SCIPisEQ(scip, consdata->lhs, consdata->rhs));
9399 lhs = consdata->lhs;
9400 rhs = consdata->rhs;
9402 if( consdata->nvars == 3 )
9407 maxnlocksremove = 3;
9409 else if( consdata->nvars == 4 )
9414 maxnlocksremove = 2;
9419 maxnlocksremove = 1;
9438 vars = consdata->vars;
9439 vals = consdata->vals;
9442 bestnlocks = INT_MAX;
9443 bestremovescons =
FALSE;
9444 bestslackdomrng = 0.0;
9445 coefszeroone =
TRUE;
9446 coefsintegral =
TRUE;
9447 varsintegral =
TRUE;
9455 for( v = 0; v < consdata->nvars; ++v )
9465 assert(vars !=
NULL);
9466 assert(vals !=
NULL);
9479 if( absval < minabsval )
9481 if( absval > maxabsval )
9489 coefszeroone = coefszeroone &&
SCIPisEQ(scip, absval, 1.0);
9517 if( nlocks > maxnlocksremove )
9521 if( (iscont || (coefsintegral && varsintegral &&
SCIPisEQ(scip, absval, 1.0))) &&
9535 slackdomrng = (varub - varlb)*absval;
9539 better = (slacktype > bestslacktype) || (bestslackpos == -1);
9540 if( !better && slacktype == bestslacktype )
9542 better = (nlocks < bestnlocks);
9543 if( nlocks == bestnlocks && !bestremovescons )
9545 better =
SCIPisGT(scip, slackdomrng, bestslackdomrng);
9546 equal = !better &&
SCIPisGE(scip, slackdomrng, bestslackdomrng);
9550 if( better || equal )
9564 &minisrelax, &maxisrelax, &isminsettoinfinity, &ismaxsettoinfinity);
9569 if( minisrelax || maxisrelax )
9589 if( conshdlrdata->multaggrremove && !removescons )
9593 if( bestremovescons && !removescons )
9599 if( !removescons && nlocks > maxnlocksstay )
9602 better = better || (!bestremovescons && removescons);
9606 bestslacktype = slacktype;
9607 bestnlocks = nlocks;
9608 bestslackdomrng = slackdomrng;
9609 bestremovescons = removescons;
9629 for( v = 0; v < consdata->nvars; ++v )
9631 if( v != bestslackpos )
9664 assert(!samevar || (supinf > 0 && infinf > 0));
9668 if( (samevar && (supinf > 1 || infinf > 1)) || (!samevar && supinf > 0 && infinf > 0) )
9670 SCIPdebugMsg(scip,
"do not perform multi-aggregation: infimum and supremum are both infinite\n");
9679 if( bestslackpos >= 0
9681 || (coefsintegral && varsintegral && nimplvars == 0)) )
9694 assert(bestslackpos < consdata->nvars);
9703 slackvar = vars[bestslackpos];
9704 slackcoef = vals[bestslackpos];
9706 aggrconst = consdata->rhs/slackcoef;
9709 assert(
SCIPisLE(scip, newlhs, newrhs));
9719 for( v = 0; v < consdata->nvars; ++v )
9721 scalars[v] = -consdata->vals[v]/slackcoef;
9724 SCIPdebugMsgPrint(scip,
" %+.15g, bounds of <%s>: [%.15g,%.15g], nlocks=%d, maxnlocks=%d, removescons=%u\n",
9726 bestnlocks, bestremovescons ? maxnlocksremove : maxnlocksstay, bestremovescons);
9730 &infeasible, &aggregated) );
9747 if( bestremovescons )
9752 if( !consdata->upgraded )
9756 else if( ncontvars == 1 )
9760 assert(0 <= contvarpos && contvarpos < consdata->nvars);
9761 var = vars[contvarpos];
9770 SCIPdebugMsg(scip,
"linear constraint <%s>: converting continuous variable <%s> to implicit integer variable\n",
9791 absval =
REALABS(vals[contvarpos]);
9802 #ifdef SCIP_DEBUG_SOLUTION 9803 if( SCIPdebugIsMainscip(scip) )
9812 SCIPdebugMsg(scip,
"linear constraint <%s>: aggregating continuous variable <%s> to newly created implicit integer variable <%s>, aggregation factor = %g\n",
9820 SCIPdebugMsg(scip,
"infeasible aggregation of variable <%s> to implicit variable <%s>, domain is empty\n",
9842 consdata->boundstightened = 0;
9843 consdata->rangedrowpropagated = 0;
9844 consdata->presolved =
FALSE;
9847 else if( ncontvars == 0 && nimplvars == 0 && nintvars == 1 && !coefszeroone )
9854 assert(varsintegral);
9855 assert(0 <= intvarpos && intvarpos < consdata->nvars);
9856 var = vars[intvarpos];
9864 SCIPdebugMsg(scip,
"linear constraint <%s>: converting integer variable <%s> to implicit integer variable\n",
9898 vars = consdata->vars;
9899 nvars = consdata->nvars;
9901 assert(vars !=
NULL);
9903 for( v = 0; v < nvars; ++v )
9907 assert(var !=
NULL);
9913 assert(var !=
NULL);
9927 val = consdata->vals[v];
9934 (*scale) = val / -objval;
9938 else if(
SCIPisEQ(scip, -objval * (*scale), val) )
9946 (*scale) = val / objval;
9948 else if( !
SCIPisEQ(scip, objval * (*scale), val) )
9974 assert(scip !=
NULL);
9975 assert(cons !=
NULL);
9976 assert(conshdlrdata !=
NULL);
9979 assert(consdata !=
NULL);
9980 assert(
SCIPisEQ(scip, consdata->lhs, consdata->rhs));
9982 nvars = consdata->nvars;
9986 if( nvars > nobjvars || nvars == 0 )
9990 if( (nvars < nobjvars && !conshdlrdata->detectpartialobjective) ||
9991 (nvars == nobjvars && (!conshdlrdata->detectcutoffbound || !conshdlrdata->detectlowerbound)) )
9994 offset = consdata->rhs;
10004 vars = consdata->vars;
10005 assert(vars !=
NULL);
10009 SCIPdebugMsg(scip,
"linear equality constraint <%s> == %g (offset %g) is a subset of the objective function\n",
10013 for( v = 0; v < nvars; ++v )
10042 SCIPdebugMsg(scip,
"update cutoff bound <%g>\n", cutoffbound);
10051 assert(consdata !=
NULL);
10086 assert(scip !=
NULL);
10087 assert(cons !=
NULL);
10088 assert(conshdlrdata !=
NULL);
10091 assert(consdata !=
NULL);
10094 if(
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
10097 nvars = consdata->nvars;
10112 if( nobjvars == 0 )
10125 if( conshdlrdata->detectcutoffbound && rhsfinite )
10129 primalbound = (consdata->rhs - offset) / scale;
10131 SCIPdebugMsg(scip,
"constraint <%s> is parallel to objective function and provides a cutoff bound <%g>\n",
10137 if( conshdlrdata->detectlowerbound && lhsfinite )
10141 lowerbound = (consdata->lhs - offset) / scale;
10143 SCIPdebugMsg(scip,
"constraint <%s> is parallel to objective function and provides a lower bound <%g>\n",
10149 if( (conshdlrdata->detectcutoffbound && (conshdlrdata->detectlowerbound || !lhsfinite)) ||
10150 (conshdlrdata->detectlowerbound && !rhsfinite) )
10159 if( conshdlrdata->detectlowerbound && rhsfinite )
10163 lowerbound = (consdata->rhs - offset) / scale;
10165 SCIPdebugMsg(scip,
"constraint <%s> is parallel to objective function and provides a lower bound <%g>\n",
10171 if( conshdlrdata->detectcutoffbound && lhsfinite )
10175 primalbound = (consdata->lhs - offset) / scale;
10177 SCIPdebugMsg(scip,
"constraint <%s> is parallel to objective function and provides a cutoff bound <%g>\n",
10183 if( (conshdlrdata->detectcutoffbound && (conshdlrdata->detectlowerbound || !rhsfinite)) ||
10184 (conshdlrdata->detectlowerbound && !lhsfinite) )
10210 assert(scip !=
NULL);
10211 assert(cons !=
NULL);
10212 assert(conshdlrdata !=
NULL);
10213 assert(cutoff !=
NULL);
10214 assert(nfixedvars !=
NULL);
10216 assert(ndelconss !=
NULL);
10219 assert(consdata !=
NULL);
10220 assert(consdata->removedfixings);
10223 if( !
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
10227 if( consdata->nvars == 1 )
10232 else if( consdata->nvars == 2 )
10262 assert(scip !=
NULL);
10263 assert(consdata !=
NULL);
10264 assert(0 <= pos && pos < consdata->nvars);
10266 for( v = 0; v < consdata->nvars; ++v )
10289 assert(scip !=
NULL);
10290 assert(minval !=
NULL);
10291 assert(maxval !=
NULL);
10296 *minval = -maxresactivity;
10298 *minval = (side - maxresactivity)/val;
10301 *maxval = -minresactivity;
10303 *maxval = (side - minresactivity)/val;
10308 *minval = minresactivity;
10310 *minval = (side - minresactivity)/val;
10313 *maxval = maxresactivity;
10315 *maxval = (side - maxresactivity)/val;
10342 assert(scip !=
NULL);
10343 assert(cons !=
NULL);
10344 assert(cutoff !=
NULL);
10345 assert(nfixedvars !=
NULL);
10346 assert(naggrvars !=
NULL);
10347 assert(ndelconss !=
NULL);
10357 assert(consdata !=
NULL);
10380 if( consdata->nvars <= 2 )
10381 maxotherlocks = INT_MAX;
10382 else if( consdata->nvars == 3 )
10384 else if( consdata->nvars == 4 )
10390 if( lhsexists && rhsexists && maxotherlocks < INT_MAX )
10393 for( i = 0; i < consdata->nvars && bestisint; ++i )
10404 var = consdata->vars[i];
10408 if( bestpos >= 0 && isint )
10420 val = consdata->vals[i];
10457 if( agglhs || aggrhs )
10470 &minisrelax, &maxisrelax, &isminsettoinfinity, &ismaxsettoinfinity);
10471 assert(
SCIPisLE(scip, minresactivity, maxresactivity));
10477 assert((!minisrelax || isminsettoinfinity) && (!maxisrelax || ismaxsettoinfinity));
10484 assert(
SCIPisLE(scip, minval, maxval));
10492 recalculated =
FALSE;
10493 oldmaxresactivity = maxresactivity;
10494 oldminresactivity = minresactivity;
10500 recalculated = !
SCIPisEQ(scip, oldminresactivity, minresactivity);
10501 isminsettoinfinity =
TRUE;
10508 recalculated = recalculated || !
SCIPisEQ(scip, oldmaxresactivity, maxresactivity);
10509 ismaxsettoinfinity =
TRUE;
10515 assert(
SCIPisLE(scip, minresactivity, maxresactivity));
10520 assert(
SCIPisLE(scip, minval, maxval));
10544 assert(
SCIPisLE(scip,minval,maxval));
10552 recalculated =
FALSE;
10553 oldmaxresactivity = maxresactivity;
10554 oldminresactivity = minresactivity;
10560 recalculated = !
SCIPisEQ(scip, oldminresactivity, minresactivity);
10567 recalculated = recalculated || !
SCIPisEQ(scip, oldmaxresactivity, maxresactivity);
10575 assert(
SCIPisLE(scip,minval,maxval));
10615 assert(!bestislhs || lhsexists);
10616 assert(bestislhs || rhsexists);
10618 bestvar = consdata->vars[bestpos];
10619 bestval = consdata->vals[bestpos];
10620 assert(bestisint ==
10636 for( j = 0; j < consdata->nvars; ++j )
10642 aggrvars[naggrs] = consdata->vars[j];
10643 aggrcoefs[naggrs] = -consdata->vals[j]/consdata->vals[bestpos];
10646 absaggrcoef =
REALABS(aggrcoefs[naggrs]);
10649 if( absaggrcoef < epsilon )
10651 SCIPdebugMsg(scip,
"do not perform multi-aggregation: too large aggregation coefficients\n");
10664 aggrcoefs[naggrs] =
SCIPfloor(scip, aggrcoefs[naggrs]+0.5);
10699 assert(!samevar || (supinf > 0 && infinf > 0));
10701 aggrconst = (bestislhs ? consdata->lhs/bestval : consdata->rhs/bestval);
10704 assert(naggrs == consdata->nvars-1);
10710 aggrconst =
SCIPfloor(scip, aggrconst+0.5);
10713 aggregated =
FALSE;
10714 infeasible =
FALSE;
10717 if( (samevar && supinf == 1 && infinf == 1) || (!samevar && (supinf == 0 || infinf == 0)) )
10728 SCIPdebugMsg(scip,
"do not perform multi-aggregation: infimum and supremum are both infinite\n");
10747 if( !consdata->upgraded )
10760 #define BINWEIGHT 1 10761 #define INTWEIGHT 4 10762 #define CONTWEIGHT 8 10811 assert( scip !=
NULL );
10812 assert( cons !=
NULL );
10815 assert( consdata !=
NULL );
10842 lhs = consdata->lhs;
10843 vars = consdata->vars;
10844 vals = consdata->vals;
10845 nvars = consdata->nvars;
10854 for( v = 0; v < nvars && noddvars < 3; ++v )
10869 if( noddvars == 0 )
10881 if( noddvars == 1 )
10883 assert( var1 !=
NULL );
10885 SCIPdebugMsg(scip,
"linear constraint <%s>: try fixing variable <%s> to <%g>\n",
10905 else if( noddvars == 2 )
10907 assert( var1 !=
NULL );
10908 assert( var2 !=
NULL );
10914 SCIPdebugMsg(scip,
"linear constraint <%s>: try aggregation of variables <%s> and <%s>\n",
10918 lhsodd ? 1.0 : 0.0, &infeasible, &redundant, &aggregated) );
10972 assert(consdata !=
NULL);
10973 assert(0 <= ind1 && ind1 < consdata->nvars);
10974 assert(0 <= ind2 && ind2 < consdata->nvars);
10982 if( vartype2 != vartype1 )
10992 value =
REALABS(consdata->vals[ind2]) -
REALABS(consdata->vals[ind1]);
10995 return (value > 0 ? +1 : (value < 0 ? -1 : 0));
11031 assert(consdata !=
NULL);
11033 nvars = consdata->nvars;
11039 vals = consdata->vals;
11040 vars = consdata->vars;
11041 assert(vars !=
NULL);
11042 assert(vals !=
NULL);
11044 lhs = consdata->lhs;
11045 rhs = consdata->rhs;
11053 for( v = nvars - 1; v >= 0; --v )
11059 secondminval = minval;
11062 else if( secondminval > vals[v] || secondminval ==
SCIP_INVALID )
11063 secondminval = vals[v];
11082 for( v = nvars - 1; v >= 0; --v )
11086 (*nchgcoefs) += nvars;
11161 assert(scip !=
NULL);
11162 assert(cons !=
NULL);
11163 assert(nchgcoefs !=
NULL);
11164 assert(nchgsides !=
NULL);
11174 assert(consdata !=
NULL);
11176 nvars = consdata->nvars;
11200 consdata->normalized =
FALSE;
11204 assert(nvars == consdata->nvars);
11206 if( !consdata->normalized )
11209 lhs = consdata->lhs;
11210 rhs = consdata->rhs;
11224 SCIPdebug( oldnchgcoefs = *nchgcoefs; )
11225 SCIPdebug( oldnchgsides = *nchgsides; )
11228 if( haslhs && hasrhs )
11234 assert(haslhs != hasrhs);
11246 SCIPsort(perm, consdataCompSim, (
void*)consdata, nvars);
11250 consdata->sorted =
FALSE;
11251 consdata->binvarssorted =
FALSE;
11253 vars = consdata->vars;
11254 vals = consdata->vals;
11255 assert(vars !=
NULL);
11256 assert(vals !=
NULL);
11272 SCIPdebugMsg(scip,
"starting simplification of coefficients\n");
11277 &isminrelax, &ismaxrelax, &isminsettoinfinity, &ismaxsettoinfinity);
11280 if( isminsettoinfinity || ismaxsettoinfinity )
11283 assert(!isminrelax);
11284 assert(!ismaxrelax);
11285 assert(maxactsub > minactsub);
11291 side = haslhs ? lhs : rhs;
11321 while( v < nvars &&
SCIPisEQ(scip, side, vals[v]) )
11345 if(
SCIPisEQ(scip, side, -vals[v]) )
11360 for( w = 0; w < v; ++w )
11365 assert(vals[w] > 0);
11368 maxactsub -= ub * vals[w];
11369 minactsub -= lb * vals[w];
11370 assert(maxactsub > minactsub);
11398 maxactsub -= ub * vals[0];
11399 minactsub -= lb * vals[0];
11403 maxactsub -= lb * vals[0];
11404 minactsub -= ub * vals[0];
11406 assert(maxactsub > minactsub);
11411 allcoefintegral =
TRUE;
11414 for( ; v < nvars - 1; ++v )
11421 allcoefintegral =
FALSE;
11440 maxactsub -= ub * vals[v];
11441 minactsub -= lb * vals[v];
11445 maxactsub -= lb * vals[v];
11446 minactsub -= ub * vals[v];
11448 assert(
SCIPisGE(scip, maxactsub, minactsub));
11464 if( (offsetv == -1 && hasrhs && maxactsub <= siderest &&
SCIPisFeasGT(scip, minactsub, siderest - gcd)) || (haslhs &&
SCIPisFeasLT(scip, maxactsub, siderest) && minactsub >= siderest - gcd) )
11470 assert(v < nvars || (offsetv >= 0 && gcd > 1));
11490 SCIPdebugMsg(scip,
"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",
11491 v, nvars, minactsub, maxactsub, redundant, hasrhs, siderest, gcd, offsetv);
11494 if( v < nvars && (redundant ||
11495 (offsetv == -1 && hasrhs && maxactsub <= siderest &&
SCIPisFeasGT(scip, minactsub, siderest - gcd)) ||
11496 (haslhs &&
SCIPisFeasLT(scip, maxactsub, siderest) && minactsub >= siderest - gcd)) )
11506 for( w = v; w < nvars; ++w )
11517 tmpmaxactsub += ub * vals[w];
11518 tmpminactsub += lb * vals[w];
11522 tmpmaxactsub += lb * vals[w];
11523 tmpminactsub += ub * vals[w];
11525 assert(tmpmaxactsub >= tmpminactsub);
11530 assert(offsetv == -1);
11544 assert((hasrhs &&
SCIPisLE(scip, tmpmaxactsub, siderest) && tmpminactsub > siderest - gcd) || (haslhs && tmpmaxactsub < siderest &&
SCIPisGE(scip, tmpminactsub, siderest - gcd)));
11547 SCIPdebugMsg(scip,
"removing %d last variables from constraint <%s>, because they never change anything on the feasibility of this constraint\n",
11551 for( w = nvars - 1; w >= v; --w )
11555 (*nchgcoefs) += (nvars - v);
11563 assert(vars == consdata->vars);
11564 assert(vals == consdata->vals);
11565 assert(w < consdata->nvars);
11568 gcd = (
SCIP_Longint)(gcd / (oldcoef/vals[w]) + feastol);
11576 rhs = consdata->rhs;
11583 lhs = consdata->lhs;
11586 assert(offsetv == -1 ||
SCIPisEQ(scip, vals[offsetv], consdata->lhs));
11594 nvars = consdata->nvars;
11595 assert(nvars >= 2);
11597 allcoefintegral =
TRUE;
11601 for( w = offsetv + 1; w < nvars; ++w )
11610 if( offsetv >= 0 && gcd == 1 )
11620 for( v = nvars - 1; v > offsetv; --v )
11628 allcoefintegral =
FALSE;
11654 if( candpos == -1 )
11664 assert(v > offsetv || candpos > offsetv);
11670 candpos = nvars - 1;
11673 if( gcd > 1 && allcoefintegral && !redundant )
11676 allcoefintegral =
FALSE;
11680 if( offsetv >= 0 && gcd > 1 && allcoefintegral )
11682 assert(offsetv + 1 < nvars);
11683 assert(0 <= candpos && candpos < nvars);
11691 for( w = offsetv + 1; w < nvars; ++w )
11706 assert(rest < gcd);
11709 restcoef = ((
SCIP_Longint)(vals[candpos] + feastol)) % gcd;
11710 assert(restcoef >= 1);
11711 assert(restcoef < gcd);
11716 if( restcoef > rest )
11717 newcoef = vals[candpos] - restcoef + gcd;
11719 newcoef = vals[candpos] - restcoef;
11724 if( rest == 0 || restcoef < rest )
11725 newcoef = vals[candpos] - restcoef;
11727 newcoef = vals[candpos] - restcoef + gcd;
11738 notchangable =
TRUE;
11779 for( w = offsetv; w >= 0; --w )
11781 assert(vals[w] > 0);
11785 (*nchgcoefs) += (offsetv + 1);
11788 if( !notchangable )
11792 assert(vars == consdata->vars);
11793 assert(vals == consdata->vals);
11796 nvars = consdata->nvars;
11797 assert(nvars >= 2);
11801 lhs = consdata->lhs;
11802 rhs = consdata->rhs;
11816 allcoefintegral =
TRUE;
11818 for( v = nvars - 1; v >= 0; --v )
11823 allcoefintegral =
FALSE;
11840 if( allcoefintegral )
11851 for( v = nvars - 1; v >= 0; --v )
11874 frac += (val -
SCIPfloor(scip, val)) * ub;
11881 if(
SCIPisGT(scip, frac, siderest) )
11887 SCIPdebugMsg(scip,
"rounding all non-integral coefficients and the right hand side down\n");
11892 for( v = nvars - 1; v >= 0; --v )
11929 if( allcoefintegral )
11944 for( v = nvars - 1; v >= 0; --v )
11975 frac += (val -
SCIPfloor(scip, val)) * ub;
11983 if(
SCIPisGE(scip, frac, 1 + siderest) )
11992 SCIPdebugMsg(scip,
"rounding all non-integral coefficients and the left hand side down\n");
11997 for( v = nvars - 1; v >= 0; --v )
12035 assert(vars == consdata->vars);
12036 assert(vals == consdata->vals);
12038 rhs = consdata->rhs;
12039 lhs = consdata->lhs;
12046 nvars = consdata->nvars;
12050 allcoefintegral =
TRUE;
12053 for( v = nvars - 1; v >= 0; --v )
12060 if( !allcoefintegral )
12075 assert(nvars >= 2);
12080 SCIPdebug( oldnchgcoefs = *nchgcoefs; )
12081 SCIPdebug( oldnchgsides = *nchgsides; )
12094 for( v = nvars - 1; v >= 0; --v )
12101 if( foundbin == -1 )
12124 foundbin = nvars - 1;
12127 if( gcd == 1 || foundbin == -1)
12130 assert((onlybin && gcd == -1) || (!onlybin && gcd > 1));
12138 for( v = foundbin; v >= 0; --v )
12164 if( candpos == -1 )
12172 if( onlybin && v == foundbin - 1 )
12173 candpos2 = foundbin;
12178 if( onlybin && candpos == v + 1 && candpos2 == v + 2 )
12180 assert(candpos2 == nvars - 1);
12183 candpos = candpos2;
12206 assert(candpos >= 0 && candpos < nvars);
12223 assert(rest < gcd);
12226 if( vals[candpos] < 0 )
12228 restcoef = ((
SCIP_Longint)(vals[candpos] - feastol)) % gcd;
12229 assert(restcoef <= -1);
12233 restcoef = ((
SCIP_Longint)(vals[candpos] + feastol)) % gcd;
12234 assert(restcoef >= 1);
12235 assert(restcoef < gcd);
12247 if( restcoef > rest )
12248 newcoef = vals[candpos] - restcoef + gcd;
12250 newcoef = vals[candpos] - restcoef;
12262 if( rest == 0 || restcoef < rest )
12263 newcoef = vals[candpos] - restcoef;
12265 newcoef = vals[candpos] - restcoef + gcd;
12269 SCIPdebugMsg(scip,
"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));
12285 assert(vars == consdata->vars);
12286 assert(vals == consdata->vals);
12290 rhs = consdata->rhs;
12291 lhs = consdata->lhs;
12295 nvars = consdata->nvars;
12297 SCIPdebugMsg(scip,
"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));
12299 while( nvars >= 2 );
12319 int* diffidx0minus1,
12320 int* diffidx1minus0,
12322 int commonidxweight,
12323 int diffidx0minus1weight,
12324 int diffidx1minus0weight,
12347 assert(scip !=
NULL);
12348 assert(cons0 !=
NULL);
12349 assert(cons1 !=
NULL);
12350 assert(commonidx0 !=
NULL);
12351 assert(commonidx1 !=
NULL);
12352 assert(diffidx0minus1 !=
NULL);
12353 assert(diffidx1minus0 !=
NULL);
12354 assert(nvarscommon >= 1);
12355 assert(commonidxweight >= nvarscommon);
12356 assert(nchgcoefs !=
NULL);
12357 assert(aggregated !=
NULL);
12366 assert(consdata0 !=
NULL);
12367 assert(consdata0->nvars >= 1);
12368 assert(
SCIPisLE(scip, consdata0->lhs, consdata0->rhs));
12369 assert(diffidx0minus1weight >= consdata0->nvars - nvarscommon);
12373 assert(consdata1 !=
NULL);
12374 assert(consdata1->nvars >= 1);
12375 assert(
SCIPisEQ(scip, consdata1->lhs, consdata1->rhs));
12376 assert(diffidx1minus0weight >= consdata1->nvars - nvarscommon);
12378 *aggregated =
FALSE;
12384 bestvarweight = commonidxweight + diffidx0minus1weight;
12385 bestnvars = consdata0->nvars;
12387 bestscalarsum = 0.0;
12388 commonvarlindependent =
TRUE;
12389 for( v = 0; v < nvarscommon; ++v )
12391 assert(consdata0->vars[commonidx0[v]] == consdata1->vars[commonidx1[v]]);
12392 a = consdata1->vals[commonidx1[v]];
12393 b = -consdata0->vals[commonidx0[v]];
12399 varweight = diffidx0minus1weight + diffidx1minus0weight;
12400 nvars = consdata0->nvars + consdata1->nvars - 2*nvarscommon;
12402 betterscalarsum = (scalarsum < bestscalarsum);
12403 for( i = 0; i < nvarscommon
12404 && (varweight < bestvarweight || (varweight == bestvarweight && betterscalarsum)); ++i )
12406 aggrcoef = a * consdata0->vals[commonidx0[i]] + b * consdata1->vals[commonidx1[i]];
12409 varweight +=
getVarWeight(consdata0->vars[commonidx0[i]]);
12413 if( varweight < bestvarweight || (varweight == bestvarweight && betterscalarsum) )
12416 bestvarweight = varweight;
12418 bestscalarsum = scalarsum;
12425 if( commonvarlindependent && v > 0 )
12426 commonvarlindependent =
SCIPisEQ(scip,
12427 consdata1->vals[commonidx1[v]] * consdata0->vals[commonidx0[0]],
12428 consdata1->vals[commonidx1[0]] * consdata0->vals[commonidx0[v]]);
12445 if( consdata1->vals[commonidx1[bestv]] > 0.0 )
12447 a = consdata1->vals[commonidx1[bestv]];
12448 b = -consdata0->vals[commonidx0[bestv]];
12452 a = -consdata1->vals[commonidx1[bestv]];
12453 b = consdata0->vals[commonidx0[bestv]];
12462 assert(commonvarlindependent);
12463 if( consdata1->vals[commonidx1[0]] > 0.0 )
12465 a = consdata1->vals[commonidx1[0]];
12466 b = -consdata0->vals[commonidx0[0]];
12470 a = -consdata1->vals[commonidx1[0]];
12471 b = consdata0->vals[commonidx0[0]];
12492 SCIPdebug( bestvarweight = diffidx0minus1weight + diffidx1minus0weight; )
12493 bestnvars = consdata0->nvars + consdata1->nvars - 2*nvarscommon;
12496 SCIPdebugMsg(scip,
"aggregate linear constraints <%s> := %.15g*<%s> + %.15g*<%s> -> nvars: %d -> %d, weight: %d -> %d\n",
12498 consdata0->nvars, bestnvars, commonidxweight + diffidx0minus1weight, bestvarweight);
12508 if( !commonvarlindependent )
12510 for( i = 0; i < nvarscommon; ++i )
12512 assert(0 <= commonidx0[i] && commonidx0[i] < consdata0->nvars);
12513 assert(0 <= commonidx1[i] && commonidx1[i] < consdata1->nvars);
12515 aggrcoef = a * consdata0->vals[commonidx0[i]] + b * consdata1->vals[commonidx1[i]];
12518 assert(newnvars < bestnvars);
12519 newvars[newnvars] = consdata0->vars[commonidx0[i]];
12520 newvals[newnvars] = aggrcoef;
12529 for( i = 0; i < nvarscommon; ++i )
12531 assert(0 <= commonidx0[i] && commonidx0[i] < consdata0->nvars);
12532 assert(0 <= commonidx1[i] && commonidx1[i] < consdata1->nvars);
12534 aggrcoef = a * consdata0->vals[commonidx0[i]] + b * consdata1->vals[commonidx1[i]];
12541 for( i = 0; i < consdata0->nvars - nvarscommon; ++i )
12543 assert(0 <= diffidx0minus1[i] && diffidx0minus1[i] < consdata0->nvars);
12545 aggrcoef = a * consdata0->vals[diffidx0minus1[i]];
12547 assert(newnvars < bestnvars);
12548 newvars[newnvars] = consdata0->vars[diffidx0minus1[i]];
12549 newvals[newnvars] = aggrcoef;
12554 for( i = 0; i < consdata1->nvars - nvarscommon; ++i )
12556 assert(0 <= diffidx1minus0[i] && diffidx1minus0[i] < consdata1->nvars);
12558 aggrcoef = b * consdata1->vals[diffidx1minus0[i]];
12560 assert(newnvars < bestnvars);
12561 newvars[newnvars] = consdata1->vars[diffidx1minus0[i]];
12562 newvals[newnvars] = aggrcoef;
12565 assert(newnvars == bestnvars);
12573 newlhs = a * consdata0->lhs + b * consdata1->lhs;
12577 newrhs = a * consdata0->rhs + b * consdata1->rhs;
12587 assert(newconsdata !=
NULL);
12590 newconsdata->upgraded = consdata0->upgraded;
12604 if( !consdata0->upgraded )
12605 (*nchgcoefs) += consdata0->nvars + consdata1->nvars - nvarscommon;
12606 *aggregated =
TRUE;
12644 assert(key1 !=
NULL);
12645 assert(key2 !=
NULL);
12648 assert(consdata1->sorted);
12649 assert(consdata2->sorted);
12651 scip = (
SCIP*)userptr;
12652 assert(scip !=
NULL);
12655 if( consdata1->nvars != consdata2->nvars )
12659 for( i = 0; i < consdata1->nvars; ++i )
12661 if( consdata1->vars[i] != consdata2->vars[i] )
12663 assert(
SCIPvarCompare(consdata1->vars[i], consdata2->vars[i]) == 1 ||
12667 assert(
SCIPvarCompare(consdata1->vars[i], consdata2->vars[i]) == 0);
12670 cons2scale = consdata1->vals[0] / consdata2->vals[0];
12673 for( i = 1; i < consdata1->nvars; ++i )
12678 val1 = consdata1->vals[i];
12679 val2 = consdata2->vals[i] * cons2scale;
12700 scip = (
SCIP*)userptr;
12701 assert(scip !=
NULL);
12704 assert(key !=
NULL);
12706 assert(consdata !=
NULL);
12707 assert(consdata->nvars > 0);
12709 assert(consdata->sorted);
12714 assert(minidx >= 0 && minidx <= maxidx);
12715 scale = COPYSIGN(1.0/consdata->maxabsval, consdata->vals[0]);
12743 assert(scip !=
NULL);
12744 assert(blkmem !=
NULL);
12746 assert(firstchange !=
NULL);
12747 assert(cutoff !=
NULL);
12748 assert(ndelconss !=
NULL);
12749 assert(nchgsides !=
NULL);
12752 hashtablesize = nconss;
12755 hashGetKeyLinearcons, hashKeyEqLinearcons, hashKeyValLinearcons, (
void*) scip) );
12758 for( c = 0; c < nconss; ++c )
12775 assert(consdata0 !=
NULL);
12777 assert(consdata0->sorted);
12783 if( cons1 !=
NULL )
12803 assert(consdata1 !=
NULL);
12804 assert(consdata0->nvars >= 1 && consdata0->nvars == consdata1->nvars);
12806 assert(consdata1->sorted);
12807 assert(consdata0->vars[0] == consdata1->vars[0]);
12811 if( consdata1->upgraded && !consdata0->upgraded )
12814 consdatastay = consdata0;
12816 consdatadel = consdata1;
12825 consdatastay = consdata1;
12827 consdatadel = consdata0;
12830 scale = consdatastay->vals[0] / consdatadel->vals[0];
12831 assert(scale != 0.0);
12833 assert(consdatastay->nvars < 2 ||
SCIPisEQ(scip, consdatastay->vals[1], scale * consdatadel->vals[1]));
12838 SCIPdebugMsg(scip,
"aggregate linear constraints <%s> and <%s> with equal coefficients into single ranged row\n",
12843 lhs =
MAX(scale * consdatadel->lhs, consdatastay->lhs);
12844 rhs =
MIN(scale * consdatadel->rhs, consdatastay->rhs);
12849 SCIPdebugMsg(scip,
"aggregate linear constraints <%s> and <%s> with negated coefficients into single ranged row\n",
12854 lhs =
MAX(scale * consdatadel->rhs, consdatastay->lhs);
12855 rhs =
MIN(scale * consdatadel->lhs, consdatastay->rhs);
12868 rhs = (lhs + rhs)/2;
12880 assert( ! consdatastay->upgraded || consdatadel->upgraded );
12882 if( !consdatadel->upgraded )
12886 if( consdatastay->changed &&
SCIPconsGetPos(consstay) < *firstchange )
12897 #ifdef SCIP_MORE_DEBUG 12928 int* diffidx0minus1;
12929 int* diffidx1minus0;
12930 uint64_t possignature0;
12931 uint64_t negsignature0;
12934 int diffidx1minus0size;
12940 assert(scip !=
NULL);
12941 assert(conss !=
NULL);
12942 assert(firstchange <= chkind);
12943 assert(cutoff !=
NULL);
12944 assert(ndelconss !=
NULL);
12945 assert(nchgsides !=
NULL);
12946 assert(nchgcoefs !=
NULL);
12949 cons0 = conss[chkind];
12950 assert(cons0 !=
NULL);
12955 assert(consdata0 !=
NULL);
12956 assert(consdata0->nvars >= 1);
12957 cons0isequality =
SCIPisEQ(scip, consdata0->lhs, consdata0->rhs);
12964 possignature0 = consdata0->possignature;
12965 negsignature0 = consdata0->negsignature;
12972 diffidx1minus0size = consdata0->nvars;
12974 cons0lhs = consdata0->lhs;
12975 cons0rhs = consdata0->rhs;
12976 cons0upgraded = consdata0->upgraded;
12979 cons0changed = consdata0->changed;
12980 consdata0->changed =
FALSE;
12981 for( c = (cons0changed ? 0 : firstchange); c < chkind && !(*cutoff) && conss[chkind] !=
NULL; ++c )
12985 uint64_t possignature1;
12986 uint64_t negsignature1;
12998 int commonidxweight;
12999 int diffidx0minus1weight;
13000 int diffidx1minus0weight;
13004 assert(cons0lhs == consdata0->lhs);
13005 assert(cons0rhs == consdata0->rhs);
13006 assert(cons0upgraded == consdata0->upgraded);
13011 if( cons1 ==
NULL )
13018 assert(consdata1 !=
NULL);
13025 if( !cons0changed && !consdata1->changed )
13030 if( cons0upgraded && consdata1->upgraded )
13033 assert(consdata1->nvars >= 1);
13040 possignature1 = consdata1->possignature;
13041 negsignature1 = consdata1->negsignature;
13044 coefsequal = (possignature0 == possignature1) && (negsignature0 == negsignature1);
13045 coefsnegated = (possignature0 == negsignature1) && (negsignature0 == possignature1);
13046 cons0dominateslhs =
SCIPisGE(scip, cons0lhs, consdata1->lhs)
13047 && ((possignature0 | possignature1) == possignature1)
13048 && ((negsignature0 | negsignature1) == negsignature0);
13049 cons1dominateslhs =
SCIPisGE(scip, consdata1->lhs, cons0lhs)
13050 && ((possignature0 | possignature1) == possignature0)
13051 && ((negsignature0 | negsignature1) == negsignature1);
13052 cons0dominatesrhs =
SCIPisLE(scip, cons0rhs, consdata1->rhs)
13053 && ((possignature0 | possignature1) == possignature0)
13054 && ((negsignature0 | negsignature1) == negsignature1);
13055 cons1dominatesrhs =
SCIPisLE(scip, consdata1->rhs, cons0rhs)
13056 && ((possignature0 | possignature1) == possignature1)
13057 && ((negsignature0 | negsignature1) == negsignature0);
13058 cons1isequality =
SCIPisEQ(scip, consdata1->lhs, consdata1->rhs);
13059 tryaggregation = (cons0isequality || cons1isequality) && (maxaggrnormscale > 0.0);
13060 if( !cons0dominateslhs && !cons1dominateslhs && !cons0dominatesrhs && !cons1dominatesrhs
13061 && !coefsequal && !coefsnegated && !tryaggregation )
13065 if( tryaggregation && consdata1->nvars > diffidx1minus0size )
13068 diffidx1minus0size = consdata1->nvars;
13094 commonidxweight = 0;
13096 diffidx0minus1weight = 0;
13098 diffidx1minus0weight = 0;
13101 while( (v0 < consdata0->nvars || v1 < consdata1->nvars)
13102 && (cons0dominateslhs || cons1dominateslhs || cons0dominatesrhs || cons1dominatesrhs
13103 || coefsequal || coefsnegated || tryaggregation) )
13111 if( v0 < consdata0->nvars && v1 < consdata1->nvars )
13112 varcmp =
SCIPvarCompare(consdata0->vars[v0], consdata1->vars[v1]);
13113 else if( v0 < consdata0->nvars )
13122 var = consdata0->vars[v0];
13123 val0 = consdata0->vals[v0];
13125 if( tryaggregation )
13127 diffidx0minus1[nvars0minus1] = v0;
13132 coefsequal =
FALSE;
13133 coefsnegated =
FALSE;
13138 var = consdata1->vars[v1];
13140 val1 = consdata1->vals[v1];
13141 if( tryaggregation )
13143 diffidx1minus0[nvars1minus0] = v1;
13148 coefsequal =
FALSE;
13149 coefsnegated =
FALSE;
13154 assert(consdata0->vars[v0] == consdata1->vars[v1]);
13155 var = consdata0->vars[v0];
13156 val0 = consdata0->vals[v0];
13157 val1 = consdata1->vals[v1];
13158 if( tryaggregation )
13160 commonidx0[nvarscommon] = v0;
13161 commonidx1[nvarscommon] = v1;
13167 coefsequal = coefsequal && (
SCIPisEQ(scip, val0, val1));
13168 coefsnegated = coefsnegated && (
SCIPisEQ(scip, val0, -val1));
13178 assert(var !=
NULL);
13185 cons0dominatesrhs =
FALSE;
13186 cons1dominateslhs =
FALSE;
13190 cons0dominateslhs =
FALSE;
13191 cons1dominatesrhs =
FALSE;
13194 else if(
SCIPisLT(scip, val0, val1) )
13198 cons0dominateslhs =
FALSE;
13199 cons1dominatesrhs =
FALSE;
13203 cons0dominatesrhs =
FALSE;
13204 cons1dominateslhs =
FALSE;
13210 if( coefsequal || coefsnegated )
13225 SCIPdebugMsg(scip,
"aggregate linear constraints <%s> and <%s> with %s coefficients into single ranged row\n",
13233 lhs =
MAX(consdata0->lhs, consdata1->lhs);
13234 rhs =
MIN(consdata0->rhs, consdata1->rhs);
13239 lhs =
MAX(consdata0->lhs, -consdata1->rhs);
13240 rhs =
MIN(consdata0->rhs, -consdata1->lhs);
13251 if( consdata0->upgraded )
13253 assert(!consdata1->upgraded);
13256 consdatastay = consdata1;
13260 consdatadel = consdata0;
13261 consinddel = chkind;
13267 consdatastay = consdata0;
13271 consdatadel = consdata1;
13278 if( !consdata0->upgraded )
13280 assert(consstay == cons0);
13281 cons0lhs = consdata0->lhs;
13282 cons0rhs = consdata0->rhs;
13288 assert( !consdatastay->upgraded );
13291 conss[consinddel] =
NULL;
13292 if( !consdatadel->upgraded )
13300 if( cons1dominateslhs && (!cons0isequality || cons1dominatesrhs ||
SCIPisInfinity(scip, consdata0->rhs) ) )
13303 SCIPdebugMsg(scip,
"left hand side of linear constraint <%s> is dominated by <%s>:\n",
13309 if(
SCIPisFeasGT(scip, consdata1->lhs, consdata0->rhs) )
13320 cons0lhs = consdata0->lhs;
13321 cons0isequality =
FALSE;
13322 if( !consdata0->upgraded )
13331 else if( cons0dominateslhs && (!cons1isequality || cons0dominatesrhs ||
SCIPisInfinity(scip, consdata1->rhs)) )
13334 SCIPdebugMsg(scip,
"left hand side of linear constraint <%s> is dominated by <%s>:\n",
13340 if(
SCIPisFeasGT(scip, consdata0->lhs, consdata1->rhs) )
13351 cons1isequality =
FALSE;
13352 if( !consdata1->upgraded )
13361 if( cons1dominatesrhs && (!cons0isequality || cons1dominateslhs ||
SCIPisInfinity(scip, -consdata0->lhs)) )
13364 SCIPdebugMsg(scip,
"right hand side of linear constraint <%s> is dominated by <%s>:\n",
13370 if(
SCIPisFeasLT(scip, consdata1->rhs, consdata0->lhs) )
13381 cons0rhs = consdata0->rhs;
13382 cons0isequality =
FALSE;
13383 if( !consdata0->upgraded )
13392 else if( cons0dominatesrhs && (!cons1isequality || cons0dominateslhs ||
SCIPisInfinity(scip, -consdata1->lhs)) )
13395 SCIPdebugMsg(scip,
"right hand side of linear constraint <%s> is dominated by <%s>:\n",
13401 if(
SCIPisFeasLT(scip, consdata0->rhs, consdata1->lhs) )
13412 cons1isequality =
FALSE;
13413 if( !consdata1->upgraded )
13429 conss[chkind] =
NULL;
13430 if( !consdata0->upgraded )
13445 if( !consdata1->upgraded )
13458 if( tryaggregation )
13462 assert(consdata0->nvars == nvarscommon + nvars0minus1);
13463 assert(consdata1->nvars == nvarscommon + nvars1minus0);
13465 aggregated =
FALSE;
13466 if( cons1isequality && !consdata0->upgraded && commonidxweight > diffidx1minus0weight )
13470 nvarscommon, commonidxweight, diffidx0minus1weight, diffidx1minus0weight, maxaggrnormscale,
13471 nchgcoefs, &aggregated) );
13478 conss[chkind] =
NULL;
13481 if( !aggregated && cons0isequality && !consdata1->upgraded && commonidxweight > diffidx0minus1weight )
13485 nvarscommon, commonidxweight, diffidx1minus0weight, diffidx0minus1weight, maxaggrnormscale,
13486 nchgcoefs, &aggregated) );
13546 assert(scip !=
NULL);
13547 assert(cons !=
NULL);
13548 assert(nfixedvars !=
NULL);
13556 if( singlevarstuffing )
13572 rhs = -consdata->lhs;
13575 maxactivity = -minactivity;
13576 minactivity = -tmp;
13581 rhs = consdata->rhs;
13585 nvars = consdata->nvars;
13586 vars = consdata->vars;
13587 vals = consdata->vals;
13590 if( singletonstuffing )
13592 for( v = 0; v < nvars; ++v )
13608 assert(singletonstuffing);
13616 mincondactivity = 0.0;
13617 maxcondactivity = 0.0;
13619 for( v = 0; v < nvars; ++v )
13625 val = factor * vals[v];
13642 maxcondactivity += val * lb;
13643 mincondactivity += val * lb;
13644 swapped[v] =
FALSE;
13645 ratios[nsingletons] = obj / val;
13646 varpos[nsingletons] = v;
13661 maxcondactivity += val * ub;
13662 mincondactivity += val * ub;
13664 ratios[nsingletons] = obj / val;
13665 varpos[nsingletons] = v;
13682 maxcondactivity += val * lb;
13683 mincondactivity += val * lb;
13700 maxcondactivity += val * ub;
13701 mincondactivity += val * ub;
13717 maxcondactivity += val * ub;
13718 mincondactivity += val * lb;
13722 maxcondactivity += val * lb;
13723 mincondactivity += val * ub;
13727 if( tryfixing && nsingletons > 0 && (
SCIPisGT(scip, rhs, maxcondactivity) ||
SCIPisLE(scip, rhs, mincondactivity)) )
13732 int oldnfixedvars = *nfixedvars;
13733 int oldnchgbds = *nchgbds;
13739 for( v = 0; v < nsingletons; ++v )
13743 val = factor * vals[idx];
13748 assert((val < 0) == swapped[idx]);
13762 delta = -(lb - ub) * val;
13764 delta = (ub - lb) * val;
13768 if(
SCIPisLE(scip, delta, rhs - maxcondactivity) )
13794 else if(
SCIPisLE(scip, rhs, mincondactivity) )
13815 maxcondactivity += delta;
13816 mincondactivity += delta;
13820 if( *nfixedvars - oldnfixedvars > 0 || *nchgbds - oldnchgbds > 0 )
13822 SCIPdebugMsg(scip,
"### stuffing fixed %d variables and changed %d bounds\n", *nfixedvars - oldnfixedvars, *nchgbds - oldnchgbds);
13866 int bestindex = -1;
13867 int bestuplocks = 0;
13868 int bestdownlocks = 1;
13874 SCIPdebug( oldnfixedvars = *nfixedvars; )
13877 for( v = 0; v < nvars; ++v )
13881 val = factor * vals[v];
13909 if( ratio > bestratio || ((ratio == bestratio) && downlocks == 0 && (bestdownlocks > 0
13914 if( bestindex != -1 )
13917 if( bestuplocks > 1 )
13924 secondbestratio = bestratio;
13927 bestdownlocks = downlocks;
13928 bestuplocks = uplocks;
13935 if( bestdownlocks > 0 && bestuplocks > 1 )
13950 if( ratio > secondbestratio )
13952 secondbestratio = ratio;
13958 if( bestindex != -1 && bestdownlocks == 0 )
13963 var = vars[bestindex];
13965 val = factor * vals[bestindex];
13978 SCIP_Real activitydelta = (maxactivity - rhs) - (bestvarfloor * -val);
13981 tryfixing =
SCIPisLE(scip, obj, -activitydelta * secondbestratio);
13983 bounddelta =
SCIPceil(scip, (maxactivity - rhs)/-val);
13987 bounddelta = (maxactivity - rhs)/-val;
13989 tryfixing = tryfixing &&
SCIPisLE(scip, bounddelta, ub - lb);
13995 if(
SCIPisEQ(scip, lb + bounddelta, ub) )
14002 SCIPdebugMsg(scip,
"tighten the lower bound of <%s> from %g to %g (ub=%g)\n",
SCIPvarGetName(var), lb, lb + bounddelta, ub);
14015 SCIP_Real activitydelta = (maxactivity - rhs) - (bestvarfloor * val);
14018 tryfixing =
SCIPisLE(scip, -obj, activitydelta * secondbestratio);
14020 bounddelta =
SCIPceil(scip, (maxactivity - rhs)/val);
14024 bounddelta = (maxactivity - rhs)/val;
14026 tryfixing = tryfixing &&
SCIPisLE(scip, bounddelta, ub - lb);
14032 if(
SCIPisEQ(scip, ub - bounddelta, lb) )
14039 SCIPdebugMsg(scip,
"tighten the upper bound of <%s> from %g to %g (lb=%g)\n",
SCIPvarGetName(var), ub, ub - bounddelta, lb);
14055 for( v = 0; v < nvars; ++v )
14057 SCIPdebugMsg(scip,
"%+g <%s>([%g,%g],%g,[%d,%d],%s)\n", factor * vals[v],
SCIPvarGetName(vars[v]),
SCIPvarGetLbGlobal(vars[v]),
14061 SCIPdebugMsg(scip,
"<= %g\n", factor > 0 ? consdata->rhs : -consdata->lhs);
14063 for( v = 0; v < nvars; ++v )
14065 if( v == bestindex )
14068 if( factor * vals[v] < 0 )
14086 SCIPdebugMsg(scip,
"### new stuffing fixed %d vars, tightened %d bounds\n", *nfixedvars - oldnfixedvars, *nchgbds - oldnchgbds);
14138 assert(scip !=
NULL);
14139 assert(nconss == 0 || conss !=
NULL);
14140 assert(nchgbds !=
NULL);
14149 if( nbinvars == nvars )
14154 nintvars = nvars - ncontvars;
14157 nvars = nvars - nbinvars;
14169 for( v = 0; v < nvars; ++v )
14181 for( v = 0; v < ncontvars; v++ )
14188 var = vars[v + nintvars - nbinvars];
14208 for( c = 0; c < nconss; ++c )
14226 assert(consdata !=
NULL);
14235 for( i = 0; i < consdata->nvars; ++i )
14239 var = consdata->vars[i];
14244 assert(0 <= contv && contv < ncontvars);
14245 isimplint[contv] =
FALSE;
14258 hasimpliedpotential =
FALSE;
14261 for( i = 0; i < consdata->nvars; ++i )
14275 var = consdata->vars[i];
14276 val = consdata->vals[i];
14290 isminsettoinfinity =
TRUE;
14291 ismaxsettoinfinity =
TRUE;
14297 &minisrelax, &maxisrelax, &isminsettoinfinity, &ismaxsettoinfinity);
14303 assert((!minisrelax || isminsettoinfinity) && (!maxisrelax || ismaxsettoinfinity));
14316 assert(0 <= arrayindex && arrayindex < nvars);
14318 newredlb = redlb[arrayindex];
14319 newredub = redub[arrayindex];
14325 nlocksdown[arrayindex] += nlockspos;
14326 newredlb = (isminsettoinfinity ?
SCIPinfinity(scip) : (consdata->lhs - minresactivity)/val);
14331 nlocksup[arrayindex] += nlockspos;
14332 newredub = (ismaxsettoinfinity ? -
SCIPinfinity(scip) : (consdata->rhs - maxresactivity)/val);
14340 nlocksup[arrayindex] += nlockspos;
14341 newredub = (isminsettoinfinity ? -
SCIPinfinity(scip) : (consdata->lhs - minresactivity)/val);
14346 nlocksdown[arrayindex] += nlockspos;
14347 newredlb = (ismaxsettoinfinity ?
SCIPinfinity(scip) : (consdata->rhs - maxresactivity)/val);
14355 newredlb =
SCIPceil(scip, newredlb);
14361 redlb[arrayindex] =
MAX(redlb[arrayindex], newredlb);
14362 redub[arrayindex] =
MIN(redub[arrayindex], newredub);
14369 assert(nconscontvars < ncontvars);
14371 conscontvars[nconscontvars] = var;
14375 assert(0 <= contv && contv < ncontvars);
14376 hasimpliedpotential = hasimpliedpotential || isimplint[contv];
14381 if( hasimpliedpotential )
14383 if( nconscontvars > 1 || !integralcoefs )
14388 for( i = 0; i < nconscontvars; i++ )
14392 assert(0 <= contv && contv < ncontvars);
14393 isimplint[contv] =
FALSE;
14407 assert(nconscontvars == 1);
14408 assert(0 <= contvarpos && contvarpos < consdata->nvars);
14409 var = consdata->vars[contvarpos];
14410 val = consdata->vals[contvarpos];
14412 assert(0 <= contv && contv < ncontvars);
14413 assert(isimplint[contv]);
14416 if( !
SCIPisEQ(scip, absval, 1.0) )
14417 isimplint[contv] =
FALSE;
14423 if( obj * val >= 0.0 && lhsexists )
14426 isimplint[contv] = isimplint[contv] &&
SCIPisIntegral(scip, consdata->lhs);
14428 if( obj * val <= 0.0 && rhsexists )
14431 isimplint[contv] = isimplint[contv] &&
SCIPisIntegral(scip, consdata->rhs);
14440 for( v = 0; v < nvars; ++v )
14468 SCIPdebugMsg(scip,
"variable <%s> only locked down in linear constraints: dual presolve <%s>[%.15g,%.15g] <= %.15g\n",
14472 assert(!infeasible);
14475 redub[v] =
MIN(redub[v], ub);
14495 SCIPdebugMsg(scip,
"variable <%s> only locked up in linear constraints: dual presolve <%s>[%.15g,%.15g] >= %.15g\n",
14499 assert(!infeasible);
14502 redlb[v] =
MAX(redlb[v], lb);
14510 for( v = nintvars - nbinvars; v < nvars; ++v )
14516 assert(var !=
NULL);
14521 assert(0 <= v - nintvars + nbinvars && v - nintvars + nbinvars < ncontvars);
14524 if( isimplint[v - nintvars + nbinvars]
14540 SCIPdebugMsg(scip,
"dual presolve: converting continuous variable <%s>[%g,%g] to implicit integer\n",
14576 assert(scip !=
NULL);
14579 assert(result !=
NULL);
14582 assert(conshdlrdata !=
NULL);
14584 checkrelmaxabs = conshdlrdata->checkrelmaxabs;
14586 SCIPdebugMsg(scip,
"Enforcement method of linear constraints for %s solution\n", sol ==
NULL ?
"LP" :
"relaxation");
14594 for( c = 0; c < nusefulconss; ++c )
14610 for( c = nusefulconss; c < nconss && *result ==
SCIP_FEASIBLE; ++c )
14625 SCIPdebugMsg(scip,
"-> constraints checked, %s\n", *result ==
SCIP_FEASIBLE ?
"all constraints feasible" :
"infeasibility detected");
14638 assert(scip !=
NULL);
14639 assert(conshdlr !=
NULL);
14656 assert(scip !=
NULL);
14657 assert(conshdlr !=
NULL);
14662 assert(conshdlrdata !=
NULL);
14679 assert(scip !=
NULL);
14683 assert(conshdlrdata !=
NULL);
14684 assert(conshdlrdata->eventhdlr !=
NULL);
14685 assert(nconss == 0 || conss !=
NULL);
14688 for( c = 0; c < nconss; ++c )
14705 assert(scip !=
NULL);
14709 assert(conshdlrdata !=
NULL);
14710 assert(conshdlrdata->eventhdlr !=
NULL);
14713 for( c = nconss - 1; c >= 0; --c )
14718 assert(consdata !=
NULL);
14720 if( consdata->eventdata !=
NULL )
14724 assert(consdata->eventdata ==
NULL);
14732 #ifdef WITH_PRINTORIGCONSTYPES 14741 assert(scip !=
NULL);
14742 assert(cons !=
NULL);
14756 assert(scip !=
NULL);
14765 int counter[(int)SCIP_CONSTYPE_GENERAL + 1];
14768 assert(scip !=
NULL);
14774 for( c = 0; c < nconss; c++ )
14782 assert(cons !=
NULL);
14786 assert(consdata !=
NULL);
14790 for( i = 0; i < consdata->nvars; i++ )
14792 assert(!
SCIPisZero(scip, consdata->vals[i]));
14796 if( consdata->nvars == 0 )
14800 counter[SCIP_CONSTYPE_EMPTY]++;
14809 counter[SCIP_CONSTYPE_FREE]++;
14814 if( consdata->nvars == 1 )
14818 counter[SCIP_CONSTYPE_SINGLETON] += isRangedRow(scip, cons) ? 2 : 1;
14823 if( consdata->nvars == 2 &&
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
14827 counter[SCIP_CONSTYPE_AGGREGATION]++;
14832 if( consdata->nvars == 2 )
14836 counter[SCIP_CONSTYPE_VARBOUND] += isRangedRow(scip, cons) ? 2 : 1;
14850 scale =
REALABS(consdata->vals[0]);
14851 for( i = 0; i < consdata->nvars && !unmatched; i++ )
14856 unmatched = unmatched || !
SCIPisEQ(scip,
REALABS(consdata->vals[i]), scale);
14858 if( consdata->vals[i] < 0.0 )
14864 if(
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
14866 b = consdata->rhs/scale + nnegbinvars;
14871 counter[SCIP_CONSTYPE_SETPARTITION]++;
14878 counter[SCIP_CONSTYPE_CARDINALITY]++;
14883 b = consdata->rhs/scale + nnegbinvars;
14888 counter[SCIP_CONSTYPE_SETPACKING]++;
14895 counter[SCIP_CONSTYPE_INVKNAPSACK]++;
14899 b = consdata->lhs/scale + nnegbinvars;
14904 counter[SCIP_CONSTYPE_SETCOVERING]++;
14923 for( i = 0; i < consdata->nvars && !unmatched; i++ )
14928 unmatched = unmatched || !
SCIPisIntegral(scip, consdata->vals[i]);
14931 b -= consdata->vals[i];
14933 unmatched = unmatched || !isFiniteNonnegativeIntegral(scip, b);
14937 if(
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
14941 counter[SCIP_CONSTYPE_EQKNAPSACK]++;
14949 for( i = 0; i < consdata->nvars && !matched; i++ )
14954 SCIPdebugMsg(scip,
"classified as %s: ", matched ?
"BINPACKING" :
"KNAPSACK");
14956 counter[matched ? SCIP_CONSTYPE_BINPACKING : SCIP_CONSTYPE_KNAPSACK]++;
14974 unmatched = unmatched || !isFiniteNonnegativeIntegral(scip, b);
14976 for( i = 0; i < consdata->nvars && !unmatched; i++ )
14980 unmatched = unmatched || !
SCIPisIntegral(scip, consdata->vals[i]);
14981 unmatched = unmatched ||
SCIPisNegative(scip, consdata->vals[i]);
14988 counter[SCIP_CONSTYPE_INTKNAPSACK]++;
15002 for( i = 0; i < consdata->nvars && !unmatched; i++ )
15012 SCIPdebugMsg(scip,
"classified as MIXEDBINARY (%d): ", isRangedRow(scip, cons) ? 2 : 1);
15014 counter[SCIP_CONSTYPE_MIXEDBINARY] += isRangedRow(scip, cons) ? 2 : 1;
15022 counter[SCIP_CONSTYPE_GENERAL] += isRangedRow(scip, cons) ? 2 : 1;
15063 for( c = 0; c <= (int)SCIP_CONSTYPE_GENERAL; c++ )
15081 #ifdef SCIP_STATISTIC 15090 assert(scip !=
NULL);
15092 #ifdef SCIP_STATISTIC 15100 for( c = 0; c < nconss; ++c )
15108 assert(consdata !=
NULL);
15110 if( consdata->upgraded )
15117 if(
SCIPisLT(scip, consdata->maxactdelta, conshdlrdata->maxeasyactivitydelta) )
15122 SCIPstatisticMessage(
"below threshold: %d / %d ratio= %g\n", ngoodconss, nallconss, (100.0 * ngoodconss / nallconss));
15126 for( c = 0; c < nconss; ++c )
15134 assert(consdata !=
NULL);
15136 if( consdata->upgraded )
15160 assert(scip !=
NULL);
15163 for( c = 0; c < nconss; ++c )
15168 assert(consdata !=
NULL);
15170 if( consdata->row !=
NULL )
15186 if( ncutsadded > 0 )
15189 "(restart) converted %d cuts from the global cut pool into linear constraints\n", ncutsadded);
15207 assert(scip !=
NULL);
15208 assert(conshdlr !=
NULL);
15213 assert(conshdlrdata !=
NULL);
15214 assert(conshdlrdata->eventhdlr !=
NULL);
15217 if( (*consdata)->eventdata !=
NULL )
15222 assert((*consdata)->eventdata ==
NULL);
15240 assert(scip !=
NULL);
15241 assert(conshdlr !=
NULL);
15244 assert(sourcecons !=
NULL);
15245 assert(targetcons !=
NULL);
15248 assert(sourcedata !=
NULL);
15249 assert(sourcedata->row ==
NULL);
15252 SCIP_CALL(
consdataCreate(scip, &targetdata, sourcedata->nvars, sourcedata->vars, sourcedata->vals, sourcedata->lhs, sourcedata->rhs) );
15271 assert(scip !=
NULL);
15274 *infeasible =
FALSE;
15276 for( c = 0; c < nconss && !(*infeasible); ++c )
15303 assert(scip !=
NULL);
15304 assert(conshdlr !=
NULL);
15306 assert(result !=
NULL);
15309 assert(conshdlrdata !=
NULL);
15318 if( (depth == 0 && conshdlrdata->maxroundsroot >= 0 && nrounds >= conshdlrdata->maxroundsroot)
15319 || (depth > 0 && conshdlrdata->maxrounds >= 0 && nrounds >= conshdlrdata->maxrounds) )
15323 maxsepacuts = (depth == 0 ? conshdlrdata->maxsepacutsroot : conshdlrdata->maxsepacuts);
15329 maxbound = glblowerbound + conshdlrdata->maxcardbounddist * (cutoffbound - glblowerbound);
15330 separatecards =
SCIPisLE(scip, loclowerbound, maxbound);
15338 for( c = 0; c < nusefulconss && ncuts < maxsepacuts && !cutoff; ++c )
15341 SCIP_CALL(
separateCons(scip, conss[c], conshdlrdata,
NULL, separatecards, conshdlrdata->separateall, &ncuts, &cutoff) );
15347 else if( ncuts > 0 )
15369 assert(scip !=
NULL);
15370 assert(conshdlr !=
NULL);
15372 assert(result !=
NULL);
15375 assert(conshdlrdata !=
NULL);
15384 if( (depth == 0 && conshdlrdata->maxroundsroot >= 0 && nrounds >= conshdlrdata->maxroundsroot)
15385 || (depth > 0 && conshdlrdata->maxrounds >= 0 && nrounds >= conshdlrdata->maxrounds) )
15389 maxsepacuts = (depth == 0 ? conshdlrdata->maxsepacutsroot : conshdlrdata->maxsepacuts);
15396 for( c = 0; c < nusefulconss && ncuts < maxsepacuts && !cutoff; ++c )
15405 else if( ncuts > 0 )
15442 assert(scip !=
NULL);
15445 assert(result !=
NULL);
15448 assert(conshdlrdata !=
NULL);
15450 checkrelmaxabs = conshdlrdata->checkrelmaxabs;
15455 if( objinfeasible )
15457 SCIPdebugMsg(scip,
"-> pseudo solution is objective infeasible, return.\n");
15465 for( c = 0; c < nconss && !violated; ++c )
15475 SCIPdebugMsg(scip,
"-> constraints checked, %s\n", *result ==
SCIP_FEASIBLE ?
"all constraints feasible" :
"infeasibility detected");
15489 assert(scip !=
NULL);
15490 assert(conshdlr !=
NULL);
15492 assert(result !=
NULL);
15497 assert(conshdlrdata !=
NULL);
15499 checkrelmaxabs = conshdlrdata->checkrelmaxabs;
15504 for( c = 0; c < nconss && (*result ==
SCIP_FEASIBLE || completely); ++c )
15507 SCIP_CALL(
checkCons(scip, conss[c], sol, checklprows, checkrelmaxabs, &violated) );
15519 assert( consdata !=
NULL);
15527 SCIPinfoMessage(scip,
NULL,
"activity invalid due to positive and negative infinity contributions\n");
15528 else if(
SCIPisFeasLT(scip, activity, consdata->lhs) )
15529 SCIPinfoMessage(scip,
NULL,
"violation: left hand side is violated by %.15g\n", consdata->lhs - activity);
15530 else if(
SCIPisFeasGT(scip, activity, consdata->rhs) )
15531 SCIPinfoMessage(scip,
NULL,
"violation: right hand side is violated by %.15g\n", activity - consdata->rhs);
15552 assert(scip !=
NULL);
15553 assert(conshdlr !=
NULL);
15555 assert(result !=
NULL);
15558 assert(conshdlrdata !=
NULL);
15564 tightenbounds =
TRUE;
15569 int tightenboundsfreq;
15574 tightenboundsfreq = propfreq * conshdlrdata->tightenboundsfreq;
15575 tightenbounds = (conshdlrdata->tightenboundsfreq >= 0)
15576 && ((tightenboundsfreq == 0 && depth == 0) || (tightenboundsfreq >= 1 && (depth % tightenboundsfreq == 0)));
15579 rangedrowpropagation = conshdlrdata->rangedrowpropagation;
15581 rangedrowpropagation = rangedrowpropagation && (depth <= conshdlrdata->rangedrowmaxdepth);
15582 rangedrowfreq = propfreq * conshdlrdata->rangedrowfreq;
15583 rangedrowpropagation = rangedrowpropagation && (depth % rangedrowfreq == 0);
15590 for( i = 0; i < nmarkedconss && !cutoff; i++ )
15594 conshdlrdata->maxeasyactivitydelta, conshdlrdata->sortvars, &cutoff, &nchgbds) );
15600 else if( nchgbds > 0 )
15609 #define MAXCONSPRESOLROUNDS 10 15630 int firstupgradetry;
15633 assert(scip !=
NULL);
15634 assert(conshdlr !=
NULL);
15636 assert(result !=
NULL);
15642 oldnfixedvars = *nfixedvars;
15643 oldnaggrvars = *naggrvars;
15644 oldnchgbds = *nchgbds;
15645 oldndelconss = *ndelconss;
15646 oldnupgdconss = *nupgdconss;
15647 oldnchgcoefs = *nchgcoefs;
15648 oldnchgsides = *nchgsides;
15652 assert(conshdlrdata !=
NULL);
15655 firstchange = INT_MAX;
15656 firstupgradetry = INT_MAX;
15657 for( c = 0; c < nconss && !cutoff && !
SCIPisStopped(scip); ++c )
15662 infeasible =
FALSE;
15667 assert(consdata !=
NULL);
15671 assert(
SCIPgetNRuns(scip) > 0 || nrounds > 0 || consdata->boundstightened == 0);
15672 assert(
SCIPgetNRuns(scip) > 0 || nrounds > 0 || !consdata->presolved);
15685 assert(consdata->removedfixings);
15692 if( firstchange == INT_MAX && consdata->changed )
15696 if( firstupgradetry == INT_MAX && !consdata->upgradetried )
15697 firstupgradetry = c;
15700 if( consdata->presolved )
15718 consdata->presolved =
TRUE;
15728 if(
SCIPisFeasGT(scip, consdata->lhs, consdata->rhs) )
15730 SCIPdebugMsg(scip,
"linear constraint <%s> is infeasible: sides=[%.15g,%.15g]\n",
15737 SCIP_CALL(
tightenBounds(scip, cons, conshdlrdata->maxeasyactivitydelta, conshdlrdata->sortvars, &cutoff, nchgbds) );
15750 SCIPdebugMsg(scip,
"linear constraint <%s> is infeasible: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
15751 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
15757 SCIPdebugMsg(scip,
"linear constraint <%s> is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
15758 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
15762 if( !consdata->upgraded )
15768 SCIPdebugMsg(scip,
"linear constraint <%s> left hand side is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
15769 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
15771 if( !consdata->upgraded )
15776 SCIPdebugMsg(scip,
"linear constraint <%s> right hand side is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
15777 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
15779 if( !consdata->upgraded )
15782 assert(consdata->nvars >= 1);
15785 if( consdata->nvars == 0 )
15787 if(
SCIPisFeasGT(scip, consdata->lhs, consdata->rhs) )
15789 SCIPdebugMsg(scip,
"empty linear constraint <%s> is infeasible: sides=[%.15g,%.15g]\n",
15795 SCIPdebugMsg(scip,
"empty linear constraint <%s> is redundant: sides=[%.15g,%.15g]\n",
15800 if( !consdata->upgraded )
15810 if( conshdlrdata->simplifyinequalities )
15816 if( conshdlrdata->aggregatevariables )
15827 if( conshdlrdata->rangedrowpropagation )
15829 int lastnfixedvars;
15831 lastnfixedvars = *nfixedvars;
15836 if( lastnfixedvars < *nfixedvars )
15847 nfixedvars, nchgbds, &cutoff) );
15852 if(
SCIPisFeasGT(scip, consdata->lhs, consdata->rhs) )
15854 SCIPdebugMsg(scip,
"empty linear constraint <%s> is infeasible: sides=[%.15g,%.15g]\n",
15860 SCIPdebugMsg(scip,
"empty linear constraint <%s> is redundant: sides=[%.15g,%.15g]\n",
15865 if( !consdata->upgraded )
15890 if( firstchange == INT_MAX && consdata->changed )
15894 if( firstupgradetry == INT_MAX && !consdata->upgradetried )
15895 firstupgradetry = c;
15900 (conshdlrdata->singletonstuffing || conshdlrdata->singlevarstuffing) &&
SCIPallowDualReds(scip) )
15903 conshdlrdata->singlevarstuffing, &cutoff, nfixedvars, nchgbds) );
15906 if( consdata->nvars == 0 )
15908 if(
SCIPisFeasGT(scip, consdata->lhs, consdata->rhs) )
15910 SCIPdebugMsg(scip,
"empty linear constraint <%s> is infeasible: sides=[%.15g,%.15g]\n",
15916 SCIPdebugMsg(scip,
"empty linear constraint <%s> is redundant: sides=[%.15g,%.15g]\n",
15921 if( !consdata->upgraded )
15934 assert(firstchange >= 0);
15936 if( firstchange < nconss && conshdlrdata->presolusehashing )
15940 ndelconss, nchgsides) );
15943 if( firstchange < nconss && conshdlrdata->presolpairwise )
15947 int firstchangenew;
15950 npaircomparisons = 0;
15951 oldndelconss = *ndelconss;
15952 oldnchgsides = *nchgsides;
15953 oldnchgcoefs = *nchgcoefs;
15959 firstchangenew = -1;
15960 for( c = 0; c < nconss; ++c )
15963 if( c == firstchange )
15964 firstchangenew = nusefulconss;
15970 usefulconss[nusefulconss] = conss[c];
15973 firstchange = firstchangenew;
15974 assert(firstchangenew >= 0 && firstchangenew <= nusefulconss);
15976 for( c = firstchange; c < nusefulconss && !cutoff && !
SCIPisStopped(scip); ++c )
15979 if( usefulconss[c] ==
NULL )
15982 npaircomparisons += (
SCIPconsGetData(conss[c])->changed) ? c : (c - firstchange);
15986 &cutoff, ndelconss, nchgsides, nchgcoefs) );
15988 if( npaircomparisons > conshdlrdata->nmincomparisons )
15990 assert(npaircomparisons > 0);
15991 if( ((*ndelconss - oldndelconss) + (*nchgsides - oldnchgsides)/2.0 + (*nchgcoefs - oldnchgcoefs)/10.0) / ((
SCIP_Real) npaircomparisons) < conshdlrdata->mingainpernmincomp )
15993 oldndelconss = *ndelconss;
15994 oldnchgsides = *nchgsides;
15995 oldnchgcoefs = *nchgcoefs;
15996 npaircomparisons = 0;
16007 if( !cutoff && firstupgradetry < nconss
16008 && *nfixedvars == oldnfixedvars && *naggrvars == oldnaggrvars && *nchgbds == oldnchgbds && *ndelconss == oldndelconss
16009 && *nupgdconss == oldnupgdconss && *nchgcoefs == oldnchgcoefs && *nchgsides == oldnchgsides
16024 for( c = firstupgradetry; c < nconss && !
SCIPisStopped(scip); ++c )
16033 assert(consdata !=
NULL);
16036 if( consdata->upgradetried )
16039 if( !consdata->presolved )
16042 consdata->upgradetried =
TRUE;
16048 if( upgdcons !=
NULL )
16058 assert(!consdata->upgraded);
16059 consdata->upgraded =
TRUE;
16064 if(
SCIPisLT(scip, consdata->lhs, consdata->rhs)
16065 || !conshdlrdata->presolpairwise
16066 || (conshdlrdata->maxaggrnormscale == 0.0) )
16078 else if( *nfixedvars > oldnfixedvars || *naggrvars > oldnaggrvars || *nchgbds > oldnchgbds || *ndelconss > oldndelconss
16079 || *nupgdconss > oldnupgdconss || *nchgcoefs > oldnchgcoefs || *nchgsides > oldnchgsides )
16093 assert(scip !=
NULL);
16094 assert(cons !=
NULL);
16095 assert(result !=
NULL);
16112 assert(scip !=
NULL);
16113 assert(cons !=
NULL);
16115 assert(consdata !=
NULL);
16121 for( i = 0; i < consdata->nvars; ++i )
16155 assert(scip !=
NULL);
16156 assert(conshdlr !=
NULL);
16157 assert(conss !=
NULL || nconss == 0);
16171 assert(scip !=
NULL);
16172 assert(conshdlr !=
NULL);
16173 assert(cons !=
NULL);
16186 const char* consname;
16189 assert(scip !=
NULL);
16190 assert(sourcescip !=
NULL);
16191 assert(sourcecons !=
NULL);
16205 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, global, valid) );
16206 assert(cons !=
NULL || *valid ==
FALSE);
16217 char** firstoperator,
16218 char** secondoperator,
16224 assert(str !=
NULL);
16225 assert(firstoperator !=
NULL);
16226 assert(secondoperator !=
NULL);
16228 *firstoperator =
NULL;
16229 *secondoperator =
NULL;
16235 while( *curr && *success )
16248 if( curr[1] ==
'=' )
16257 if( strncmp(curr,
"[free]", 6) == 0 )
16273 if( *firstoperator ==
NULL )
16275 *firstoperator = curr;
16279 if( *secondoperator !=
NULL )
16284 else if( strncmp(*firstoperator,
"<=", 2) != 0 )
16286 SCIPerrorMessage(
"Two operators in line that is not a ranged row: %s", str);
16289 else if( strncmp(curr,
"<=", 2) != 0 )
16291 SCIPerrorMessage(
"Bad second operator, expected ranged row specification: %s", str);
16295 *secondoperator = curr;
16305 if( *firstoperator ==
NULL )
16335 assert(success !=
NULL);
16336 assert(str !=
NULL);
16337 assert(name !=
NULL);
16338 assert(cons !=
NULL);
16344 (*success) =
FALSE;
16351 while( isspace((
unsigned char)*str) )
16360 if( ! operatorsuccess )
16363 varstrptr = (
char *)str;
16364 lhsstrptr = rhsstrptr =
NULL;
16365 assert(firstop !=
NULL);
16371 assert(firstop[1] ==
'=');
16373 if( secondop !=
NULL )
16375 assert(secondop[0] ==
'<' && secondop[1] ==
'=');
16376 lhsstrptr = (
char *)str;
16377 varstrptr = firstop + 2;
16378 rhsstrptr = secondop + 2;
16384 varstrptr = (
char *)str;
16385 rhsstrptr = firstop + 2;
16389 assert(firstop[1] ==
'=');
16390 assert(secondop ==
NULL);
16392 lhsstrptr = firstop + 2;
16395 assert(firstop[1] ==
'=');
16396 assert(secondop ==
NULL);
16398 rhsstrptr = firstop + 2;
16399 lhsstrptr = firstop + 2;
16402 assert(strncmp(firstop,
"[free]", 6) == 0);
16403 assert(secondop ==
NULL);
16408 SCIPerrorMessage(
"Parsing has wrong operator character '%c', should be one of <=>[", *firstop);
16413 if( lhsstrptr !=
NULL )
16417 SCIPerrorMessage(
"error parsing left hand side number from <%s>\n", lhsstrptr);
16422 if( rhsstrptr == lhsstrptr )
16427 if( rhsstrptr !=
NULL && rhsstrptr != lhsstrptr )
16431 SCIPerrorMessage(
"error parsing right hand side number from <%s>\n", lhsstrptr);
16441 assert(varstrptr !=
NULL);
16446 if( *success && requsize > coefssize )
16449 coefssize = requsize;
16454 assert(!*success || requsize <= coefssize);
16464 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
16481 assert(consdata !=
NULL);
16483 if( varssize < consdata->nvars )
16484 (*success) =
FALSE;
16487 assert(vars !=
NULL);
16504 assert(consdata !=
NULL);
16506 (*nvars) = consdata->nvars;
16525 assert(scip !=
NULL);
16526 assert(eventhdlr !=
NULL);
16527 assert(eventdata !=
NULL);
16529 assert(event !=
NULL);
16531 cons = eventdata->cons;
16532 assert(cons !=
NULL);
16534 assert(consdata !=
NULL);
16550 varpos = eventdata->varpos;
16551 assert(0 <= varpos && varpos < consdata->nvars);
16554 assert(var !=
NULL);
16555 assert(consdata->vars[varpos] == var);
16556 val = consdata->vals[varpos];
16575 consdata->presolved =
FALSE;
16576 consdata->rangedrowpropagated = 0;
16584 if( consdata->maxactdeltavar == var )
16587 consdata->maxactdeltavar =
NULL;
16591 if( consdata->boundstightened > 0)
16593 switch( eventtype )
16597 consdata->boundstightened = 0;
16601 consdata->boundstightened = 0;
16623 delta =
REALABS(val) * domain;
16625 if( delta > consdata->maxactdelta )
16627 consdata->maxactdelta = delta;
16628 consdata->maxactdeltavar = var;
16635 consdata->presolved =
FALSE;
16636 consdata->removedfixings =
FALSE;
16637 consdata->rangedrowpropagated = 0;
16640 if( consdata->maxactdeltavar == var )
16643 consdata->maxactdeltavar =
NULL;
16652 consdata->presolved =
FALSE;
16661 varpos = eventdata->varpos;
16662 assert(0 <= varpos && varpos < consdata->nvars);
16665 assert(var !=
NULL);
16666 assert(consdata->vars[varpos] == var);
16667 val = consdata->vals[varpos];
16669 consdata->rangedrowpropagated = 0;
16683 consdata->varsdeleted =
TRUE;
16702 assert(scip !=
NULL);
16703 assert(conflicthdlr !=
NULL);
16705 assert(bdchginfos !=
NULL || nbdchginfos == 0);
16706 assert(result !=
NULL);
16721 for( i = 0; i < nbdchginfos; ++i )
16723 assert(bdchginfos !=
NULL);
16742 if( i == nbdchginfos )
16755 if( upgdcons !=
NULL )
16785 assert(scip !=
NULL);
16786 assert(cons !=
NULL);
16787 assert(nupgdconss !=
NULL);
16788 assert(upgdconss !=
NULL);
16800 if( upgdconsssize < 1 )
16827 assert(nupgdconss !=
NULL);
16828 assert(upgdconss !=
NULL);
16840 if( upgdconsssize < 1 )
16873 assert(scip !=
NULL);
16877 eventExecLinear,
NULL) );
16889 consEnfolpLinear, consEnfopsLinear, consCheckLinear, consLockLinear,
16892 assert(conshdlr !=
NULL);
16906 #ifdef WITH_PRINTORIGCONSTYPES 16935 "multiplier on propagation frequency, how often the bounds are tightened (-1: never, 0: only at root)",
16939 "maximal number of separation rounds per node (-1: unlimited)",
16943 "maximal number of separation rounds per node in the root node (-1: unlimited)",
16947 "maximal number of cuts separated per separation round",
16951 "maximal number of cuts separated per separation round in the root node",
16955 "should pairwise constraint comparison be performed in presolving?",
16959 "should hash table be used for detecting redundant constraints in advance",
16963 "number for minimal pairwise presolve comparisons",
16967 "minimal gain per minimal pairwise presolve comparisons to repeat pairwise comparison round",
16971 "maximal allowed relative gain in maximum norm for constraint aggregation (0.0: disable constraint aggregation)",
16975 "maximum activity delta to run easy propagation on linear constraint (faster, but numerically less stable)",
16979 "maximal relative distance from current node's dual bound to primal bound compared to best node's dual bound for separating knapsack cardinality cuts",
16983 "should all constraints be subject to cardinality cut generation instead of only the ones with non-zero dual value?",
16987 "should presolving search for aggregations in equations",
16991 "should presolving try to simplify inequalities",
16995 "should dual presolving steps be performed?",
16999 "should stuffing of singleton continuous variables be performed?",
17003 "should single variable stuffing be performed, which tries to fulfill constraints using the cheapest variable?",
17006 "constraints/" CONSHDLR_NAME "/sortvars",
"apply binaries sorting in decr. order of coeff abs value?",
17010 "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)?",
17014 "should presolving try to detect constraints parallel to the objective function defining an upper bound and prevent these constraints from entering the LP?",
17018 "should presolving try to detect constraints parallel to the objective function defining a lower bound and prevent these constraints from entering the LP?",
17022 "should presolving try to detect subsets of constraints parallel to the objective function?",
17026 "should presolving and propagation try to improve bounds, detect infeasibility, and extract sub-constraints from ranged rows and equations?",
17030 "should presolving and propagation extract sub-constraints from ranged rows and equations?",
17034 "maximum depth to apply ranged row propagation",
17038 "frequency for applying ranged row propagation",
17042 "should multi-aggregations only be performed if the constraint can be removed afterwards?",
17053 const char* conshdlrname
17062 assert(scip !=
NULL);
17063 assert(linconsupgd !=
NULL);
17064 assert(conshdlrname !=
NULL );
17068 if( conshdlr ==
NULL )
17075 assert(conshdlrdata !=
NULL);
17090 paramname, paramdesc,
17139 assert(scip !=
NULL);
17140 assert(cons !=
NULL);
17144 if( conshdlr ==
NULL )
17152 assert(conshdlrdata !=
NULL);
17153 assert(conshdlrdata->eventhdlr !=
NULL);
17174 if( requiredsize > nconsvars )
17180 assert(requiredsize <= nconsvars);
17186 if( constant < 0.0 )
17193 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);
17203 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);
17219 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);
17229 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);
17259 assert(consdata !=
NULL);
17268 assert(consdata !=
NULL);
17272 SCIP_CALL(
SCIPcreateCons(scip, cons, name, conshdlr, consdata, initial, separate, enforce, check, propagate,
17273 local, modifiable, dynamic, removable, stickingatnode) );
17279 assert(consdata->eventdata !=
NULL);
17304 assert(scip !=
NULL);
17361 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
17369 if( sourcecoefs !=
NULL )
17376 for( v = 0; v < nvars; ++v )
17389 if( requiredsize > nvars )
17395 assert(requiredsize <= nvars);
17400 for( v = 0; v < nvars; ++v )
17404 assert(vars[v] !=
NULL);
17411 for( v = 0; v < nvars && success; ++v )
17417 assert(!(success) || vars[v] !=
NULL);
17430 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
17450 assert(scip !=
NULL);
17451 assert(cons !=
NULL);
17452 assert(var !=
NULL);
17485 if( requiredsize > nconsvars )
17491 assert(requiredsize <= nconsvars);
17495 assert(consdata !=
NULL);
17497 lhs = consdata->lhs;
17498 rhs = consdata->rhs;
17504 if( constant < 0.0 )
17511 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));
17521 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));
17537 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));
17547 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));
17577 for( v = nconsvars - 1; v >= 0; --v )
17616 assert(scip !=
NULL);
17617 assert(cons !=
NULL);
17618 assert(var !=
NULL);
17628 SCIPerrorMessage(
"method may only be called during problem creation stage for original constraints and variables\n");
17633 assert(consdata !=
NULL);
17635 vars = consdata->vars;
17638 while( i < consdata->nvars )
17640 if( vars[i] == var )
17678 assert(scip !=
NULL);
17679 assert(cons !=
NULL);
17680 assert(var !=
NULL);
17695 assert(cons !=
NULL);
17707 return consdata->lhs;
17718 assert(cons !=
NULL);
17730 return consdata->rhs;
17740 assert(scip !=
NULL);
17741 assert(cons !=
NULL);
17780 assert(cons !=
NULL);
17792 return consdata->nvars;
17803 assert(cons !=
NULL);
17815 return consdata->vars;
17826 assert(cons !=
NULL);
17838 return consdata->vals;
17854 assert(cons !=
NULL);
17864 assert(consdata !=
NULL);
17866 if( consdata->row !=
NULL )
17881 assert(cons !=
NULL);
17891 assert(consdata !=
NULL);
17893 if( consdata->row !=
NULL )
17907 assert(cons !=
NULL);
17918 assert(consdata !=
NULL);
17920 if( consdata->row !=
NULL )
17934 assert(cons !=
NULL);
17945 assert(consdata !=
NULL);
17947 if( consdata->row !=
NULL )
17963 assert(cons !=
NULL);
17975 return consdata->row;
18013 assert(scip !=
NULL);
18014 assert(cons !=
NULL);
18015 assert(upgdcons !=
NULL);
18037 assert(conshdlrdata !=
NULL);
18039 assert(consdata !=
NULL);
18042 if( consdata->upgraded )
18046 if( consdata->row !=
NULL )
18050 SCIPerrorMessage(
"cannot upgrade linear constraint that is already stored as row in the LP\n");
18087 for( i = 0; i < consdata->nvars; ++i )
18089 var = consdata->vars[i];
18090 val = consdata->vals[i];
18141 else if(
SCIPisEQ(scip, val, -1.0) )
18158 poscoeffsum += val;
18160 negcoeffsum += val;
18168 SCIPdebugMsg(scip,
"upgrading linear constraint <%s> (%d upgrade methods):\n",
18170 SCIPdebugMsg(scip,
" +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",
18171 nposbin, nnegbin, nposint, nnegint, nposimpl, nnegimpl, nposcont, nnegcont,
18172 ncoeffspone, ncoeffsnone, ncoeffspint, ncoeffsnint, ncoeffspfrac, ncoeffsnfrac,
18173 poscoeffsum, negcoeffsum, integral);
18176 for( i = 0; i < conshdlrdata->nlinconsupgrades && *upgdcons ==
NULL; ++i )
18178 if( conshdlrdata->linconsupgrades[i]->active )
18180 SCIP_CALL( conshdlrdata->linconsupgrades[i]->linconsupgd(scip, cons, consdata->nvars,
18181 consdata->vars, consdata->vals, consdata->lhs, consdata->rhs,
18182 nposbin, nnegbin, nposint, nnegint, nposimpl, nnegimpl, nposimplbin, nnegimplbin, nposcont, nnegcont,
18183 ncoeffspone, ncoeffsnone, ncoeffspint, ncoeffsnint, ncoeffspfrac, ncoeffsnfrac,
18184 poscoeffsum, negcoeffsum, integral,
18190 if( *upgdcons !=
NULL )
enum SCIP_Result SCIP_RESULT
#define CONSHDLR_DELAYSEPA
void SCIPsortRealInt(SCIP_Real *realarray, int *intarray, int len)
SCIP_VAR ** SCIPgetLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
#define SCIP_DECL_LINCONSUPGD(x)
enum SCIP_BoundType SCIP_BOUNDTYPE
void SCIPconshdlrSetData(SCIP_CONSHDLR *conshdlr, SCIP_CONSHDLRDATA *conshdlrdata)
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
struct InferInfo INFERINFO
SCIP_RETCODE SCIPincConsAge(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetActivityLinear(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
SCIP_RETCODE SCIPflattenVarAggregationGraph(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
SCIP_Bool SCIPinRepropagation(SCIP *scip)
static SCIP_RETCODE tightenVarBounds(SCIP *scip, SCIP_CONS *cons, int pos, SCIP_Bool *cutoff, int *nchgbds, SCIP_Bool force)
static void consdataCalcMinAbsval(SCIP_CONSDATA *consdata)
SCIP_RETCODE SCIPincludeNonlinconsUpgrade(SCIP *scip, SCIP_DECL_NONLINCONSUPGD((*nonlinconsupgd)), SCIP_DECL_EXPRGRAPHNODEREFORM((*nodereform)), int priority, SCIP_Bool active, const char *conshdlrname)
SCIP_Real SCIPfeastol(SCIP *scip)
SCIP_RETCODE SCIPincludeConshdlrLinear(SCIP *scip)
static SCIP_RETCODE consdataCreate(SCIP *scip, SCIP_CONSDATA **consdata, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs)
static int inferInfoGetPos(INFERINFO inferinfo)
static SCIP_RETCODE consCatchEvent(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, int pos)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
static SCIP_RETCODE chgCoefPos(SCIP *scip, SCIP_CONS *cons, int pos, SCIP_Real newval)
static SCIP_RETCODE simplifyInequalities(SCIP *scip, SCIP_CONS *cons, int *nchgcoefs, int *nchgsides)
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
static SCIP_Real consdataGetFeasibility(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_SOL *sol)
SCIP_Real SCIPgetVarUbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define DEFAULT_MAXAGGRNORMSCALE
SCIP_STAGE SCIPgetStage(SCIP *scip)
#define DEFAULT_PRESOLPAIRWISE
#define SCIP_EVENTTYPE_VARFIXED
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
SCIP_Real * SCIPvarGetMultaggrScalars(SCIP_VAR *var)
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSTRANS((*constrans)))
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)
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPgetVarLbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
#define CONSHDLR_MAXPREROUNDS
static void calculateMinvalAndMaxval(SCIP *scip, SCIP_Real side, SCIP_Real val, SCIP_Real minresactivity, SCIP_Real maxresactivity, SCIP_Real *minval, SCIP_Real *maxval)
static void consdataUpdateSignatures(SCIP_CONSDATA *consdata, int pos)
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
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)
#define DEFAULT_RANGEDROWFREQ
static void consdataRecomputeMaxActivityDelta(SCIP *scip, SCIP_CONSDATA *consdata)
SCIP_RETCODE SCIPcatchVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
static SCIP_Bool checkEqualObjective(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_Real *scale, SCIP_Real *offset)
#define DEFAULT_CHECKRELMAXABS
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
static SCIP_RETCODE fixVariables(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff, int *nfixedvars)
SCIP_VAR * SCIPbdchginfoGetVar(SCIP_BDCHGINFO *bdchginfo)
SCIP_Bool SCIPisUbBetter(SCIP *scip, SCIP_Real newub, SCIP_Real oldlb, SCIP_Real oldub)
#define DEFAULT_MAXROUNDS
static SCIP_RETCODE convertUnaryEquality(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff, int *nfixedvars, int *ndelconss)
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)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPincludeQuadconsUpgrade(SCIP *scip, SCIP_DECL_QUADCONSUPGD((*quadconsupgd)), int priority, SCIP_Bool active, const char *conshdlrname)
SCIP_RETCODE SCIPsetConshdlrGetVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETVARS((*consgetvars)))
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)
static SCIP_RETCODE findOperators(const char *str, char **firstoperator, char **secondoperator, SCIP_Bool *success)
SCIP_RETCODE SCIPupdateCutoffbound(SCIP *scip, SCIP_Real cutoffbound)
#define SCIP_DECL_CONSINITPRE(x)
SCIP_Bool SCIPvarIsInitial(SCIP_VAR *var)
SCIP_Bool SCIPparseReal(SCIP *scip, const char *str, SCIP_Real *value, char **endptr)
SCIP_RETCODE SCIPsetConshdlrEnforelax(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENFORELAX((*consenforelax)))
SCIP_RETCODE SCIPresetConsAge(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE consDropAllEvents(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr)
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
SCIP_VAR ** SCIPvarGetMultaggrVars(SCIP_VAR *var)
SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
SCIP_RETCODE SCIPsetConsPropagated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool propagate)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisSumRelEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static void consdataUpdateActivitiesGlbUb(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_Real oldub, SCIP_Real newub, SCIP_Real val, SCIP_Bool checkreliability)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_Bool SCIPisUpdateUnreliable(SCIP *scip, SCIP_Real newvalue, SCIP_Real oldvalue)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
static SCIP_Real consdataGetMaxAbsval(SCIP_CONSDATA *consdata)
static SCIP_RETCODE linconsupgradeCreate(SCIP *scip, SCIP_LINCONSUPGRADE **linconsupgrade, SCIP_DECL_LINCONSUPGD((*linconsupgd)), int priority)
void SCIPsortDownRealPtr(SCIP_Real *realarray, void **ptrarray, int len)
#define DEFAULT_MAXSEPACUTS
SCIP_RETCODE SCIPgetTransformedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **transvar)
SCIP_RETCODE SCIPupdateConsFlags(SCIP *scip, SCIP_CONS *cons0, SCIP_CONS *cons1)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
SCIP_RETCODE SCIPsetConshdlrInitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITPRE((*consinitpre)))
static void consdataRecomputeMinactivity(SCIP *scip, SCIP_CONSDATA *consdata)
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
#define DEFAULT_DETECTPARTIALOBJECTIVE
SCIP_RETCODE SCIPconvertCutsToConss(SCIP *scip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, int *ncutsadded)
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
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)
static void permSortConsdata(SCIP_CONSDATA *consdata, int *perm, int nvars)
#define DEFAULT_AGGREGATEVARIABLES
SCIP_Real SCIPadjustedVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real ub)
static SCIP_DECL_HASHGETKEY(hashGetKeyLinearcons)
static SCIP_DECL_CONSEXITSOL(consExitsolLinear)
static void consdataInvalidateActivities(SCIP_CONSDATA *consdata)
int SCIPconsGetPos(SCIP_CONS *cons)
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
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)
SCIP_Real * SCIPgetLinearCoefsNonlinear(SCIP *scip, SCIP_CONS *cons)
static SCIP_DECL_CONSCOPY(consCopyLinear)
SCIP_Real SCIPinfinity(SCIP *scip)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
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)
static SCIP_Bool conshdlrdataHasUpgrade(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_DECL_LINCONSUPGD((*linconsupgd)), const char *conshdlrname)
#define DEFAULT_MAXCARDBOUNDDIST
SCIP_RETCODE SCIPunmarkConsPropagate(SCIP *scip, SCIP_CONS *cons)
enum SCIP_Retcode SCIP_RETCODE
SCIP_Real SCIPgetLocalLowerbound(SCIP *scip)
SCIP_Real SCIPvarGetNegationConstant(SCIP_VAR *var)
#define DEFAULT_NMINCOMPARISONS
#define SCIPstatisticMessage
SCIP_ROW * SCIPgetRowLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPaddConflictUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
static SCIP_DECL_CONSINITLP(consInitlpLinear)
SCIP_RETCODE SCIPaddVarLocks(SCIP *scip, SCIP_VAR *var, int nlocksdown, int nlocksup)
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
#define SCIP_PRESOLTIMING_EXHAUSTIVE
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)
static SCIP_Bool consdataIsResidualIntegral(SCIP *scip, SCIP_CONSDATA *consdata, int pos, SCIP_Real val)
enum SCIP_Varstatus SCIP_VARSTATUS
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)
int SCIPvarGetProbindex(SCIP_VAR *var)
#define SCIP_EVENTTYPE_GLBCHANGED
static SCIP_DECL_CONSENFOPS(consEnfopsLinear)
SCIP_Real SCIPvarGetAggrScalar(SCIP_VAR *var)
SCIP_Real SCIPgetRhsNonlinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
static GRAPHNODE ** active
SCIP_RETCODE SCIPinitConflictAnalysis(SCIP *scip, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
#define SCIPfreeBlockMemory(scip, ptr)
static SCIP_RETCODE tightenSides(SCIP *scip, SCIP_CONS *cons, int *nchgsides)
#define DEFAULT_MINGAINPERNMINCOMP
SCIP_RETCODE SCIPsetConshdlrSepa(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), int sepafreq, int sepapriority, SCIP_Bool delaysepa)
SCIP_Real SCIPselectSimpleValue(SCIP_Real lb, SCIP_Real ub, SCIP_Longint maxdnom)
int SCIPconsGetNLocksNeg(SCIP_CONS *cons)
SCIP_MESSAGEHDLR * SCIPgetMessagehdlr(SCIP *scip)
static SCIP_DECL_CONSEXITPRE(consExitpreLinear)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
void SCIPsortDownRealInt(SCIP_Real *realarray, int *intarray, int len)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_DECL_CONSRESPROP(consRespropLinear)
static SCIP_RETCODE detectRedundantConstraints(SCIP *scip, BMS_BLKMEM *blkmem, SCIP_CONS **conss, int nconss, int *firstchange, SCIP_Bool *cutoff, int *ndelconss, int *nchgsides)
#define SCIPfreeBufferArray(scip, ptr)
static INFERINFO getInferInfo(PROPRULE proprule, int pos)
static SCIP_RETCODE rangedRowPropagation(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff, int *nfixedvars, int *nchgbds, int *naddconss)
SCIP_Real SCIPadjustedVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real lb)
SCIP_Bool SCIPvarIsRemovable(SCIP_VAR *var)
SCIP_RETCODE SCIPincludeConflicthdlrBasic(SCIP *scip, SCIP_CONFLICTHDLR **conflicthdlrptr, const char *name, const char *desc, int priority, SCIP_DECL_CONFLICTEXEC((*conflictexec)), SCIP_CONFLICTHDLRDATA *conflicthdlrdata)
#define SCIPallocBlockMemory(scip, ptr)
#define SCIPdebugPrintCons(x, y, z)
SCIP_Bool SCIPisTransformed(SCIP *scip)
SCIP_RETCODE SCIPdelCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
int SCIPgetNLPBranchCands(SCIP *scip)
static SCIP_RETCODE consDropEvent(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, int pos)
SCIP_RETCODE SCIPsetConshdlrDelvars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELVARS((*consdelvars)))
#define checkMaxActivityDelta(scip, consdata)
SCIP_VAR * SCIPvarGetNegationVar(SCIP_VAR *var)
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
#define SCIP_EVENTTYPE_BOUNDCHANGED
static SCIP_DECL_SORTINDCOMP(consdataCompVar)
SCIP_RETCODE SCIPsetConshdlrInitlp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITLP((*consinitlp)))
SCIP_Real SCIProwGetDualsol(SCIP_ROW *row)
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
#define SCIPdebugMsgPrint
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)
static SCIP_Real consdataGetMinAbsval(SCIP_CONSDATA *consdata)
SCIP_RETCODE SCIPgetTransformedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPARSE((*consparse)))
SCIP_Real SCIPgetLhsQuadratic(SCIP *scip, SCIP_CONS *cons)
#define DEFAULT_SEPARATEALL
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
SCIP_RETCODE SCIPaddCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
#define DEFAULT_MAXSEPACUTSROOT
int SCIPgetNContVars(SCIP *scip)
static SCIP_RETCODE addConflictFixedVars(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *infervar, SCIP_BDCHGIDX *bdchgidx, int inferpos)
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)
SCIP_Real SCIPepsilon(SCIP *scip)
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)
#define CONSHDLR_PRESOLTIMING
SCIP_RETCODE SCIPaddConflictLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
#define CONSHDLR_PROP_TIMING
#define MAXMULTIAGGRQUOTIENT
static SCIP_RETCODE rangedRowSimplify(SCIP *scip, SCIP_CONS *cons, int *nchgcoefs, int *nchgsides)
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)
int SCIPgetNQuadVarTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPconsIsOriginal(SCIP_CONS *cons)
#define SCIP_EVENTTYPE_LBCHANGED
static SCIP_DECL_CONSFREE(consFreeLinear)
#define CONSHDLR_SEPAFREQ
SCIP_VAR * SCIPvarGetNegatedVar(SCIP_VAR *var)
SCIP_Bool SCIProwIsInLP(SCIP_ROW *row)
#define MAXCONSPRESOLROUNDS
SCIP_Bool SCIPisConflictAnalysisApplicable(SCIP *scip)
static SCIP_DECL_EVENTEXEC(eventExecLinear)
SCIP_Bool SCIPrealToRational(SCIP_Real val, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Longint *nominator, SCIP_Longint *denominator)
SCIP_Bool SCIPisLbBetter(SCIP *scip, SCIP_Real newlb, SCIP_Real oldlb, SCIP_Real oldub)
static void linconsupgradeFree(SCIP *scip, SCIP_LINCONSUPGRADE **linconsupgrade)
SCIP_RETCODE SCIPsetConsSeparated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool separate)
SCIP_RETCODE SCIPchgVarType(SCIP *scip, SCIP_VAR *var, SCIP_VARTYPE vartype, SCIP_Bool *infeasible)
static SCIP_RETCODE analyzeConflict(SCIP *scip, SCIP_CONS *cons, SCIP_Bool reasonisrhs)
static SCIP_RETCODE checkCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool checklprows, SCIP_Bool checkrelmaxabs, SCIP_Bool *violated)
SCIP_RETCODE SCIPaddClique(SCIP *scip, SCIP_VAR **vars, SCIP_Bool *values, int nvars, SCIP_Bool isequation, SCIP_Bool *infeasible, int *nbdchgs)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
static SCIP_RETCODE checkParallelObjective(SCIP *scip, SCIP_CONS *cons, SCIP_CONSHDLRDATA *conshdlrdata)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
#define CONFLICTHDLR_NAME
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)
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)
Constraint handler for knapsack constraints of the form , x binary and .
#define DEFAULT_DETECTCUTOFFBOUND
static SCIP_RETCODE updateCutoffbound(SCIP *scip, SCIP_CONS *cons, SCIP_Real primalbound)
SCIP_Real SCIPeventGetNewbound(SCIP_EVENT *event)
SCIP_Bool SCIPisPresolveFinished(SCIP *scip)
SCIP_Bool SCIPconsIsLocked(SCIP_CONS *cons)
static SCIP_DECL_CONSDELETE(consDeleteLinear)
#define CONFLICTHDLR_PRIORITY
static SCIP_RETCODE addRelaxation(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *cutoff)
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
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)
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)
#define SCIPhashFour(a, b, c, d)
SCIP_Bool SCIPisSumRelLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
#define CONSHDLR_PROPFREQ
SCIP_Real SCIPgetDualsolLinear(SCIP *scip, SCIP_CONS *cons)
static SCIP_DECL_QUADCONSUPGD(upgradeConsQuadratic)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPaddConsLocal(SCIP *scip, SCIP_CONS *cons, SCIP_NODE *validnode)
static SCIP_DECL_CONSENFOLP(consEnfolpLinear)
SCIP_Bool SCIPdoNotMultaggrVar(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPdelConsLocal(SCIP *scip, SCIP_CONS *cons)
static void consdataGetActivityBounds(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_Bool goodrelax, SCIP_Real *minactivity, SCIP_Real *maxactivity, SCIP_Bool *minisrelax, SCIP_Bool *maxisrelax)
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)
SCIP_RETCODE SCIPupgradeConsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_CONS **upgdcons)
static SCIP_DECL_CONSSEPALP(consSepalpLinear)
SCIP_RETCODE SCIPgetProbvarSum(SCIP *scip, SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
SCIP_Real * SCIPgetCoefsLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons)
static void consdataCalcMaxAbsval(SCIP_CONSDATA *consdata)
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)
static INLINE uint32_t SCIPrealHashCode(double x)
#define DEFAULT_MULTAGGRREMOVE
static SCIP_RETCODE chgRhs(SCIP *scip, SCIP_CONS *cons, SCIP_Real rhs)
static SCIP_RETCODE conshdlrdataEnsureLinconsupgradesSize(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, int num)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
static void consdataUpdateDelCoef(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR *var, SCIP_Real val, SCIP_Bool checkreliability)
static SCIP_RETCODE consdataSort(SCIP *scip, SCIP_CONSDATA *consdata)
SCIP_RETCODE SCIPunlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
static void consdataUpdateAddCoef(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR *var, SCIP_Real val, SCIP_Bool checkreliability)
static int inferInfoGetProprule(INFERINFO inferinfo)
static SCIP_RETCODE consdataTightenCoefs(SCIP *scip, SCIP_CONS *cons, int *nchgcoefs, int *nchgsides)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_Real SCIPvarGetAggrConstant(SCIP_VAR *var)
SCIP_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
struct SCIP_EventData SCIP_EVENTDATA
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSFREE((*consfree)))
constraint handler for quadratic constraints
SCIP_CONSHDLRDATA * SCIPconshdlrGetData(SCIP_CONSHDLR *conshdlr)
static SCIP_RETCODE addConflictReasonVars(SCIP *scip, SCIP_VAR **vars, int nvars, SCIP_VAR *var, SCIP_Real bound)
SCIP_RETCODE SCIPmarkConsPropagate(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE delCoefPos(SCIP *scip, SCIP_CONS *cons, int pos)
static SCIP_RETCODE resolvePropagation(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *infervar, INFERINFO inferinfo, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_RESULT *result)
static int getInferInt(PROPRULE proprule, int pos)
SCIP_RETCODE SCIPgetIntParam(SCIP *scip, const char *name, int *value)
static SCIP_RETCODE checkPartialObjective(SCIP *scip, SCIP_CONS *cons, SCIP_CONSHDLRDATA *conshdlrdata)
static SCIP_RETCODE conshdlrdataIncludeUpgrade(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_LINCONSUPGRADE *linconsupgrade)
#define CONSHDLR_DELAYPROP
int SCIPconsGetNLocksPos(SCIP_CONS *cons)
int SCIPconshdlrGetPropFreq(SCIP_CONSHDLR *conshdlr)
SCIP_Real SCIPgetLowerbound(SCIP *scip)
#define SCIP_EVENTTYPE_LBTIGHTENED
static SCIP_Bool canTightenBounds(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define CONSHDLR_CHECKPRIORITY
static SCIP_RETCODE tightenVarBoundsEasy(SCIP *scip, SCIP_CONS *cons, int pos, SCIP_Bool *cutoff, int *nchgbds, SCIP_Bool force)
#define SCIPhashSignature64(a)
SCIP_RETCODE SCIPgetProbvarLinearSum(SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, int varssize, SCIP_Real *constant, int *requiredsize, SCIP_Bool mergemultiples)
SCIP_Real SCIPvarGetMultaggrConstant(SCIP_VAR *var)
SCIP_RETCODE SCIPhashtableRemove(SCIP_HASHTABLE *hashtable, void *element)
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
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)
SCIP_RETCODE SCIPanalyzeConflictCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
static SCIP_RETCODE scaleCons(SCIP *scip, SCIP_CONS *cons, SCIP_Real scalar)
static SCIP_DECL_CONSINIT(consInitLinear)
SCIP_RETCODE SCIPsetConshdlrResprop(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSRESPROP((*consresprop)))
#define SCIPdebugGetSolVal(scip, var, val)
SCIP_RETCODE SCIPaddCut(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut, SCIP_Bool forcecut, SCIP_Bool *infeasible)
struct SCIP_ConsData SCIP_CONSDATA
static SCIP_DECL_CONSTRANS(consTransLinear)
#define SCIP_EVENTTYPE_BOUNDTIGHTENED
static SCIP_DECL_HASHKEYVAL(hashKeyValLinearcons)
SCIP_Bool SCIPhasCurrentNodeLP(SCIP *scip)
#define SCIP_EVENTTYPE_UBCHANGED
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)
SCIP_Real SCIPgetDualfarkasLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisHugeValue(SCIP *scip, SCIP_Real val)
static void consdataUpdateChgCoef(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR *var, SCIP_Real oldval, SCIP_Real newval, SCIP_Bool checkreliability)
#define DEFAULT_DETECTLOWERBOUND
SCIP_RETCODE SCIPchgVarObj(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
SCIP_Real SCIPgetRhsQuadratic(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE consdataPrint(SCIP *scip, SCIP_CONSDATA *consdata, FILE *file)
SCIP_Bool SCIPvarIsOriginal(SCIP_VAR *var)
void SCIPhashtablePrintStatistics(SCIP_HASHTABLE *hashtable, SCIP_MESSAGEHDLR *messagehdlr)
#define QUADCONSUPGD_PRIORITY
#define SCIPallocBufferArray(scip, ptr, num)
public data structures and miscellaneous methods
static SCIP_RETCODE chgLhs(SCIP *scip, SCIP_CONS *cons, SCIP_Real lhs)
SCIP_Bool SCIPisSumGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_VAR * SCIPeventGetVar(SCIP_EVENT *event)
SCIP_RETCODE SCIPchgRowRhs(SCIP *scip, SCIP_ROW *row, SCIP_Real rhs)
#define CONSHDLR_NEEDSCONS
#define CONSHDLR_EAGERFREQ
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
static SCIP_RETCODE performVarDeletions(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss)
static const char * paramname[]
static void consdataRecomputeGlbMaxactivity(SCIP *scip, SCIP_CONSDATA *consdata)
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)
SCIP_Real SCIPgetLhsNonlinear(SCIP *scip, SCIP_CONS *cons)
static SCIP_Real consdataGetActivity(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_SOL *sol)
int SCIPgetDepth(SCIP *scip)
constraint handler for nonlinear constraints
static void conshdlrdataFree(SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata)
#define DEFAULT_SINGLEVARSTUFFING
static SCIP_DECL_CONSPROP(consPropLinear)
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
int SCIPvarGetNLocksUp(SCIP_VAR *var)
#define DEFAULT_DUALPRESOLVING
static SCIP_RETCODE mergeMultiples(SCIP *scip, SCIP_CONS *cons)
static SCIP_DECL_CONSDELVARS(consDelvarsLinear)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
int SCIPvarCompare(SCIP_VAR *var1, SCIP_VAR *var2)
SCIP_Bool SCIPconsIsDeleted(SCIP_CONS *cons)
static SCIP_RETCODE presolStuffing(SCIP *scip, SCIP_CONS *cons, SCIP_Bool singletonstuffing, SCIP_Bool singlevarstuffing, SCIP_Bool *cutoff, int *nfixedvars, int *nchgbds)
SCIP_RETCODE SCIPchgRowLhs(SCIP *scip, SCIP_ROW *row, SCIP_Real lhs)
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
static void consdataUpdateActivitiesGlbLb(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_Real oldlb, SCIP_Real newlb, SCIP_Real val, SCIP_Bool checkreliability)
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
static SCIP_Real consdataComputePseudoActivity(SCIP *scip, SCIP_CONSDATA *consdata)
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
SCIP_Real SCIPbdchginfoGetNewbound(SCIP_BDCHGINFO *bdchginfo)
static void consdataCalcActivities(SCIP *scip, SCIP_CONSDATA *consdata)
#define NONLINCONSUPGD_PRIORITY
SCIP_VAR * SCIPvarGetAggrVar(SCIP_VAR *var)
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)
static int getVarWeight(SCIP_VAR *var)
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
#define BMScopyMemoryArray(ptr, source, num)
int SCIPgetNRuns(SCIP *scip)
SCIP_Real SCIProwGetDualfarkas(SCIP_ROW *row)
SCIP_RETCODE SCIPlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRINT((*consprint)))
#define SCIP_EVENTTYPE_UBTIGHTENED
Constraint handler for linear constraints in their most general form, .
int SCIPgetNObjVars(SCIP *scip)
SCIP_Longint SCIPgetNConflictConssApplied(SCIP *scip)
void * SCIPhashtableRetrieve(SCIP_HASHTABLE *hashtable, void *key)
SCIP_RETCODE SCIPchgRhsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_Real rhs)
int SCIPvarGetMultaggrNVars(SCIP_VAR *var)
SCIP_Bool SCIPisSumRelGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPgetRowSolActivity(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
#define DEFAULT_MAXROUNDSROOT
#define SCIP_EVENTTYPE_GBDCHANGED
SCIP_RETCODE SCIPvarGetOrigvarSum(SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
SCIP_Real SCIPgetFeasibilityLinear(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol)
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)
#define DEFAULT_TIGHTENBOUNDSFREQ
#define SCIP_MAXTREEDEPTH
static SCIP_Bool needEvents(SCIP *scip)
int SCIPgetNBinVars(SCIP *scip)
static SCIP_RETCODE aggregateVariables(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff, int *nfixedvars, int *naggrvars, int *ndelconss)
SCIP_Bool SCIPinProbing(SCIP *scip)
#define DEFAULT_SIMPLIFYINEQUALITIES
static SCIP_RETCODE createRow(SCIP *scip, SCIP_CONS *cons)
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
SCIP_RETCODE SCIPincludeLinconsUpgrade(SCIP *scip, SCIP_DECL_LINCONSUPGD((*linconsupgd)), int priority, const char *conshdlrname)
#define CONSHDLR_SEPAPRIORITY
int SCIPgetNVars(SCIP *scip)
int SCIPconsGetNUpgradeLocks(SCIP_CONS *cons)
static void consdataGetReliableResidualActivity(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR *cancelvar, SCIP_Real *resactivity, SCIP_Bool isminresact, SCIP_Bool useglobalbounds)
static void consdataRecomputeMaxactivity(SCIP *scip, SCIP_CONSDATA *consdata)
SCIP_RETCODE SCIPwriteVarsLinearsum(SCIP *scip, FILE *file, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SCIP_Bool type)
SCIP_RETCODE SCIPupdateLocalLowerbound(SCIP *scip, SCIP_Real newbound)
static SCIP_DECL_CONSENFORELAX(consEnforelaxLinear)
#define MAXSCALEDCOEFINTEGER
static SCIP_DECL_CONSCHECK(consCheckLinear)
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)
SCIP_RETCODE SCIPsetConshdlrExitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITPRE((*consexitpre)))
static SCIP_RETCODE conshdlrdataCreate(SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata, SCIP_EVENTHDLR *eventhdlr)
static void consdataCalcSignatures(SCIP_CONSDATA *consdata)
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
int SCIPgetNLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons)
static SCIP_DECL_CONSPARSE(consParseLinear)
static SCIP_RETCODE analyzeConflictRangedRow(SCIP *scip, SCIP_CONS *cons, SCIP_VAR **vars, int nvars, SCIP_VAR *var, SCIP_Real bound)
static SCIP_RETCODE lockRounding(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
static SCIP_DECL_CONSGETVARS(consGetVarsLinear)
int SCIPvarGetNLocksDown(SCIP_VAR *var)
void SCIPsort(int *perm, SCIP_DECL_SORTINDCOMP((*indcomp)), void *dataptr, int len)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
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)
SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
static SCIP_RETCODE fullDualPresolve(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_Bool *cutoff, int *nchgbds)
int SCIPgetNLinearVarsNonlinear(SCIP *scip, SCIP_CONS *cons)
static const SCIP_Real scalars[]
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)
SCIP_RETCODE SCIPaddVar(SCIP *scip, SCIP_VAR *var)
SCIP_VAR ** SCIPgetVarsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_CONSDATA * SCIPconsGetData(SCIP_CONS *cons)
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)
SCIP_RETCODE SCIPsetConshdlrInit(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINIT((*consinit)))
SCIP_Real SCIPgetHugeValue(SCIP *scip)
static SCIP_DECL_CONSLOCK(consLockLinear)
SCIP_RETCODE SCIPsetConsEnforced(SCIP *scip, SCIP_CONS *cons, SCIP_Bool enforce)
static void consdataCheckNonbinvar(SCIP_CONSDATA *consdata)
static SCIP_RETCODE consCatchAllEvents(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr)
SCIP_RETCODE SCIPsetConshdlrExit(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXIT((*consexit)))
static SCIP_DECL_CONSSEPASOL(consSepasolLinear)
static SCIP_RETCODE extractCliques(SCIP *scip, SCIP_CONS *cons, SCIP_Real maxeasyactivitydelta, SCIP_Bool sortvars, int *nfixedvars, int *nchgbds, SCIP_Bool *cutoff)
SCIP_Bool SCIPisConsCompressionEnabled(SCIP *scip)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
static SCIP_DECL_CONSPRINT(consPrintLinear)
static SCIP_DECL_CONSHDLRCOPY(conshdlrCopyLinear)
SCIP_Bool SCIPallowDualReds(SCIP *scip)
const char * SCIPconflicthdlrGetName(SCIP_CONFLICTHDLR *conflicthdlr)
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
SCIP_Real SCIPeventGetOldbound(SCIP_EVENT *event)
SCIP_Bool SCIPisFeasPositive(SCIP *scip, SCIP_Real val)
static SCIP_RETCODE convertBinaryEquality(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff, int *naggrvars, int *ndelconss)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
static SCIP_DECL_HASHKEYEQ(hashKeyEqLinearcons)
#define CONFLICTHDLR_DESC
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
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)
static SCIP_RETCODE normalizeCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcaptureVar(SCIP *scip, SCIP_VAR *var)
static SCIP_RETCODE tightenBounds(SCIP *scip, SCIP_CONS *cons, SCIP_Real maxeasyactivitydelta, SCIP_Bool sortvars, SCIP_Bool *cutoff, int *nchgbds)
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
SCIP_RETCODE SCIPaddVarsToRow(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
SCIP_VAR ** SCIPgetLinearVarsNonlinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisStopped(SCIP *scip)
#define SCIP_EVENTTYPE_VARUNLOCKED
static void getNewSidesAfterAggregation(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR *slackvar, SCIP_Real slackcoef, SCIP_Real *newlhs, SCIP_Real *newrhs)
#define DEFAULT_SINGLETONSTUFFING
SCIP_RETCODE SCIPsetConshdlrGetNVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETNVARS((*consgetnvars)))
SCIP_Bool SCIPisScalingIntegral(SCIP *scip, SCIP_Real val, SCIP_Real scalar)
#define CONSHDLR_ENFOPRIORITY
static SCIP_RETCODE convertEquality(SCIP *scip, SCIP_CONS *cons, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_Bool *cutoff, int *nfixedvars, int *naggrvars, int *ndelconss)
static SCIP_RETCODE applyFixings(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *infeasible)
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
SCIP_Bool SCIPdoNotAggr(SCIP *scip)
#define DEFAULT_RANGEDROWPROPAGATION
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
static SCIP_RETCODE addCoef(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
static SCIP_DECL_CONFLICTEXEC(conflictExecLinear)
SCIP_Real SCIPcutoffbounddelta(SCIP *scip)
SCIP_BOUNDTYPE SCIPvarGetBestBoundType(SCIP_VAR *var)
int SCIPvarGetIndex(SCIP_VAR *var)
SCIP_Real SCIPgetRowSolFeasibility(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
static SCIP_RETCODE consdataEnsureVarsSize(SCIP *scip, SCIP_CONSDATA *consdata, int num)
#define SCIPdebugAddSolVal(scip, var, val)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
static SCIP_DECL_NONLINCONSUPGD(upgradeConsNonlinear)
#define MAX_CLIQUE_NONZEROS_PER_CONS
static void consdataRecomputeGlbMinactivity(SCIP *scip, SCIP_CONSDATA *consdata)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Real * SCIPgetValsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
enum SCIP_Vartype SCIP_VARTYPE
static SCIP_RETCODE convertLongEquality(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_CONS *cons, SCIP_Bool *cutoff, int *naggrvars, int *ndelconss)
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
SCIP_RETCODE SCIPchgLhsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_Real lhs)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPvarIsTransformed(SCIP_VAR *var)
static int inferInfoToInt(INFERINFO inferinfo)
SCIP_Bool SCIPconsIsMarkedPropagate(SCIP_CONS *cons)
static SCIP_RETCODE unlockRounding(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
static SCIP_DECL_CONSPRESOL(consPresolLinear)
#define BMSclearMemoryArray(ptr, num)
#define DEFAULT_MAXEASYACTIVITYDELTA
struct BMS_BlkMem BMS_BLKMEM
SCIP_EXPRGRAPHNODE * SCIPgetExprgraphNodeNonlinear(SCIP *scip, SCIP_CONS *cons)
#define SCIP_EVENTTYPE_GUBCHANGED
SCIP_RETCODE SCIPaddConflict(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons, SCIP_NODE *validnode, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
static SCIP_RETCODE enforceConstraint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, int nusefulconss, SCIP_SOL *sol, SCIP_RESULT *result)
static SCIP_DECL_CONSGETNVARS(consGetNVarsLinear)
SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
static SCIP_DECL_CONSEXIT(consExitLinear)
#define DEFAULT_RANGEDROWMAXDEPTH
SCIP_RETCODE SCIPsetConshdlrExitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITSOL((*consexitsol)))
#define SCIPcombineTwoInt(a, b)
SCIP_Bool SCIPvarIsIntegral(SCIP_VAR *var)
SCIP_Longint SCIPcalcGreComDiv(SCIP_Longint val1, SCIP_Longint val2)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_Bool SCIPvarIsDeleted(SCIP_VAR *var)
static INFERINFO intToInferInfo(int i)
SCIP_RETCODE SCIPaddObjoffset(SCIP *scip, SCIP_Real addval)
int SCIPgetNVarsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLhsLinear(SCIP *scip, SCIP_CONS *cons)
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)
static SCIP_RETCODE addConflictBounds(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *infervar, SCIP_BDCHGIDX *bdchgidx, int inferpos, SCIP_Bool reasonisrhs)
SCIP_Longint SCIPcalcSmaComMul(SCIP_Longint val1, SCIP_Longint val2)
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
#define SCIP_EVENTTYPE_VARDELETED
static void consdataUpdateActivitiesLb(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR *var, SCIP_Real oldlb, SCIP_Real newlb, SCIP_Real val, SCIP_Bool checkreliability)
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)
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)
int SCIPgetNSepaRounds(SCIP *scip)
#define DEFAULT_PRESOLUSEHASHING
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
#define HASHSIZE_LINEARCONS
SCIP_RETCODE SCIPchgCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
SCIP_Bool SCIPvarIsNegated(SCIP_VAR *var)
static void consdataUpdateActivitiesUb(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR *var, SCIP_Real oldub, SCIP_Real newub, SCIP_Real val, SCIP_Bool checkreliability)
static SCIP_RETCODE consdataFree(SCIP *scip, SCIP_CONSDATA **consdata)
#define SCIPreallocBufferArray(scip, ptr, num)
SCIP_RETCODE SCIPsetConshdlrProp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING proptiming)
SCIP_RETCODE SCIPsetConsInitial(SCIP *scip, SCIP_CONS *cons, SCIP_Bool initial)
#define SCIP_EVENTTYPE_BOUNDRELAXED
#define DEFAULT_RANGEDROWARTCONS
static SCIP_RETCODE dualPresolve(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff, int *nfixedvars, int *naggrvars, int *ndelconss)