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) )
7505 SCIPdebugMsg(scip,
"linear constraint <%s> found %d bound changes and %d fixings\n",
SCIPconsGetName(cons), *nchgbds - oldnchgbds, nfixedvars);
7508 if( nfixedvars > 0 )
7509 *nchgbds += 2*nfixedvars;
7519 SCIPdebugMsg(scip,
"linear constraint <%s> is infeasible (rhs): activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
7520 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
7528 else if(
SCIPisFeasLT(scip, maxactivity, consdata->lhs) )
7530 SCIPdebugMsg(scip,
"linear constraint <%s> is infeasible (lhs): activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
7531 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
7539 else if(
SCIPisGE(scip, minactivity, consdata->lhs) &&
SCIPisLE(scip, maxactivity, consdata->rhs) )
7541 SCIPdebugMsg(scip,
"linear constraint <%s> is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
7542 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
7574 assert(scip !=
NULL);
7576 assert(cutoff !=
NULL);
7577 assert(nfixedvars !=
NULL);
7580 assert(consdata !=
NULL);
7582 for( v = 0; v < consdata->nvars; ++v )
7584 assert(consdata->vars !=
NULL);
7585 var = consdata->vars[v];
7597 SCIPdebugMsg(scip,
"converting variable <%s> with fixed bounds [%.15g,%.15g] into fixed variable fixed at %.15g\n",
7621 assert(consdata->removedfixings);
7626 #define MAX_CLIQUE_NONZEROS_PER_CONS 1000000 7718 int cliquenonzerosadded;
7725 assert(scip !=
NULL);
7726 assert(cons !=
NULL);
7727 assert(nfixedvars !=
NULL);
7728 assert(nchgbds !=
NULL);
7729 assert(cutoff !=
NULL);
7733 assert(consdata !=
NULL);
7735 if( consdata->nvars < 2 )
7744 if( !consdata->implsadded )
7756 nvars = consdata->nvars;
7757 vars = consdata->vars;
7758 vals = consdata->vals;
7761 if( !consdata->validactivities )
7763 assert(consdata->validactivities);
7767 finitenegminact = (consdata->glbminactivityneginf == 0 && consdata->glbminactivityneghuge == 0);
7768 finitenegmaxact = (consdata->glbmaxactivityneginf == 0 && consdata->maxactivityneghuge == 0);
7769 finiteposminact = (consdata->glbminactivityposinf == 0 && consdata->glbminactivityposhuge == 0);
7770 finiteposmaxact = (consdata->glbmaxactivityposinf == 0 && consdata->glbmaxactivityposhuge == 0);
7771 finiteminact = (finitenegminact && finiteposminact);
7772 finitemaxact = (finitenegmaxact && finiteposmaxact);
7774 if( (finiterhs || finitelhs) && (finitenegminact || finiteposminact || finitenegmaxact || finiteposmaxact) )
7779 int oldnchgbds = *nchgbds;
7785 if( (finitenegminact || finiteposminact) && !consdata->validglbminact )
7788 assert(consdata->validglbminact);
7791 if( (finitenegmaxact || finiteposmaxact) && !consdata->validglbmaxact )
7794 assert(consdata->validglbmaxact);
7796 assert(consdata->validglbminact || consdata->validglbmaxact);
7801 for( v = nvars - 1; v >= 0; --v )
7809 if( value > maxabscontrib )
7811 maxabscontrib = value;
7822 if( value > maxabscontrib )
7824 maxabscontrib = value;
7833 assert(0 <= position && position < nvars);
7835 if( !
SCIPisEQ(scip, maxabscontrib, 1.0) && !allbinary )
7841 if( finiterhs && finiteminact &&
SCIPisEQ(scip, consdata->glbminactivity, consdata->rhs - maxabscontrib) )
7843 for( v = nvars - 1; v >= 0; --v )
7855 *nchgbds += nbdchgs;
7862 *nchgbds += nbdchgs;
7882 if( finitelhs && finitemaxact &&
SCIPisEQ(scip, consdata->glbmaxactivity, consdata->lhs - maxabscontrib) )
7884 for( v = nvars - 1; v >= 0; --v )
7896 *nchgbds += nbdchgs;
7903 *nchgbds += nbdchgs;
7922 SCIPdebugMsg(scip,
"extracted %d implications from constraint %s which led to %d bound changes, %scutoff detetcted\n", nimpls,
SCIPconsGetName(cons), *nchgbds - oldnchgbds, *cutoff ?
"" :
"no ");
7928 if( *nchgbds - oldnchgbds > 0 )
7949 consdata->implsadded =
TRUE;
7953 if( consdata->cliquesadded )
7956 consdata->cliquesadded =
TRUE;
7957 cliquenonzerosadded = 0;
7963 nvars = consdata->nvars;
7964 vars = consdata->vars;
7965 vals = consdata->vals;
7970 if( !consdata->validactivities )
7972 assert(consdata->validactivities);
7976 finitenegminact = (consdata->glbminactivityneginf == 0 && consdata->glbminactivityneghuge == 0);
7977 finitenegmaxact = (consdata->glbmaxactivityneginf == 0 && consdata->maxactivityneghuge == 0);
7978 finiteposminact = (consdata->glbminactivityposinf == 0 && consdata->glbminactivityposhuge == 0);
7979 finiteposmaxact = (consdata->glbmaxactivityposinf == 0 && consdata->glbmaxactivityposhuge == 0);
7980 finiteminact = (finitenegminact && finiteposminact);
7981 finitemaxact = (finitenegmaxact && finiteposmaxact);
7986 if( (finiterhs || finitelhs) && (finitenegminact || finiteposminact || finitenegmaxact || finiteposmaxact) )
7990 int nposbinvars = 0;
7991 int nnegbinvars = 0;
7992 int allonebinary = 0;
7998 for( i = 0; i < nvars; ++i )
8007 binvars[nposbinvars + nnegbinvars] = vars[i];
8008 binvarvals[nposbinvars + nnegbinvars] = vals[i];
8015 assert(nposbinvars + nnegbinvars <= nvars);
8021 assert(nposbinvars + nnegbinvars <= nvars);
8026 if( allonebinary < nvars && (nposbinvars >= 2 || nnegbinvars >= 2) )
8029 int oldnchgbds = *nchgbds;
8035 if( (finitenegminact || finiteposminact) && !consdata->validglbminact )
8038 assert(consdata->validglbminact);
8041 if( (finitenegmaxact || finiteposmaxact) && !consdata->validglbmaxact )
8044 assert(consdata->validglbmaxact);
8046 assert(consdata->validglbminact || consdata->validglbmaxact);
8052 if( finiterhs && finitenegminact && nposbinvars >= 2 )
8055 threshold = consdata->rhs - consdata->glbminactivity;
8064 if(
SCIPisFeasGT(scip, binvarvals[i] + binvarvals[j], threshold) )
8068 while( j < nposbinvars )
8070 if( !
SCIPisFeasGT(scip, binvarvals[j-1] + binvarvals[j], threshold) )
8082 *nchgbds += nbdchgs;
8084 cliquenonzerosadded += j;
8089 if( !stopped && !(*cutoff) && j < nposbinvars )
8092 int lastfit = j - 2;
8093 assert(lastfit >= i);
8099 while( lastfit >= i && j < nposbinvars )
8102 if(
SCIPisFeasGT(scip, binvarvals[lastfit] + binvarvals[j], threshold) )
8104 clqvars[lastfit + 1] = binvars[j];
8115 *nchgbds += nbdchgs;
8117 cliquenonzerosadded += (lastfit - i + 2);
8136 if( !stopped && !*cutoff && *nchgbds - oldnchgbds > 0 )
8157 if( !consdata->validactivities )
8159 assert(consdata->validactivities);
8161 nvars = consdata->nvars;
8162 vars = consdata->vars;
8163 vals = consdata->vals;
8169 for( i = 0; i < nvars; ++i )
8178 binvars[nposbinvars + nnegbinvars] = vars[i];
8179 binvarvals[nposbinvars + nnegbinvars] = vals[i];
8186 assert(nposbinvars + nnegbinvars <= nvars);
8192 assert(nposbinvars + nnegbinvars <= nvars);
8197 oldnchgbds = *nchgbds;
8201 if( !stopped && !(*cutoff) && finitelhs && finiteposmaxact && nnegbinvars >= 2 )
8204 threshold = consdata->lhs - consdata->glbmaxactivity;
8206 i = nposbinvars + nnegbinvars - 1;
8213 if(
SCIPisFeasLT(scip, binvarvals[i] + binvarvals[j], threshold) )
8217 while( j >= nposbinvars )
8219 if( !
SCIPisFeasLT(scip, binvarvals[j+1] + binvarvals[j], threshold) )
8232 *nchgbds += nbdchgs;
8234 cliquenonzerosadded += (i - j);
8239 if( !stopped && !(*cutoff) && jstart >= nposbinvars )
8242 int lastfit = jstart + 1;
8243 assert(lastfit < i);
8250 while( lastfit <= i && j >= nposbinvars )
8253 if(
SCIPisFeasLT(scip, binvarvals[lastfit] + binvarvals[j], threshold) )
8255 assert(lastfit - jstart - 2 >= 0 && lastfit - jstart - 2 < i);
8256 clqvars[lastfit - jstart - 2] = binvars[j];
8258 assert(i - lastfit + 2 >= 2);
8268 *nchgbds += nbdchgs;
8270 cliquenonzerosadded += (i - lastfit + 2);
8289 if( !stopped && !*cutoff && *nchgbds - oldnchgbds > 0 )
8310 if( !consdata->validactivities )
8312 assert(consdata->validactivities);
8314 nvars = consdata->nvars;
8315 vars = consdata->vars;
8316 vals = consdata->vals;
8322 for( i = 0; i < nvars; ++i )
8331 binvars[nposbinvars + nnegbinvars] = vars[i];
8332 binvarvals[nposbinvars + nnegbinvars] = vals[i];
8339 assert(nposbinvars + nnegbinvars <= nvars);
8345 assert(nposbinvars + nnegbinvars <= nvars);
8350 oldnchgbds = *nchgbds;
8354 if( !(*cutoff) && finiterhs && finiteminact && nnegbinvars >= 2 )
8363 threshold = consdata->rhs - consdata->glbminactivity;
8365 i = nposbinvars + nnegbinvars - 1;
8373 if(
SCIPisFeasGT(scip, -binvarvals[i] - binvarvals[j], threshold) )
8377 while( j >= nposbinvars )
8379 if( !
SCIPisFeasGT(scip, -binvarvals[j+1] - binvarvals[j], threshold) )
8392 *nchgbds += nbdchgs;
8394 cliquenonzerosadded += (i - j);
8399 if( !stopped && !(*cutoff) && jstart >= nposbinvars )
8402 int lastfit = j + 1;
8403 assert(lastfit < i);
8410 while( lastfit <= i && j >= nposbinvars )
8413 if(
SCIPisFeasGT(scip, -binvarvals[lastfit] - binvarvals[j], threshold) )
8415 assert(lastfit - jstart - 2 >= 0 && lastfit - jstart - 2 < i);
8416 clqvars[lastfit - jstart - 2] = binvars[j];
8418 assert(i - lastfit + 2 >= 2);
8428 *nchgbds += nbdchgs;
8430 cliquenonzerosadded += (i - lastfit + 2);
8451 if( !stopped && !*cutoff && *nchgbds - oldnchgbds > 0 )
8472 if( !consdata->validactivities )
8474 assert(consdata->validactivities);
8476 nvars = consdata->nvars;
8477 vars = consdata->vars;
8478 vals = consdata->vals;
8484 for( i = 0; i < nvars; ++i )
8493 binvars[nposbinvars + nnegbinvars] = vars[i];
8494 binvarvals[nposbinvars + nnegbinvars] = vals[i];
8501 assert(nposbinvars + nnegbinvars <= nvars);
8507 assert(nposbinvars + nnegbinvars <= nvars);
8514 if( !stopped && !(*cutoff) && finitelhs && finitemaxact && nposbinvars >= 2 )
8523 threshold = consdata->lhs - consdata->glbmaxactivity;
8530 assert(!
SCIPisFeasLT(scip, -binvarvals[i], threshold));
8533 if(
SCIPisFeasLT(scip, -binvarvals[i] - binvarvals[j], threshold) )
8537 while( j < nposbinvars )
8539 if( !
SCIPisFeasLT(scip, -binvarvals[j-1] - binvarvals[j], threshold) )
8551 *nchgbds += nbdchgs;
8553 cliquenonzerosadded += j;
8558 if( !stopped && !(*cutoff) && j < nposbinvars )
8561 int lastfit = j - 2;
8562 assert(lastfit >= i);
8568 while( lastfit >= i && j < nposbinvars )
8571 if(
SCIPisFeasLT(scip, -binvarvals[lastfit] - binvarvals[j], threshold) )
8573 clqvars[lastfit + 1] = binvars[j];
8584 *nchgbds += nbdchgs;
8586 cliquenonzerosadded += (lastfit - i + 2);
8618 for( i = 0; i < nvars; ++i )
8622 else if(
SCIPisEQ(scip, vals[i], +1.0) )
8624 else if(
SCIPisEQ(scip, vals[i], -1.0) )
8633 if( lhsclique || rhsclique )
8638 SCIPdebugMsg(scip,
"linear constraint <%s>: adding clique with %d vars (%d pos, %d neg)\n",
8642 for( i = 0; i < nvars; ++i )
8643 values[i] = (rhsclique == (vals[i] > 0.0));
8650 *nchgbds += nbdchgs;
8669 assert(scip !=
NULL);
8670 assert(cons !=
NULL);
8671 assert(nchgsides !=
NULL);
8674 assert(consdata !=
NULL);
8679 for( i = 0; i < consdata->nvars && integral; ++i )
8686 SCIPdebugMsg(scip,
"linear constraint <%s>: make sides integral: sides=[%.15g,%.15g]\n",
8691 if( !consdata->upgraded )
8697 if( !consdata->upgraded )
8700 SCIPdebugMsg(scip,
"linear constraint <%s>: new integral sides: sides=[%.15g,%.15g]\n",
8771 assert(scip !=
NULL);
8772 assert(cons !=
NULL);
8773 assert(nchgcoefs !=
NULL);
8774 assert(nchgsides !=
NULL);
8777 assert(consdata !=
NULL);
8781 if( (consdata->validmaxabsval && consdata->maxabsval >
MAXVALRECOMP)
8782 || (consdata->validminabsval && consdata->minabsval <
MINVALRECOMP) )
8791 minleftactivity = 0.0;
8792 maxleftactivity = 0.0;
8796 while( i < consdata->nvars )
8798 var = consdata->vars[i];
8803 val = consdata->vals[i];
8811 SCIPisGE(scip, minactivity + val, consdata->lhs) &&
SCIPisLE(scip, maxactivity - val, consdata->rhs) )
8819 lval = consdata->lhs - minactivity;
8820 rval = maxactivity - consdata->rhs;
8823 if( consdata->nvars == 2 )
8826 otherval = consdata->vals[1-i];
8828 if( !
SCIPisInfinity(scip, -consdata->lhs) && consdata->minactivityneginf + consdata->minactivityneginf == 0 )
8830 lval = consdata->lhs - val*lb;
8834 if( !
SCIPisInfinity(scip,consdata->rhs) && consdata->maxactivityneginf + consdata->maxactivityneginf == 0 )
8836 rval = val*ub - consdata->rhs;
8841 newval =
MAX(lval, rval);
8845 newlhs = consdata->lhs - val * lb;
8846 newlhs += newval * lb;
8847 newrhs = consdata->rhs - val * ub;
8848 newrhs += newval * ub;
8852 SCIPdebugMsg(scip,
"linear constraint <%s>: change coefficient %+.15g<%s> to %+.15g<%s>, act=[%.15g,%.15g], side=[%.15g,%.15g]\n",
8854 minactivity, maxactivity, consdata->lhs, consdata->rhs);
8877 assert(
SCIPisEQ(scip, consdata->lhs, newlhs));
8886 assert(
SCIPisEQ(scip, consdata->rhs, newrhs));
8899 minleftactivity += val * lb;
8909 maxleftactivity += val * ub;
8917 SCIPisGE(scip, minactivity - val, consdata->lhs) &&
SCIPisLE(scip, maxactivity + val, consdata->rhs) )
8925 lval = minactivity - consdata->lhs;
8926 rval = consdata->rhs - maxactivity;
8929 if( consdata->nvars == 2 )
8932 otherval = consdata->vals[1-i];
8934 if( !
SCIPisInfinity(scip,-consdata->lhs) && consdata->minactivityneginf + consdata->minactivityneginf == 0 )
8936 lval = val*ub - consdata->lhs;
8940 if( !
SCIPisInfinity(scip,consdata->rhs) && consdata->maxactivityneginf + consdata->maxactivityneginf == 0 )
8942 rval = consdata->rhs - val*lb;
8947 newval =
MIN(lval, rval);
8951 newlhs = consdata->lhs - val * ub;
8952 newlhs += newval * ub;
8953 newrhs = consdata->rhs - val * lb;
8954 newrhs += newval * lb;
8958 SCIPdebugMsg(scip,
"linear constraint <%s>: change coefficient %+.15g<%s> to %+.15g<%s>, act=[%.15g,%.15g], side=[%.15g,%.15g]\n",
8960 minactivity, maxactivity, consdata->lhs, consdata->rhs);
8983 assert(
SCIPisEQ(scip, consdata->lhs, newlhs));
8992 assert(
SCIPisEQ(scip, consdata->rhs, newrhs));
9005 minleftactivity += val * ub;
9015 maxleftactivity += val * lb;
9022 SCIPdebugMsg(scip,
"minleftactivity = %.15g, rhs = %.15g\n",
9023 minleftactivity, consdata->rhs);
9024 SCIPdebugMsg(scip,
"maxleftactivity = %.15g, lhs = %.15g\n",
9025 maxleftactivity, consdata->lhs);
9052 aggrlhs = consdata->lhs - minactivity + minleftactivity;
9053 aggrrhs = consdata->rhs - maxactivity + maxleftactivity;
9071 while( i < consdata->nvars )
9073 var = consdata->vars[i];
9074 minleftactivitypart = 0.0;
9075 maxleftactivitypart = 0.0;
9080 val = consdata->vals[i];
9088 SCIPisLT(scip, minactivity + val, consdata->lhs) ||
SCIPisGT(scip, maxactivity - val, consdata->rhs) )
9090 SCIPdebugMsg(scip,
"minactivity = %g\tval = %g\tlhs = %g\n", minactivity, val, consdata->lhs);
9091 SCIPdebugMsg(scip,
"maxactivity = %g\tval = %g\trhs = %g\n", maxactivity, val, consdata->rhs);
9092 SCIPdebugMsg(scip,
"linear constraint <%s>: remove variable <%s> with coefficient <%g> from constraint since it is redundant\n",
9095 minleftactivitypart = val * lb;
9096 maxleftactivitypart = val * ub;
9115 SCIPisLT(scip, minactivity - val, consdata->lhs) ||
SCIPisGT(scip, maxactivity + val, consdata->rhs) )
9117 SCIPdebugMsg(scip,
"linear constraint <%s>: remove variable <%s> with coefficient <%g> from constraint since it is redundant\n",
9120 minleftactivitypart = val * ub;
9121 maxleftactivitypart = val * lb;
9143 newlhs = consdata->lhs - minleftactivitypart;
9144 newrhs = consdata->rhs - maxleftactivitypart;
9151 assert(
SCIPisEQ(scip, consdata->lhs, newlhs));
9158 assert(
SCIPisEQ(scip, consdata->rhs, newrhs));
9184 assert(scip !=
NULL);
9185 assert(cons !=
NULL);
9187 assert(nfixedvars !=
NULL);
9188 assert(ndelconss !=
NULL);
9191 assert(consdata !=
NULL);
9192 assert(consdata->nvars == 1);
9193 assert(
SCIPisEQ(scip, consdata->lhs, consdata->rhs));
9196 var = consdata->vars[0];
9197 val = consdata->vals[0];
9201 SCIPdebugMsg(scip,
"linear equality <%s>: fix <%s> == %.15g\n",
9217 if( !consdata->upgraded )
9238 assert(scip !=
NULL);
9239 assert(cons !=
NULL);
9240 assert(cutoff !=
NULL);
9241 assert(naggrvars !=
NULL);
9245 assert(consdata !=
NULL);
9246 assert(consdata->nvars == 2);
9247 assert(
SCIPisEQ(scip, consdata->lhs, consdata->rhs));
9249 SCIPdebugMsg(scip,
"linear constraint <%s>: aggregate %.15g<%s> + %.15g<%s> == %.15g\n",
9251 consdata->vals[1],
SCIPvarGetName(consdata->vars[1]), consdata->rhs);
9255 consdata->rhs, &infeasible, &redundant, &aggregated) );
9274 if( !consdata->upgraded )
9295 assert(scip !=
NULL);
9296 assert(consdata !=
NULL);
9297 assert(newlhs !=
NULL);
9298 assert(newrhs !=
NULL);
9304 if( slackcoef > 0.0 )
9309 *newrhs = consdata->rhs - slackcoef * slackvarlb;
9313 *newlhs = consdata->lhs - slackcoef * slackvarub;
9320 *newlhs = consdata->rhs - slackcoef * slackvarlb;
9324 *newrhs = consdata->lhs - slackcoef * slackvarub;
9326 assert(
SCIPisLE(scip, *newlhs, *newrhs));
9329 #define MAXMULTIAGGRQUOTIENT 1e+03 9371 int maxnlocksremove;
9381 assert(scip !=
NULL);
9382 assert(cons !=
NULL);
9383 assert(cutoff !=
NULL);
9384 assert(naggrvars !=
NULL);
9387 assert(consdata !=
NULL);
9388 assert(consdata->nvars > 2);
9389 assert(
SCIPisEQ(scip, consdata->lhs, consdata->rhs));
9398 lhs = consdata->lhs;
9399 rhs = consdata->rhs;
9401 if( consdata->nvars == 3 )
9406 maxnlocksremove = 3;
9408 else if( consdata->nvars == 4 )
9413 maxnlocksremove = 2;
9418 maxnlocksremove = 1;
9437 vars = consdata->vars;
9438 vals = consdata->vals;
9441 bestnlocks = INT_MAX;
9442 bestremovescons =
FALSE;
9443 bestslackdomrng = 0.0;
9444 coefszeroone =
TRUE;
9445 coefsintegral =
TRUE;
9446 varsintegral =
TRUE;
9454 for( v = 0; v < consdata->nvars; ++v )
9464 assert(vars !=
NULL);
9465 assert(vals !=
NULL);
9478 if( absval < minabsval )
9480 if( absval > maxabsval )
9488 coefszeroone = coefszeroone &&
SCIPisEQ(scip, absval, 1.0);
9516 if( nlocks > maxnlocksremove )
9520 if( (iscont || (coefsintegral && varsintegral &&
SCIPisEQ(scip, absval, 1.0))) &&
9534 slackdomrng = (varub - varlb)*absval;
9538 better = (slacktype > bestslacktype) || (bestslackpos == -1);
9539 if( !better && slacktype == bestslacktype )
9541 better = (nlocks < bestnlocks);
9542 if( nlocks == bestnlocks && !bestremovescons )
9544 better =
SCIPisGT(scip, slackdomrng, bestslackdomrng);
9545 equal = !better &&
SCIPisGE(scip, slackdomrng, bestslackdomrng);
9549 if( better || equal )
9563 &minisrelax, &maxisrelax, &isminsettoinfinity, &ismaxsettoinfinity);
9568 if( minisrelax || maxisrelax )
9588 if( conshdlrdata->multaggrremove && !removescons )
9592 if( bestremovescons && !removescons )
9598 if( !removescons && nlocks > maxnlocksstay )
9601 better = better || (!bestremovescons && removescons);
9605 bestslacktype = slacktype;
9606 bestnlocks = nlocks;
9607 bestslackdomrng = slackdomrng;
9608 bestremovescons = removescons;
9628 for( v = 0; v < consdata->nvars; ++v )
9630 if( v != bestslackpos )
9663 assert(!samevar || (supinf > 0 && infinf > 0));
9667 if( (samevar && (supinf > 1 || infinf > 1)) || (!samevar && supinf > 0 && infinf > 0) )
9669 SCIPdebugMsg(scip,
"do not perform multi-aggregation: infimum and supremum are both infinite\n");
9678 if( bestslackpos >= 0
9680 || (coefsintegral && varsintegral && nimplvars == 0)) )
9693 assert(bestslackpos < consdata->nvars);
9702 slackvar = vars[bestslackpos];
9703 slackcoef = vals[bestslackpos];
9705 aggrconst = consdata->rhs/slackcoef;
9708 assert(
SCIPisLE(scip, newlhs, newrhs));
9718 for( v = 0; v < consdata->nvars; ++v )
9720 scalars[v] = -consdata->vals[v]/slackcoef;
9723 SCIPdebugMsgPrint(scip,
" %+.15g, bounds of <%s>: [%.15g,%.15g], nlocks=%d, maxnlocks=%d, removescons=%u\n",
9725 bestnlocks, bestremovescons ? maxnlocksremove : maxnlocksstay, bestremovescons);
9729 &infeasible, &aggregated) );
9746 if( bestremovescons )
9751 if( !consdata->upgraded )
9755 else if( ncontvars == 1 )
9759 assert(0 <= contvarpos && contvarpos < consdata->nvars);
9760 var = vars[contvarpos];
9769 SCIPdebugMsg(scip,
"linear constraint <%s>: converting continuous variable <%s> to implicit integer variable\n",
9790 absval =
REALABS(vals[contvarpos]);
9801 #ifdef SCIP_DEBUG_SOLUTION 9802 if( SCIPdebugIsMainscip(scip) )
9811 SCIPdebugMsg(scip,
"linear constraint <%s>: aggregating continuous variable <%s> to newly created implicit integer variable <%s>, aggregation factor = %g\n",
9819 SCIPdebugMsg(scip,
"infeasible aggregation of variable <%s> to implicit variable <%s>, domain is empty\n",
9839 consdata->boundstightened = 0;
9840 consdata->rangedrowpropagated = 0;
9841 consdata->presolved =
FALSE;
9844 else if( ncontvars == 0 && nimplvars == 0 && nintvars == 1 && !coefszeroone )
9851 assert(varsintegral);
9852 assert(0 <= intvarpos && intvarpos < consdata->nvars);
9853 var = vars[intvarpos];
9861 SCIPdebugMsg(scip,
"linear constraint <%s>: converting integer variable <%s> to implicit integer variable\n",
9895 vars = consdata->vars;
9896 nvars = consdata->nvars;
9898 assert(vars !=
NULL);
9900 for( v = 0; v < nvars; ++v )
9904 assert(var !=
NULL);
9910 assert(var !=
NULL);
9924 val = consdata->vals[v];
9931 (*scale) = val / -objval;
9935 else if(
SCIPisEQ(scip, -objval * (*scale), val) )
9943 (*scale) = val / objval;
9945 else if( !
SCIPisEQ(scip, objval * (*scale), val) )
9971 assert(scip !=
NULL);
9972 assert(cons !=
NULL);
9973 assert(conshdlrdata !=
NULL);
9976 assert(consdata !=
NULL);
9977 assert(
SCIPisEQ(scip, consdata->lhs, consdata->rhs));
9979 nvars = consdata->nvars;
9983 if( nvars > nobjvars || nvars == 0 )
9987 if( (nvars < nobjvars && !conshdlrdata->detectpartialobjective) ||
9988 (nvars == nobjvars && (!conshdlrdata->detectcutoffbound || !conshdlrdata->detectlowerbound)) )
9991 offset = consdata->rhs;
10001 vars = consdata->vars;
10002 assert(vars !=
NULL);
10006 SCIPdebugMsg(scip,
"linear equality constraint <%s> == %g (offset %g) is a subset of the objective function\n",
10010 for( v = 0; v < nvars; ++v )
10039 SCIPdebugMsg(scip,
"update cutoff bound <%g>\n", cutoffbound);
10048 assert(consdata !=
NULL);
10083 assert(scip !=
NULL);
10084 assert(cons !=
NULL);
10085 assert(conshdlrdata !=
NULL);
10088 assert(consdata !=
NULL);
10091 if(
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
10094 nvars = consdata->nvars;
10109 if( nobjvars == 0 )
10122 if( conshdlrdata->detectcutoffbound && rhsfinite )
10126 primalbound = (consdata->rhs - offset) / scale;
10128 SCIPdebugMsg(scip,
"constraint <%s> is parallel to objective function and provides a cutoff bound <%g>\n",
10134 if( conshdlrdata->detectlowerbound && lhsfinite )
10138 lowerbound = (consdata->lhs - offset) / scale;
10140 SCIPdebugMsg(scip,
"constraint <%s> is parallel to objective function and provides a lower bound <%g>\n",
10146 if( (conshdlrdata->detectcutoffbound && (conshdlrdata->detectlowerbound || !lhsfinite)) ||
10147 (conshdlrdata->detectlowerbound && !rhsfinite) )
10156 if( conshdlrdata->detectlowerbound && rhsfinite )
10160 lowerbound = (consdata->rhs - offset) / scale;
10162 SCIPdebugMsg(scip,
"constraint <%s> is parallel to objective function and provides a lower bound <%g>\n",
10168 if( conshdlrdata->detectcutoffbound && lhsfinite )
10172 primalbound = (consdata->lhs - offset) / scale;
10174 SCIPdebugMsg(scip,
"constraint <%s> is parallel to objective function and provides a cutoff bound <%g>\n",
10180 if( (conshdlrdata->detectcutoffbound && (conshdlrdata->detectlowerbound || !rhsfinite)) ||
10181 (conshdlrdata->detectlowerbound && !lhsfinite) )
10207 assert(scip !=
NULL);
10208 assert(cons !=
NULL);
10209 assert(conshdlrdata !=
NULL);
10210 assert(cutoff !=
NULL);
10211 assert(nfixedvars !=
NULL);
10213 assert(ndelconss !=
NULL);
10216 assert(consdata !=
NULL);
10217 assert(consdata->removedfixings);
10220 if( !
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
10224 if( consdata->nvars == 1 )
10229 else if( consdata->nvars == 2 )
10259 assert(scip !=
NULL);
10260 assert(consdata !=
NULL);
10261 assert(0 <= pos && pos < consdata->nvars);
10263 for( v = 0; v < consdata->nvars; ++v )
10286 assert(scip !=
NULL);
10287 assert(minval !=
NULL);
10288 assert(maxval !=
NULL);
10293 *minval = -maxresactivity;
10295 *minval = (side - maxresactivity)/val;
10298 *maxval = -minresactivity;
10300 *maxval = (side - minresactivity)/val;
10305 *minval = minresactivity;
10307 *minval = (side - minresactivity)/val;
10310 *maxval = maxresactivity;
10312 *maxval = (side - maxresactivity)/val;
10339 assert(scip !=
NULL);
10340 assert(cons !=
NULL);
10341 assert(cutoff !=
NULL);
10342 assert(nfixedvars !=
NULL);
10343 assert(naggrvars !=
NULL);
10344 assert(ndelconss !=
NULL);
10354 assert(consdata !=
NULL);
10377 if( consdata->nvars <= 2 )
10378 maxotherlocks = INT_MAX;
10379 else if( consdata->nvars == 3 )
10381 else if( consdata->nvars == 4 )
10387 if( lhsexists && rhsexists && maxotherlocks < INT_MAX )
10390 for( i = 0; i < consdata->nvars && bestisint; ++i )
10401 var = consdata->vars[i];
10405 if( bestpos >= 0 && isint )
10417 val = consdata->vals[i];
10454 if( agglhs || aggrhs )
10467 &minisrelax, &maxisrelax, &isminsettoinfinity, &ismaxsettoinfinity);
10468 assert(
SCIPisLE(scip, minresactivity, maxresactivity));
10474 assert((!minisrelax || isminsettoinfinity) && (!maxisrelax || ismaxsettoinfinity));
10481 assert(
SCIPisLE(scip, minval, maxval));
10489 recalculated =
FALSE;
10490 oldmaxresactivity = maxresactivity;
10491 oldminresactivity = minresactivity;
10497 recalculated = !
SCIPisEQ(scip, oldminresactivity, minresactivity);
10498 isminsettoinfinity =
TRUE;
10505 recalculated = recalculated || !
SCIPisEQ(scip, oldmaxresactivity, maxresactivity);
10506 ismaxsettoinfinity =
TRUE;
10512 assert(
SCIPisLE(scip, minresactivity, maxresactivity));
10517 assert(
SCIPisLE(scip, minval, maxval));
10541 assert(
SCIPisLE(scip,minval,maxval));
10549 recalculated =
FALSE;
10550 oldmaxresactivity = maxresactivity;
10551 oldminresactivity = minresactivity;
10557 recalculated = !
SCIPisEQ(scip, oldminresactivity, minresactivity);
10564 recalculated = recalculated || !
SCIPisEQ(scip, oldmaxresactivity, maxresactivity);
10572 assert(
SCIPisLE(scip,minval,maxval));
10612 assert(!bestislhs || lhsexists);
10613 assert(bestislhs || rhsexists);
10615 bestvar = consdata->vars[bestpos];
10616 bestval = consdata->vals[bestpos];
10617 assert(bestisint ==
10633 for( j = 0; j < consdata->nvars; ++j )
10639 aggrvars[naggrs] = consdata->vars[j];
10640 aggrcoefs[naggrs] = -consdata->vals[j]/consdata->vals[bestpos];
10643 absaggrcoef =
REALABS(aggrcoefs[naggrs]);
10646 if( absaggrcoef < epsilon )
10648 SCIPdebugMsg(scip,
"do not perform multi-aggregation: too large aggregation coefficients\n");
10661 aggrcoefs[naggrs] =
SCIPfloor(scip, aggrcoefs[naggrs]+0.5);
10696 assert(!samevar || (supinf > 0 && infinf > 0));
10698 aggrconst = (bestislhs ? consdata->lhs/bestval : consdata->rhs/bestval);
10701 assert(naggrs == consdata->nvars-1);
10707 aggrconst =
SCIPfloor(scip, aggrconst+0.5);
10710 aggregated =
FALSE;
10711 infeasible =
FALSE;
10714 if( (samevar && supinf == 1 && infinf == 1) || (!samevar && (supinf == 0 || infinf == 0)) )
10725 SCIPdebugMsg(scip,
"do not perform multi-aggregation: infimum and supremum are both infinite\n");
10744 if( !consdata->upgraded )
10757 #define BINWEIGHT 1 10758 #define INTWEIGHT 4 10759 #define CONTWEIGHT 8 10808 assert( scip !=
NULL );
10809 assert( cons !=
NULL );
10812 assert( consdata !=
NULL );
10839 lhs = consdata->lhs;
10840 vars = consdata->vars;
10841 vals = consdata->vals;
10842 nvars = consdata->nvars;
10851 for( v = 0; v < nvars && noddvars < 3; ++v )
10866 if( noddvars == 0 )
10878 if( noddvars == 1 )
10880 assert( var1 !=
NULL );
10882 SCIPdebugMsg(scip,
"linear constraint <%s>: try fixing variable <%s> to <%g>\n",
10902 else if( noddvars == 2 )
10904 assert( var1 !=
NULL );
10905 assert( var2 !=
NULL );
10911 SCIPdebugMsg(scip,
"linear constraint <%s>: try aggregation of variables <%s> and <%s>\n",
10915 lhsodd ? 1.0 : 0.0, &infeasible, &redundant, &aggregated) );
10969 assert(consdata !=
NULL);
10970 assert(0 <= ind1 && ind1 < consdata->nvars);
10971 assert(0 <= ind2 && ind2 < consdata->nvars);
10979 if( vartype2 != vartype1 )
10989 value =
REALABS(consdata->vals[ind2]) -
REALABS(consdata->vals[ind1]);
10992 return (value > 0 ? +1 : (value < 0 ? -1 : 0));
11028 assert(consdata !=
NULL);
11030 nvars = consdata->nvars;
11036 vals = consdata->vals;
11037 vars = consdata->vars;
11038 assert(vars !=
NULL);
11039 assert(vals !=
NULL);
11041 lhs = consdata->lhs;
11042 rhs = consdata->rhs;
11050 for( v = nvars - 1; v >= 0; --v )
11056 secondminval = minval;
11059 else if( secondminval > vals[v] || secondminval ==
SCIP_INVALID )
11060 secondminval = vals[v];
11079 for( v = nvars - 1; v >= 0; --v )
11083 (*nchgcoefs) += nvars;
11158 assert(scip !=
NULL);
11159 assert(cons !=
NULL);
11160 assert(nchgcoefs !=
NULL);
11161 assert(nchgsides !=
NULL);
11171 assert(consdata !=
NULL);
11173 nvars = consdata->nvars;
11197 consdata->normalized =
FALSE;
11201 assert(nvars == consdata->nvars);
11203 if( !consdata->normalized )
11206 lhs = consdata->lhs;
11207 rhs = consdata->rhs;
11221 SCIPdebug( oldnchgcoefs = *nchgcoefs; )
11222 SCIPdebug( oldnchgsides = *nchgsides; )
11225 if( haslhs && hasrhs )
11231 assert(haslhs != hasrhs);
11243 SCIPsort(perm, consdataCompSim, (
void*)consdata, nvars);
11247 consdata->sorted =
FALSE;
11248 consdata->binvarssorted =
FALSE;
11250 vars = consdata->vars;
11251 vals = consdata->vals;
11252 assert(vars !=
NULL);
11253 assert(vals !=
NULL);
11269 SCIPdebugMsg(scip,
"starting simplification of coefficients\n");
11274 &isminrelax, &ismaxrelax, &isminsettoinfinity, &ismaxsettoinfinity);
11277 if( isminsettoinfinity || ismaxsettoinfinity )
11280 assert(!isminrelax);
11281 assert(!ismaxrelax);
11282 assert(maxactsub > minactsub);
11288 side = haslhs ? lhs : rhs;
11318 while( v < nvars &&
SCIPisEQ(scip, side, vals[v]) )
11342 if(
SCIPisEQ(scip, side, -vals[v]) )
11357 for( w = 0; w < v; ++w )
11362 assert(vals[w] > 0);
11365 maxactsub -= ub * vals[w];
11366 minactsub -= lb * vals[w];
11367 assert(maxactsub > minactsub);
11395 maxactsub -= ub * vals[0];
11396 minactsub -= lb * vals[0];
11400 maxactsub -= lb * vals[0];
11401 minactsub -= ub * vals[0];
11403 assert(maxactsub > minactsub);
11408 allcoefintegral =
TRUE;
11411 for( ; v < nvars - 1; ++v )
11418 allcoefintegral =
FALSE;
11437 maxactsub -= ub * vals[v];
11438 minactsub -= lb * vals[v];
11442 maxactsub -= lb * vals[v];
11443 minactsub -= ub * vals[v];
11445 assert(
SCIPisGE(scip, maxactsub, minactsub));
11461 if( (offsetv == -1 && hasrhs && maxactsub <= siderest &&
SCIPisFeasGT(scip, minactsub, siderest - gcd)) || (haslhs &&
SCIPisFeasLT(scip, maxactsub, siderest) && minactsub >= siderest - gcd) )
11467 assert(v < nvars || (offsetv >= 0 && gcd > 1));
11487 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",
11488 v, nvars, minactsub, maxactsub, redundant, hasrhs, siderest, gcd, offsetv);
11491 if( v < nvars && (redundant ||
11492 (offsetv == -1 && hasrhs && maxactsub <= siderest &&
SCIPisFeasGT(scip, minactsub, siderest - gcd)) ||
11493 (haslhs &&
SCIPisFeasLT(scip, maxactsub, siderest) && minactsub >= siderest - gcd)) )
11503 for( w = v; w < nvars; ++w )
11514 tmpmaxactsub += ub * vals[w];
11515 tmpminactsub += lb * vals[w];
11519 tmpmaxactsub += lb * vals[w];
11520 tmpminactsub += ub * vals[w];
11522 assert(tmpmaxactsub >= tmpminactsub);
11527 assert(offsetv == -1);
11541 assert((hasrhs &&
SCIPisLE(scip, tmpmaxactsub, siderest) && tmpminactsub > siderest - gcd) || (haslhs && tmpmaxactsub < siderest &&
SCIPisGE(scip, tmpminactsub, siderest - gcd)));
11544 SCIPdebugMsg(scip,
"removing %d last variables from constraint <%s>, because they never change anything on the feasibility of this constraint\n",
11548 for( w = nvars - 1; w >= v; --w )
11552 (*nchgcoefs) += (nvars - v);
11560 assert(vars == consdata->vars);
11561 assert(vals == consdata->vals);
11562 assert(w < consdata->nvars);
11565 gcd = (
SCIP_Longint)(gcd / (oldcoef/vals[w]) + feastol);
11573 rhs = consdata->rhs;
11580 lhs = consdata->lhs;
11583 assert(offsetv == -1 ||
SCIPisEQ(scip, vals[offsetv], consdata->lhs));
11591 nvars = consdata->nvars;
11592 assert(nvars >= 2);
11594 allcoefintegral =
TRUE;
11598 for( w = offsetv + 1; w < nvars; ++w )
11607 if( offsetv >= 0 && gcd == 1 )
11617 for( v = nvars - 1; v > offsetv; --v )
11625 allcoefintegral =
FALSE;
11651 if( candpos == -1 )
11661 assert(v > offsetv || candpos > offsetv);
11667 candpos = nvars - 1;
11670 if( gcd > 1 && allcoefintegral && !redundant )
11673 allcoefintegral =
FALSE;
11677 if( offsetv >= 0 && gcd > 1 && allcoefintegral )
11679 assert(offsetv + 1 < nvars);
11680 assert(0 <= candpos && candpos < nvars);
11688 for( w = offsetv + 1; w < nvars; ++w )
11703 assert(rest < gcd);
11706 restcoef = ((
SCIP_Longint)(vals[candpos] + feastol)) % gcd;
11707 assert(restcoef >= 1);
11708 assert(restcoef < gcd);
11713 if( restcoef > rest )
11714 newcoef = vals[candpos] - restcoef + gcd;
11716 newcoef = vals[candpos] - restcoef;
11721 if( rest == 0 || restcoef < rest )
11722 newcoef = vals[candpos] - restcoef;
11724 newcoef = vals[candpos] - restcoef + gcd;
11735 notchangable =
TRUE;
11776 for( w = offsetv; w >= 0; --w )
11778 assert(vals[w] > 0);
11782 (*nchgcoefs) += (offsetv + 1);
11785 if( !notchangable )
11789 assert(vars == consdata->vars);
11790 assert(vals == consdata->vals);
11793 nvars = consdata->nvars;
11794 assert(nvars >= 2);
11798 lhs = consdata->lhs;
11799 rhs = consdata->rhs;
11813 allcoefintegral =
TRUE;
11815 for( v = nvars - 1; v >= 0; --v )
11820 allcoefintegral =
FALSE;
11837 if( allcoefintegral )
11848 for( v = nvars - 1; v >= 0; --v )
11871 frac += (val -
SCIPfloor(scip, val)) * ub;
11878 if(
SCIPisGT(scip, frac, siderest) )
11884 SCIPdebugMsg(scip,
"rounding all non-integral coefficients and the right hand side down\n");
11889 for( v = nvars - 1; v >= 0; --v )
11926 if( allcoefintegral )
11941 for( v = nvars - 1; v >= 0; --v )
11972 frac += (val -
SCIPfloor(scip, val)) * ub;
11980 if(
SCIPisGE(scip, frac, 1 + siderest) )
11989 SCIPdebugMsg(scip,
"rounding all non-integral coefficients and the left hand side down\n");
11994 for( v = nvars - 1; v >= 0; --v )
12032 assert(vars == consdata->vars);
12033 assert(vals == consdata->vals);
12035 rhs = consdata->rhs;
12036 lhs = consdata->lhs;
12043 nvars = consdata->nvars;
12047 allcoefintegral =
TRUE;
12050 for( v = nvars - 1; v >= 0; --v )
12057 if( !allcoefintegral )
12072 assert(nvars >= 2);
12077 SCIPdebug( oldnchgcoefs = *nchgcoefs; )
12078 SCIPdebug( oldnchgsides = *nchgsides; )
12091 for( v = nvars - 1; v >= 0; --v )
12098 if( foundbin == -1 )
12121 foundbin = nvars - 1;
12124 if( gcd == 1 || foundbin == -1)
12127 assert((onlybin && gcd == -1) || (!onlybin && gcd > 1));
12135 for( v = foundbin; v >= 0; --v )
12161 if( candpos == -1 )
12169 if( onlybin && v == foundbin - 1 )
12170 candpos2 = foundbin;
12175 if( onlybin && candpos == v + 1 && candpos2 == v + 2 )
12177 assert(candpos2 == nvars - 1);
12180 candpos = candpos2;
12203 assert(candpos >= 0 && candpos < nvars);
12220 assert(rest < gcd);
12223 if( vals[candpos] < 0 )
12225 restcoef = ((
SCIP_Longint)(vals[candpos] - feastol)) % gcd;
12226 assert(restcoef <= -1);
12230 restcoef = ((
SCIP_Longint)(vals[candpos] + feastol)) % gcd;
12231 assert(restcoef >= 1);
12232 assert(restcoef < gcd);
12244 if( restcoef > rest )
12245 newcoef = vals[candpos] - restcoef + gcd;
12247 newcoef = vals[candpos] - restcoef;
12259 if( rest == 0 || restcoef < rest )
12260 newcoef = vals[candpos] - restcoef;
12262 newcoef = vals[candpos] - restcoef + gcd;
12266 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));
12282 assert(vars == consdata->vars);
12283 assert(vals == consdata->vals);
12287 rhs = consdata->rhs;
12288 lhs = consdata->lhs;
12292 nvars = consdata->nvars;
12294 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));
12296 while( nvars >= 2 );
12316 int* diffidx0minus1,
12317 int* diffidx1minus0,
12319 int commonidxweight,
12320 int diffidx0minus1weight,
12321 int diffidx1minus0weight,
12344 assert(scip !=
NULL);
12345 assert(cons0 !=
NULL);
12346 assert(cons1 !=
NULL);
12347 assert(commonidx0 !=
NULL);
12348 assert(commonidx1 !=
NULL);
12349 assert(diffidx0minus1 !=
NULL);
12350 assert(diffidx1minus0 !=
NULL);
12351 assert(nvarscommon >= 1);
12352 assert(commonidxweight >= nvarscommon);
12353 assert(nchgcoefs !=
NULL);
12354 assert(aggregated !=
NULL);
12363 assert(consdata0 !=
NULL);
12364 assert(consdata0->nvars >= 1);
12365 assert(
SCIPisLE(scip, consdata0->lhs, consdata0->rhs));
12366 assert(diffidx0minus1weight >= consdata0->nvars - nvarscommon);
12370 assert(consdata1 !=
NULL);
12371 assert(consdata1->nvars >= 1);
12372 assert(
SCIPisEQ(scip, consdata1->lhs, consdata1->rhs));
12373 assert(diffidx1minus0weight >= consdata1->nvars - nvarscommon);
12375 *aggregated =
FALSE;
12381 bestvarweight = commonidxweight + diffidx0minus1weight;
12382 bestnvars = consdata0->nvars;
12384 bestscalarsum = 0.0;
12385 commonvarlindependent =
TRUE;
12386 for( v = 0; v < nvarscommon; ++v )
12388 assert(consdata0->vars[commonidx0[v]] == consdata1->vars[commonidx1[v]]);
12389 a = consdata1->vals[commonidx1[v]];
12390 b = -consdata0->vals[commonidx0[v]];
12396 varweight = diffidx0minus1weight + diffidx1minus0weight;
12397 nvars = consdata0->nvars + consdata1->nvars - 2*nvarscommon;
12399 betterscalarsum = (scalarsum < bestscalarsum);
12400 for( i = 0; i < nvarscommon
12401 && (varweight < bestvarweight || (varweight == bestvarweight && betterscalarsum)); ++i )
12403 aggrcoef = a * consdata0->vals[commonidx0[i]] + b * consdata1->vals[commonidx1[i]];
12406 varweight +=
getVarWeight(consdata0->vars[commonidx0[i]]);
12410 if( varweight < bestvarweight || (varweight == bestvarweight && betterscalarsum) )
12413 bestvarweight = varweight;
12415 bestscalarsum = scalarsum;
12422 if( commonvarlindependent && v > 0 )
12423 commonvarlindependent =
SCIPisEQ(scip,
12424 consdata1->vals[commonidx1[v]] * consdata0->vals[commonidx0[0]],
12425 consdata1->vals[commonidx1[0]] * consdata0->vals[commonidx0[v]]);
12442 if( consdata1->vals[commonidx1[bestv]] > 0.0 )
12444 a = consdata1->vals[commonidx1[bestv]];
12445 b = -consdata0->vals[commonidx0[bestv]];
12449 a = -consdata1->vals[commonidx1[bestv]];
12450 b = consdata0->vals[commonidx0[bestv]];
12459 assert(commonvarlindependent);
12460 if( consdata1->vals[commonidx1[0]] > 0.0 )
12462 a = consdata1->vals[commonidx1[0]];
12463 b = -consdata0->vals[commonidx0[0]];
12467 a = -consdata1->vals[commonidx1[0]];
12468 b = consdata0->vals[commonidx0[0]];
12489 SCIPdebug( bestvarweight = diffidx0minus1weight + diffidx1minus0weight; )
12490 bestnvars = consdata0->nvars + consdata1->nvars - 2*nvarscommon;
12493 SCIPdebugMsg(scip,
"aggregate linear constraints <%s> := %.15g*<%s> + %.15g*<%s> -> nvars: %d -> %d, weight: %d -> %d\n",
12495 consdata0->nvars, bestnvars, commonidxweight + diffidx0minus1weight, bestvarweight);
12505 if( !commonvarlindependent )
12507 for( i = 0; i < nvarscommon; ++i )
12509 assert(0 <= commonidx0[i] && commonidx0[i] < consdata0->nvars);
12510 assert(0 <= commonidx1[i] && commonidx1[i] < consdata1->nvars);
12512 aggrcoef = a * consdata0->vals[commonidx0[i]] + b * consdata1->vals[commonidx1[i]];
12515 assert(newnvars < bestnvars);
12516 newvars[newnvars] = consdata0->vars[commonidx0[i]];
12517 newvals[newnvars] = aggrcoef;
12526 for( i = 0; i < nvarscommon; ++i )
12528 assert(0 <= commonidx0[i] && commonidx0[i] < consdata0->nvars);
12529 assert(0 <= commonidx1[i] && commonidx1[i] < consdata1->nvars);
12531 aggrcoef = a * consdata0->vals[commonidx0[i]] + b * consdata1->vals[commonidx1[i]];
12538 for( i = 0; i < consdata0->nvars - nvarscommon; ++i )
12540 assert(0 <= diffidx0minus1[i] && diffidx0minus1[i] < consdata0->nvars);
12542 aggrcoef = a * consdata0->vals[diffidx0minus1[i]];
12544 assert(newnvars < bestnvars);
12545 newvars[newnvars] = consdata0->vars[diffidx0minus1[i]];
12546 newvals[newnvars] = aggrcoef;
12551 for( i = 0; i < consdata1->nvars - nvarscommon; ++i )
12553 assert(0 <= diffidx1minus0[i] && diffidx1minus0[i] < consdata1->nvars);
12555 aggrcoef = b * consdata1->vals[diffidx1minus0[i]];
12557 assert(newnvars < bestnvars);
12558 newvars[newnvars] = consdata1->vars[diffidx1minus0[i]];
12559 newvals[newnvars] = aggrcoef;
12562 assert(newnvars == bestnvars);
12570 newlhs = a * consdata0->lhs + b * consdata1->lhs;
12574 newrhs = a * consdata0->rhs + b * consdata1->rhs;
12584 assert(newconsdata !=
NULL);
12587 newconsdata->upgraded = consdata0->upgraded;
12601 if( !consdata0->upgraded )
12602 (*nchgcoefs) += consdata0->nvars + consdata1->nvars - nvarscommon;
12603 *aggregated =
TRUE;
12642 assert(key1 !=
NULL);
12643 assert(key2 !=
NULL);
12646 assert(consdata1->sorted);
12647 assert(consdata2->sorted);
12649 scip = (
SCIP*)userptr;
12653 if( consdata1->nvars != consdata2->nvars )
12657 coefsnegated =
TRUE;
12659 for( i = 0; i < consdata1->nvars && (coefsequal || coefsnegated); ++i )
12665 if( consdata1->vars[i] != consdata2->vars[i] )
12667 assert(
SCIPvarCompare(consdata1->vars[i], consdata2->vars[i]) == 1 ||
12669 coefsequal =
FALSE;
12670 coefsnegated =
FALSE;
12673 assert(
SCIPvarCompare(consdata1->vars[i], consdata2->vars[i]) == 0);
12676 val1 = consdata1->vals[i];
12677 val2 = consdata2->vals[i];
12678 coefsequal = coefsequal &&
SCIPisEQ(scip, val1, val2);
12679 coefsnegated = coefsnegated &&
SCIPisEQ(scip, val1, -val2);
12682 return (coefsequal || coefsnegated);
12696 scip = (
SCIP*)userptr;
12697 assert(scip !=
NULL);
12700 assert(key !=
NULL);
12702 assert(consdata !=
NULL);
12703 assert(consdata->nvars > 0);
12705 assert(consdata->sorted);
12710 assert(minidx >= 0 && minidx <= maxidx);
12738 assert(scip !=
NULL);
12739 assert(blkmem !=
NULL);
12741 assert(firstchange !=
NULL);
12742 assert(cutoff !=
NULL);
12743 assert(ndelconss !=
NULL);
12744 assert(nchgsides !=
NULL);
12747 hashtablesize = nconss;
12750 hashGetKeyLinearcons, hashKeyEqLinearcons, hashKeyValLinearcons, (
void*) scip) );
12753 for( c = 0; c < nconss; ++c )
12770 assert(consdata0 !=
NULL);
12772 assert(consdata0->sorted);
12778 if( cons1 !=
NULL )
12797 assert(consdata1 !=
NULL);
12798 assert(consdata0->nvars >= 1 && consdata0->nvars == consdata1->nvars);
12800 assert(consdata1->sorted);
12801 assert(consdata0->vars[0] == consdata1->vars[0]);
12803 if(
SCIPisEQ(scip, consdata0->vals[0], consdata1->vals[0]) )
12806 assert(consdata0->nvars < 2 ||
SCIPisEQ(scip, consdata0->vals[1], consdata1->vals[1]));
12807 SCIPdebugMsg(scip,
"aggregate linear constraints <%s> and <%s> with equal coefficients into single ranged row\n",
12812 lhs =
MAX(consdata1->lhs, consdata0->lhs);
12813 rhs =
MIN(consdata1->rhs, consdata0->rhs);
12818 assert(
SCIPisEQ(scip, consdata0->vals[0], -(consdata1->vals[0])));
12819 assert(consdata0->nvars < 2 ||
SCIPisEQ(scip, consdata0->vals[1], -(consdata1->vals[1])));
12820 SCIPdebugMsg(scip,
"aggregate linear constraints <%s> and <%s> with negated coefficients into single ranged row\n",
12825 lhs =
MAX(consdata1->lhs, -consdata0->rhs);
12826 rhs =
MIN(consdata1->rhs, -consdata0->lhs);
12839 rhs = (lhs + rhs)/2;
12845 if( consdata1->upgraded && !consdata0->upgraded )
12848 if( !
SCIPisEQ(scip, consdata0->vals[0], consdata1->vals[0]) )
12856 consdatastay = consdata0;
12858 consdatadel = consdata1;
12867 consdatastay = consdata1;
12869 consdatadel = consdata0;
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);
17919 if( consdata->row !=
NULL )
17933 assert(cons !=
NULL);
17945 if( consdata->row !=
NULL )
17961 assert(cons !=
NULL);
17973 return consdata->row;
18011 assert(scip !=
NULL);
18012 assert(cons !=
NULL);
18013 assert(upgdcons !=
NULL);
18035 assert(conshdlrdata !=
NULL);
18037 assert(consdata !=
NULL);
18040 if( consdata->upgraded )
18044 if( consdata->row !=
NULL )
18048 SCIPerrorMessage(
"cannot upgrade linear constraint that is already stored as row in the LP\n");
18085 for( i = 0; i < consdata->nvars; ++i )
18087 var = consdata->vars[i];
18088 val = consdata->vals[i];
18139 else if(
SCIPisEQ(scip, val, -1.0) )
18156 poscoeffsum += val;
18158 negcoeffsum += val;
18166 SCIPdebugMsg(scip,
"upgrading linear constraint <%s> (%d upgrade methods):\n",
18168 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",
18169 nposbin, nnegbin, nposint, nnegint, nposimpl, nnegimpl, nposcont, nnegcont,
18170 ncoeffspone, ncoeffsnone, ncoeffspint, ncoeffsnint, ncoeffspfrac, ncoeffsnfrac,
18171 poscoeffsum, negcoeffsum, integral);
18174 for( i = 0; i < conshdlrdata->nlinconsupgrades && *upgdcons ==
NULL; ++i )
18176 if( conshdlrdata->linconsupgrades[i]->active )
18178 SCIP_CALL( conshdlrdata->linconsupgrades[i]->linconsupgd(scip, cons, consdata->nvars,
18179 consdata->vars, consdata->vals, consdata->lhs, consdata->rhs,
18180 nposbin, nnegbin, nposint, nnegint, nposimpl, nnegimpl, nposimplbin, nnegimplbin, nposcont, nnegcont,
18181 ncoeffspone, ncoeffsnone, ncoeffspint, ncoeffsnint, ncoeffspfrac, ncoeffsnfrac,
18182 poscoeffsum, negcoeffsum, integral,
18188 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)
#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)
#define SCIPcombineFourInt(a, b, c, d)
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)))
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)
#define SCIPrealHashCode(x, n)
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)