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 MAXVALRECOMP 1e+06 136 #define MINVALRECOMP 1e-05 139 #define QUADCONSUPGD_PRIORITY 1000000 140 #define NONLINCONSUPGD_PRIORITY 1000000 172 uint64_t possignature;
173 uint64_t negsignature;
178 int minactivityneginf;
179 int minactivityposinf;
180 int maxactivityneginf;
181 int maxactivityposinf;
182 int minactivityneghuge;
183 int minactivityposhuge;
184 int maxactivityneghuge;
185 int maxactivityposhuge;
186 int glbminactivityneginf;
187 int glbminactivityposinf;
188 int glbmaxactivityneginf;
189 int glbmaxactivityposinf;
190 int glbminactivityneghuge;
191 int glbminactivityposhuge;
192 int glbmaxactivityneghuge;
193 int glbmaxactivityposhuge;
199 unsigned int boundstightened:2;
200 unsigned int rangedrowpropagated:2;
202 unsigned int validmaxabsval:1;
203 unsigned int validminabsval:1;
204 unsigned int validactivities:1;
205 unsigned int validminact:1;
206 unsigned int validmaxact:1;
207 unsigned int validglbminact:1;
208 unsigned int validglbmaxact:1;
209 unsigned int presolved:1;
210 unsigned int removedfixings:1;
211 unsigned int validsignature:1;
212 unsigned int changed:1;
213 unsigned int normalized:1;
214 unsigned int upgradetried:1;
215 unsigned int upgraded:1;
216 unsigned int sorted:1;
217 unsigned int merged:1;
218 unsigned int cliquesadded:1;
219 unsigned int implsadded:1;
220 unsigned int binvarssorted:1;
221 unsigned int varsdeleted:1;
222 unsigned int hascontvar:1;
223 unsigned int hasnonbinvar:1;
224 unsigned int hasnonbinvalid:1;
225 unsigned int checkabsolute:1;
229 struct SCIP_EventData
237 struct SCIP_ConshdlrData
248 int linconsupgradessize;
249 int nlinconsupgrades;
250 int tightenboundsfreq;
282 int rangedrowmaxdepth;
320 unsigned int proprule:8;
336 inferinfo.val.asint = i;
347 return inferinfo.val.asint;
356 return (
int) inferinfo.val.asbits.proprule;
365 return (
int) inferinfo.val.asbits.pos;
379 assert(pos < (1<<24));
381 inferinfo.val.asbits.proprule = (
unsigned int) proprule;
382 inferinfo.val.asbits.pos = (
unsigned int) pos;
410 assert(scip != NULL);
411 assert(conshdlrdata != NULL);
412 assert(conshdlrdata->nlinconsupgrades <= conshdlrdata->linconsupgradessize);
414 if( num > conshdlrdata->linconsupgradessize )
420 conshdlrdata->linconsupgradessize = newsize;
422 assert(num <= conshdlrdata->linconsupgradessize);
435 assert(scip != NULL);
436 assert(consdata != NULL);
437 assert(consdata->nvars <= consdata->varssize);
439 if( num > consdata->varssize )
446 if( consdata->eventdata != NULL )
450 consdata->varssize = newsize;
452 assert(num <= consdata->varssize);
471 assert(scip != NULL);
472 assert(linconsupgrade != NULL);
473 assert(linconsupgd != NULL);
476 (*linconsupgrade)->linconsupgd = linconsupgd;
477 (*linconsupgrade)->priority = priority;
478 (*linconsupgrade)->active =
TRUE;
490 assert(scip != NULL);
491 assert(linconsupgrade != NULL);
492 assert(*linconsupgrade != NULL);
505 assert(scip != NULL);
506 assert(conshdlrdata != NULL);
507 assert(eventhdlr != NULL);
510 (*conshdlrdata)->linconsupgrades = NULL;
511 (*conshdlrdata)->linconsupgradessize = 0;
512 (*conshdlrdata)->nlinconsupgrades = 0;
513 (*conshdlrdata)->naddconss = 0;
516 (*conshdlrdata)->eventhdlr = eventhdlr;
530 assert(scip != NULL);
531 assert(conshdlrdata != NULL);
532 assert(*conshdlrdata != NULL);
534 for( i = 0; i < (*conshdlrdata)->nlinconsupgrades; ++i )
549 const char* conshdlrname
554 assert(scip != NULL);
555 assert(conshdlrdata != NULL);
556 assert(linconsupgd != NULL);
557 assert(conshdlrname != NULL);
559 for( i = conshdlrdata->nlinconsupgrades - 1; i >= 0; --i )
561 if( conshdlrdata->linconsupgrades[i]->linconsupgd == linconsupgd )
564 SCIPwarningMessage(scip,
"Try to add already known upgrade message %p for constraint handler %s.\n", linconsupgd, conshdlrname);
583 assert(scip != NULL);
584 assert(conshdlrdata != NULL);
585 assert(linconsupgrade != NULL);
589 for( i = conshdlrdata->nlinconsupgrades;
590 i > 0 && conshdlrdata->linconsupgrades[i-1]->priority < linconsupgrade->
priority; --i )
592 conshdlrdata->linconsupgrades[i] = conshdlrdata->linconsupgrades[i-1];
594 assert(0 <= i && i <= conshdlrdata->nlinconsupgrades);
595 conshdlrdata->linconsupgrades[i] = linconsupgrade;
596 conshdlrdata->nlinconsupgrades++;
616 assert(scip != NULL);
617 assert(cons != NULL);
621 assert(consdata != NULL);
649 assert(scip != NULL);
650 assert(cons != NULL);
654 assert(consdata != NULL);
682 assert(scip != NULL);
683 assert(cons != NULL);
684 assert(eventhdlr != NULL);
687 assert(consdata != NULL);
689 assert(0 <= pos && pos < consdata->nvars);
690 assert(consdata->vars != NULL);
691 assert(consdata->vars[pos] != NULL);
693 assert(consdata->eventdata != NULL);
694 assert(consdata->eventdata[pos] == NULL);
697 consdata->eventdata[pos]->cons = cons;
698 consdata->eventdata[pos]->varpos = pos;
703 eventhdlr, consdata->eventdata[pos], &consdata->eventdata[pos]->filterpos) );
719 assert(scip != NULL);
720 assert(cons != NULL);
721 assert(eventhdlr != NULL);
724 assert(consdata != NULL);
726 assert(0 <= pos && pos < consdata->nvars);
727 assert(consdata->vars[pos] != NULL);
728 assert(consdata->eventdata != NULL);
729 assert(consdata->eventdata[pos] != NULL);
730 assert(consdata->eventdata[pos]->cons == cons);
731 assert(consdata->eventdata[pos]->varpos == pos);
736 eventhdlr, consdata->eventdata[pos], consdata->eventdata[pos]->filterpos) );
754 assert(scip != NULL);
755 assert(cons != NULL);
758 assert(consdata != NULL);
759 assert(consdata->eventdata == NULL);
763 assert(consdata->eventdata != NULL);
767 for( i = 0; i < consdata->nvars; ++i )
786 assert(scip != NULL);
787 assert(cons != NULL);
790 assert(consdata != NULL);
791 assert(consdata->eventdata != NULL);
794 for( i = consdata->nvars - 1; i >= 0; --i )
801 assert(consdata->eventdata == NULL);
821 assert(scip != NULL);
822 assert(consdata != NULL);
823 assert(nvars == 0 || vars != NULL);
824 assert(nvars == 0 || vals != NULL);
838 SCIPwarningMessage(scip,
"left hand side of linear constraint greater than right hand side\n");
844 (*consdata)->varssize = 0;
845 (*consdata)->nvars = nvars;
846 (*consdata)->hascontvar =
FALSE;
847 (*consdata)->hasnonbinvar =
FALSE;
848 (*consdata)->hasnonbinvalid =
TRUE;
849 (*consdata)->vars = NULL;
850 (*consdata)->vals = NULL;
866 for( v = 0; v < nvars; ++v )
889 if( !(*consdata)->hascontvar )
895 (*consdata)->hasnonbinvar =
TRUE;
898 (*consdata)->hascontvar =
TRUE;
904 (*consdata)->nvars = k;
911 (*consdata)->varssize = k;
918 (*consdata)->eventdata = NULL;
930 (*consdata)->row = NULL;
931 (*consdata)->lhs = lhs;
932 (*consdata)->rhs = rhs;
940 (*consdata)->maxactdeltavar = NULL;
941 (*consdata)->minactivityneginf = -1;
942 (*consdata)->minactivityposinf = -1;
943 (*consdata)->maxactivityneginf = -1;
944 (*consdata)->maxactivityposinf = -1;
945 (*consdata)->minactivityneghuge = -1;
946 (*consdata)->minactivityposhuge = -1;
947 (*consdata)->maxactivityneghuge = -1;
948 (*consdata)->maxactivityposhuge = -1;
953 (*consdata)->glbminactivityneginf = -1;
954 (*consdata)->glbminactivityposinf = -1;
955 (*consdata)->glbmaxactivityneginf = -1;
956 (*consdata)->glbmaxactivityposinf = -1;
957 (*consdata)->glbminactivityneghuge = -1;
958 (*consdata)->glbminactivityposhuge = -1;
959 (*consdata)->glbmaxactivityneghuge = -1;
960 (*consdata)->glbmaxactivityposhuge = -1;
961 (*consdata)->possignature = 0;
962 (*consdata)->negsignature = 0;
963 (*consdata)->validmaxabsval =
FALSE;
964 (*consdata)->validminabsval =
FALSE;
965 (*consdata)->validactivities =
FALSE;
966 (*consdata)->validminact =
FALSE;
967 (*consdata)->validmaxact =
FALSE;
968 (*consdata)->validglbminact =
FALSE;
969 (*consdata)->validglbmaxact =
FALSE;
970 (*consdata)->boundstightened = 0;
971 (*consdata)->presolved =
FALSE;
972 (*consdata)->removedfixings =
FALSE;
973 (*consdata)->validsignature =
FALSE;
974 (*consdata)->changed =
TRUE;
975 (*consdata)->normalized =
FALSE;
976 (*consdata)->upgradetried =
FALSE;
977 (*consdata)->upgraded =
FALSE;
978 (*consdata)->sorted = (nvars <= 1);
979 (*consdata)->merged = (nvars <= 1);
980 (*consdata)->cliquesadded =
FALSE;
981 (*consdata)->implsadded =
FALSE;
982 (*consdata)->binvarssorted =
FALSE;
983 (*consdata)->nbinvars = -1;
984 (*consdata)->varsdeleted =
FALSE;
985 (*consdata)->rangedrowpropagated = 0;
986 (*consdata)->checkabsolute =
FALSE;
995 for( v = 0; v < (*consdata)->nvars; v++ )
997 assert((*consdata)->vars[v] != NULL);
998 assert(!
SCIPisZero(scip, (*consdata)->vals[v]));
1014 assert(scip != NULL);
1015 assert(consdata != NULL);
1016 assert(*consdata != NULL);
1017 assert((*consdata)->varssize >= 0);
1020 if( (*consdata)->row != NULL )
1026 for( v = 0; v < (*consdata)->nvars; v++ )
1028 assert((*consdata)->vars[v] != NULL);
1029 assert(!
SCIPisZero(scip, (*consdata)->vals[v]));
1048 assert(scip != NULL);
1049 assert(consdata != NULL);
1054 && !
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
1058 if( consdata->nvars == 0 )
1067 if(
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
1090 assert(scip != NULL);
1091 assert(cons != NULL);
1094 assert(consdata != NULL);
1101 && !
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
1105 if( consdata->nvars == 0 )
1112 for( v = 0; v < consdata->nvars; ++v )
1114 if( consdata->vals != NULL )
1116 if( consdata->vals[v] == 1.0 )
1121 else if( consdata->vals[v] == -1.0 )
1126 else if( consdata->nvars > 0 )
1137 if(
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
1157 assert(consdata != NULL);
1159 consdata->validactivities =
FALSE;
1160 consdata->validminact =
FALSE;
1161 consdata->validmaxact =
FALSE;
1162 consdata->validglbminact =
FALSE;
1163 consdata->validglbmaxact =
FALSE;
1164 consdata->validmaxabsval =
FALSE;
1165 consdata->validminabsval =
FALSE;
1166 consdata->hasnonbinvalid =
FALSE;
1174 consdata->maxactdeltavar = NULL;
1175 consdata->minactivityneginf = -1;
1176 consdata->minactivityposinf = -1;
1177 consdata->maxactivityneginf = -1;
1178 consdata->maxactivityposinf = -1;
1179 consdata->minactivityneghuge = -1;
1180 consdata->minactivityposhuge = -1;
1181 consdata->maxactivityneghuge = -1;
1182 consdata->maxactivityposhuge = -1;
1187 consdata->glbminactivityneginf = -1;
1188 consdata->glbminactivityposinf = -1;
1189 consdata->glbmaxactivityneginf = -1;
1190 consdata->glbmaxactivityposinf = -1;
1191 consdata->glbminactivityneghuge = -1;
1192 consdata->glbminactivityposhuge = -1;
1193 consdata->glbmaxactivityneghuge = -1;
1194 consdata->glbmaxactivityposhuge = -1;
1205 int pseudoactivityposinf;
1206 int pseudoactivityneginf;
1212 pseudoactivityposinf = 0;
1213 pseudoactivityneginf = 0;
1215 for( i = consdata->nvars - 1; i >= 0; --i )
1217 val = consdata->vals[i];
1222 pseudoactivityposinf++;
1224 pseudoactivityneginf++;
1231 pseudoactivityneginf++;
1233 pseudoactivityposinf++;
1236 pseudoactivity += val *
bound;
1240 if( pseudoactivityneginf > 0 && pseudoactivityposinf > 0 )
1242 else if( pseudoactivityneginf > 0 )
1244 else if( pseudoactivityposinf > 0 )
1247 return pseudoactivity;
1260 consdata->minactivity = 0;
1262 for( i = consdata->nvars - 1; i >= 0; --i )
1267 consdata->minactivity += consdata->vals[i] *
bound;
1271 consdata->validminact =
TRUE;
1274 consdata->lastminactivity = consdata->minactivity;
1287 consdata->maxactivity = 0;
1289 for( i = consdata->nvars - 1; i >= 0; --i )
1294 consdata->maxactivity += consdata->vals[i] *
bound;
1298 consdata->validmaxact =
TRUE;
1301 consdata->lastmaxactivity = consdata->maxactivity;
1314 consdata->glbminactivity = 0;
1316 for( i = consdata->nvars - 1; i >= 0; --i )
1320 consdata->glbminactivity += consdata->vals[i] *
bound;
1324 consdata->validglbminact =
TRUE;
1327 consdata->lastglbminactivity = consdata->glbminactivity;
1340 consdata->glbmaxactivity = 0;
1342 for( i = consdata->nvars - 1; i >= 0; --i )
1346 consdata->glbmaxactivity += consdata->vals[i] *
bound;
1350 consdata->validglbmaxact =
TRUE;
1353 consdata->lastglbmaxactivity = consdata->glbmaxactivity;
1365 assert(consdata != NULL);
1366 assert(!consdata->validmaxabsval);
1369 consdata->validmaxabsval =
TRUE;
1370 consdata->maxabsval = 0.0;
1371 for( i = 0; i < consdata->nvars; ++i )
1373 absval = consdata->vals[i];
1375 if( absval > consdata->maxabsval )
1376 consdata->maxabsval = absval;
1389 assert(consdata != NULL);
1390 assert(!consdata->validminabsval);
1393 consdata->validminabsval =
TRUE;
1395 if( consdata->nvars > 0 )
1396 consdata->minabsval =
REALABS(consdata->vals[0]);
1398 consdata->minabsval = 0.0;
1400 for( i = 1; i < consdata->nvars; ++i )
1402 absval = consdata->vals[i];
1404 if( absval < consdata->minabsval )
1405 consdata->minabsval = absval;
1417 assert(!consdata->hasnonbinvalid);
1418 consdata->hasnonbinvar =
FALSE;
1419 consdata->hascontvar =
FALSE;
1421 for( v = consdata->nvars - 1; v >= 0; --v )
1427 consdata->hasnonbinvar =
TRUE;
1431 consdata->hascontvar =
TRUE;
1436 assert(consdata->hascontvar || v < 0);
1438 consdata->hasnonbinvalid =
TRUE;
1442 #ifdef CHECKMAXACTDELTA 1459 for( v = consdata->nvars - 1; v >= 0; --v )
1471 delta =
REALABS(consdata->vals[v]) * domain;
1473 if( delta > maxactdelta )
1475 maxactdelta = delta;
1478 assert(
SCIPisFeasEQ(scip, maxactdelta, consdata->maxactdelta));
1482 #define checkMaxActivityDelta(scip, consdata) 1495 consdata->maxactdelta = 0.0;
1497 if( !consdata->hasnonbinvalid )
1501 if( !consdata->hasnonbinvar )
1503 for( v = consdata->nvars - 1; v >= 0; --v )
1507 delta =
REALABS(consdata->vals[v]);
1509 if( delta > consdata->maxactdelta )
1511 consdata->maxactdelta = delta;
1512 consdata->maxactdeltavar = consdata->vars[v];
1519 for( v = consdata->nvars - 1; v >= 0; --v )
1531 consdata->maxactdeltavar = consdata->vars[v];
1536 delta =
REALABS(consdata->vals[v]) * domain;
1538 if( delta > consdata->maxactdelta )
1540 consdata->maxactdelta = delta;
1541 consdata->maxactdeltavar = consdata->vars[v];
1563 int* activityposinf;
1564 int* activityneginf;
1565 int* activityposhuge;
1566 int* activityneghuge;
1574 assert(scip != NULL);
1575 assert(consdata != NULL);
1576 assert(global || (var != NULL));
1577 assert(consdata->validactivities);
1582 assert(consdata->minactivityneginf >= 0);
1583 assert(consdata->minactivityposinf >= 0);
1584 assert(consdata->maxactivityneginf >= 0);
1585 assert(consdata->maxactivityposinf >= 0);
1586 assert(consdata->minactivityneghuge >= 0);
1587 assert(consdata->minactivityposhuge >= 0);
1588 assert(consdata->maxactivityneghuge >= 0);
1589 assert(consdata->maxactivityposhuge >= 0);
1594 assert(consdata->glbminactivityneginf >= 0);
1595 assert(consdata->glbminactivityposinf >= 0);
1596 assert(consdata->glbmaxactivityneginf >= 0);
1597 assert(consdata->glbmaxactivityposinf >= 0);
1598 assert(consdata->glbminactivityneghuge >= 0);
1599 assert(consdata->glbminactivityposhuge >= 0);
1600 assert(consdata->glbmaxactivityneghuge >= 0);
1601 assert(consdata->glbmaxactivityposhuge >= 0);
1618 activity = &(consdata->glbminactivity);
1619 lastactivity = &(consdata->lastglbminactivity);
1620 activityposinf = &(consdata->glbminactivityposinf);
1621 activityneginf = &(consdata->glbminactivityneginf);
1622 activityposhuge = &(consdata->glbminactivityposhuge);
1623 activityneghuge = &(consdata->glbminactivityneghuge);
1624 validact = consdata->validglbminact;
1628 activity = &(consdata->glbmaxactivity);
1629 lastactivity = &(consdata->lastglbmaxactivity);
1630 activityposinf = &(consdata->glbmaxactivityneginf);
1631 activityneginf = &(consdata->glbmaxactivityposinf);
1632 activityposhuge = &(consdata->glbmaxactivityposhuge);
1633 activityneghuge = &(consdata->glbmaxactivityneghuge);
1634 validact = consdata->validglbmaxact;
1641 activity = &(consdata->glbmaxactivity);
1642 lastactivity = &(consdata->lastglbmaxactivity);
1643 activityposinf = &(consdata->glbmaxactivityposinf);
1644 activityneginf = &(consdata->glbmaxactivityneginf);
1645 activityposhuge = &(consdata->glbmaxactivityposhuge);
1646 activityneghuge = &(consdata->glbmaxactivityneghuge);
1647 validact = consdata->validglbmaxact;
1651 activity = &(consdata->glbminactivity);
1652 lastactivity = &(consdata->lastglbminactivity);
1653 activityposinf = &(consdata->glbminactivityneginf);
1654 activityneginf = &(consdata->glbminactivityposinf);
1655 activityposhuge = &(consdata->glbminactivityposhuge);
1656 activityneghuge = &(consdata->glbminactivityneghuge);
1657 validact = consdata->validglbminact;
1674 activity = &(consdata->minactivity);
1675 lastactivity = &(consdata->lastminactivity);
1676 activityposinf = &(consdata->minactivityposinf);
1677 activityneginf = &(consdata->minactivityneginf);
1678 activityposhuge = &(consdata->minactivityposhuge);
1679 activityneghuge = &(consdata->minactivityneghuge);
1680 validact = consdata->validminact;
1684 activity = &(consdata->maxactivity);
1685 lastactivity = &(consdata->lastmaxactivity);
1686 activityposinf = &(consdata->maxactivityneginf);
1687 activityneginf = &(consdata->maxactivityposinf);
1688 activityposhuge = &(consdata->maxactivityposhuge);
1689 activityneghuge = &(consdata->maxactivityneghuge);
1690 validact = consdata->validmaxact;
1697 activity = &(consdata->maxactivity);
1698 lastactivity = &(consdata->lastmaxactivity);
1699 activityposinf = &(consdata->maxactivityposinf);
1700 activityneginf = &(consdata->maxactivityneginf);
1701 activityposhuge = &(consdata->maxactivityposhuge);
1702 activityneghuge = &(consdata->maxactivityneghuge);
1703 validact = consdata->validmaxact;
1707 activity = &(consdata->minactivity);
1708 lastactivity = &(consdata->lastminactivity);
1709 activityposinf = &(consdata->minactivityneginf);
1710 activityneginf = &(consdata->minactivityposinf);
1711 activityposhuge = &(consdata->minactivityposhuge);
1712 activityneghuge = &(consdata->minactivityneghuge);
1713 validact = consdata->validminact;
1718 oldcontribution = val * oldbound;
1719 newcontribution = val * newbound;
1726 if( oldbound > 0.0 )
1728 assert((*activityposinf) >= 1);
1731 if( finitenewbound || newbound < 0.0 )
1734 (*activityposinf)--;
1737 if( !finitenewbound && newbound < 0.0 )
1738 (*activityneginf)++;
1739 else if( hugevalnewcont )
1742 if( newcontribution > 0.0 )
1743 (*activityposhuge)++;
1745 (*activityneghuge)++;
1749 delta = newcontribution;
1755 assert(oldbound < 0.0);
1756 assert((*activityneginf) >= 1);
1759 if( finitenewbound || newbound > 0.0 )
1762 (*activityneginf)--;
1765 if( !finitenewbound && newbound > 0.0 )
1766 (*activityposinf)++;
1767 else if( hugevalnewcont )
1770 if( newcontribution > 0.0 )
1771 (*activityposhuge)++;
1773 (*activityneghuge)++;
1777 delta = newcontribution;
1784 if( oldcontribution > 0.0 )
1786 assert((*activityposhuge) >= 1);
1791 (*activityposhuge)--;
1793 if( !finitenewbound )
1796 if( newbound > 0.0 )
1797 (*activityposinf)++;
1800 (*activityneginf)++;
1802 else if( hugevalnewcont )
1805 if( newcontribution > 0.0 )
1806 (*activityposhuge)++;
1809 (*activityneghuge)++;
1813 delta = newcontribution;
1818 assert(oldcontribution < 0.0);
1819 assert((*activityneghuge) >= 1);
1824 (*activityneghuge)--;
1826 if( !finitenewbound )
1829 if( newbound > 0.0 )
1830 (*activityposinf)++;
1833 (*activityneginf)++;
1835 else if( hugevalnewcont )
1838 if( newcontribution > 0.0 )
1839 (*activityposhuge)++;
1842 (*activityneghuge)++;
1846 delta = newcontribution;
1852 if( !finitenewbound )
1857 if( newbound > 0.0 )
1859 (*activityposinf)++;
1860 delta = -oldcontribution;
1867 assert(newbound < 0.0 );
1869 (*activityneginf)++;
1870 delta = -oldcontribution;
1874 else if( hugevalnewcont )
1876 if( newcontribution > 0.0 )
1878 (*activityposhuge)++;
1879 delta = -oldcontribution;
1883 (*activityneghuge)++;
1884 delta = -oldcontribution;
1889 delta = newcontribution - oldcontribution;
1893 if( validact && (delta != 0.0) )
1898 (*activity) = (*activity) + delta;
1903 (*lastactivity) = (*activity);
1909 SCIPdebugMsg(scip,
"%s activity of linear constraint unreliable after update: %16.9g\n",
1910 (global ?
"global " :
""), (*activity));
1916 consdata->validglbminact =
FALSE;
1918 consdata->validglbmaxact =
FALSE;
1923 consdata->validminact =
FALSE;
1925 consdata->validmaxact =
FALSE;
1944 assert(scip != NULL);
1945 assert(consdata != NULL);
1946 assert(var != NULL);
1948 if( consdata->validactivities )
1969 assert(scip != NULL);
1970 assert(consdata != NULL);
1971 assert(var != NULL);
1973 if( consdata->validactivities )
1993 assert(scip != NULL);
1994 assert(consdata != NULL);
1996 if( consdata->validactivities )
2016 assert(scip != NULL);
2017 assert(consdata != NULL);
2019 if( consdata->validactivities )
2038 assert(scip != NULL);
2039 assert(consdata != NULL);
2040 assert(var != NULL);
2043 if( consdata->validmaxabsval )
2050 consdata->maxabsval =
MAX(consdata->maxabsval, absval);
2053 if( consdata->validminabsval )
2060 consdata->minabsval = MIN(consdata->minabsval, absval);
2064 if( consdata->validactivities )
2088 assert(scip != NULL);
2089 assert(consdata != NULL);
2090 assert(var != NULL);
2093 if( consdata->validmaxabsval )
2099 if(
SCIPisEQ(scip, absval, consdata->maxabsval) )
2101 consdata->validmaxabsval =
FALSE;
2107 if( consdata->validminabsval )
2113 if(
SCIPisEQ(scip, absval, consdata->minabsval) )
2115 consdata->validminabsval =
FALSE;
2121 if( consdata->validactivities )
2146 assert(scip != NULL);
2147 assert(consdata != NULL);
2148 assert(var != NULL);
2157 if( consdata->validmaxabsval )
2163 if(
SCIPisGE(scip, absval, consdata->maxabsval) )
2165 consdata->maxabsval = absval;
2172 if(
SCIPisEQ(scip, absval, consdata->maxabsval) )
2174 consdata->validmaxabsval =
FALSE;
2181 if( consdata->validminabsval )
2187 if(
SCIPisLE(scip, absval, consdata->minabsval) )
2189 consdata->minabsval = absval;
2196 if(
SCIPisEQ(scip, absval, consdata->minabsval) )
2198 consdata->validminabsval =
FALSE;
2215 delta =
REALABS(newval) * domain;
2217 if( delta > consdata->maxactdelta )
2219 consdata->maxactdelta = delta;
2220 consdata->maxactdeltavar = var;
2225 if( consdata->maxactdeltavar == var )
2241 assert(consdata != NULL);
2243 if( !consdata->validmaxabsval )
2245 assert(consdata->validmaxabsval);
2248 return consdata->maxabsval;
2257 assert(consdata != NULL);
2259 if( !consdata->validminabsval )
2261 assert(consdata->validminabsval);
2264 return consdata->minabsval;
2278 assert(scip != NULL);
2279 assert(consdata != NULL);
2280 assert(!consdata->validactivities);
2281 assert(consdata->minactivity >=
SCIP_INVALID || consdata->validminact);
2282 assert(consdata->maxactivity >=
SCIP_INVALID || consdata->validmaxact);
2283 assert(consdata->glbminactivity >=
SCIP_INVALID || consdata->validglbminact);
2284 assert(consdata->glbmaxactivity >=
SCIP_INVALID || consdata->validglbmaxact);
2286 consdata->validmaxabsval =
TRUE;
2287 consdata->validminabsval =
TRUE;
2289 consdata->validminact =
TRUE;
2290 consdata->validmaxact =
TRUE;
2291 consdata->validglbminact =
TRUE;
2292 consdata->validglbmaxact =
TRUE;
2293 consdata->maxabsval = 0.0;
2294 consdata->minabsval = (consdata->nvars == 0 ? 0.0 :
REALABS(consdata->vals[0]));
2295 consdata->minactivity = 0.0;
2296 consdata->maxactivity = 0.0;
2297 consdata->lastminactivity = 0.0;
2298 consdata->lastmaxactivity = 0.0;
2299 consdata->minactivityneginf = 0;
2300 consdata->minactivityposinf = 0;
2301 consdata->maxactivityneginf = 0;
2302 consdata->maxactivityposinf = 0;
2303 consdata->minactivityneghuge = 0;
2304 consdata->minactivityposhuge = 0;
2305 consdata->maxactivityneghuge = 0;
2306 consdata->maxactivityposhuge = 0;
2307 consdata->glbminactivity = 0.0;
2308 consdata->glbmaxactivity = 0.0;
2309 consdata->lastglbminactivity = 0.0;
2310 consdata->lastglbmaxactivity = 0.0;
2311 consdata->glbminactivityneginf = 0;
2312 consdata->glbminactivityposinf = 0;
2313 consdata->glbmaxactivityneginf = 0;
2314 consdata->glbmaxactivityposinf = 0;
2315 consdata->glbminactivityneghuge = 0;
2316 consdata->glbminactivityposhuge = 0;
2317 consdata->glbmaxactivityneghuge = 0;
2318 consdata->glbmaxactivityposhuge = 0;
2320 for( i = 0; i < consdata->nvars; ++i )
2323 consdata->lastminactivity = consdata->minactivity;
2324 consdata->lastmaxactivity = consdata->maxactivity;
2325 consdata->lastglbminactivity = consdata->glbminactivity;
2326 consdata->lastglbmaxactivity = consdata->glbmaxactivity;
2350 assert(scip != NULL);
2351 assert(consdata != NULL);
2352 assert(posinf >= 0);
2353 assert(neginf >= 0);
2354 assert(poshuge >= 0);
2355 assert(neghuge >= 0);
2356 assert(minactivity != NULL);
2357 assert(isrelax != NULL);
2358 assert(issettoinfinity != NULL);
2364 *issettoinfinity =
TRUE;
2368 else if( neginf > 0 )
2371 *issettoinfinity =
TRUE;
2375 else if( neghuge > 0 )
2378 *issettoinfinity =
TRUE;
2382 else if( !goodrelax && poshuge > 0 )
2385 *issettoinfinity =
TRUE;
2395 if( !consdata->validglbminact )
2397 assert(consdata->validglbminact);
2399 tmpactivity = consdata->glbminactivity;
2403 if( !consdata->validminact )
2405 assert(consdata->validminact);
2407 tmpactivity = consdata->minactivity;
2416 *minactivity = 1.0 * poshuge *
SCIPgetHugeValue(scip) + (tmpactivity - delta);
2417 *issettoinfinity =
FALSE;
2423 *minactivity = tmpactivity - delta;
2424 *issettoinfinity =
FALSE;
2451 assert(scip != NULL);
2452 assert(consdata != NULL);
2453 assert(posinf >= 0);
2454 assert(neginf >= 0);
2455 assert(poshuge >= 0);
2456 assert(neghuge >= 0);
2457 assert(maxactivity != NULL);
2458 assert(isrelax != NULL);
2459 assert(issettoinfinity != NULL);
2465 *issettoinfinity =
TRUE;
2469 else if( posinf > 0 )
2472 *issettoinfinity =
TRUE;
2476 else if( poshuge > 0 )
2479 *issettoinfinity =
TRUE;
2483 else if( !goodrelax && neghuge > 0 )
2486 *issettoinfinity =
TRUE;
2496 if( !consdata->validglbmaxact )
2498 assert(consdata->validglbmaxact);
2500 tmpactivity = consdata->glbmaxactivity;
2504 if( !consdata->validmaxact )
2506 assert(consdata->validmaxact);
2508 tmpactivity = consdata->maxactivity;
2517 *maxactivity = -1.0 * neghuge *
SCIPgetHugeValue(scip) + tmpactivity - delta;
2518 *issettoinfinity =
FALSE;
2524 *maxactivity = tmpactivity - delta;
2525 *issettoinfinity =
FALSE;
2550 assert(scip != NULL);
2551 assert(consdata != NULL);
2552 assert(minactivity != NULL);
2553 assert(maxactivity != NULL);
2555 if( !consdata->validactivities )
2558 assert(consdata->validminact);
2559 assert(consdata->validmaxact);
2563 assert(consdata->minactivityneginf >= 0);
2564 assert(consdata->minactivityposinf >= 0);
2565 assert(consdata->maxactivityneginf >= 0);
2566 assert(consdata->maxactivityposinf >= 0);
2568 getMinActivity(scip, consdata, consdata->minactivityposinf, consdata->minactivityneginf,
2569 consdata->minactivityposhuge, consdata->minactivityneghuge, 0.0,
FALSE, goodrelax,
2570 minactivity, minisrelax, &issettoinfinity);
2572 getMaxActivity(scip, consdata, consdata->maxactivityposinf, consdata->maxactivityneginf,
2573 consdata->maxactivityposhuge, consdata->maxactivityneghuge, 0.0,
FALSE, goodrelax,
2574 maxactivity, maxisrelax, &issettoinfinity);
2594 assert(scip != NULL);
2595 assert(consdata != NULL);
2596 assert(cancelvar != NULL);
2597 assert(resactivity != NULL);
2601 for( v = 0; v < consdata->nvars; ++v )
2603 var = consdata->vars[v];
2604 assert(var != NULL);
2605 if( var == cancelvar )
2608 val = consdata->vals[v];
2610 if( useglobalbounds )
2630 *resactivity += val*lb;
2636 *resactivity += val*ub;
2645 *resactivity += val*ub;
2651 *resactivity += val*lb;
2683 assert(scip != NULL);
2684 assert(consdata != NULL);
2685 assert(var != NULL);
2686 assert(minresactivity != NULL);
2687 assert(maxresactivity != NULL);
2688 assert(minisrelax != NULL);
2689 assert(maxisrelax != NULL);
2690 assert(isminsettoinfinity != NULL);
2691 assert(ismaxsettoinfinity != NULL);
2694 if( !consdata->validactivities )
2697 assert(consdata->validminact);
2698 assert(consdata->validmaxact);
2702 assert(consdata->minactivityneginf >= 0);
2703 assert(consdata->minactivityposinf >= 0);
2704 assert(consdata->maxactivityneginf >= 0);
2705 assert(consdata->maxactivityposinf >= 0);
2706 assert(consdata->minactivityneghuge >= 0);
2707 assert(consdata->minactivityposhuge >= 0);
2708 assert(consdata->maxactivityneghuge >= 0);
2709 assert(consdata->maxactivityposhuge >= 0);
2729 assert(consdata->minactivityposinf >= 1);
2731 getMinActivity(scip, consdata, consdata->minactivityposinf - 1, consdata->minactivityneginf,
2732 consdata->minactivityposhuge, consdata->minactivityneghuge, 0.0,
FALSE, goodrelax,
2733 minresactivity, minisrelax, isminsettoinfinity);
2737 assert(consdata->minactivityneginf >= 1);
2739 getMinActivity(scip, consdata, consdata->minactivityposinf, consdata->minactivityneginf - 1,
2740 consdata->minactivityposhuge, consdata->minactivityneghuge, 0.0,
FALSE, goodrelax,
2741 minresactivity, minisrelax, isminsettoinfinity);
2745 assert(consdata->minactivityposhuge >= 1);
2747 getMinActivity(scip, consdata, consdata->minactivityposinf, consdata->minactivityneginf,
2748 consdata->minactivityposhuge - 1, consdata->minactivityneghuge, 0.0,
FALSE, goodrelax,
2749 minresactivity, minisrelax, isminsettoinfinity);
2753 assert(consdata->minactivityneghuge >= 1);
2755 getMinActivity(scip, consdata, consdata->minactivityposinf, consdata->minactivityneginf,
2756 consdata->minactivityposhuge, consdata->minactivityneghuge - 1, 0.0,
FALSE, goodrelax,
2757 minresactivity, minisrelax, isminsettoinfinity);
2761 getMinActivity(scip, consdata, consdata->minactivityposinf, consdata->minactivityneginf,
2762 consdata->minactivityposhuge, consdata->minactivityneghuge, absval * minactbound,
FALSE, goodrelax,
2763 minresactivity, minisrelax, isminsettoinfinity);
2771 assert(consdata->maxactivityneginf >= 1);
2773 getMaxActivity(scip, consdata, consdata->maxactivityposinf, consdata->maxactivityneginf - 1,
2774 consdata->maxactivityposhuge, consdata->maxactivityneghuge, 0.0,
FALSE, goodrelax,
2775 maxresactivity, maxisrelax, ismaxsettoinfinity);
2779 assert(consdata->maxactivityposinf >= 1);
2781 getMaxActivity(scip, consdata, consdata->maxactivityposinf - 1, consdata->maxactivityneginf,
2782 consdata->maxactivityposhuge, consdata->maxactivityneghuge, 0.0,
FALSE, goodrelax,
2783 maxresactivity, maxisrelax, ismaxsettoinfinity);
2787 assert(consdata->maxactivityposhuge >= 1);
2789 getMaxActivity(scip, consdata, consdata->maxactivityposinf, consdata->maxactivityneginf,
2790 consdata->maxactivityposhuge - 1, consdata->maxactivityneghuge, 0.0,
FALSE, goodrelax,
2791 maxresactivity, maxisrelax, ismaxsettoinfinity);
2795 assert(consdata->maxactivityneghuge >= 1);
2797 getMaxActivity(scip, consdata, consdata->maxactivityposinf, consdata->maxactivityneginf,
2798 consdata->maxactivityposhuge, consdata->maxactivityneghuge - 1, 0.0,
FALSE, goodrelax,
2799 maxresactivity, maxisrelax, ismaxsettoinfinity);
2803 getMaxActivity(scip, consdata, consdata->maxactivityposinf, consdata->maxactivityneginf,
2804 consdata->maxactivityposhuge, consdata->maxactivityneghuge, absval * maxactbound,
FALSE, goodrelax,
2805 maxresactivity, maxisrelax, ismaxsettoinfinity);
2828 assert(scip != NULL);
2829 assert(consdata != NULL);
2830 assert((glbminactivity != NULL && minisrelax != NULL && isminsettoinfinity != NULL)
2831 || (glbmaxactivity != NULL && maxisrelax != NULL && ismaxsettoinfinity != NULL));
2833 if( !consdata->validactivities )
2836 assert(consdata->validglbminact);
2837 assert(consdata->validglbmaxact);
2841 assert(consdata->glbminactivityneginf >= 0);
2842 assert(consdata->glbminactivityposinf >= 0);
2843 assert(consdata->glbmaxactivityneginf >= 0);
2844 assert(consdata->glbmaxactivityposinf >= 0);
2845 assert(consdata->glbminactivityneghuge >= 0);
2846 assert(consdata->glbminactivityposhuge >= 0);
2847 assert(consdata->glbmaxactivityneghuge >= 0);
2848 assert(consdata->glbmaxactivityposhuge >= 0);
2850 if( glbminactivity != NULL )
2852 assert(isminsettoinfinity != NULL);
2853 assert(minisrelax != NULL);
2855 getMinActivity(scip, consdata, consdata->glbminactivityposinf, consdata->glbminactivityneginf,
2856 consdata->glbminactivityposhuge, consdata->glbminactivityneghuge, 0.0,
TRUE, goodrelax,
2857 glbminactivity, minisrelax, isminsettoinfinity);
2860 if( glbmaxactivity != NULL )
2862 assert(ismaxsettoinfinity != NULL);
2863 assert(maxisrelax != NULL);
2865 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf, consdata->glbmaxactivityneginf,
2866 consdata->glbmaxactivityposhuge, consdata->glbmaxactivityneghuge, 0.0,
TRUE, goodrelax,
2867 glbmaxactivity, maxisrelax, ismaxsettoinfinity);
2896 assert(scip != NULL);
2897 assert(consdata != NULL);
2898 assert(var != NULL);
2899 assert((minresactivity != NULL && minisrelax != NULL && isminsettoinfinity != NULL )
2900 || (maxresactivity != NULL && maxisrelax != NULL && ismaxsettoinfinity != NULL));
2903 if( !consdata->validactivities )
2908 assert(consdata->glbminactivityneginf >= 0);
2909 assert(consdata->glbminactivityposinf >= 0);
2910 assert(consdata->glbmaxactivityneginf >= 0);
2911 assert(consdata->glbmaxactivityposinf >= 0);
2926 if( minresactivity != NULL )
2928 assert(isminsettoinfinity != NULL);
2929 assert(minisrelax != NULL);
2936 assert(consdata->glbminactivityposinf >= 1);
2938 getMinActivity(scip, consdata, consdata->glbminactivityposinf - 1, consdata->glbminactivityneginf,
2939 consdata->glbminactivityposhuge, consdata->glbminactivityneghuge, 0.0,
TRUE, goodrelax,
2940 minresactivity, minisrelax, isminsettoinfinity);
2944 assert(consdata->glbminactivityneginf >= 1);
2946 getMinActivity(scip, consdata, consdata->glbminactivityposinf, consdata->glbminactivityneginf - 1,
2947 consdata->glbminactivityposhuge, consdata->glbminactivityneghuge, 0.0,
TRUE, goodrelax,
2948 minresactivity, minisrelax, isminsettoinfinity);
2952 assert(consdata->glbminactivityposhuge >= 1);
2954 getMinActivity(scip, consdata, consdata->glbminactivityposinf, consdata->glbminactivityneginf,
2955 consdata->glbminactivityposhuge - 1, consdata->glbminactivityneghuge, 0.0,
TRUE, goodrelax,
2956 minresactivity, minisrelax, isminsettoinfinity);
2960 assert(consdata->glbminactivityneghuge >= 1);
2962 getMinActivity(scip, consdata, consdata->glbminactivityposinf, consdata->glbminactivityneginf,
2963 consdata->glbminactivityposhuge, consdata->glbminactivityneghuge - 1, 0.0,
TRUE, goodrelax,
2964 minresactivity, minisrelax, isminsettoinfinity);
2968 getMinActivity(scip, consdata, consdata->glbminactivityposinf, consdata->glbminactivityneginf,
2969 consdata->glbminactivityposhuge, consdata->glbminactivityneghuge, absval * minactbound,
TRUE,
2970 goodrelax, minresactivity, minisrelax, isminsettoinfinity);
2974 if( maxresactivity != NULL )
2976 assert(ismaxsettoinfinity != NULL);
2977 assert(maxisrelax != NULL);
2984 assert(consdata->glbmaxactivityneginf >= 1);
2986 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf, consdata->glbmaxactivityneginf - 1,
2987 consdata->glbmaxactivityposhuge, consdata->glbmaxactivityneghuge, 0.0,
TRUE, goodrelax,
2988 maxresactivity, maxisrelax, ismaxsettoinfinity);
2992 assert(consdata->glbmaxactivityposinf >= 1);
2994 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf - 1, consdata->glbmaxactivityneginf,
2995 consdata->glbmaxactivityposhuge, consdata->glbmaxactivityneghuge, 0.0,
TRUE, goodrelax,
2996 maxresactivity, maxisrelax, ismaxsettoinfinity);
3000 assert(consdata->glbmaxactivityposhuge >= 1);
3002 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf, consdata->glbmaxactivityneginf,
3003 consdata->glbmaxactivityposhuge - 1, consdata->glbmaxactivityneghuge, 0.0,
TRUE, goodrelax,
3004 maxresactivity, maxisrelax, ismaxsettoinfinity);
3008 assert(consdata->glbmaxactivityneghuge >= 1);
3010 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf, consdata->glbmaxactivityneginf,
3011 consdata->glbmaxactivityposhuge, consdata->glbmaxactivityneghuge - 1, 0.0,
TRUE, goodrelax,
3012 maxresactivity, maxisrelax, ismaxsettoinfinity);
3016 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf, consdata->glbmaxactivityneginf,
3017 consdata->glbmaxactivityposhuge, consdata->glbmaxactivityneghuge, absval * maxactbound,
TRUE,
3018 goodrelax, maxresactivity, maxisrelax, ismaxsettoinfinity);
3033 assert(scip != NULL);
3034 assert(consdata != NULL);
3050 for( v = 0; v < consdata->nvars; ++v )
3054 if( consdata->vals[v] < 0 )
3064 activity += consdata->vals[v] * solval;
3066 assert(nneginf >= 0 && nposinf >= 0);
3068 SCIPdebugMsg(scip,
"activity of linear constraint: %.15g, %d positive infinity values, %d negative infinity values \n", activity, nposinf, nneginf);
3071 if( nposinf > 0 && nneginf > 0 )
3072 activity = (consdata->rhs + consdata->lhs) / 2;
3073 else if( nposinf > 0 )
3075 else if( nneginf > 0 )
3078 SCIPdebugMsg(scip,
"corrected activity of linear constraint: %.15g\n", activity);
3083 else if( activity < 0 )
3101 assert(scip != NULL);
3102 assert(consdata != NULL);
3109 return MIN(consdata->rhs - activity, activity - consdata->lhs);
3119 uint64_t varsignature;
3124 assert(consdata != NULL);
3125 assert(consdata->validsignature);
3130 val = consdata->vals[pos];
3131 if( (val > 0.0 && ub > 0.0) || (val < 0.0 && lb < 0.0) )
3132 consdata->possignature |= varsignature;
3133 if( (val > 0.0 && lb < 0.0) || (val < 0.0 && ub > 0.0) )
3134 consdata->negsignature |= varsignature;
3143 assert(consdata != NULL);
3145 if( !consdata->validsignature )
3149 consdata->validsignature =
TRUE;
3150 consdata->possignature = 0;
3151 consdata->negsignature = 0;
3152 for( i = 0; i < consdata->nvars; ++i )
3163 assert(consdata != NULL);
3164 assert(0 <= ind1 && ind1 < consdata->nvars);
3165 assert(0 <= ind2 && ind2 < consdata->nvars);
3167 return SCIPvarCompare(consdata->vars[ind1], consdata->vars[ind2]);
3185 assert(perm != NULL);
3186 assert(consdata != NULL);
3190 for( v = 0; v < nvars; ++v )
3194 varv = consdata->vars[v];
3195 valv = consdata->vals[v];
3196 if( consdata->eventdata != NULL )
3197 eventdatav = consdata->eventdata[v];
3201 assert(0 <= perm[i] && perm[i] < nvars);
3202 assert(perm[i] != i);
3203 consdata->vars[i] = consdata->vars[perm[i]];
3204 consdata->vals[i] = consdata->vals[perm[i]];
3205 if( consdata->eventdata != NULL )
3207 consdata->eventdata[i] = consdata->eventdata[perm[i]];
3208 consdata->eventdata[i]->varpos = i;
3214 while( perm[i] != v );
3215 consdata->vars[i] = varv;
3216 consdata->vals[i] = valv;
3217 if( consdata->eventdata != NULL )
3219 consdata->eventdata[i] = eventdatav;
3220 consdata->eventdata[i]->varpos = i;
3227 for( v = 0; v < nvars; ++v )
3229 assert(perm[v] == v);
3230 assert(consdata->eventdata == NULL || consdata->eventdata[v]->varpos == v);
3250 assert(scip != NULL);
3251 assert(consdata != NULL);
3254 if( consdata->nvars <= 1 )
3256 consdata->sorted =
TRUE;
3257 consdata->binvarssorted =
TRUE;
3267 SCIPsort(perm, consdataCompVar, (
void*)consdata, consdata->nvars);
3274 consdata->sorted =
TRUE;
3275 consdata->binvarssorted =
FALSE;
3286 nvars = consdata->nvars;
3287 vars = consdata->vars;
3288 vals = consdata->vals;
3289 eventdata = consdata->eventdata;
3290 assert(vars != NULL || nvars == 0);
3291 assert(vals != NULL || nvars == 0);
3295 for( v = 0; v < nvars; ++v )
3297 assert( vars != NULL);
3298 assert( vals != NULL);
3307 tmpvar = vars[lastbin];
3308 tmpval = vals[lastbin];
3310 vars[lastbin] = vars[v];
3311 vals[lastbin] = vals[v];
3316 if( eventdata != NULL )
3320 tmpeventdata = eventdata[lastbin];
3321 eventdata[lastbin] = eventdata[v];
3322 eventdata[lastbin]->varpos = lastbin;
3323 eventdata[v] = tmpeventdata;
3324 eventdata[v]->varpos = v;
3330 assert(lastbin == v);
3335 consdata->nbinvars = lastbin;
3339 for( v = 0; v < nvars; ++v )
3341 assert(vars != NULL);
3342 assert(eventdata == NULL || eventdata[v]->varpos == v);
3347 if( consdata->nbinvars > 1 )
3352 assert(lastbin == consdata->nbinvars);
3353 assert(lastbin <= nvars);
3354 assert(vals != NULL);
3360 for( v = 0; v < lastbin; ++v )
3362 absvals[v] = ABS(vals[v]);
3375 consdata->binvarssorted =
TRUE;
3378 consdata->sorted = (consdata->sorted && consdata->nbinvars == 0);
3401 assert(scip != NULL);
3402 assert(cons != NULL);
3410 assert(consdata != NULL);
3411 assert(consdata->nvars == 0 || (consdata->vars != NULL && consdata->vals != NULL));
3415 if(
SCIPisEQ(scip, consdata->lhs, lhs) )
3419 if(
SCIPisEQ(scip, lhs, consdata->rhs) )
3421 consdata->rhs = lhs;
3422 assert(consdata->row == NULL);
3435 vars = consdata->vars;
3436 vals = consdata->vals;
3438 for( v = 0; v < consdata->nvars; ++v )
3440 assert(vars[v] != NULL);
3460 vars = consdata->vars;
3461 vals = consdata->vals;
3463 for( v = 0; v < consdata->nvars; ++v )
3465 assert(vars[v] != NULL);
3483 consdata->boundstightened = 0;
3484 consdata->presolved =
FALSE;
3485 consdata->cliquesadded =
FALSE;
3486 consdata->implsadded =
FALSE;
3496 consdata->lhs = lhs;
3497 consdata->changed =
TRUE;
3498 consdata->normalized =
FALSE;
3499 consdata->upgradetried =
FALSE;
3500 consdata->rangedrowpropagated = 0;
3504 if( consdata->row != NULL )
3522 assert(scip != NULL);
3523 assert(cons != NULL);
3531 assert(consdata != NULL);
3532 assert(consdata->nvars == 0 || (consdata->vars != NULL && consdata->vals != NULL));
3536 if(
SCIPisEQ(scip, consdata->rhs, rhs) )
3540 if(
SCIPisEQ(scip, rhs, consdata->lhs) )
3542 consdata->lhs = rhs;
3543 assert(consdata->row == NULL);
3558 vars = consdata->vars;
3559 vals = consdata->vals;
3561 for( v = 0; v < consdata->nvars; ++v )
3563 assert(vars[v] != NULL);
3583 vars = consdata->vars;
3584 vals = consdata->vals;
3586 for( v = 0; v < consdata->nvars; ++v )
3588 assert(vars[v] != NULL);
3606 consdata->boundstightened = 0;
3607 consdata->presolved =
FALSE;
3608 consdata->cliquesadded =
FALSE;
3609 consdata->implsadded =
FALSE;
3619 consdata->rhs = rhs;
3620 consdata->changed =
TRUE;
3621 consdata->normalized =
FALSE;
3622 consdata->upgradetried =
FALSE;
3623 consdata->rangedrowpropagated = 0;
3626 if( consdata->row != NULL )
3646 assert(scip != NULL);
3647 assert(cons != NULL);
3648 assert(var != NULL);
3655 assert(consdata != NULL);
3665 assert(var != NULL);
3669 consdata->vars[consdata->nvars] = var;
3670 consdata->vals[consdata->nvars] = val;
3679 if( consdata->eventdata != NULL )
3687 assert(conshdlrdata != NULL);
3688 assert(conshdlrdata->eventhdlr != NULL);
3691 consdata->eventdata[consdata->nvars-1] = NULL;
3712 consdata->maxactdeltavar = var;
3719 if( delta > consdata->maxactdelta )
3721 consdata->maxactdelta = delta;
3722 consdata->maxactdeltavar = var;
3737 consdata->boundstightened = 0;
3738 consdata->presolved =
FALSE;
3739 consdata->removedfixings = consdata->removedfixings &&
SCIPvarIsActive(var);
3741 if( consdata->validsignature )
3744 consdata->changed =
TRUE;
3745 consdata->normalized =
FALSE;
3746 consdata->upgradetried =
FALSE;
3747 consdata->cliquesadded =
FALSE;
3748 consdata->implsadded =
FALSE;
3749 consdata->rangedrowpropagated = 0;
3751 if( consdata->nvars == 1 )
3753 consdata->binvarssorted =
TRUE;
3754 consdata->sorted =
TRUE;
3755 consdata->merged =
TRUE;
3759 consdata->binvarssorted = consdata->binvarssorted && !
SCIPvarIsBinary(var);
3760 consdata->sorted = consdata->sorted
3761 && (
SCIPvarCompare(consdata->vars[consdata->nvars-2], consdata->vars[consdata->nvars-1]) <= 0);
3762 consdata->merged =
FALSE;
3766 if( consdata->hasnonbinvalid && !consdata->hascontvar )
3772 consdata->hasnonbinvar =
TRUE;
3775 consdata->hascontvar =
TRUE;
3780 if( consdata->row != NULL )
3800 assert(scip != NULL);
3801 assert(cons != NULL);
3804 assert(consdata != NULL);
3805 assert(0 <= pos && pos < consdata->nvars);
3807 var = consdata->vars[pos];
3808 val = consdata->vals[pos];
3809 assert(var != NULL);
3823 assert(conshdlrdata != NULL);
3824 assert(conshdlrdata->eventhdlr != NULL);
3827 if( consdata->eventdata != NULL )
3830 assert(consdata->eventdata[pos] == NULL);
3835 if( pos != consdata->nvars-1 )
3837 consdata->binvarssorted = consdata->binvarssorted && !
SCIPvarIsBinary(consdata->vars[pos]);
3839 consdata->vars[pos] = consdata->vars[consdata->nvars-1];
3840 consdata->vals[pos] = consdata->vals[consdata->nvars-1];
3842 if( consdata->eventdata != NULL )
3844 consdata->eventdata[pos] = consdata->eventdata[consdata->nvars-1];
3845 assert(consdata->eventdata[pos] != NULL);
3846 consdata->eventdata[pos]->varpos = pos;
3848 consdata->sorted = consdata->sorted && (pos + 2 >= consdata->nvars || (
SCIPvarCompare(consdata->vars[pos], consdata->vars[pos + 1]) <= 0));
3855 if( consdata->nvars <= 1 )
3867 if( consdata->maxactdeltavar == var )
3870 consdata->maxactdeltavar = NULL;
3881 consdata->boundstightened = 0;
3882 consdata->presolved =
FALSE;
3883 consdata->validsignature =
FALSE;
3884 consdata->changed =
TRUE;
3885 consdata->normalized =
FALSE;
3886 consdata->upgradetried =
FALSE;
3887 consdata->cliquesadded =
FALSE;
3888 consdata->implsadded =
FALSE;
3889 consdata->rangedrowpropagated = 0;
3894 consdata->hasnonbinvalid =
FALSE;
3898 if( consdata->row != NULL )
3922 assert(scip != NULL);
3923 assert(cons != NULL);
3927 assert(consdata != NULL);
3928 assert(0 <= pos && pos < consdata->nvars);
3931 var = consdata->vars[pos];
3932 val = consdata->vals[pos];
3933 assert(var != NULL);
3949 consdata->vals[pos] = newval;
3951 consdata->binvarssorted = consdata->binvarssorted && !
SCIPvarIsBinary(var);
3963 consdata->boundstightened = 0;
3964 consdata->presolved =
FALSE;
3965 consdata->validsignature = consdata->validsignature && (newval * val > 0.0);
3966 consdata->changed =
TRUE;
3967 consdata->normalized =
FALSE;
3968 consdata->upgradetried =
FALSE;
3969 consdata->cliquesadded =
FALSE;
3970 consdata->implsadded =
FALSE;
3971 consdata->rangedrowpropagated = 0;
3989 assert(scip != NULL);
3990 assert(cons != NULL);
3993 assert(consdata != NULL);
3994 assert(consdata->row == NULL);
3998 for( i = consdata->nvars - 1; i >= 0; --i )
4000 newval = scalar * consdata->vals[i];
4010 SCIPwarningMessage(scip,
"coefficient %.15g of variable <%s> in linear constraint <%s> scaled to zero (scalar: %.15g)\n",
4015 consdata->vals[i] = newval;
4023 lhs = consdata->lhs;
4024 consdata->lhs = -consdata->rhs;
4025 consdata->rhs = -lhs;
4030 newval = absscalar * consdata->lhs;
4038 consdata->lhs = newval;
4042 newval = absscalar * consdata->rhs;
4050 consdata->rhs = newval;
4054 consdata->cliquesadded =
FALSE;
4055 consdata->implsadded =
FALSE;
4073 assert(scip != NULL);
4074 assert(conshdlr != NULL);
4075 assert(conss != NULL);
4076 assert(nconss >= 0);
4080 for( i = 0; i < nconss; i++ )
4085 if( consdata->varsdeleted )
4088 for( v = consdata->nvars - 1; v >= 0; --v )
4095 consdata->varsdeleted =
FALSE;
4147 assert(scip != NULL);
4148 assert(cons != NULL);
4156 assert(consdata != NULL);
4159 if( consdata->normalized )
4163 vals = consdata->vals;
4164 nvars = consdata->nvars;
4165 vars = consdata->vars;
4166 assert(nvars == 0 || vars != NULL);
4167 assert(nvars == 0 || vals != NULL);
4171 consdata->normalized =
TRUE;
4175 assert(vars != NULL);
4176 assert(vals != NULL);
4187 if( !
SCIPisEQ(scip, maxabsval, 1.0) )
4193 for( v = nvars - 1; v >= 0; --v )
4197 abscoefsequ =
FALSE;
4205 SCIPdebugMsg(scip,
"divide linear constraint with %g, because all coefficents are in absolute value the same\n", maxabsval);
4209 if( consdata->validmaxabsval )
4211 if( !
SCIPisEQ(scip, consdata->maxabsval, 1.0) )
4212 consdata->maxabsval = 1.0;
4213 if( !
SCIPisEQ(scip, consdata->minabsval, 1.0) )
4214 consdata->minabsval = 1.0;
4225 vals = consdata->vals;
4226 nvars = consdata->nvars;
4227 vars = consdata->vars;
4229 assert(nvars == 0 || vars != NULL);
4230 assert(nvars == 0 || vals != NULL);
4237 consdata->normalized =
TRUE;
4241 assert(vars != NULL);
4242 assert(vals != NULL);
4255 if( !consdata->hasnonbinvalid )
4259 if( !consdata->hascontvar )
4272 for( v = nvars - 1; v >= 0; --v )
4321 for( i = 0; i < nvars; ++i )
4328 if( nposcoeffs > nnegcoeffs )
4330 else if( nposcoeffs < nnegcoeffs )
4340 assert(mult == +1 || mult == -1);
4344 SCIPdebugMsg(scip,
"multiply linear constraint with -1.0\n");
4349 assert(nvars == consdata->nvars);
4359 for( i = 0; i < nvars && success && scm <= maxmult; ++i )
4364 success =
SCIPrealToRational(vals[i], -epsilon, epsilon , maxmult, &nominator, &denominator);
4374 onlyintegral =
TRUE;
4377 for( i = nvars - 1; i >= 0; --i )
4381 onlyintegral =
FALSE;
4387 success = success && (scm <= maxmult || (scm == 1 && onlyintegral));
4388 if( success && scm != 1 )
4391 SCIPdebugMsg(scip,
"scale linear constraint with %" SCIP_LONGINT_FORMAT
" to make coefficients integral\n", scm);
4395 if( consdata->validmaxabsval )
4400 consdata->validmaxabsval =
FALSE;
4406 if( consdata->validminabsval )
4411 consdata->validminabsval =
FALSE;
4418 vals = consdata->vals;
4419 nvars = consdata->nvars;
4420 assert(nvars == 0 || vals != NULL);
4426 if( success && nvars >= 1 )
4432 for( i = 1; i < nvars && gcd > 1; ++i )
4441 SCIPdebugMsg(scip,
"divide linear constraint by greatest common divisor %" SCIP_LONGINT_FORMAT
"\n", gcd);
4445 if( consdata->validmaxabsval )
4449 if( consdata->validminabsval )
4457 consdata->normalized =
TRUE;
4477 assert(scip != NULL);
4478 assert(cons != NULL);
4481 assert(consdata != NULL);
4483 if( consdata->merged )
4493 v = consdata->nvars-1;
4496 var = consdata->vars[v];
4497 if( consdata->vars[v-1] == var )
4499 valsum = consdata->vals[v];
4504 valsum += consdata->vals[v];
4506 while( v >= 1 && consdata->vars[v-1] == var );
4509 assert(consdata->vars[v] == var);
4517 if( consdata->maxactdeltavar == var )
4520 consdata->maxactdeltavar = NULL;
4531 consdata->merged =
TRUE;
4557 assert(scip != NULL);
4558 assert(cons != NULL);
4560 if( infeasible != NULL )
4561 *infeasible =
FALSE;
4564 assert(consdata != NULL);
4566 if( !consdata->removedfixings )
4571 lhssubtrahend = 0.0;
4572 rhssubtrahend = 0.0;
4578 while( v < consdata->nvars )
4580 var = consdata->vars[v];
4581 val = consdata->vals[v];
4602 if( val * fixedval > 0.0 )
4608 if( infeasible != NULL )
4621 lhssubtrahend += val * fixedval;
4627 if( val * fixedval > 0.0 )
4629 if( infeasible != NULL )
4646 rhssubtrahend += val * fixedval;
4657 assert(activevar != NULL);
4659 assert(activevar != NULL);
4669 lhssubtrahend += activeconstant;
4671 rhssubtrahend += activeconstant;
4682 for( i = 0; i < naggrvars; ++i )
4689 lhssubtrahend += val * aggrconst;
4691 rhssubtrahend += val * aggrconst;
4701 lhssubtrahend += val * aggrconst;
4703 rhssubtrahend += val * aggrconst;
4749 consdata->removedfixings =
TRUE;
4762 assert(consdata->removedfixings);
4766 for( v = 0; v < consdata->nvars; ++v )
4794 assert(scip != NULL);
4795 assert(cons != NULL);
4799 assert(consdata != NULL);
4801 vars = consdata->vars;
4802 vals = consdata->vals;
4803 nvars = consdata->nvars;
4805 assert(vars != NULL || nvars == 0);
4806 assert(vals != NULL || nvars == 0);
4808 assert(-1 <= inferpos && inferpos < nvars);
4809 assert((infervar == NULL) == (inferpos == -1));
4810 assert(inferpos == -1 || vars[inferpos] == infervar);
4832 if( infervar != NULL )
4834 assert(vals != NULL);
4837 &minisrelax, NULL, &isminsettoinfinity, NULL);
4840 NULL, &maxisrelax, NULL, &ismaxsettoinfinity);
4846 &minisrelax, NULL, &isminsettoinfinity, NULL);
4849 NULL, &maxisrelax, NULL, &ismaxsettoinfinity);
4853 if( (reasonisrhs && !isminsettoinfinity && !minisrelax) || (!reasonisrhs && !ismaxsettoinfinity && !maxisrelax) )
4858 resactisinf =
FALSE;
4863 if( infervar != NULL )
4865 assert(vals != NULL);
4875 rescap = consdata->rhs - minresactivity;
4885 rescap = consdata->lhs - maxresactivity;
4888 if( reasonisrhs == (vals[inferpos] > 0.0) )
4894 rescap = (reasonisrhs ? consdata->rhs - minresactivity : consdata->lhs - maxresactivity);
4899 for( i = 0; i < nvars; ++i )
4901 assert( vars != NULL && vals != NULL );
4904 if( vars[i] == infervar ||
SCIPisZero(scip, vals[i]) )
4913 if( reasonisrhs == (vals[i] > 0.0) )
4932 for( i = 0; i < nvars; ++i )
4934 assert(vars != NULL);
4935 assert(vals != NULL);
4938 if( vars[i] == infervar ||
SCIPisZero(scip, vals[i]) )
4941 if( reasonisrhs == (vals[i] > 0.0) )
4974 assert(scip != NULL);
4975 assert(cons != NULL);
4978 assert(consdata != NULL);
4979 vars = consdata->vars;
4980 nvars = consdata->nvars;
4981 assert(vars != NULL || nvars == 0);
4982 assert(-1 <= inferpos && inferpos < nvars);
4983 assert((infervar == NULL) == (inferpos == -1));
4984 assert(inferpos == -1 || vars != NULL);
4985 assert(inferpos == -1 || vars[inferpos] == infervar);
4988 for( v = nvars - 1; v >= 0; --v )
4990 assert(vars != NULL);
4993 if( vars[v] == infervar )
4995 assert(vars[v] != NULL);
5036 assert(scip != NULL);
5039 for( v = nvars - 1; v >= 0; --v )
5041 assert(vars != NULL);
5095 assert(scip != NULL);
5096 assert(cons != NULL);
5097 assert(result != NULL);
5100 assert(consdata != NULL);
5101 vars = consdata->vars;
5102 nvars = consdata->nvars;
5104 vals = consdata->vals;
5105 assert(vars != NULL);
5106 assert(vals != NULL);
5111 if( inferpos >= nvars || vars[inferpos] != infervar )
5115 for( inferpos = 0; inferpos < nvars && vars[inferpos] != infervar; ++inferpos )
5118 assert(inferpos < nvars);
5119 assert(vars[inferpos] == infervar);
5157 SCIPerrorMessage(
"invalid inference information %d in linear constraint <%s> at position %d for %s bound of variable <%s>\n",
5204 assert(consdata != NULL);
5206 infcountmin = consdata->minactivityneginf
5207 + consdata->minactivityposinf
5208 + consdata->minactivityneghuge
5209 + consdata->minactivityposhuge;
5210 infcountmax = consdata->maxactivityneginf
5211 + consdata->maxactivityposinf
5212 + consdata->maxactivityneghuge
5213 + consdata->maxactivityposhuge;
5215 if( infcountmin > 1 && infcountmax > 1 )
5241 assert(cons != NULL);
5245 assert(consdata != NULL);
5246 var = consdata->vars[pos];
5247 assert(var != NULL);
5256 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, activity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newub=%.15g\n",
5257 SCIPconsGetName(cons),
SCIPvarGetName(var), lb, oldub, consdata->vals[pos], consdata->minactivity, consdata->maxactivity, consdata->lhs, consdata->rhs, newub);
5266 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
5274 else if( tightened )
5277 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, new bds=[%.15g,%.15g]\n",
5284 consdata->upgradetried =
FALSE;
5310 assert(cons != NULL);
5314 assert(consdata != NULL);
5315 var = consdata->vars[pos];
5316 assert(var != NULL);
5325 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, activity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newlb=%.15g\n",
5326 SCIPconsGetName(cons),
SCIPvarGetName(var), oldlb, ub, consdata->vals[pos], consdata->minactivity, consdata->maxactivity, consdata->lhs, consdata->rhs, newlb);
5335 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
5343 else if( tightened )
5346 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, new bds=[%.15g,%.15g]\n",
5353 consdata->upgradetried =
FALSE;
5378 assert(scip != NULL);
5379 assert(cons != NULL);
5380 assert(cutoff != NULL);
5381 assert(nchgbds != NULL);
5388 assert(consdata != NULL);
5389 assert(0 <= pos && pos < consdata->nvars);
5393 var = consdata->vars[pos];
5394 assert(var != NULL);
5400 val = consdata->vals[pos];
5401 lhs = consdata->lhs;
5402 rhs = consdata->rhs;
5412 if( !consdata->validactivities )
5414 assert(consdata->validactivities);
5415 if( !consdata->validminact )
5417 assert(consdata->validminact);
5418 if( !consdata->validmaxact )
5420 assert(consdata->validmaxact);
5433 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, minactivity=%.15g > rhs=%.15g\n",
5440 slack = rhs - consdata->minactivity;
5448 alpha = val * (ub - lb);
5456 newub = lb + (slack / val);
5462 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
5482 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, maxactivity=%.15g < lhs=%.15g\n",
5489 slack = consdata->maxactivity - lhs;
5497 alpha = val * (ub - lb);
5505 newlb = ub - (slack / val);
5511 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
5530 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, minactivity=%.15g > rhs=%.15g\n",
5537 slack = rhs - consdata->minactivity;
5545 alpha = val * (lb - ub);
5553 newlb = ub + slack / val;
5559 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
5578 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, maxactivity=%.15g < lhs=%.15g\n",
5585 slack = consdata->maxactivity - lhs;
5593 alpha = val * (lb - ub);
5601 newub = lb - (slack / val);
5607 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
5633 assert(scip != NULL);
5634 assert(cons != NULL);
5637 assert(consdata != NULL);
5716 assert(scip != NULL);
5717 assert(cons != NULL);
5718 assert(cutoff != NULL);
5719 assert(nfixedvars != NULL);
5720 assert(nchgbds != NULL);
5721 assert(naddconss != NULL);
5728 assert(consdata != NULL);
5731 if( consdata->rangedrowpropagated == 2 )
5735 if( consdata->nvars < 3 )
5744 assert(conshdlr != NULL);
5746 assert(conshdlrdata != NULL);
5752 consdata->rangedrowpropagated = 2;
5759 if( consdata->rangedrowpropagated > 0 )
5762 consdata->rangedrowpropagated = 1;
5767 for( v = consdata->nvars - 1; v >= 0; --v )
5770 assert(!
SCIPisZero(scip, consdata->vals[v]));
5785 lhs = consdata->lhs - fixedact;
5786 rhs = consdata->rhs - fixedact;
5787 nunfixedvars = consdata->nvars - nfixedconsvars;
5832 absval =
REALABS(consdata->vals[v]);
5834 if( absminbincoef > absval )
5835 absminbincoef = absval;
5838 gcdisone = gcdisone &&
SCIPisEQ(scip,
REALABS(consdata->vals[v]), 1.0);
5839 possiblegcd =
FALSE;
5840 infcheckvars[ninfcheckvars] = consdata->vars[v];
5841 infcheckvals[ninfcheckvars] = consdata->vals[v];
5857 if( v == consdata->nvars )
5861 if( ncontvars + 2 > nunfixedvars )
5874 for( ; v < consdata->nvars; ++v )
5883 absval =
REALABS(consdata->vals[v]);
5885 if( absminbincoef > absval )
5886 absminbincoef = absval;
5895 gcdisone = gcdisone &&
SCIPisEQ(scip,
REALABS(consdata->vals[v]), 1.0);
5896 possiblegcd =
FALSE;
5897 infcheckvars[ninfcheckvars] = consdata->vars[v];
5898 infcheckvals[ninfcheckvars] = consdata->vals[v];
5907 assert(
REALABS(consdata->vals[v]) > 1.5);
5910 assert(gcdtmp >= 1);
5914 infcheckvars[ninfcheckvars] = consdata->vars[v];
5915 infcheckvals[ninfcheckvars] = consdata->vals[v];
5930 if( ninfcheckvars == 0 )
5935 minactinfvarsinvalid =
FALSE;
5936 maxactinfvarsinvalid =
FALSE;
5937 maxactinfvars = 0.0;
5938 minactinfvars = 0.0;
5941 for( v = ninfcheckvars - 1; v >= 0; --v )
5948 if( infcheckvals[v] < 0.0 )
5949 maxactinfvarsinvalid =
TRUE;
5951 minactinfvarsinvalid =
TRUE;
5955 if( infcheckvals[v] < 0.0 )
5956 maxactinfvars += infcheckvals[v] * lb;
5958 minactinfvars += infcheckvals[v] * lb;
5963 if( infcheckvals[v] > 0.0 )
5964 maxactinfvarsinvalid =
TRUE;
5966 minactinfvarsinvalid =
TRUE;
5970 if( infcheckvals[v] > 0.0 )
5971 maxactinfvars += infcheckvals[v] * ub;
5973 minactinfvars += infcheckvals[v] * ub;
5978 minactinfvarsinvalid =
TRUE;
5980 maxactinfvarsinvalid =
TRUE;
5982 if( minactinfvarsinvalid || maxactinfvarsinvalid )
5985 assert(!minactinfvarsinvalid && !maxactinfvarsinvalid);
5987 SCIPdebugMsg(scip,
"minactinfvarsinvalid = %u, minactinfvars = %g, maxactinfvarsinvalid = %u, maxactinfvars = %g, gcd = %lld, ninfcheckvars = %d, ncontvars = %d\n",
5988 minactinfvarsinvalid, minactinfvars, maxactinfvarsinvalid, maxactinfvars, gcd, ninfcheckvars, ncontvars);
6002 SCIPisGT(scip,
SCIPceil(scip, (lhs - maxactinfvars) / gcd) * gcd, rhs - minactinfvars) )
6013 else if( ncontvars == 0 )
6020 v = ninfcheckvars - 1;
6022 assert(gcdinfvars >= 2);
6024 for( ; v >= 0 && gcdinfvars >= 2; --v )
6032 SCIPdebugMsg(scip,
"gcdinfvars =%lld, possiblegcd = %u\n", gcdinfvars, possiblegcd);
6035 if( gcdinfvars >= 1 )
6046 while(
SCIPisLE(scip, value, maxactinfvars) )
6048 value2 = value + gcd * (
SCIPceil(scip, (lhs - value) / gcd));
6063 value += gcdinfvars;
6065 assert(nsols < 2 || minvalue <= maxvalue);
6076 while(
SCIPisGE(scip, value, minactinfvars) )
6078 value2 = value + gcd * (
SCIPfloor(scip, (rhs - value) / gcd));
6083 assert(maxvalue > minvalue);
6086 value -= gcdinfvars;
6088 assert(maxvalue > secondsolval);
6091 SCIPdebugMsg(scip,
"here nsols %s %d, minsolvalue = %g, maxsolvalue = %g, ninfcheckvars = %d, nunfixedvars = %d\n",
6092 nsols > 2 ?
">=" :
"=", nsols, minvalue, maxvalue, ninfcheckvars, nunfixedvars);
6097 SCIPdebugMsg(scip,
"gcdinfvars = %lld, gcd = %lld, correctedlhs = %g, correctedrhs = %g\n",
6098 gcdinfvars, gcd, lhs, rhs);
6109 else if( nsols == 1 )
6111 assert(minvalue == maxvalue);
6114 if( ninfcheckvars == 1 )
6120 SCIPdebugMsg(scip,
"fixing single variable <%s> with bounds [%.15g,%.15g] to %.15g\n",
6141 if( ninfcheckvars == nunfixedvars - 1 )
6148 assert(ninfcheckvars > 0);
6151 for( v = 0; v < consdata->nvars - 1; ++v )
6155 if( w >= ninfcheckvars || consdata->vars[v] != infcheckvars[w] )
6161 assert((nfixedconsvars == 0) ? (consdata->nvars - v - 1 == ninfcheckvars - w) :
TRUE);
6163 for( ; v2 < consdata->nvars && w2 < ninfcheckvars; ++v2 )
6168 assert(consdata->vars[v2] == infcheckvars[w2]);
6171 assert(w2 == ninfcheckvars);
6177 if( consdata->vals[v] < 0 )
6179 bound =
SCIPfloor(scip, (lhs - maxvalue) / consdata->vals[v]);
6183 bound =
SCIPceil(scip, (lhs - maxvalue) / consdata->vals[v]);
6186 SCIPdebugMsg(scip,
"fixing variable <%s> with bounds [%.15g,%.15g] to %.15g\n",
6199 consdata->vars[v], bound) );
6215 assert(v == consdata->nvars - 1);
6218 if( consdata->vals[v] < 0 )
6220 bound =
SCIPfloor(scip, (lhs - maxvalue) / consdata->vals[v]);
6224 bound =
SCIPceil(scip, (lhs - maxvalue) / consdata->vals[v]);
6227 SCIPdebugMsg(scip,
"fixing variable <%s> with bounds [%.15g,%.15g] to %.15g\n",
6240 consdata->vars[v], bound) );
6247 else if( addartconss && (
SCIPisGT(scip, minvalue, minactinfvars) ||
SCIPisLT(scip, maxvalue, maxactinfvars)) )
6255 ++conshdlrdata->naddconss;
6257 SCIPdebugMsg(scip,
"adding artificial constraint %s\n", name);
6260 maxvalue, maxvalue,
TRUE,
TRUE,
TRUE,
FALSE,
TRUE,
TRUE,
FALSE,
FALSE,
TRUE,
FALSE) );
6277 if( ninfcheckvars == 1 )
6285 if( infcheckvals[0] < 0 )
6287 newlb = maxvalue/infcheckvals[0];
6288 newub = minvalue/infcheckvals[0];
6292 newlb = minvalue/infcheckvals[0];
6293 newub = maxvalue/infcheckvals[0];
6295 assert(newlb < newub);
6300 SCIPdebugMsg(scip,
"tightening lower bound of variable <%s> from %g to %g\n",
6321 SCIPdebugMsg(scip,
"tightening upper bound of variable <%s> from %g to %g\n",
6340 else if( ninfcheckvars == nunfixedvars - 1 )
6348 assert(ninfcheckvars > 0);
6349 assert(minvalue < maxvalue);
6352 for( v = 0; v < consdata->nvars - 1; ++v )
6356 if( w >= ninfcheckvars || consdata->vars[v] != infcheckvars[w] )
6362 assert((nfixedconsvars == 0) ? (consdata->nvars - v - 1 == ninfcheckvars - w) :
TRUE);
6364 for( ; v2 < consdata->nvars && w2 < ninfcheckvars; ++v2 )
6369 assert(consdata->vars[v2] == infcheckvars[w2]);
6372 assert(w2 == ninfcheckvars);
6378 if( consdata->vals[v] < 0 )
6380 newlb =
SCIPfloor(scip, (rhs - minvalue) / consdata->vals[v]);
6381 newub =
SCIPfloor(scip, (lhs - maxvalue) / consdata->vals[v]);
6385 newlb =
SCIPceil(scip, (lhs - maxvalue) / consdata->vals[v]);
6386 newub =
SCIPceil(scip, (rhs - minvalue) / consdata->vals[v]);
6388 assert(
SCIPisLE(scip, newlb, newub));
6393 SCIPdebugMsg(scip,
"tightening lower bound of variable <%s> from %g to %g\n",
6405 consdata->vars[v], newlb) );
6415 SCIPdebugMsg(scip,
"tightening upper bound of variable <%s> from %g to %g\n",
6427 consdata->vars[v], newub) );
6444 assert(v == consdata->nvars - 1);
6447 if( consdata->vals[v] < 0 )
6449 newlb =
SCIPfloor(scip, (rhs - minvalue) / consdata->vals[v]);
6450 newub =
SCIPfloor(scip, (lhs - maxvalue) / consdata->vals[v]);
6454 newlb =
SCIPceil(scip, (lhs - maxvalue) / consdata->vals[v]);
6455 newub =
SCIPceil(scip, (rhs - minvalue) / consdata->vals[v]);
6457 assert(
SCIPisLE(scip, newlb, newub));
6462 SCIPdebugMsg(scip,
"tightening lower bound of variable <%s> from %g to %g\n",
6483 SCIPdebugMsg(scip,
"tightening upper bound of variable <%s> from %g to %g\n",
6505 else if( addartconss && (
SCIPisGT(scip, minvalue, minactinfvars) ||
SCIPisLT(scip, maxvalue, maxactinfvars)) )
6512 assert(maxvalue > minvalue);
6514 if(
SCIPisGT(scip, minvalue, minactinfvars) )
6519 if(
SCIPisLT(scip, maxvalue, maxactinfvars) )
6528 ++conshdlrdata->naddconss;
6530 SCIPdebugMsg(scip,
"adding artificial constraint %s\n", name);
6547 else if( addartconss && ncontvars < ninfcheckvars )
6554 for( v = 0; v < consdata->nvars; ++v )
6556 if( w < ninfcheckvars && consdata->vars[v] == infcheckvars[w] )
6566 if( consdata->vals[v] > 0.0 )
6567 maxact += consdata->vals[v];
6569 minact += consdata->vals[v];
6577 if( consdata->vals[v] > 0.0 )
6619 assert(maxact > minact);
6620 assert(w == ninfcheckvars);
6622 newlhs = lhs - maxact;
6623 newrhs = rhs - minact;
6624 assert(newlhs < newrhs);
6628 ++conshdlrdata->naddconss;
6630 SCIPdebugMsg(scip,
"adding artificial constraint %s\n", name);
6677 assert(scip != NULL);
6678 assert(cons != NULL);
6679 assert(cutoff != NULL);
6680 assert(nchgbds != NULL);
6687 assert(consdata != NULL);
6688 assert(0 <= pos && pos < consdata->nvars);
6692 var = consdata->vars[pos];
6698 val = consdata->vals[pos];
6699 lhs = consdata->lhs;
6700 rhs = consdata->rhs;
6702 &minisrelax, &maxisrelax, &isminsettoinfinity, &ismaxsettoinfinity);
6703 assert(var != NULL);
6715 if( !isminsettoinfinity && !
SCIPisInfinity(scip, rhs) && !minisrelax )
6719 newub = (rhs - minresactivity)/val;
6728 if( activityunreliable )
6731 newub = (rhs - minresactivity)/val;
6734 && (!force || !
SCIPisLT(scip, newub, ub)));
6737 if( !activityunreliable )
6740 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, resactivity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newub=%.15g\n",
6743 &infeasible, &tightened) );
6746 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
6761 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, new bds=[%.15g,%.15g]\n",
6768 if( !ismaxsettoinfinity && !
SCIPisInfinity(scip, -lhs) && !maxisrelax )
6772 newlb = (lhs - maxresactivity)/val;
6780 newlb = (lhs - maxresactivity)/val;
6784 && (!force || !
SCIPisGT(scip, newlb, lb))) )
6789 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, resactivity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newlb=%.15g\n",
6792 &infeasible, &tightened) );
6795 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
6809 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, new bds=[%.15g,%.15g]\n",
6818 if( !isminsettoinfinity && !
SCIPisInfinity(scip, rhs) && !minisrelax )
6822 newlb = (rhs - minresactivity)/val;
6829 if( activityunreliable )
6832 newlb = (rhs - minresactivity)/val;
6836 && (!force || !
SCIPisGT(scip, newlb, lb)));
6839 if( !activityunreliable )
6842 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, resactivity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newlb=%.15g\n",
6845 &infeasible, &tightened) );
6848 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
6862 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, new bds=[%.15g,%.15g]\n",
6869 if( !ismaxsettoinfinity && !
SCIPisInfinity(scip, -lhs) && !maxisrelax )
6873 newub = (lhs - maxresactivity)/val;
6881 newub = (lhs - maxresactivity)/val;
6885 && (!force || !
SCIPisLT(scip, newub, ub))) )
6890 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, resactivity=[%.15g,%.15g], sides=[%.15g,%.15g], newub=%.15g\n",
6893 &infeasible, &tightened) );
6896 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
6910 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, new bds=[%.15g,%.15g]\n",
6920 #define MAXTIGHTENROUNDS 10 6934 unsigned int tightenmode;
6940 int oldnchgbdstotal;
6946 assert(scip != NULL);
6947 assert(cons != NULL);
6948 assert(nchgbds != NULL);
6949 assert(cutoff != NULL);
6970 assert(consdata != NULL);
6972 nvars = consdata->nvars;
6982 if( !force && (consdata->boundstightened >= tightenmode) )
6989 assert(consdata->binvarssorted);
7022 if(
SCIPisLE(scip, consdata->maxactdelta, MIN(slack, surplus)) )
7027 easycase =
SCIPisLT(scip, consdata->maxactdelta, maxeasyactivitydelta);
7034 oldnchgbdstotal = *nchgbds;
7037 for( nrounds = 0; (force || consdata->boundstightened < tightenmode) && nrounds <
MAXTIGHTENROUNDS; ++nrounds )
7040 consdata->boundstightened = (
unsigned int)tightenmode;
7046 while( v < nvars && v != lastchange && !(*cutoff) )
7048 oldnchgbds = *nchgbds;
7062 if( *nchgbds > oldnchgbds )
7067 else if( consdata->binvarssorted && v < consdata->nbinvars - 1
7069 v = consdata->nbinvars;
7076 *nchgbds - oldnchgbdstotal, nrounds);
7077 oldnchgbdstotal += oldnchgbds;
7082 if( force &&
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
7108 assert(scip != NULL);
7109 assert(cons != NULL);
7110 assert(violated != NULL);
7116 assert(consdata != NULL);
7120 if( consdata->row != NULL )
7132 SCIPdebugMsg(scip,
" consdata activity=%.15g (lhs=%.15g, rhs=%.15g, row=%p, checklprows=%u, rowinlp=%u, sol=%p, hascurrentnodelp=%u)\n",
7133 activity, consdata->lhs, consdata->rhs, (
void*)consdata->row, checklprows,
7134 consdata->row == NULL ? 0 :
SCIProwIsInLP(consdata->row), (
void*)sol,
7138 lhsviol = consdata->lhs - activity;
7139 rhsviol = activity - consdata->rhs;
7143 if( (lhsviol > 0) && (lhsviol > rhsviol) )
7148 else if( rhsviol > 0 )
7159 assert(sol == NULL);
7170 else if( !consdata->checkabsolute && (
SCIPisFeasLT(scip, activity, consdata->lhs) ||
SCIPisFeasGT(scip, activity, consdata->rhs)) )
7173 if( !checkrelmaxabs )
7197 for( v = 0; v < consdata->nvars; ++v )
7199 if( consdata->vals != NULL )
7201 coef = consdata->vals[v];
7207 absval =
REALABS( coef * solval );
7208 maxabs =
MAX( maxabs, absval );
7215 if( (consdata->lhs - activity) <= (1e-15 * maxabs) )
7217 SCIPdebugMsg(scip,
" lhs violated due to random noise: violation=%16.9g, maxabs=%16.9g\n",
7218 consdata->lhs - activity, maxabs);
7230 if( (consdata->lhs - activity) <= (
SCIPfeastol(scip) * maxabs) )
7232 SCIPdebugMsg(scip,
" lhs violated absolutely (violation=%16.9g), but feasible when using relative tolerance w.r.t. maximum absolute value (%16.9g)\n",
7233 consdata->lhs - activity, maxabs);
7269 if( (activity - consdata->rhs) <= (1e-15 * maxabs) )
7271 SCIPdebugMsg(scip,
" rhs violated due to random noise: violation=%16.9g, maxabs=%16.9g\n",
7272 activity - consdata->rhs, maxabs);
7284 if( (activity - consdata->rhs) <= (
SCIPfeastol(scip) * maxabs) )
7286 SCIPdebugMsg(scip,
" rhs violated absolutely (violation=%16.9g), but feasible when using relative tolerance w.r.t. maximum absolute value (%16.9g)\n",
7287 activity - consdata->rhs, maxabs);
7321 else if( consdata->checkabsolute &&
7358 assert(scip != NULL);
7359 assert(cons != NULL);
7362 assert(consdata != NULL);
7363 assert(consdata->row == NULL);
7383 assert(scip != NULL);
7384 assert(cons != NULL);
7387 assert(consdata != NULL);
7389 if( consdata->row == NULL )
7394 assert(consdata->row != NULL);
7396 if( consdata->nvars == 0 )
7418 assert( pr == 0 || cr == 0 );
7444 assert(scip != NULL);
7445 assert(conshdlrdata != NULL);
7446 assert(cons != NULL);
7447 assert(cutoff != NULL);
7450 assert(ncuts != NULL);
7451 assert(consdata != NULL);
7456 SCIP_CALL(
checkCons(scip, cons, sol, (sol != NULL), conshdlrdata->checkrelmaxabs, &violated) );
7467 if( !separateall && sol == NULL )
7480 consdata->vals, +1.0, consdata->rhs, sol, cutoff, ncuts) );
7488 consdata->vals, -1.0, -consdata->lhs, sol, cutoff, ncuts) );
7498 consdata->vals, +1.0, consdata->rhs, sol, cutoff, ncuts) );
7503 consdata->vals, -1.0, -consdata->lhs, sol, cutoff, ncuts) );
7508 if( *ncuts > oldncuts )
7535 assert(scip != NULL);
7536 assert(cons != NULL);
7537 assert(cutoff != NULL);
7538 assert(nchgbds != NULL);
7543 assert(consdata != NULL);
7545 if( consdata->eventdata == NULL )
7551 assert(conshdlr != NULL);
7554 assert(conshdlrdata != NULL);
7558 assert(consdata->eventdata != NULL);
7577 oldnchgbds = *nchgbds;
7581 if( *nchgbds > oldnchgbds )
7588 if( rangedrowpropagation && tightenbounds && !(*cutoff) )
7607 SCIPdebugMsg(scip,
"linear constraint <%s> found %d bound changes and %d fixings\n",
SCIPconsGetName(cons), *nchgbds - oldnchgbds, nfixedvars);
7610 if( nfixedvars > 0 )
7611 *nchgbds += 2*nfixedvars;
7621 SCIPdebugMsg(scip,
"linear constraint <%s> is infeasible (rhs): activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
7622 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
7630 else if(
SCIPisFeasLT(scip, maxactivity, consdata->lhs) )
7632 SCIPdebugMsg(scip,
"linear constraint <%s> is infeasible (lhs): activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
7633 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
7641 else if(
SCIPisGE(scip, minactivity, consdata->lhs) &&
SCIPisLE(scip, maxactivity, consdata->rhs) )
7643 SCIPdebugMsg(scip,
"linear constraint <%s> is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
7644 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
7647 if( consdata->nvars > 0 )
7681 assert(scip != NULL);
7682 assert(cons != NULL);
7683 assert(cutoff != NULL);
7684 assert(nfixedvars != NULL);
7687 assert(consdata != NULL);
7689 for( v = 0; v < consdata->nvars; ++v )
7691 assert(consdata->vars != NULL);
7692 var = consdata->vars[v];
7704 SCIPdebugMsg(scip,
"converting variable <%s> with fixed bounds [%.15g,%.15g] into fixed variable fixed at %.15g\n",
7728 assert(consdata->removedfixings);
7733 #define MAX_CLIQUE_NONZEROS_PER_CONS 1000000 7825 int cliquenonzerosadded;
7832 assert(scip != NULL);
7833 assert(cons != NULL);
7834 assert(nfixedvars != NULL);
7835 assert(nchgbds != NULL);
7836 assert(cutoff != NULL);
7840 assert(consdata != NULL);
7842 if( consdata->nvars < 2 )
7851 if( !consdata->implsadded )
7863 nvars = consdata->nvars;
7864 vars = consdata->vars;
7865 vals = consdata->vals;
7868 if( !consdata->validactivities )
7870 assert(consdata->validactivities);
7874 finitenegminact = (consdata->glbminactivityneginf == 0 && consdata->glbminactivityneghuge == 0);
7875 finitenegmaxact = (consdata->glbmaxactivityneginf == 0 && consdata->maxactivityneghuge == 0);
7876 finiteposminact = (consdata->glbminactivityposinf == 0 && consdata->glbminactivityposhuge == 0);
7877 finiteposmaxact = (consdata->glbmaxactivityposinf == 0 && consdata->glbmaxactivityposhuge == 0);
7878 finiteminact = (finitenegminact && finiteposminact);
7879 finitemaxact = (finitenegmaxact && finiteposmaxact);
7881 if( (finiterhs || finitelhs) && (finitenegminact || finiteposminact || finitenegmaxact || finiteposmaxact) )
7886 int oldnchgbds = *nchgbds;
7892 if( (finitenegminact || finiteposminact) && !consdata->validglbminact )
7895 assert(consdata->validglbminact);
7898 if( (finitenegmaxact || finiteposmaxact) && !consdata->validglbmaxact )
7901 assert(consdata->validglbmaxact);
7903 assert(consdata->validglbminact || consdata->validglbmaxact);
7908 for( v = nvars - 1; v >= 0; --v )
7916 if( value > maxabscontrib )
7918 maxabscontrib = value;
7929 if( value > maxabscontrib )
7931 maxabscontrib = value;
7940 assert(0 <= position && position < nvars);
7942 if( !
SCIPisEQ(scip, maxabscontrib, 1.0) && !allbinary )
7948 if( finiterhs && finiteminact &&
SCIPisEQ(scip, consdata->glbminactivity, consdata->rhs - maxabscontrib) )
7950 for( v = nvars - 1; v >= 0; --v )
7962 *nchgbds += nbdchgs;
7969 *nchgbds += nbdchgs;
7989 if( finitelhs && finitemaxact &&
SCIPisEQ(scip, consdata->glbmaxactivity, consdata->lhs - maxabscontrib) )
7991 for( v = nvars - 1; v >= 0; --v )
8003 *nchgbds += nbdchgs;
8010 *nchgbds += nbdchgs;
8029 SCIPdebugMsg(scip,
"extracted %d implications from constraint %s which led to %d bound changes, %scutoff detetcted\n", nimpls,
SCIPconsGetName(cons), *nchgbds - oldnchgbds, *cutoff ?
"" :
"no ");
8035 if( *nchgbds - oldnchgbds > 0 )
8056 consdata->implsadded =
TRUE;
8060 if( consdata->cliquesadded )
8063 consdata->cliquesadded =
TRUE;
8064 cliquenonzerosadded = 0;
8070 nvars = consdata->nvars;
8071 vars = consdata->vars;
8072 vals = consdata->vals;
8077 if( !consdata->validactivities )
8079 assert(consdata->validactivities);
8083 finitenegminact = (consdata->glbminactivityneginf == 0 && consdata->glbminactivityneghuge == 0);
8084 finitenegmaxact = (consdata->glbmaxactivityneginf == 0 && consdata->maxactivityneghuge == 0);
8085 finiteposminact = (consdata->glbminactivityposinf == 0 && consdata->glbminactivityposhuge == 0);
8086 finiteposmaxact = (consdata->glbmaxactivityposinf == 0 && consdata->glbmaxactivityposhuge == 0);
8087 finiteminact = (finitenegminact && finiteposminact);
8088 finitemaxact = (finitenegmaxact && finiteposmaxact);
8093 if( (finiterhs || finitelhs) && (finitenegminact || finiteposminact || finitenegmaxact || finiteposmaxact) )
8097 int nposbinvars = 0;
8098 int nnegbinvars = 0;
8099 int allonebinary = 0;
8105 for( i = 0; i < nvars; ++i )
8114 binvars[nposbinvars + nnegbinvars] = vars[i];
8115 binvarvals[nposbinvars + nnegbinvars] = vals[i];
8122 assert(nposbinvars + nnegbinvars <= nvars);
8128 assert(nposbinvars + nnegbinvars <= nvars);
8133 if( allonebinary < nvars && (nposbinvars >= 2 || nnegbinvars >= 2) )
8136 int oldnchgbds = *nchgbds;
8142 if( (finitenegminact || finiteposminact) && !consdata->validglbminact )
8145 assert(consdata->validglbminact);
8148 if( (finitenegmaxact || finiteposmaxact) && !consdata->validglbmaxact )
8151 assert(consdata->validglbmaxact);
8153 assert(consdata->validglbminact || consdata->validglbmaxact);
8159 if( finiterhs && finitenegminact && nposbinvars >= 2 )
8162 threshold = consdata->rhs - consdata->glbminactivity;
8171 if(
SCIPisFeasGT(scip, binvarvals[i] + binvarvals[j], threshold) )
8175 while( j < nposbinvars )
8177 if( !
SCIPisFeasGT(scip, binvarvals[j-1] + binvarvals[j], threshold) )
8189 *nchgbds += nbdchgs;
8191 cliquenonzerosadded += j;
8196 if( !stopped && !(*cutoff) && j < nposbinvars )
8199 int lastfit = j - 2;
8200 assert(lastfit >= i);
8206 while( lastfit >= i && j < nposbinvars )
8209 if(
SCIPisFeasGT(scip, binvarvals[lastfit] + binvarvals[j], threshold) )
8211 clqvars[lastfit + 1] = binvars[j];
8222 *nchgbds += nbdchgs;
8224 cliquenonzerosadded += (lastfit - i + 2);
8243 if( !stopped && !*cutoff && *nchgbds - oldnchgbds > 0 )
8264 if( !consdata->validactivities )
8266 assert(consdata->validactivities);
8268 nvars = consdata->nvars;
8269 vars = consdata->vars;
8270 vals = consdata->vals;
8276 for( i = 0; i < nvars; ++i )
8285 binvars[nposbinvars + nnegbinvars] = vars[i];
8286 binvarvals[nposbinvars + nnegbinvars] = vals[i];
8293 assert(nposbinvars + nnegbinvars <= nvars);
8299 assert(nposbinvars + nnegbinvars <= nvars);
8304 oldnchgbds = *nchgbds;
8308 if( !stopped && !(*cutoff) && finitelhs && finiteposmaxact && nnegbinvars >= 2 )
8311 threshold = consdata->lhs - consdata->glbmaxactivity;
8313 i = nposbinvars + nnegbinvars - 1;
8320 if(
SCIPisFeasLT(scip, binvarvals[i] + binvarvals[j], threshold) )
8324 while( j >= nposbinvars )
8326 if( !
SCIPisFeasLT(scip, binvarvals[j+1] + binvarvals[j], threshold) )
8339 *nchgbds += nbdchgs;
8341 cliquenonzerosadded += (i - j);
8346 if( !stopped && !(*cutoff) && jstart >= nposbinvars )
8349 int lastfit = jstart + 1;
8350 assert(lastfit < i);
8357 while( lastfit <= i && j >= nposbinvars )
8360 if(
SCIPisFeasLT(scip, binvarvals[lastfit] + binvarvals[j], threshold) )
8362 assert(lastfit - jstart - 2 >= 0 && lastfit - jstart - 2 < i);
8363 clqvars[lastfit - jstart - 2] = binvars[j];
8365 assert(i - lastfit + 2 >= 2);
8375 *nchgbds += nbdchgs;
8377 cliquenonzerosadded += (i - lastfit + 2);
8396 if( !stopped && !*cutoff && *nchgbds - oldnchgbds > 0 )
8417 if( !consdata->validactivities )
8419 assert(consdata->validactivities);
8421 nvars = consdata->nvars;
8422 vars = consdata->vars;
8423 vals = consdata->vals;
8429 for( i = 0; i < nvars; ++i )
8438 binvars[nposbinvars + nnegbinvars] = vars[i];
8439 binvarvals[nposbinvars + nnegbinvars] = vals[i];
8446 assert(nposbinvars + nnegbinvars <= nvars);
8452 assert(nposbinvars + nnegbinvars <= nvars);
8457 oldnchgbds = *nchgbds;
8461 if( !(*cutoff) && finiterhs && finiteminact && nnegbinvars >= 2 )
8470 threshold = consdata->rhs - consdata->glbminactivity;
8472 i = nposbinvars + nnegbinvars - 1;
8480 if(
SCIPisFeasGT(scip, -binvarvals[i] - binvarvals[j], threshold) )
8484 while( j >= nposbinvars )
8486 if( !
SCIPisFeasGT(scip, -binvarvals[j+1] - binvarvals[j], threshold) )
8499 *nchgbds += nbdchgs;
8501 cliquenonzerosadded += (i - j);
8506 if( !stopped && !(*cutoff) && jstart >= nposbinvars )
8509 int lastfit = j + 1;
8510 assert(lastfit < i);
8517 while( lastfit <= i && j >= nposbinvars )
8520 if(
SCIPisFeasGT(scip, -binvarvals[lastfit] - binvarvals[j], threshold) )
8522 assert(lastfit - jstart - 2 >= 0 && lastfit - jstart - 2 < i);
8523 clqvars[lastfit - jstart - 2] = binvars[j];
8525 assert(i - lastfit + 2 >= 2);
8535 *nchgbds += nbdchgs;
8537 cliquenonzerosadded += (i - lastfit + 2);
8558 if( !stopped && !*cutoff && *nchgbds - oldnchgbds > 0 )
8579 if( !consdata->validactivities )
8581 assert(consdata->validactivities);
8583 nvars = consdata->nvars;
8584 vars = consdata->vars;
8585 vals = consdata->vals;
8591 for( i = 0; i < nvars; ++i )
8600 binvars[nposbinvars + nnegbinvars] = vars[i];
8601 binvarvals[nposbinvars + nnegbinvars] = vals[i];
8608 assert(nposbinvars + nnegbinvars <= nvars);
8614 assert(nposbinvars + nnegbinvars <= nvars);
8621 if( !stopped && !(*cutoff) && finitelhs && finitemaxact && nposbinvars >= 2 )
8630 threshold = consdata->lhs - consdata->glbmaxactivity;
8637 assert(!
SCIPisFeasLT(scip, -binvarvals[i], threshold));
8640 if(
SCIPisFeasLT(scip, -binvarvals[i] - binvarvals[j], threshold) )
8644 while( j < nposbinvars )
8646 if( !
SCIPisFeasLT(scip, -binvarvals[j-1] - binvarvals[j], threshold) )
8658 *nchgbds += nbdchgs;
8660 cliquenonzerosadded += j;
8665 if( !stopped && !(*cutoff) && j < nposbinvars )
8668 int lastfit = j - 2;
8669 assert(lastfit >= i);
8675 while( lastfit >= i && j < nposbinvars )
8678 if(
SCIPisFeasLT(scip, -binvarvals[lastfit] - binvarvals[j], threshold) )
8680 clqvars[lastfit + 1] = binvars[j];
8691 *nchgbds += nbdchgs;
8693 cliquenonzerosadded += (lastfit - i + 2);
8725 for( i = 0; i < nvars; ++i )
8729 else if(
SCIPisEQ(scip, vals[i], +1.0) )
8731 else if(
SCIPisEQ(scip, vals[i], -1.0) )
8740 if( lhsclique || rhsclique )
8745 SCIPdebugMsg(scip,
"linear constraint <%s>: adding clique with %d vars (%d pos, %d neg)\n",
8749 for( i = 0; i < nvars; ++i )
8750 values[i] = (rhsclique == (vals[i] > 0.0));
8757 *nchgbds += nbdchgs;
8776 assert(scip != NULL);
8777 assert(cons != NULL);
8778 assert(nchgsides != NULL);
8781 assert(consdata != NULL);
8786 for( i = 0; i < consdata->nvars && integral; ++i )
8793 SCIPdebugMsg(scip,
"linear constraint <%s>: make sides integral: sides=[%.15g,%.15g]\n",
8798 if( !consdata->upgraded )
8804 if( !consdata->upgraded )
8807 SCIPdebugMsg(scip,
"linear constraint <%s>: new integral sides: sides=[%.15g,%.15g]\n",
8878 assert(scip != NULL);
8879 assert(cons != NULL);
8880 assert(nchgcoefs != NULL);
8881 assert(nchgsides != NULL);
8884 assert(consdata != NULL);
8888 if( (consdata->validmaxabsval && consdata->maxabsval >
MAXVALRECOMP)
8889 || (consdata->validminabsval && consdata->minabsval <
MINVALRECOMP) )
8898 minleftactivity = 0.0;
8899 maxleftactivity = 0.0;
8903 while( i < consdata->nvars )
8905 var = consdata->vars[i];
8910 val = consdata->vals[i];
8918 SCIPisGE(scip, minactivity + val, consdata->lhs) &&
SCIPisLE(scip, maxactivity - val, consdata->rhs) )
8926 lval = consdata->lhs - minactivity;
8927 rval = maxactivity - consdata->rhs;
8930 if( consdata->nvars == 2 )
8933 otherval = consdata->vals[1-i];
8935 if( !
SCIPisInfinity(scip, -consdata->lhs) && consdata->minactivityneginf + consdata->minactivityneginf == 0 )
8937 lval = consdata->lhs - val*lb;
8941 if( !
SCIPisInfinity(scip,consdata->rhs) && consdata->maxactivityneginf + consdata->maxactivityneginf == 0 )
8943 rval = val*ub - consdata->rhs;
8948 newval =
MAX(lval, rval);
8952 newlhs = consdata->lhs - val * lb;
8953 newlhs += newval * lb;
8954 newrhs = consdata->rhs - val * ub;
8955 newrhs += newval * ub;
8959 SCIPdebugMsg(scip,
"linear constraint <%s>: change coefficient %+.15g<%s> to %+.15g<%s>, act=[%.15g,%.15g], side=[%.15g,%.15g]\n",
8961 minactivity, maxactivity, consdata->lhs, consdata->rhs);
8984 assert(
SCIPisEQ(scip, consdata->lhs, newlhs));
8993 assert(
SCIPisEQ(scip, consdata->rhs, newrhs));
9006 minleftactivity += val * lb;
9016 maxleftactivity += val * ub;
9024 SCIPisGE(scip, minactivity - val, consdata->lhs) &&
SCIPisLE(scip, maxactivity + val, consdata->rhs) )
9032 lval = minactivity - consdata->lhs;
9033 rval = consdata->rhs - maxactivity;
9036 if( consdata->nvars == 2 )
9039 otherval = consdata->vals[1-i];
9041 if( !
SCIPisInfinity(scip,-consdata->lhs) && consdata->minactivityneginf + consdata->minactivityneginf == 0 )
9043 lval = val*ub - consdata->lhs;
9047 if( !
SCIPisInfinity(scip,consdata->rhs) && consdata->maxactivityneginf + consdata->maxactivityneginf == 0 )
9049 rval = consdata->rhs - val*lb;
9054 newval = MIN(lval, rval);
9058 newlhs = consdata->lhs - val * ub;
9059 newlhs += newval * ub;
9060 newrhs = consdata->rhs - val * lb;
9061 newrhs += newval * lb;
9065 SCIPdebugMsg(scip,
"linear constraint <%s>: change coefficient %+.15g<%s> to %+.15g<%s>, act=[%.15g,%.15g], side=[%.15g,%.15g]\n",
9067 minactivity, maxactivity, consdata->lhs, consdata->rhs);
9090 assert(
SCIPisEQ(scip, consdata->lhs, newlhs));
9099 assert(
SCIPisEQ(scip, consdata->rhs, newrhs));
9112 minleftactivity += val * ub;
9122 maxleftactivity += val * lb;
9129 SCIPdebugMsg(scip,
"minleftactivity = %.15g, rhs = %.15g\n",
9130 minleftactivity, consdata->rhs);
9131 SCIPdebugMsg(scip,
"maxleftactivity = %.15g, lhs = %.15g\n",
9132 maxleftactivity, consdata->lhs);
9159 aggrlhs = consdata->lhs - minactivity + minleftactivity;
9160 aggrrhs = consdata->rhs - maxactivity + maxleftactivity;
9178 while( i < consdata->nvars )
9180 var = consdata->vars[i];
9181 minleftactivitypart = 0.0;
9182 maxleftactivitypart = 0.0;
9187 val = consdata->vals[i];
9195 SCIPisLT(scip, minactivity + val, consdata->lhs) ||
SCIPisGT(scip, maxactivity - val, consdata->rhs) )
9197 SCIPdebugMsg(scip,
"minactivity = %g\tval = %g\tlhs = %g\n", minactivity, val, consdata->lhs);
9198 SCIPdebugMsg(scip,
"maxactivity = %g\tval = %g\trhs = %g\n", maxactivity, val, consdata->rhs);
9199 SCIPdebugMsg(scip,
"linear constraint <%s>: remove variable <%s> with coefficient <%g> from constraint since it is redundant\n",
9202 minleftactivitypart = val * lb;
9203 maxleftactivitypart = val * ub;
9222 SCIPisLT(scip, minactivity - val, consdata->lhs) ||
SCIPisGT(scip, maxactivity + val, consdata->rhs) )
9224 SCIPdebugMsg(scip,
"linear constraint <%s>: remove variable <%s> with coefficient <%g> from constraint since it is redundant\n",
9227 minleftactivitypart = val * ub;
9228 maxleftactivitypart = val * lb;
9250 newlhs = consdata->lhs - minleftactivitypart;
9251 newrhs = consdata->rhs - maxleftactivitypart;
9258 assert(
SCIPisEQ(scip, consdata->lhs, newlhs));
9265 assert(
SCIPisEQ(scip, consdata->rhs, newrhs));
9291 assert(scip != NULL);
9292 assert(cons != NULL);
9293 assert(cutoff != NULL);
9294 assert(nfixedvars != NULL);
9295 assert(ndelconss != NULL);
9298 assert(consdata != NULL);
9299 assert(consdata->nvars == 1);
9300 assert(
SCIPisEQ(scip, consdata->lhs, consdata->rhs));
9303 var = consdata->vars[0];
9304 val = consdata->vals[0];
9308 SCIPdebugMsg(scip,
"linear equality <%s>: fix <%s> == %.15g\n",
9324 if( !consdata->upgraded )
9345 assert(scip != NULL);
9346 assert(cons != NULL);
9347 assert(cutoff != NULL);
9348 assert(naggrvars != NULL);
9349 assert(ndelconss != NULL);
9352 assert(consdata != NULL);
9353 assert(consdata->nvars == 2);
9354 assert(
SCIPisEQ(scip, consdata->lhs, consdata->rhs));
9356 SCIPdebugMsg(scip,
"linear constraint <%s>: aggregate %.15g<%s> + %.15g<%s> == %.15g\n",
9358 consdata->vals[1],
SCIPvarGetName(consdata->vars[1]), consdata->rhs);
9362 consdata->rhs, &infeasible, &redundant, &aggregated) );
9381 if( !consdata->upgraded )
9402 assert(scip != NULL);
9403 assert(consdata != NULL);
9404 assert(newlhs != NULL);
9405 assert(newrhs != NULL);
9411 if( slackcoef > 0.0 )
9416 *newrhs = consdata->rhs - slackcoef * slackvarlb;
9420 *newlhs = consdata->lhs - slackcoef * slackvarub;
9427 *newlhs = consdata->rhs - slackcoef * slackvarlb;
9431 *newrhs = consdata->lhs - slackcoef * slackvarub;
9433 assert(
SCIPisLE(scip, *newlhs, *newrhs));
9436 #define MAXMULTIAGGRQUOTIENT 1e+03 9478 int maxnlocksremove;
9488 assert(scip != NULL);
9489 assert(cons != NULL);
9490 assert(cutoff != NULL);
9491 assert(naggrvars != NULL);
9494 assert(consdata != NULL);
9495 assert(consdata->nvars > 2);
9496 assert(
SCIPisEQ(scip, consdata->lhs, consdata->rhs));
9505 lhs = consdata->lhs;
9506 rhs = consdata->rhs;
9508 if( consdata->nvars == 3 )
9513 maxnlocksremove = 3;
9515 else if( consdata->nvars == 4 )
9520 maxnlocksremove = 2;
9525 maxnlocksremove = 1;
9544 vars = consdata->vars;
9545 vals = consdata->vals;
9548 bestnlocks = INT_MAX;
9549 bestremovescons =
FALSE;
9550 bestslackdomrng = 0.0;
9551 coefszeroone =
TRUE;
9552 coefsintegral =
TRUE;
9553 varsintegral =
TRUE;
9561 for( v = 0; v < consdata->nvars; ++v )
9571 assert(vars != NULL);
9572 assert(vals != NULL);
9585 if( absval < minabsval )
9587 if( absval > maxabsval )
9595 coefszeroone = coefszeroone &&
SCIPisEQ(scip, absval, 1.0);
9623 if( nlocks > maxnlocksremove )
9627 if( (iscont || (coefsintegral && varsintegral &&
SCIPisEQ(scip, absval, 1.0))) &&
9641 slackdomrng = (varub - varlb)*absval;
9645 better = (slacktype > bestslacktype) || (bestslackpos == -1);
9646 if( !better && slacktype == bestslacktype )
9648 better = (nlocks < bestnlocks);
9649 if( nlocks == bestnlocks && !bestremovescons )
9651 better =
SCIPisGT(scip, slackdomrng, bestslackdomrng);
9652 equal = !better &&
SCIPisGE(scip, slackdomrng, bestslackdomrng);
9656 if( better || equal )
9670 &minisrelax, &maxisrelax, &isminsettoinfinity, &ismaxsettoinfinity);
9675 if( minisrelax || maxisrelax )
9695 if( conshdlrdata->multaggrremove && !removescons )
9699 if( bestremovescons && !removescons )
9705 if( !removescons && nlocks > maxnlocksstay )
9708 better = better || (!bestremovescons && removescons);
9712 bestslacktype = slacktype;
9713 bestnlocks = nlocks;
9714 bestslackdomrng = slackdomrng;
9715 bestremovescons = removescons;
9735 for( v = 0; v < consdata->nvars; ++v )
9737 if( v != bestslackpos )
9770 assert(!samevar || (supinf > 0 && infinf > 0));
9774 if( (samevar && (supinf > 1 || infinf > 1)) || (!samevar && supinf > 0 && infinf > 0) )
9776 SCIPdebugMsg(scip,
"do not perform multi-aggregation: infimum and supremum are both infinite\n");
9785 if( bestslackpos >= 0
9787 || (coefsintegral && varsintegral && nimplvars == 0)) )
9800 assert(bestslackpos < consdata->nvars);
9809 slackvar = vars[bestslackpos];
9810 slackcoef = vals[bestslackpos];
9812 aggrconst = consdata->rhs/slackcoef;
9815 assert(
SCIPisLE(scip, newlhs, newrhs));
9825 for( v = 0; v < consdata->nvars; ++v )
9827 scalars[v] = -consdata->vals[v]/slackcoef;
9830 SCIPdebugMsgPrint(scip,
" %+.15g, bounds of <%s>: [%.15g,%.15g], nlocks=%d, maxnlocks=%d, removescons=%u\n",
9832 bestnlocks, bestremovescons ? maxnlocksremove : maxnlocksstay, bestremovescons);
9836 &infeasible, &aggregated) );
9853 if( bestremovescons )
9858 if( !consdata->upgraded )
9862 else if( ncontvars == 1 )
9866 assert(0 <= contvarpos && contvarpos < consdata->nvars);
9867 var = vars[contvarpos];
9876 SCIPdebugMsg(scip,
"linear constraint <%s>: converting continuous variable <%s> to implicit integer variable\n",
9897 absval =
REALABS(vals[contvarpos]);
9908 #ifdef WITH_DEBUG_SOLUTION 9909 if( SCIPdebugIsMainscip(scip) )
9918 SCIPdebugMsg(scip,
"linear constraint <%s>: aggregating continuous variable <%s> to newly created implicit integer variable <%s>, aggregation factor = %g\n",
9926 SCIPdebugMsg(scip,
"infeasible aggregation of variable <%s> to implicit variable <%s>, domain is empty\n",
9948 consdata->boundstightened = 0;
9949 consdata->rangedrowpropagated = 0;
9950 consdata->presolved =
FALSE;
9953 else if( ncontvars == 0 && nimplvars == 0 && nintvars == 1 && !coefszeroone )
9960 assert(varsintegral);
9961 assert(0 <= intvarpos && intvarpos < consdata->nvars);
9962 var = vars[intvarpos];
9970 SCIPdebugMsg(scip,
"linear constraint <%s>: converting integer variable <%s> to implicit integer variable\n",
10004 vars = consdata->vars;
10005 nvars = consdata->nvars;
10007 assert(vars != NULL);
10009 for( v = 0; v < nvars; ++v )
10013 assert(var != NULL);
10019 assert(var != NULL);
10033 val = consdata->vals[v];
10040 (*scale) = val / -objval;
10044 else if(
SCIPisEQ(scip, -objval * (*scale), val) )
10052 (*scale) = val / objval;
10054 else if( !
SCIPisEQ(scip, objval * (*scale), val) )
10080 assert(scip != NULL);
10081 assert(cons != NULL);
10082 assert(conshdlrdata != NULL);
10085 assert(consdata != NULL);
10086 assert(
SCIPisEQ(scip, consdata->lhs, consdata->rhs));
10088 nvars = consdata->nvars;
10092 if( nvars > nobjvars || nvars == 0 )
10096 if( (nvars < nobjvars && !conshdlrdata->detectpartialobjective) ||
10097 (nvars == nobjvars && (!conshdlrdata->detectcutoffbound || !conshdlrdata->detectlowerbound)) )
10100 offset = consdata->rhs;
10110 vars = consdata->vars;
10111 assert(vars != NULL);
10115 SCIPdebugMsg(scip,
"linear equality constraint <%s> == %g (offset %g) is a subset of the objective function\n",
10119 for( v = 0; v < nvars; ++v )
10148 SCIPdebugMsg(scip,
"update cutoff bound <%g>\n", cutoffbound);
10157 assert(consdata != NULL);
10192 assert(scip != NULL);
10193 assert(cons != NULL);
10194 assert(conshdlrdata != NULL);
10197 assert(consdata != NULL);
10200 if(
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
10203 nvars = consdata->nvars;
10218 if( nobjvars == 0 )
10231 if( conshdlrdata->detectcutoffbound && rhsfinite )
10235 primalbound = (consdata->rhs - offset) / scale;
10237 SCIPdebugMsg(scip,
"constraint <%s> is parallel to objective function and provides a cutoff bound <%g>\n",
10243 if( conshdlrdata->detectlowerbound && lhsfinite )
10247 lowerbound = (consdata->lhs - offset) / scale;
10249 SCIPdebugMsg(scip,
"constraint <%s> is parallel to objective function and provides a lower bound <%g>\n",
10255 if( (conshdlrdata->detectcutoffbound && (conshdlrdata->detectlowerbound || !lhsfinite)) ||
10256 (conshdlrdata->detectlowerbound && !rhsfinite) )
10265 if( conshdlrdata->detectlowerbound && rhsfinite )
10269 lowerbound = (consdata->rhs - offset) / scale;
10271 SCIPdebugMsg(scip,
"constraint <%s> is parallel to objective function and provides a lower bound <%g>\n",
10277 if( conshdlrdata->detectcutoffbound && lhsfinite )
10281 primalbound = (consdata->lhs - offset) / scale;
10283 SCIPdebugMsg(scip,
"constraint <%s> is parallel to objective function and provides a cutoff bound <%g>\n",
10289 if( (conshdlrdata->detectcutoffbound && (conshdlrdata->detectlowerbound || !rhsfinite)) ||
10290 (conshdlrdata->detectlowerbound && !lhsfinite) )
10316 assert(scip != NULL);
10317 assert(cons != NULL);
10318 assert(conshdlrdata != NULL);
10319 assert(cutoff != NULL);
10320 assert(nfixedvars != NULL);
10321 assert(naggrvars != NULL);
10322 assert(ndelconss != NULL);
10325 assert(consdata != NULL);
10326 assert(consdata->removedfixings);
10329 if( !
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
10333 if( consdata->nvars == 1 )
10338 else if( consdata->nvars == 2 )
10368 assert(scip != NULL);
10369 assert(consdata != NULL);
10370 assert(0 <= pos && pos < consdata->nvars);
10372 for( v = 0; v < consdata->nvars; ++v )
10395 assert(scip != NULL);
10396 assert(minval != NULL);
10397 assert(maxval != NULL);
10402 *minval = -maxresactivity;
10404 *minval = (side - maxresactivity)/val;
10407 *maxval = -minresactivity;
10409 *maxval = (side - minresactivity)/val;
10414 *minval = minresactivity;
10416 *minval = (side - minresactivity)/val;
10419 *maxval = maxresactivity;
10421 *maxval = (side - maxresactivity)/val;
10448 assert(scip != NULL);
10449 assert(cons != NULL);
10450 assert(cutoff != NULL);
10451 assert(nfixedvars != NULL);
10452 assert(naggrvars != NULL);
10453 assert(ndelconss != NULL);
10463 assert(consdata != NULL);
10486 if( consdata->nvars <= 2 )
10487 maxotherlocks = INT_MAX;
10488 else if( consdata->nvars == 3 )
10490 else if( consdata->nvars == 4 )
10496 if( lhsexists && rhsexists && maxotherlocks < INT_MAX )
10499 for( i = 0; i < consdata->nvars && bestisint; ++i )
10510 var = consdata->vars[i];
10514 if( bestpos >= 0 && isint )
10526 val = consdata->vals[i];
10563 if( agglhs || aggrhs )
10576 &minisrelax, &maxisrelax, &isminsettoinfinity, &ismaxsettoinfinity);
10577 assert(
SCIPisLE(scip, minresactivity, maxresactivity));
10583 assert((!minisrelax || isminsettoinfinity) && (!maxisrelax || ismaxsettoinfinity));
10590 assert(
SCIPisLE(scip, minval, maxval));
10598 recalculated =
FALSE;
10599 oldmaxresactivity = maxresactivity;
10600 oldminresactivity = minresactivity;
10606 recalculated = !
SCIPisEQ(scip, oldminresactivity, minresactivity);
10607 isminsettoinfinity =
TRUE;
10614 recalculated = recalculated || !
SCIPisEQ(scip, oldmaxresactivity, maxresactivity);
10615 ismaxsettoinfinity =
TRUE;
10621 assert(
SCIPisLE(scip, minresactivity, maxresactivity));
10626 assert(
SCIPisLE(scip, minval, maxval));
10650 assert(
SCIPisLE(scip,minval,maxval));
10658 recalculated =
FALSE;
10659 oldmaxresactivity = maxresactivity;
10660 oldminresactivity = minresactivity;
10666 recalculated = !
SCIPisEQ(scip, oldminresactivity, minresactivity);
10673 recalculated = recalculated || !
SCIPisEQ(scip, oldmaxresactivity, maxresactivity);
10681 assert(
SCIPisLE(scip,minval,maxval));
10721 assert(!bestislhs || lhsexists);
10722 assert(bestislhs || rhsexists);
10724 bestvar = consdata->vars[bestpos];
10725 bestval = consdata->vals[bestpos];
10726 assert(bestisint ==
10742 for( j = 0; j < consdata->nvars; ++j )
10748 aggrvars[naggrs] = consdata->vars[j];
10749 aggrcoefs[naggrs] = -consdata->vals[j]/consdata->vals[bestpos];
10752 absaggrcoef =
REALABS(aggrcoefs[naggrs]);
10755 if( absaggrcoef < epsilon )
10757 SCIPdebugMsg(scip,
"do not perform multi-aggregation: too large aggregation coefficients\n");
10770 aggrcoefs[naggrs] =
SCIPfloor(scip, aggrcoefs[naggrs]+0.5);
10805 assert(!samevar || (supinf > 0 && infinf > 0));
10807 aggrconst = (bestislhs ? consdata->lhs/bestval : consdata->rhs/bestval);
10810 assert(naggrs == consdata->nvars-1);
10816 aggrconst =
SCIPfloor(scip, aggrconst+0.5);
10819 aggregated =
FALSE;
10820 infeasible =
FALSE;
10823 if( (samevar && supinf == 1 && infinf == 1) || (!samevar && (supinf == 0 || infinf == 0)) )
10834 SCIPdebugMsg(scip,
"do not perform multi-aggregation: infimum and supremum are both infinite\n");
10853 if( !consdata->upgraded )
10866 #define BINWEIGHT 1 10867 #define INTWEIGHT 4 10868 #define CONTWEIGHT 8 10917 assert( scip != NULL );
10918 assert( cons != NULL );
10921 assert( consdata != NULL );
10948 lhs = consdata->lhs;
10949 vars = consdata->vars;
10950 vals = consdata->vals;
10951 nvars = consdata->nvars;
10960 for( v = 0; v < nvars && noddvars < 3; ++v )
10975 if( noddvars == 0 )
10987 if( noddvars == 1 )
10989 assert( var1 != NULL );
10991 SCIPdebugMsg(scip,
"linear constraint <%s>: try fixing variable <%s> to <%g>\n",
11011 else if( noddvars == 2 )
11013 assert( var1 != NULL );
11014 assert( var2 != NULL );
11020 SCIPdebugMsg(scip,
"linear constraint <%s>: try aggregation of variables <%s> and <%s>\n",
11024 lhsodd ? 1.0 : 0.0, &infeasible, &redundant, &aggregated) );
11078 assert(consdata != NULL);
11079 assert(0 <= ind1 && ind1 < consdata->nvars);
11080 assert(0 <= ind2 && ind2 < consdata->nvars);
11088 if( vartype2 != vartype1 )
11098 value =
REALABS(consdata->vals[ind2]) -
REALABS(consdata->vals[ind1]);
11101 return (value > 0 ? +1 : (value < 0 ? -1 : 0));
11137 assert(consdata != NULL);
11139 nvars = consdata->nvars;
11145 vals = consdata->vals;
11146 vars = consdata->vars;
11147 assert(vars != NULL);
11148 assert(vals != NULL);
11150 lhs = consdata->lhs;
11151 rhs = consdata->rhs;
11159 for( v = nvars - 1; v >= 0; --v )
11165 secondminval = minval;
11168 else if( secondminval > vals[v] || secondminval ==
SCIP_INVALID )
11169 secondminval = vals[v];
11188 for( v = nvars - 1; v >= 0; --v )
11192 (*nchgcoefs) += nvars;
11267 assert(scip != NULL);
11268 assert(cons != NULL);
11269 assert(nchgcoefs != NULL);
11270 assert(nchgsides != NULL);
11280 assert(consdata != NULL);
11282 nvars = consdata->nvars;
11306 consdata->normalized =
FALSE;
11310 assert(nvars == consdata->nvars);
11312 if( !consdata->normalized )
11315 lhs = consdata->lhs;
11316 rhs = consdata->rhs;
11330 SCIPdebug( oldnchgcoefs = *nchgcoefs; )
11331 SCIPdebug( oldnchgsides = *nchgsides; )
11334 if( haslhs && hasrhs )
11340 assert(haslhs != hasrhs);
11352 SCIPsort(perm, consdataCompSim, (
void*)consdata, nvars);
11356 consdata->sorted =
FALSE;
11357 consdata->binvarssorted =
FALSE;
11359 vars = consdata->vars;
11360 vals = consdata->vals;
11361 assert(vars != NULL);
11362 assert(vals != NULL);
11378 SCIPdebugMsg(scip,
"starting simplification of coefficients\n");
11383 &isminrelax, &ismaxrelax, &isminsettoinfinity, &ismaxsettoinfinity);
11386 if( isminsettoinfinity || ismaxsettoinfinity )
11389 assert(!isminrelax);
11390 assert(!ismaxrelax);
11391 assert(maxactsub > minactsub);
11397 side = haslhs ? lhs : rhs;
11427 while( v < nvars &&
SCIPisEQ(scip, side, vals[v]) )
11451 if(
SCIPisEQ(scip, side, -vals[v]) )
11466 for( w = 0; w < v; ++w )
11471 assert(vals[w] > 0);
11474 maxactsub -= ub * vals[w];
11475 minactsub -= lb * vals[w];
11476 assert(maxactsub > minactsub);
11504 maxactsub -= ub * vals[0];
11505 minactsub -= lb * vals[0];
11509 maxactsub -= lb * vals[0];
11510 minactsub -= ub * vals[0];
11512 assert(maxactsub > minactsub);
11517 allcoefintegral =
TRUE;
11520 for( ; v < nvars - 1; ++v )
11527 allcoefintegral =
FALSE;
11546 maxactsub -= ub * vals[v];
11547 minactsub -= lb * vals[v];
11551 maxactsub -= lb * vals[v];
11552 minactsub -= ub * vals[v];
11554 assert(
SCIPisGE(scip, maxactsub, minactsub));
11570 if( (offsetv == -1 && hasrhs && maxactsub <= siderest &&
SCIPisFeasGT(scip, minactsub, siderest - gcd)) || (haslhs &&
SCIPisFeasLT(scip, maxactsub, siderest) && minactsub >= siderest - gcd) )
11576 assert(v < nvars || (offsetv >= 0 && gcd > 1));
11596 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",
11597 v, nvars, minactsub, maxactsub, redundant, hasrhs, siderest, gcd, offsetv);
11600 if( v < nvars && (redundant ||
11601 (offsetv == -1 && hasrhs && maxactsub <= siderest &&
SCIPisFeasGT(scip, minactsub, siderest - gcd)) ||
11602 (haslhs &&
SCIPisFeasLT(scip, maxactsub, siderest) && minactsub >= siderest - gcd)) )
11612 for( w = v; w < nvars; ++w )
11623 tmpmaxactsub += ub * vals[w];
11624 tmpminactsub += lb * vals[w];
11628 tmpmaxactsub += lb * vals[w];
11629 tmpminactsub += ub * vals[w];
11631 assert(tmpmaxactsub >= tmpminactsub);
11636 assert(offsetv == -1);
11650 assert((hasrhs &&
SCIPisLE(scip, tmpmaxactsub, siderest) && tmpminactsub > siderest - gcd) || (haslhs && tmpmaxactsub < siderest &&
SCIPisGE(scip, tmpminactsub, siderest - gcd)));
11653 SCIPdebugMsg(scip,
"removing %d last variables from constraint <%s>, because they never change anything on the feasibility of this constraint\n",
11657 for( w = nvars - 1; w >= v; --w )
11661 (*nchgcoefs) += (nvars - v);
11669 assert(vars == consdata->vars);
11670 assert(vals == consdata->vals);
11671 assert(w < consdata->nvars);
11674 gcd = (
SCIP_Longint)(gcd / (oldcoef/vals[w]) + feastol);
11682 rhs = consdata->rhs;
11689 lhs = consdata->lhs;
11692 assert(offsetv == -1 ||
SCIPisEQ(scip, vals[offsetv], consdata->lhs));
11700 nvars = consdata->nvars;
11701 assert(nvars >= 2);
11703 allcoefintegral =
TRUE;
11707 for( w = offsetv + 1; w < nvars; ++w )
11716 if( offsetv >= 0 && gcd == 1 )
11726 for( v = nvars - 1; v > offsetv; --v )
11734 allcoefintegral =
FALSE;
11760 if( candpos == -1 )
11770 assert(v > offsetv || candpos > offsetv);
11776 candpos = nvars - 1;
11779 if( gcd > 1 && allcoefintegral && !redundant )
11782 allcoefintegral =
FALSE;
11786 if( offsetv >= 0 && gcd > 1 && allcoefintegral )
11788 assert(offsetv + 1 < nvars);
11789 assert(0 <= candpos && candpos < nvars);
11797 for( w = offsetv + 1; w < nvars; ++w )
11812 assert(rest < gcd);
11815 restcoef = ((
SCIP_Longint)(vals[candpos] + feastol)) % gcd;
11816 assert(restcoef >= 1);
11817 assert(restcoef < gcd);
11822 if( restcoef > rest )
11823 newcoef = vals[candpos] - restcoef + gcd;
11825 newcoef = vals[candpos] - restcoef;
11830 if( rest == 0 || restcoef < rest )
11831 newcoef = vals[candpos] - restcoef;
11833 newcoef = vals[candpos] - restcoef + gcd;
11844 notchangable =
TRUE;
11885 for( w = offsetv; w >= 0; --w )
11887 assert(vals[w] > 0);
11891 (*nchgcoefs) += (offsetv + 1);
11894 if( !notchangable )
11898 assert(vars == consdata->vars);
11899 assert(vals == consdata->vals);
11902 nvars = consdata->nvars;
11903 assert(nvars >= 2);
11907 lhs = consdata->lhs;
11908 rhs = consdata->rhs;
11922 allcoefintegral =
TRUE;
11924 for( v = nvars - 1; v >= 0; --v )
11929 allcoefintegral =
FALSE;
11946 if( allcoefintegral )
11957 for( v = nvars - 1; v >= 0; --v )
11980 frac += (val -
SCIPfloor(scip, val)) * ub;
11987 if(
SCIPisGT(scip, frac, siderest) )
11993 SCIPdebugMsg(scip,
"rounding all non-integral coefficients and the right hand side down\n");
11998 for( v = nvars - 1; v >= 0; --v )
12035 if( allcoefintegral )
12050 for( v = nvars - 1; v >= 0; --v )
12081 frac += (val -
SCIPfloor(scip, val)) * ub;
12089 if(
SCIPisGE(scip, frac, 1 + siderest) )
12098 SCIPdebugMsg(scip,
"rounding all non-integral coefficients and the left hand side down\n");
12103 for( v = nvars - 1; v >= 0; --v )
12141 assert(vars == consdata->vars);
12142 assert(vals == consdata->vals);
12144 rhs = consdata->rhs;
12145 lhs = consdata->lhs;
12152 nvars = consdata->nvars;
12156 allcoefintegral =
TRUE;
12159 for( v = nvars - 1; v >= 0; --v )
12166 if( !allcoefintegral )
12181 assert(nvars >= 2);
12186 SCIPdebug( oldnchgcoefs = *nchgcoefs; )
12187 SCIPdebug( oldnchgsides = *nchgsides; )
12200 for( v = nvars - 1; v >= 0; --v )
12207 if( foundbin == -1 )
12233 foundbin = nvars - 1;
12236 if( gcd == 1 || foundbin == -1)
12239 assert((onlybin && gcd == -1) || (!onlybin && gcd > 1));
12247 for( v = foundbin; v >= 0; --v )
12276 if( candpos == -1 )
12284 if( onlybin && v == foundbin - 1 )
12285 candpos2 = foundbin;
12290 if( onlybin && candpos == v + 1 && candpos2 == v + 2 )
12292 assert(candpos2 == nvars - 1);
12295 candpos = candpos2;
12318 assert(candpos >= 0 && candpos < nvars);
12335 assert(rest < gcd);
12338 if( vals[candpos] < 0 )
12340 restcoef = ((
SCIP_Longint)(vals[candpos] - feastol)) % gcd;
12341 assert(restcoef <= -1);
12345 restcoef = ((
SCIP_Longint)(vals[candpos] + feastol)) % gcd;
12346 assert(restcoef >= 1);
12347 assert(restcoef < gcd);
12359 if( restcoef > rest )
12360 newcoef = vals[candpos] - restcoef + gcd;
12362 newcoef = vals[candpos] - restcoef;
12374 if( rest == 0 || restcoef < rest )
12375 newcoef = vals[candpos] - restcoef;
12377 newcoef = vals[candpos] - restcoef + gcd;
12381 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));
12397 assert(vars == consdata->vars);
12398 assert(vals == consdata->vals);
12402 rhs = consdata->rhs;
12403 lhs = consdata->lhs;
12407 nvars = consdata->nvars;
12409 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));
12411 while( nvars >= 2 );
12431 int* diffidx0minus1,
12432 int* diffidx1minus0,
12434 int commonidxweight,
12435 int diffidx0minus1weight,
12436 int diffidx1minus0weight,
12459 assert(scip != NULL);
12460 assert(cons0 != NULL);
12461 assert(cons1 != NULL);
12462 assert(commonidx0 != NULL);
12463 assert(commonidx1 != NULL);
12464 assert(diffidx0minus1 != NULL);
12465 assert(diffidx1minus0 != NULL);
12466 assert(nvarscommon >= 1);
12467 assert(commonidxweight >= nvarscommon);
12468 assert(nchgcoefs != NULL);
12469 assert(aggregated != NULL);
12478 assert(consdata0 != NULL);
12479 assert(consdata0->nvars >= 1);
12480 assert(
SCIPisLE(scip, consdata0->lhs, consdata0->rhs));
12481 assert(diffidx0minus1weight >= consdata0->nvars - nvarscommon);
12485 assert(consdata1 != NULL);
12486 assert(consdata1->nvars >= 1);
12487 assert(
SCIPisEQ(scip, consdata1->lhs, consdata1->rhs));
12488 assert(diffidx1minus0weight >= consdata1->nvars - nvarscommon);
12490 *aggregated =
FALSE;
12496 bestvarweight = commonidxweight + diffidx0minus1weight;
12497 bestnvars = consdata0->nvars;
12499 bestscalarsum = 0.0;
12500 commonvarlindependent =
TRUE;
12501 for( v = 0; v < nvarscommon; ++v )
12503 assert(consdata0->vars[commonidx0[v]] == consdata1->vars[commonidx1[v]]);
12504 a = consdata1->vals[commonidx1[v]];
12505 b = -consdata0->vals[commonidx0[v]];
12511 varweight = diffidx0minus1weight + diffidx1minus0weight;
12512 nvars = consdata0->nvars + consdata1->nvars - 2*nvarscommon;
12514 betterscalarsum = (scalarsum < bestscalarsum);
12515 for( i = 0; i < nvarscommon
12516 && (varweight < bestvarweight || (varweight == bestvarweight && betterscalarsum)); ++i )
12518 aggrcoef = a * consdata0->vals[commonidx0[i]] + b * consdata1->vals[commonidx1[i]];
12521 varweight +=
getVarWeight(consdata0->vars[commonidx0[i]]);
12525 if( varweight < bestvarweight || (varweight == bestvarweight && betterscalarsum) )
12528 bestvarweight = varweight;
12530 bestscalarsum = scalarsum;
12537 if( commonvarlindependent && v > 0 )
12538 commonvarlindependent =
SCIPisEQ(scip,
12539 consdata1->vals[commonidx1[v]] * consdata0->vals[commonidx0[0]],
12540 consdata1->vals[commonidx1[0]] * consdata0->vals[commonidx0[v]]);
12557 if( consdata1->vals[commonidx1[bestv]] > 0.0 )
12559 a = consdata1->vals[commonidx1[bestv]];
12560 b = -consdata0->vals[commonidx0[bestv]];
12564 a = -consdata1->vals[commonidx1[bestv]];
12565 b = consdata0->vals[commonidx0[bestv]];
12574 assert(commonvarlindependent);
12575 if( consdata1->vals[commonidx1[0]] > 0.0 )
12577 a = consdata1->vals[commonidx1[0]];
12578 b = -consdata0->vals[commonidx0[0]];
12582 a = -consdata1->vals[commonidx1[0]];
12583 b = consdata0->vals[commonidx0[0]];
12604 SCIPdebug( bestvarweight = diffidx0minus1weight + diffidx1minus0weight; )
12605 bestnvars = consdata0->nvars + consdata1->nvars - 2*nvarscommon;
12608 SCIPdebugMsg(scip,
"aggregate linear constraints <%s> := %.15g*<%s> + %.15g*<%s> -> nvars: %d -> %d, weight: %d -> %d\n",
12610 consdata0->nvars, bestnvars, commonidxweight + diffidx0minus1weight, bestvarweight);
12620 if( !commonvarlindependent )
12622 for( i = 0; i < nvarscommon; ++i )
12624 assert(0 <= commonidx0[i] && commonidx0[i] < consdata0->nvars);
12625 assert(0 <= commonidx1[i] && commonidx1[i] < consdata1->nvars);
12627 aggrcoef = a * consdata0->vals[commonidx0[i]] + b * consdata1->vals[commonidx1[i]];
12630 assert(newnvars < bestnvars);
12631 newvars[newnvars] = consdata0->vars[commonidx0[i]];
12632 newvals[newnvars] = aggrcoef;
12641 for( i = 0; i < nvarscommon; ++i )
12643 assert(0 <= commonidx0[i] && commonidx0[i] < consdata0->nvars);
12644 assert(0 <= commonidx1[i] && commonidx1[i] < consdata1->nvars);
12646 aggrcoef = a * consdata0->vals[commonidx0[i]] + b * consdata1->vals[commonidx1[i]];
12653 for( i = 0; i < consdata0->nvars - nvarscommon; ++i )
12655 assert(0 <= diffidx0minus1[i] && diffidx0minus1[i] < consdata0->nvars);
12657 aggrcoef = a * consdata0->vals[diffidx0minus1[i]];
12659 assert(newnvars < bestnvars);
12660 newvars[newnvars] = consdata0->vars[diffidx0minus1[i]];
12661 newvals[newnvars] = aggrcoef;
12666 for( i = 0; i < consdata1->nvars - nvarscommon; ++i )
12668 assert(0 <= diffidx1minus0[i] && diffidx1minus0[i] < consdata1->nvars);
12670 aggrcoef = b * consdata1->vals[diffidx1minus0[i]];
12672 assert(newnvars < bestnvars);
12673 newvars[newnvars] = consdata1->vars[diffidx1minus0[i]];
12674 newvals[newnvars] = aggrcoef;
12677 assert(newnvars == bestnvars);
12685 newlhs = a * consdata0->lhs + b * consdata1->lhs;
12689 newrhs = a * consdata0->rhs + b * consdata1->rhs;
12699 assert(newconsdata != NULL);
12702 newconsdata->upgraded = consdata0->upgraded;
12716 if( !consdata0->upgraded )
12717 (*nchgcoefs) += consdata0->nvars + consdata1->nvars - nvarscommon;
12718 *aggregated =
TRUE;
12757 assert(key1 != NULL);
12758 assert(key2 != NULL);
12761 assert(consdata1->sorted);
12762 assert(consdata2->sorted);
12764 scip = (
SCIP*)userptr;
12765 assert(scip != NULL);
12772 if( consdata1->nvars != consdata2->nvars )
12776 for( i = 0; i < consdata1->nvars; ++i )
12778 if( consdata1->vars[i] != consdata2->vars[i] )
12780 assert(
SCIPvarCompare(consdata1->vars[i], consdata2->vars[i]) == 1 ||
12784 assert(
SCIPvarCompare(consdata1->vars[i], consdata2->vars[i]) == 0);
12788 cons1scale = COPYSIGN(1.0/consdata1->maxabsval, consdata1->vals[0]);
12789 cons2scale = COPYSIGN(1.0/consdata2->maxabsval, consdata2->vals[0]);
12792 for( i = 0; i < consdata1->nvars; ++i )
12797 val1 = consdata1->vals[i] * cons1scale;
12798 val2 = consdata2->vals[i] * cons2scale;
12819 scip = (
SCIP*)userptr;
12820 assert(scip != NULL);
12823 assert(key != NULL);
12825 assert(consdata != NULL);
12826 assert(consdata->nvars > 0);
12828 assert(consdata->sorted);
12833 assert(minidx >= 0 && minidx <= maxidx);
12834 scale = COPYSIGN(1.0/consdata->maxabsval, consdata->vals[0]);
12853 assert(cons != NULL);
12856 assert(consdata != NULL);
12858 return (((
unsigned int)consdata->upgraded)<<31) + (
unsigned int)
SCIPconsGetPos(cons);
12872 int* nparallelconss
12876 unsigned int querykey;
12878 *nparallelconss = 0;
12885 if( conskey < querykey )
12887 parallelconss[(*nparallelconss)++] = *querycons;
12888 *querycons = parallelcons;
12889 querykey = conskey;
12893 parallelconss[(*nparallelconss)++] = parallelcons;
12904 if( *querycons == parallelcons )
12940 int nparallelconss;
12944 assert(scip != NULL);
12945 assert(blkmem != NULL);
12946 assert(conss != NULL);
12947 assert(firstchange != NULL);
12948 assert(cutoff != NULL);
12949 assert(ndelconss != NULL);
12950 assert(nchgsides != NULL);
12953 hashtablesize = nconss;
12955 hashGetKeyLinearcons, hashKeyEqLinearcons, hashKeyValLinearcons, (
void*) scip) );
12960 for( c = 0; c < nconss; ++c )
12976 assert(consdata0 != NULL);
12978 assert(consdata0->sorted);
12987 if( nparallelconss != 0 )
12997 lhs = consdata0->lhs;
12998 rhs = consdata0->rhs;
13000 for( i = 0; i < nparallelconss; ++i )
13006 consdel = parallelconss[i];
13015 assert(consdatadel != NULL);
13016 assert(consdata0->nvars >= 1 && consdata0->nvars == consdatadel->nvars);
13018 assert(consdatadel->sorted);
13019 assert(consdata0->vars[0] == consdatadel->vars[0]);
13021 scale = consdata0->vals[0] / consdatadel->vals[0];
13022 assert(scale != 0.0);
13030 SCIP_Real scale0 = 1.0 / consdata0->maxabsval;
13031 SCIP_Real scaledel = COPYSIGN(1.0 / consdatadel->maxabsval, scale);
13033 for( k = 0; k < consdata0->nvars; ++k )
13035 assert(
SCIPisEQ(scip, scale0 * consdata0->vals[k], scaledel * consdatadel->vals[k]));
13043 SCIPdebugMsg(scip,
"aggregate linear constraints <%s> and <%s> with equal coefficients into single ranged row\n",
13049 lhs =
MAX(scale * consdatadel->lhs, lhs);
13052 rhs = MIN(scale * consdatadel->rhs, rhs);
13057 SCIPdebugMsg(scip,
"aggregate linear constraints <%s> and <%s> with negated coefficients into single ranged row\n",
13063 lhs =
MAX(scale * consdatadel->rhs, lhs);
13066 rhs = MIN(scale * consdatadel->lhs, rhs);
13073 assert( ! consdata0->upgraded || consdatadel->upgraded );
13075 if( !consdatadel->upgraded )
13089 rhs = (lhs + rhs)/2;
13098 if( consdata0->changed &&
SCIPconsGetPos(cons0) < *firstchange )
13104 #ifdef SCIP_MORE_DEBUG 13105 SCIPinfoMessage(scip, NULL,
"linear pairwise comparison hashtable statistics:\n");
13137 int* diffidx0minus1;
13138 int* diffidx1minus0;
13139 uint64_t possignature0;
13140 uint64_t negsignature0;
13143 int diffidx1minus0size;
13149 assert(scip != NULL);
13150 assert(conss != NULL);
13151 assert(firstchange <= chkind);
13152 assert(cutoff != NULL);
13153 assert(ndelconss != NULL);
13154 assert(nchgsides != NULL);
13155 assert(nchgcoefs != NULL);
13158 cons0 = conss[chkind];
13159 assert(cons0 != NULL);
13164 assert(consdata0 != NULL);
13165 assert(consdata0->nvars >= 1);
13166 cons0isequality =
SCIPisEQ(scip, consdata0->lhs, consdata0->rhs);
13173 possignature0 = consdata0->possignature;
13174 negsignature0 = consdata0->negsignature;
13181 diffidx1minus0size = consdata0->nvars;
13183 cons0lhs = consdata0->lhs;
13184 cons0rhs = consdata0->rhs;
13185 cons0upgraded = consdata0->upgraded;
13188 cons0changed = consdata0->changed;
13189 consdata0->changed =
FALSE;
13190 for( c = (cons0changed ? 0 : firstchange); c < chkind && !(*cutoff) && conss[chkind] != NULL; ++c )
13194 uint64_t possignature1;
13195 uint64_t negsignature1;
13207 int commonidxweight;
13208 int diffidx0minus1weight;
13209 int diffidx1minus0weight;
13213 assert(cons0lhs == consdata0->lhs);
13214 assert(cons0rhs == consdata0->rhs);
13215 assert(cons0upgraded == consdata0->upgraded);
13220 if( cons1 == NULL )
13227 assert(consdata1 != NULL);
13234 if( !cons0changed && !consdata1->changed )
13239 if( cons0upgraded && consdata1->upgraded )
13242 assert(consdata1->nvars >= 1);
13249 possignature1 = consdata1->possignature;
13250 negsignature1 = consdata1->negsignature;
13253 coefsequal = (possignature0 == possignature1) && (negsignature0 == negsignature1);
13254 coefsnegated = (possignature0 == negsignature1) && (negsignature0 == possignature1);
13255 cons0dominateslhs =
SCIPisGE(scip, cons0lhs, consdata1->lhs)
13256 && ((possignature0 | possignature1) == possignature1)
13257 && ((negsignature0 | negsignature1) == negsignature0);
13258 cons1dominateslhs =
SCIPisGE(scip, consdata1->lhs, cons0lhs)
13259 && ((possignature0 | possignature1) == possignature0)
13260 && ((negsignature0 | negsignature1) == negsignature1);
13261 cons0dominatesrhs =
SCIPisLE(scip, cons0rhs, consdata1->rhs)
13262 && ((possignature0 | possignature1) == possignature0)
13263 && ((negsignature0 | negsignature1) == negsignature1);
13264 cons1dominatesrhs =
SCIPisLE(scip, consdata1->rhs, cons0rhs)
13265 && ((possignature0 | possignature1) == possignature1)
13266 && ((negsignature0 | negsignature1) == negsignature0);
13267 cons1isequality =
SCIPisEQ(scip, consdata1->lhs, consdata1->rhs);
13268 tryaggregation = (cons0isequality || cons1isequality) && (maxaggrnormscale > 0.0);
13269 if( !cons0dominateslhs && !cons1dominateslhs && !cons0dominatesrhs && !cons1dominatesrhs
13270 && !coefsequal && !coefsnegated && !tryaggregation )
13274 if( tryaggregation && consdata1->nvars > diffidx1minus0size )
13277 diffidx1minus0size = consdata1->nvars;
13303 commonidxweight = 0;
13305 diffidx0minus1weight = 0;
13307 diffidx1minus0weight = 0;
13310 while( (v0 < consdata0->nvars || v1 < consdata1->nvars)
13311 && (cons0dominateslhs || cons1dominateslhs || cons0dominatesrhs || cons1dominatesrhs
13312 || coefsequal || coefsnegated || tryaggregation) )
13320 if( v0 < consdata0->nvars && v1 < consdata1->nvars )
13321 varcmp =
SCIPvarCompare(consdata0->vars[v0], consdata1->vars[v1]);
13322 else if( v0 < consdata0->nvars )
13331 var = consdata0->vars[v0];
13332 val0 = consdata0->vals[v0];
13334 if( tryaggregation )
13336 diffidx0minus1[nvars0minus1] = v0;
13341 coefsequal =
FALSE;
13342 coefsnegated =
FALSE;
13347 var = consdata1->vars[v1];
13349 val1 = consdata1->vals[v1];
13350 if( tryaggregation )
13352 diffidx1minus0[nvars1minus0] = v1;
13357 coefsequal =
FALSE;
13358 coefsnegated =
FALSE;
13363 assert(consdata0->vars[v0] == consdata1->vars[v1]);
13364 var = consdata0->vars[v0];
13365 val0 = consdata0->vals[v0];
13366 val1 = consdata1->vals[v1];
13367 if( tryaggregation )
13369 commonidx0[nvarscommon] = v0;
13370 commonidx1[nvarscommon] = v1;
13376 coefsequal = coefsequal && (
SCIPisEQ(scip, val0, val1));
13377 coefsnegated = coefsnegated && (
SCIPisEQ(scip, val0, -val1));
13387 assert(var != NULL);
13394 cons0dominatesrhs =
FALSE;
13395 cons1dominateslhs =
FALSE;
13399 cons0dominateslhs =
FALSE;
13400 cons1dominatesrhs =
FALSE;
13403 else if(
SCIPisLT(scip, val0, val1) )
13407 cons0dominateslhs =
FALSE;
13408 cons1dominatesrhs =
FALSE;
13412 cons0dominatesrhs =
FALSE;
13413 cons1dominateslhs =
FALSE;
13419 if( coefsequal || coefsnegated )
13434 SCIPdebugMsg(scip,
"aggregate linear constraints <%s> and <%s> with %s coefficients into single ranged row\n",
13442 lhs =
MAX(consdata0->lhs, consdata1->lhs);
13443 rhs = MIN(consdata0->rhs, consdata1->rhs);
13448 lhs =
MAX(consdata0->lhs, -consdata1->rhs);
13449 rhs = MIN(consdata0->rhs, -consdata1->lhs);
13460 if( consdata0->upgraded )
13462 assert(!consdata1->upgraded);
13465 consdatastay = consdata1;
13469 consdatadel = consdata0;
13470 consinddel = chkind;
13476 consdatastay = consdata0;
13480 consdatadel = consdata1;
13487 if( !consdata0->upgraded )
13489 assert(consstay == cons0);
13490 cons0lhs = consdata0->lhs;
13491 cons0rhs = consdata0->rhs;
13497 assert( !consdatastay->upgraded );
13500 conss[consinddel] = NULL;
13501 if( !consdatadel->upgraded )
13509 if( cons1dominateslhs && (!cons0isequality || cons1dominatesrhs ||
SCIPisInfinity(scip, consdata0->rhs) ) )
13512 SCIPdebugMsg(scip,
"left hand side of linear constraint <%s> is dominated by <%s>:\n",
13518 if(
SCIPisFeasGT(scip, consdata1->lhs, consdata0->rhs) )
13529 cons0lhs = consdata0->lhs;
13530 cons0isequality =
FALSE;
13531 if( !consdata0->upgraded )
13540 else if( cons0dominateslhs && (!cons1isequality || cons0dominatesrhs ||
SCIPisInfinity(scip, consdata1->rhs)) )
13543 SCIPdebugMsg(scip,
"left hand side of linear constraint <%s> is dominated by <%s>:\n",
13549 if(
SCIPisFeasGT(scip, consdata0->lhs, consdata1->rhs) )
13560 cons1isequality =
FALSE;
13561 if( !consdata1->upgraded )
13570 if( cons1dominatesrhs && (!cons0isequality || cons1dominateslhs ||
SCIPisInfinity(scip, -consdata0->lhs)) )
13573 SCIPdebugMsg(scip,
"right hand side of linear constraint <%s> is dominated by <%s>:\n",
13579 if(
SCIPisFeasLT(scip, consdata1->rhs, consdata0->lhs) )
13590 cons0rhs = consdata0->rhs;
13591 cons0isequality =
FALSE;
13592 if( !consdata0->upgraded )
13601 else if( cons0dominatesrhs && (!cons1isequality || cons0dominateslhs ||
SCIPisInfinity(scip, -consdata1->lhs)) )
13604 SCIPdebugMsg(scip,
"right hand side of linear constraint <%s> is dominated by <%s>:\n",
13610 if(
SCIPisFeasLT(scip, consdata0->rhs, consdata1->lhs) )
13621 cons1isequality =
FALSE;
13622 if( !consdata1->upgraded )
13638 conss[chkind] = NULL;
13639 if( !consdata0->upgraded )
13654 if( !consdata1->upgraded )
13667 if( tryaggregation )
13671 assert(consdata0->nvars == nvarscommon + nvars0minus1);
13672 assert(consdata1->nvars == nvarscommon + nvars1minus0);
13674 aggregated =
FALSE;
13675 if( cons1isequality && !consdata0->upgraded && commonidxweight > diffidx1minus0weight )
13679 nvarscommon, commonidxweight, diffidx0minus1weight, diffidx1minus0weight, maxaggrnormscale,
13680 nchgcoefs, &aggregated) );
13687 conss[chkind] = NULL;
13690 if( !aggregated && cons0isequality && !consdata1->upgraded && commonidxweight > diffidx0minus1weight )
13694 nvarscommon, commonidxweight, diffidx1minus0weight, diffidx0minus1weight, maxaggrnormscale,
13695 nchgcoefs, &aggregated) );
13755 assert(scip != NULL);
13756 assert(cons != NULL);
13757 assert(nfixedvars != NULL);
13765 if( singlevarstuffing )
13781 rhs = -consdata->lhs;
13784 maxactivity = -minactivity;
13785 minactivity = -tmp;
13790 rhs = consdata->rhs;
13794 nvars = consdata->nvars;
13795 vars = consdata->vars;
13796 vals = consdata->vals;
13799 if( singletonstuffing )
13801 for( v = 0; v < nvars; ++v )
13817 assert(singletonstuffing);
13825 mincondactivity = 0.0;
13826 maxcondactivity = 0.0;
13828 for( v = 0; v < nvars; ++v )
13834 val = factor * vals[v];
13851 maxcondactivity += val * lb;
13852 mincondactivity += val * lb;
13853 swapped[v] =
FALSE;
13854 ratios[nsingletons] = obj / val;
13855 varpos[nsingletons] = v;
13870 maxcondactivity += val * ub;
13871 mincondactivity += val * ub;
13873 ratios[nsingletons] = obj / val;
13874 varpos[nsingletons] = v;
13891 maxcondactivity += val * lb;
13892 mincondactivity += val * lb;
13909 maxcondactivity += val * ub;
13910 mincondactivity += val * ub;
13926 maxcondactivity += val * ub;
13927 mincondactivity += val * lb;
13931 maxcondactivity += val * lb;
13932 mincondactivity += val * ub;
13936 if( tryfixing && nsingletons > 0 && (
SCIPisGT(scip, rhs, maxcondactivity) ||
SCIPisLE(scip, rhs, mincondactivity)) )
13941 int oldnfixedvars = *nfixedvars;
13942 int oldnchgbds = *nchgbds;
13948 for( v = 0; v < nsingletons; ++v )
13952 val = factor * vals[idx];
13957 assert((val < 0) == swapped[idx]);
13971 delta = -(lb - ub) * val;
13973 delta = (ub - lb) * val;
13977 if(
SCIPisLE(scip, delta, rhs - maxcondactivity) )
14003 else if(
SCIPisLE(scip, rhs, mincondactivity) )
14024 maxcondactivity += delta;
14025 mincondactivity += delta;
14029 if( *nfixedvars - oldnfixedvars > 0 || *nchgbds - oldnchgbds > 0 )
14031 SCIPdebugMsg(scip,
"### stuffing fixed %d variables and changed %d bounds\n", *nfixedvars - oldnfixedvars, *nchgbds - oldnchgbds);
14075 int bestindex = -1;
14076 int bestuplocks = 0;
14077 int bestdownlocks = 1;
14083 SCIPdebug( oldnfixedvars = *nfixedvars; )
14086 for( v = 0; v < nvars; ++v )
14090 val = factor * vals[v];
14118 if( ratio > bestratio || ((ratio == bestratio) && downlocks == 0 && (bestdownlocks > 0
14123 if( bestindex != -1 )
14126 if( bestuplocks > 1 )
14133 secondbestratio = bestratio;
14136 bestdownlocks = downlocks;
14137 bestuplocks = uplocks;
14144 if( bestdownlocks > 0 && bestuplocks > 1 )
14159 if( ratio > secondbestratio )
14161 secondbestratio = ratio;
14167 if( bestindex != -1 && bestdownlocks == 0 )
14172 var = vars[bestindex];
14174 val = factor * vals[bestindex];
14187 SCIP_Real activitydelta = (maxactivity - rhs) - (bestvarfloor * -val);
14190 tryfixing =
SCIPisLE(scip, obj, -activitydelta * secondbestratio);
14192 bounddelta =
SCIPceil(scip, (maxactivity - rhs)/-val);
14196 bounddelta = (maxactivity - rhs)/-val;
14198 tryfixing = tryfixing &&
SCIPisLE(scip, bounddelta, ub - lb);
14204 if(
SCIPisEQ(scip, lb + bounddelta, ub) )
14211 SCIPdebugMsg(scip,
"tighten the lower bound of <%s> from %g to %g (ub=%g)\n",
SCIPvarGetName(var), lb, lb + bounddelta, ub);
14224 SCIP_Real activitydelta = (maxactivity - rhs) - (bestvarfloor * val);
14227 tryfixing =
SCIPisLE(scip, -obj, activitydelta * secondbestratio);
14229 bounddelta =
SCIPceil(scip, (maxactivity - rhs)/val);
14233 bounddelta = (maxactivity - rhs)/val;
14235 tryfixing = tryfixing &&
SCIPisLE(scip, bounddelta, ub - lb);
14241 if(
SCIPisEQ(scip, ub - bounddelta, lb) )
14248 SCIPdebugMsg(scip,
"tighten the upper bound of <%s> from %g to %g (lb=%g)\n",
SCIPvarGetName(var), ub, ub - bounddelta, lb);
14264 for( v = 0; v < nvars; ++v )
14266 SCIPdebugMsg(scip,
"%+g <%s>([%g,%g],%g,[%d,%d],%s)\n", factor * vals[v],
SCIPvarGetName(vars[v]),
SCIPvarGetLbGlobal(vars[v]),
14270 SCIPdebugMsg(scip,
"<= %g\n", factor > 0 ? consdata->rhs : -consdata->lhs);
14272 for( v = 0; v < nvars; ++v )
14274 if( v == bestindex )
14277 if( factor * vals[v] < 0 )
14295 SCIPdebugMsg(scip,
"### new stuffing fixed %d vars, tightened %d bounds\n", *nfixedvars - oldnfixedvars, *nchgbds - oldnchgbds);
14347 assert(scip != NULL);
14348 assert(nconss == 0 || conss != NULL);
14349 assert(nchgbds != NULL);
14358 if( nbinvars == nvars )
14363 nintvars = nvars - ncontvars;
14366 nvars = nvars - nbinvars;
14378 for( v = 0; v < nvars; ++v )
14390 for( v = 0; v < ncontvars; v++ )
14397 var = vars[v + nintvars - nbinvars];
14417 for( c = 0; c < nconss; ++c )
14435 assert(consdata != NULL);
14444 for( i = 0; i < consdata->nvars; ++i )
14448 var = consdata->vars[i];
14453 assert(0 <= contv && contv < ncontvars);
14454 isimplint[contv] =
FALSE;
14467 hasimpliedpotential =
FALSE;
14470 for( i = 0; i < consdata->nvars; ++i )
14484 var = consdata->vars[i];
14485 val = consdata->vals[i];
14499 isminsettoinfinity =
TRUE;
14500 ismaxsettoinfinity =
TRUE;
14506 &minisrelax, &maxisrelax, &isminsettoinfinity, &ismaxsettoinfinity);
14512 assert((!minisrelax || isminsettoinfinity) && (!maxisrelax || ismaxsettoinfinity));
14525 assert(0 <= arrayindex && arrayindex < nvars);
14527 newredlb = redlb[arrayindex];
14528 newredub = redub[arrayindex];
14534 nlocksdown[arrayindex] += nlockspos;
14535 newredlb = (isminsettoinfinity ?
SCIPinfinity(scip) : (consdata->lhs - minresactivity)/val);
14540 nlocksup[arrayindex] += nlockspos;
14541 newredub = (ismaxsettoinfinity ? -
SCIPinfinity(scip) : (consdata->rhs - maxresactivity)/val);
14549 nlocksup[arrayindex] += nlockspos;
14550 newredub = (isminsettoinfinity ? -
SCIPinfinity(scip) : (consdata->lhs - minresactivity)/val);
14555 nlocksdown[arrayindex] += nlockspos;
14556 newredlb = (ismaxsettoinfinity ?
SCIPinfinity(scip) : (consdata->rhs - maxresactivity)/val);
14564 newredlb =
SCIPceil(scip, newredlb);
14570 redlb[arrayindex] =
MAX(redlb[arrayindex], newredlb);
14571 redub[arrayindex] = MIN(redub[arrayindex], newredub);
14578 assert(nconscontvars < ncontvars);
14580 conscontvars[nconscontvars] = var;
14584 assert(0 <= contv && contv < ncontvars);
14585 hasimpliedpotential = hasimpliedpotential || isimplint[contv];
14590 if( hasimpliedpotential )
14592 if( nconscontvars > 1 || !integralcoefs )
14597 for( i = 0; i < nconscontvars; i++ )
14601 assert(0 <= contv && contv < ncontvars);
14602 isimplint[contv] =
FALSE;
14616 assert(nconscontvars == 1);
14617 assert(0 <= contvarpos && contvarpos < consdata->nvars);
14618 var = consdata->vars[contvarpos];
14619 val = consdata->vals[contvarpos];
14621 assert(0 <= contv && contv < ncontvars);
14622 assert(isimplint[contv]);
14625 if( !
SCIPisEQ(scip, absval, 1.0) )
14626 isimplint[contv] =
FALSE;
14632 if( obj * val >= 0.0 && lhsexists )
14635 isimplint[contv] = isimplint[contv] &&
SCIPisIntegral(scip, consdata->lhs);
14637 if( obj * val <= 0.0 && rhsexists )
14640 isimplint[contv] = isimplint[contv] &&
SCIPisIntegral(scip, consdata->rhs);
14649 for( v = 0; v < nvars; ++v )
14677 SCIPdebugMsg(scip,
"variable <%s> only locked down in linear constraints: dual presolve <%s>[%.15g,%.15g] <= %.15g\n",
14681 assert(!infeasible);
14684 redub[v] = MIN(redub[v], ub);
14704 SCIPdebugMsg(scip,
"variable <%s> only locked up in linear constraints: dual presolve <%s>[%.15g,%.15g] >= %.15g\n",
14708 assert(!infeasible);
14711 redlb[v] =
MAX(redlb[v], lb);
14719 for( v = nintvars - nbinvars; v < nvars; ++v )
14725 assert(var != NULL);
14730 assert(0 <= v - nintvars + nbinvars && v - nintvars + nbinvars < ncontvars);
14733 if( isimplint[v - nintvars + nbinvars]
14749 SCIPdebugMsg(scip,
"dual presolve: converting continuous variable <%s>[%g,%g] to implicit integer\n",
14785 assert(scip != NULL);
14786 assert(conshdlr != NULL);
14788 assert(result != NULL);
14791 assert(conshdlrdata != NULL);
14793 checkrelmaxabs = conshdlrdata->checkrelmaxabs;
14795 SCIPdebugMsg(scip,
"Enforcement method of linear constraints for %s solution\n", sol == NULL ?
"LP" :
"relaxation");
14803 for( c = 0; c < nusefulconss; ++c )
14819 for( c = nusefulconss; c < nconss && *result ==
SCIP_FEASIBLE; ++c )
14834 SCIPdebugMsg(scip,
"-> constraints checked, %s\n", *result ==
SCIP_FEASIBLE ?
"all constraints feasible" :
"infeasibility detected");
14847 assert(scip != NULL);
14848 assert(conshdlr != NULL);
14865 assert(scip != NULL);
14866 assert(conshdlr != NULL);
14871 assert(conshdlrdata != NULL);
14888 assert(scip != NULL);
14892 assert(conshdlrdata != NULL);
14893 assert(conshdlrdata->eventhdlr != NULL);
14894 assert(nconss == 0 || conss != NULL);
14897 for( c = 0; c < nconss; ++c )
14914 assert(scip != NULL);
14918 assert(conshdlrdata != NULL);
14919 assert(conshdlrdata->eventhdlr != NULL);
14922 for( c = nconss - 1; c >= 0; --c )
14927 assert(consdata != NULL);
14929 if( consdata->eventdata != NULL )
14933 assert(consdata->eventdata == NULL);
14949 assert(scip != NULL);
14962 assert(scip != NULL);
14985 assert(scip != NULL);
14986 assert(linconsstats != NULL);
14988 assert(conshdlr != NULL);
15006 for( c = 0; c < nconss; c++ )
15016 assert(cons != NULL);
15024 assert(consdata != NULL);
15025 rhs = consdata->rhs;
15026 lhs = consdata->lhs;
15030 for( i = 0; i < consdata->nvars; i++ )
15032 assert(!
SCIPisZero(scip, consdata->vals[i]));
15036 if( consdata->nvars == 0 )
15056 if( consdata->nvars == 1 )
15066 if( consdata->nvars == 2 &&
SCIPisEQ(scip, lhs, rhs) )
15076 if( consdata->nvars == 2 )
15081 if(
SCIPisEQ(scip, consdata->vals[0], -consdata->vals[1])
15109 scale =
REALABS(consdata->vals[0]);
15112 for( i = 0; i < consdata->nvars && !unmatched; i++ )
15117 unmatched = unmatched || !
SCIPisEQ(scip,
REALABS(consdata->vals[i]), scale);
15119 if( consdata->vals[i] < 0.0 )
15127 b = rhs/scale + nnegbinvars;
15148 b = rhs/scale + nnegbinvars;
15173 b = lhs/scale + nnegbinvars;
15203 for( i = 0; i < consdata->nvars && !unmatched; i++ )
15208 unmatched = unmatched || !
SCIPisIntegral(scip, consdata->vals[i]);
15211 b -= consdata->vals[i];
15231 for( i = 0; i < consdata->nvars && !matched; i++ )
15236 SCIPdebugMsg(scip,
"classified as %s: ", matched ?
"BINPACKING" :
"KNAPSACK");
15259 for( i = 0; i < consdata->nvars && !unmatched; i++ )
15263 unmatched = unmatched || !
SCIPisIntegral(scip, consdata->vals[i]);
15264 unmatched = unmatched ||
SCIPisNegative(scip, consdata->vals[i]);
15286 for( i = 0; i < consdata->nvars && !unmatched; i++ )
15319 #ifdef SCIP_STATISTIC 15328 assert(scip != NULL);
15330 #ifdef SCIP_STATISTIC 15333 assert(conshdlrdata != NULL);
15338 for( c = 0; c < nconss; ++c )
15346 assert(consdata != NULL);
15348 if( consdata->upgraded )
15355 if(
SCIPisLT(scip, consdata->maxactdelta, conshdlrdata->maxeasyactivitydelta) )
15360 SCIPstatisticMessage(
"below threshold: %d / %d ratio= %g\n", ngoodconss, nallconss, (100.0 * ngoodconss / nallconss));
15364 for( c = 0; c < nconss; ++c )
15372 assert(consdata != NULL);
15374 if( consdata->upgraded )
15398 assert(scip != NULL);
15401 for( c = 0; c < nconss; ++c )
15406 assert(consdata != NULL);
15408 if( consdata->row != NULL )
15424 if( ncutsadded > 0 )
15427 "(restart) converted %d cuts from the global cut pool into linear constraints\n", ncutsadded);
15449 assert(scip != NULL);
15450 assert(conshdlr != NULL);
15455 assert(consdata != NULL);
15459 assert(conshdlrdata != NULL);
15460 assert(conshdlrdata->eventhdlr != NULL);
15463 if( consdata->eventdata != NULL )
15468 assert(consdata->eventdata == NULL);
15479 assert(scip != NULL);
15480 assert(conshdlr != NULL);
15483 if( (*consdata)->eventdata != NULL )
15488 assert(conshdlrdata != NULL);
15492 assert((*consdata)->eventdata == NULL);
15511 assert(scip != NULL);
15512 assert(conshdlr != NULL);
15515 assert(sourcecons != NULL);
15516 assert(targetcons != NULL);
15519 assert(sourcedata != NULL);
15520 assert(sourcedata->row == NULL);
15523 SCIP_CALL(
consdataCreate(scip, &targetdata, sourcedata->nvars, sourcedata->vars, sourcedata->vals, sourcedata->lhs, sourcedata->rhs) );
15542 assert(scip != NULL);
15545 *infeasible =
FALSE;
15547 for( c = 0; c < nconss && !(*infeasible); ++c )
15574 assert(scip != NULL);
15575 assert(conshdlr != NULL);
15577 assert(result != NULL);
15580 assert(conshdlrdata != NULL);
15589 if( (depth == 0 && conshdlrdata->maxroundsroot >= 0 && nrounds >= conshdlrdata->maxroundsroot)
15590 || (depth > 0 && conshdlrdata->maxrounds >= 0 && nrounds >= conshdlrdata->maxrounds) )
15594 maxsepacuts = (depth == 0 ? conshdlrdata->maxsepacutsroot : conshdlrdata->maxsepacuts);
15600 maxbound = glblowerbound + conshdlrdata->maxcardbounddist * (cutoffbound - glblowerbound);
15601 separatecards =
SCIPisLE(scip, loclowerbound, maxbound);
15609 for( c = 0; c < nusefulconss && ncuts < maxsepacuts && !cutoff; ++c )
15612 SCIP_CALL(
separateCons(scip, conss[c], conshdlrdata, NULL, separatecards, conshdlrdata->separateall, &ncuts, &cutoff) );
15618 else if( ncuts > 0 )
15640 assert(scip != NULL);
15641 assert(conshdlr != NULL);
15643 assert(result != NULL);
15646 assert(conshdlrdata != NULL);
15655 if( (depth == 0 && conshdlrdata->maxroundsroot >= 0 && nrounds >= conshdlrdata->maxroundsroot)
15656 || (depth > 0 && conshdlrdata->maxrounds >= 0 && nrounds >= conshdlrdata->maxrounds) )
15660 maxsepacuts = (depth == 0 ? conshdlrdata->maxsepacutsroot : conshdlrdata->maxsepacuts);
15667 for( c = 0; c < nusefulconss && ncuts < maxsepacuts && !cutoff; ++c )
15676 else if( ncuts > 0 )
15713 assert(scip != NULL);
15714 assert(conshdlr != NULL);
15716 assert(result != NULL);
15719 assert(conshdlrdata != NULL);
15721 checkrelmaxabs = conshdlrdata->checkrelmaxabs;
15726 if( objinfeasible )
15728 SCIPdebugMsg(scip,
"-> pseudo solution is objective infeasible, return.\n");
15736 for( c = 0; c < nconss && !violated; ++c )
15746 SCIPdebugMsg(scip,
"-> constraints checked, %s\n", *result ==
SCIP_FEASIBLE ?
"all constraints feasible" :
"infeasibility detected");
15760 assert(scip != NULL);
15761 assert(conshdlr != NULL);
15763 assert(result != NULL);
15768 assert(conshdlrdata != NULL);
15770 checkrelmaxabs = conshdlrdata->checkrelmaxabs;
15775 for( c = 0; c < nconss && (*result ==
SCIP_FEASIBLE || completely); ++c )
15778 SCIP_CALL(
checkCons(scip, conss[c], sol, checklprows, checkrelmaxabs, &violated) );
15790 assert( consdata != NULL);
15798 SCIPinfoMessage(scip, NULL,
"activity invalid due to positive and negative infinity contributions\n");
15799 else if(
SCIPisFeasLT(scip, activity, consdata->lhs) )
15800 SCIPinfoMessage(scip, NULL,
"violation: left hand side is violated by %.15g\n", consdata->lhs - activity);
15801 else if(
SCIPisFeasGT(scip, activity, consdata->rhs) )
15802 SCIPinfoMessage(scip, NULL,
"violation: right hand side is violated by %.15g\n", activity - consdata->rhs);
15823 assert(scip != NULL);
15824 assert(conshdlr != NULL);
15826 assert(result != NULL);
15829 assert(conshdlrdata != NULL);
15835 tightenbounds =
TRUE;
15840 int tightenboundsfreq;
15845 tightenboundsfreq = propfreq * conshdlrdata->tightenboundsfreq;
15846 tightenbounds = (conshdlrdata->tightenboundsfreq >= 0)
15847 && ((tightenboundsfreq == 0 && depth == 0) || (tightenboundsfreq >= 1 && (depth % tightenboundsfreq == 0)));
15850 rangedrowpropagation = conshdlrdata->rangedrowpropagation;
15852 rangedrowpropagation = rangedrowpropagation && (depth <= conshdlrdata->rangedrowmaxdepth);
15853 rangedrowfreq = propfreq * conshdlrdata->rangedrowfreq;
15854 rangedrowpropagation = rangedrowpropagation && (depth % rangedrowfreq == 0);
15861 for( i = 0; i < nmarkedconss && !cutoff; i++ )
15865 conshdlrdata->maxeasyactivitydelta, conshdlrdata->sortvars, &cutoff, &nchgbds) );
15871 else if( nchgbds > 0 )
15880 #define MAXCONSPRESOLROUNDS 10 15901 int firstupgradetry;
15904 assert(scip != NULL);
15905 assert(conshdlr != NULL);
15907 assert(result != NULL);
15913 oldnfixedvars = *nfixedvars;
15914 oldnaggrvars = *naggrvars;
15915 oldnchgbds = *nchgbds;
15916 oldndelconss = *ndelconss;
15917 oldnupgdconss = *nupgdconss;
15918 oldnchgcoefs = *nchgcoefs;
15919 oldnchgsides = *nchgsides;
15923 assert(conshdlrdata != NULL);
15926 firstchange = INT_MAX;
15927 firstupgradetry = INT_MAX;
15928 for( c = 0; c < nconss && !cutoff && !
SCIPisStopped(scip); ++c )
15933 infeasible =
FALSE;
15938 assert(consdata != NULL);
15940 if( consdata->eventdata == NULL )
15944 assert(consdata->eventdata != NULL);
15949 assert(
SCIPgetNRuns(scip) > 0 || nrounds > 0 || consdata->boundstightened == 0);
15950 assert(
SCIPgetNRuns(scip) > 0 || nrounds > 0 || !consdata->presolved);
15963 assert(consdata->removedfixings);
15970 if( firstchange == INT_MAX && consdata->changed )
15974 if( firstupgradetry == INT_MAX && !consdata->upgradetried )
15975 firstupgradetry = c;
15978 if( consdata->presolved )
15996 consdata->presolved =
TRUE;
16006 if(
SCIPisFeasGT(scip, consdata->lhs, consdata->rhs) )
16008 SCIPdebugMsg(scip,
"linear constraint <%s> is infeasible: sides=[%.15g,%.15g]\n",
16015 SCIP_CALL(
tightenBounds(scip, cons, conshdlrdata->maxeasyactivitydelta, conshdlrdata->sortvars, &cutoff, nchgbds) );
16028 SCIPdebugMsg(scip,
"linear constraint <%s> is infeasible: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
16029 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
16035 SCIPdebugMsg(scip,
"linear constraint <%s> is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
16036 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
16040 if( !consdata->upgraded )
16046 SCIPdebugMsg(scip,
"linear constraint <%s> left hand side is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
16047 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
16049 if( !consdata->upgraded )
16054 SCIPdebugMsg(scip,
"linear constraint <%s> right hand side is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
16055 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
16057 if( !consdata->upgraded )
16060 assert(consdata->nvars >= 1);
16063 if( consdata->nvars == 0 )
16065 if(
SCIPisFeasGT(scip, consdata->lhs, consdata->rhs) )
16067 SCIPdebugMsg(scip,
"empty linear constraint <%s> is infeasible: sides=[%.15g,%.15g]\n",
16073 SCIPdebugMsg(scip,
"empty linear constraint <%s> is redundant: sides=[%.15g,%.15g]\n",
16078 if( !consdata->upgraded )
16088 if( conshdlrdata->simplifyinequalities )
16094 if( conshdlrdata->aggregatevariables )
16105 if( conshdlrdata->rangedrowpropagation )
16107 int lastnfixedvars;
16109 lastnfixedvars = *nfixedvars;
16114 if( lastnfixedvars < *nfixedvars )
16125 nfixedvars, nchgbds, &cutoff) );
16130 if(
SCIPisFeasGT(scip, consdata->lhs, consdata->rhs) )
16132 SCIPdebugMsg(scip,
"empty linear constraint <%s> is infeasible: sides=[%.15g,%.15g]\n",
16138 SCIPdebugMsg(scip,
"empty linear constraint <%s> is redundant: sides=[%.15g,%.15g]\n",
16143 if( !consdata->upgraded )
16168 if( firstchange == INT_MAX && consdata->changed )
16172 if( firstupgradetry == INT_MAX && !consdata->upgradetried )
16173 firstupgradetry = c;
16178 (conshdlrdata->singletonstuffing || conshdlrdata->singlevarstuffing) &&
SCIPallowDualReds(scip) )
16181 conshdlrdata->singlevarstuffing, &cutoff, nfixedvars, nchgbds) );
16184 if( consdata->nvars == 0 )
16186 if(
SCIPisFeasGT(scip, consdata->lhs, consdata->rhs) )
16188 SCIPdebugMsg(scip,
"empty linear constraint <%s> is infeasible: sides=[%.15g,%.15g]\n",
16194 SCIPdebugMsg(scip,
"empty linear constraint <%s> is redundant: sides=[%.15g,%.15g]\n",
16199 if( !consdata->upgraded )
16212 assert(firstchange >= 0);
16214 if( firstchange < nconss && conshdlrdata->presolusehashing )
16218 ndelconss, nchgsides) );
16221 if( firstchange < nconss && conshdlrdata->presolpairwise )
16225 int firstchangenew;
16228 npaircomparisons = 0;
16229 oldndelconss = *ndelconss;
16230 oldnchgsides = *nchgsides;
16231 oldnchgcoefs = *nchgcoefs;
16237 firstchangenew = -1;
16238 for( c = 0; c < nconss; ++c )
16241 if( c == firstchange )
16242 firstchangenew = nusefulconss;
16248 usefulconss[nusefulconss] = conss[c];
16251 firstchange = firstchangenew;
16252 assert(firstchangenew >= 0 && firstchangenew <= nusefulconss);
16254 for( c = firstchange; c < nusefulconss && !cutoff && !
SCIPisStopped(scip); ++c )
16257 if( usefulconss[c] == NULL )
16260 npaircomparisons += (
SCIPconsGetData(conss[c])->changed) ? c : (c - firstchange);
16264 &cutoff, ndelconss, nchgsides, nchgcoefs) );
16266 if( npaircomparisons > conshdlrdata->nmincomparisons )
16268 assert(npaircomparisons > 0);
16269 if( ((*ndelconss - oldndelconss) + (*nchgsides - oldnchgsides)/2.0 + (*nchgcoefs - oldnchgcoefs)/10.0) / ((
SCIP_Real) npaircomparisons) < conshdlrdata->mingainpernmincomp )
16271 oldndelconss = *ndelconss;
16272 oldnchgsides = *nchgsides;
16273 oldnchgcoefs = *nchgcoefs;
16274 npaircomparisons = 0;
16285 if( !cutoff && firstupgradetry < nconss
16286 && *nfixedvars == oldnfixedvars && *naggrvars == oldnaggrvars && *nchgbds == oldnchgbds && *ndelconss == oldndelconss
16287 && *nupgdconss == oldnupgdconss && *nchgcoefs == oldnchgcoefs && *nchgsides == oldnchgsides
16302 for( c = firstupgradetry; c < nconss && !
SCIPisStopped(scip); ++c )
16311 assert(consdata != NULL);
16314 if( consdata->upgradetried )
16317 if( !consdata->presolved )
16320 consdata->upgradetried =
TRUE;
16326 if( upgdcons != NULL )
16336 assert(!consdata->upgraded);
16337 consdata->upgraded =
TRUE;
16342 if(
SCIPisLT(scip, consdata->lhs, consdata->rhs)
16343 || !conshdlrdata->presolpairwise
16344 || (conshdlrdata->maxaggrnormscale == 0.0) )
16356 else if( *nfixedvars > oldnfixedvars || *naggrvars > oldnaggrvars || *nchgbds > oldnchgbds || *ndelconss > oldndelconss
16357 || *nupgdconss > oldnupgdconss || *nchgcoefs > oldnchgcoefs || *nchgsides > oldnchgsides )
16371 assert(scip != NULL);
16372 assert(cons != NULL);
16373 assert(result != NULL);
16390 assert(scip != NULL);
16391 assert(cons != NULL);
16393 assert(consdata != NULL);
16399 for( i = 0; i < consdata->nvars; ++i )
16433 assert(scip != NULL);
16434 assert(conshdlr != NULL);
16435 assert(conss != NULL || nconss == 0);
16449 assert(scip != NULL);
16450 assert(conshdlr != NULL);
16451 assert(cons != NULL);
16464 const char* consname;
16467 assert(scip != NULL);
16468 assert(sourcescip != NULL);
16469 assert(sourcecons != NULL);
16483 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, global, valid) );
16484 assert(cons != NULL || *valid ==
FALSE);
16497 char** firstoperator,
16498 char** secondoperator,
16504 assert(str != NULL);
16505 assert(firstoperator != NULL);
16506 assert(secondoperator != NULL);
16508 *firstoperator = NULL;
16509 *secondoperator = NULL;
16515 while( *curr && *success )
16528 if( curr[1] ==
'=' )
16537 if( strncmp(curr,
"[free]", 6) == 0 )
16553 if( *firstoperator == NULL )
16555 *firstoperator = curr;
16559 if( *secondoperator != NULL )
16564 else if( strncmp(*firstoperator,
"<=", 2) != 0 )
16566 SCIPerrorMessage(
"Two operators in line that is not a ranged row: %s", str);
16569 else if( strncmp(curr,
"<=", 2) != 0 )
16571 SCIPerrorMessage(
"Bad second operator, expected ranged row specification: %s", str);
16575 *secondoperator = curr;
16585 if( *firstoperator == NULL )
16614 assert(scip != NULL);
16615 assert(success != NULL);
16616 assert(str != NULL);
16617 assert(name != NULL);
16618 assert(cons != NULL);
16624 (*success) =
FALSE;
16631 while( isspace((
unsigned char)*str) )
16640 if( ! operatorsuccess )
16643 varstrptr = (
char *)str;
16644 lhsstrptr = rhsstrptr = NULL;
16645 assert(firstop != NULL);
16651 assert(firstop[1] ==
'=');
16653 if( secondop != NULL )
16655 assert(secondop[0] ==
'<' && secondop[1] ==
'=');
16656 lhsstrptr = (
char *)str;
16657 varstrptr = firstop + 2;
16658 rhsstrptr = secondop + 2;
16664 varstrptr = (
char *)str;
16665 rhsstrptr = firstop + 2;
16669 assert(firstop[1] ==
'=');
16670 assert(secondop == NULL);
16672 lhsstrptr = firstop + 2;
16675 assert(firstop[1] ==
'=');
16676 assert(secondop == NULL);
16678 rhsstrptr = firstop + 2;
16679 lhsstrptr = firstop + 2;
16682 assert(strncmp(firstop,
"[free]", 6) == 0);
16683 assert(secondop == NULL);
16688 SCIPerrorMessage(
"Parsing has wrong operator character '%c', should be one of <=>[", *firstop);
16693 if( lhsstrptr != NULL )
16697 SCIPerrorMessage(
"error parsing left hand side number from <%s>\n", lhsstrptr);
16702 if( rhsstrptr == lhsstrptr )
16707 if( rhsstrptr != NULL && rhsstrptr != lhsstrptr )
16711 SCIPerrorMessage(
"error parsing right hand side number from <%s>\n", lhsstrptr);
16721 assert(varstrptr != NULL);
16726 if( *success && requsize > coefssize )
16729 coefssize = requsize;
16734 assert(!*success || requsize <= coefssize);
16744 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
16761 assert(consdata != NULL);
16763 if( varssize < consdata->nvars )
16764 (*success) =
FALSE;
16767 assert(vars != NULL);
16784 assert(consdata != NULL);
16786 (*nvars) = consdata->nvars;
16805 assert(scip != NULL);
16806 assert(eventhdlr != NULL);
16807 assert(eventdata != NULL);
16809 assert(event != NULL);
16811 cons = eventdata->cons;
16812 assert(cons != NULL);
16814 assert(consdata != NULL);
16830 varpos = eventdata->varpos;
16831 assert(0 <= varpos && varpos < consdata->nvars);
16834 assert(var != NULL);
16835 assert(consdata->vars[varpos] == var);
16836 val = consdata->vals[varpos];
16855 consdata->presolved =
FALSE;
16856 consdata->rangedrowpropagated = 0;
16864 if( consdata->maxactdeltavar == var )
16867 consdata->maxactdeltavar = NULL;
16871 if( consdata->boundstightened > 0)
16873 switch( eventtype )
16877 consdata->boundstightened = 0;
16881 consdata->boundstightened = 0;
16903 delta =
REALABS(val) * domain;
16905 if( delta > consdata->maxactdelta )
16907 consdata->maxactdelta = delta;
16908 consdata->maxactdeltavar = var;
16915 consdata->presolved =
FALSE;
16916 consdata->removedfixings =
FALSE;
16917 consdata->rangedrowpropagated = 0;
16920 if( consdata->maxactdeltavar == var )
16923 consdata->maxactdeltavar = NULL;
16932 consdata->presolved =
FALSE;
16941 varpos = eventdata->varpos;
16942 assert(0 <= varpos && varpos < consdata->nvars);
16945 assert(var != NULL);
16946 assert(consdata->vars[varpos] == var);
16947 val = consdata->vals[varpos];
16949 consdata->rangedrowpropagated = 0;
16963 consdata->varsdeleted =
TRUE;
16982 assert(scip != NULL);
16983 assert(conflicthdlr != NULL);
16985 assert(bdchginfos != NULL || nbdchginfos == 0);
16986 assert(result != NULL);
17001 for( i = 0; i < nbdchginfos; ++i )
17003 assert(bdchginfos != NULL);
17022 if( i == nbdchginfos )
17035 if( upgdcons != NULL )
17067 assert(scip != NULL);
17068 assert(cons != NULL);
17069 assert(nupgdconss != NULL);
17070 assert(upgdconss != NULL);
17082 if( upgdconsssize < 1 )
17101 assert(upgdconsdata != NULL);
17104 upgdconsdata->checkabsolute =
TRUE;
17118 assert(nupgdconss != NULL);
17119 assert(upgdconss != NULL);
17131 if( upgdconsssize < 1 )
17148 assert(upgdconsdata != NULL);
17151 upgdconsdata->checkabsolute =
TRUE;
17173 assert(scip != NULL);
17177 eventExecLinear, NULL) );
17181 conflictExecLinear, NULL) );
17189 consEnfolpLinear, consEnfopsLinear, consCheckLinear, consLockLinear,
17192 assert(conshdlr != NULL);
17233 "multiplier on propagation frequency, how often the bounds are tightened (-1: never, 0: only at root)",
17237 "maximal number of separation rounds per node (-1: unlimited)",
17241 "maximal number of separation rounds per node in the root node (-1: unlimited)",
17245 "maximal number of cuts separated per separation round",
17249 "maximal number of cuts separated per separation round in the root node",
17253 "should pairwise constraint comparison be performed in presolving?",
17257 "should hash table be used for detecting redundant constraints in advance",
17261 "number for minimal pairwise presolve comparisons",
17265 "minimal gain per minimal pairwise presolve comparisons to repeat pairwise comparison round",
17269 "maximal allowed relative gain in maximum norm for constraint aggregation (0.0: disable constraint aggregation)",
17273 "maximum activity delta to run easy propagation on linear constraint (faster, but numerically less stable)",
17277 "maximal relative distance from current node's dual bound to primal bound compared to best node's dual bound for separating knapsack cardinality cuts",
17281 "should all constraints be subject to cardinality cut generation instead of only the ones with non-zero dual value?",
17285 "should presolving search for aggregations in equations",
17289 "should presolving try to simplify inequalities",
17293 "should dual presolving steps be performed?",
17297 "should stuffing of singleton continuous variables be performed?",
17301 "should single variable stuffing be performed, which tries to fulfill constraints using the cheapest variable?",
17304 "constraints/" CONSHDLR_NAME "/sortvars",
"apply binaries sorting in decr. order of coeff abs value?",
17308 "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)?",
17312 "should presolving try to detect constraints parallel to the objective function defining an upper bound and prevent these constraints from entering the LP?",
17316 "should presolving try to detect constraints parallel to the objective function defining a lower bound and prevent these constraints from entering the LP?",
17320 "should presolving try to detect subsets of constraints parallel to the objective function?",
17324 "should presolving and propagation try to improve bounds, detect infeasibility, and extract sub-constraints from ranged rows and equations?",
17328 "should presolving and propagation extract sub-constraints from ranged rows and equations?",
17332 "maximum depth to apply ranged row propagation",
17336 "frequency for applying ranged row propagation",
17340 "should multi-aggregations only be performed if the constraint can be removed afterwards?",
17351 const char* conshdlrname
17360 assert(scip != NULL);
17361 assert(linconsupgd != NULL);
17362 assert(conshdlrname != NULL );
17366 if( conshdlr == NULL )
17373 assert(conshdlrdata != NULL);
17388 paramname, paramdesc,
17436 assert(scip != NULL);
17437 assert(cons != NULL);
17441 if( conshdlr == NULL )
17466 if( requiredsize > nconsvars )
17472 assert(requiredsize <= nconsvars);
17478 if( constant < 0.0 )
17485 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);
17495 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);
17511 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);
17521 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);
17551 assert(consdata != NULL);
17560 assert(consdata != NULL);
17564 SCIP_CALL(
SCIPcreateCons(scip, cons, name, conshdlr, consdata, initial, separate, enforce, check, propagate,
17565 local, modifiable, dynamic, removable, stickingatnode) );
17589 assert(scip != NULL);
17646 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
17654 if( sourcecoefs != NULL )
17661 for( v = 0; v < nvars; ++v )
17674 if( requiredsize > nvars )
17680 assert(requiredsize <= nvars);
17685 for( v = 0; v < nvars; ++v )
17689 assert(vars[v] != NULL);
17696 for( v = 0; v < nvars && success; ++v )
17702 assert(!(success) || vars[v] != NULL);
17715 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
17735 assert(scip != NULL);
17736 assert(cons != NULL);
17737 assert(var != NULL);
17770 if( requiredsize > nconsvars )
17776 assert(requiredsize <= nconsvars);
17780 assert(consdata != NULL);
17782 lhs = consdata->lhs;
17783 rhs = consdata->rhs;
17789 if( constant < 0.0 )
17796 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));
17806 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));
17822 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));
17832 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));
17862 for( v = nconsvars - 1; v >= 0; --v )
17901 assert(scip != NULL);
17902 assert(cons != NULL);
17903 assert(var != NULL);
17913 SCIPerrorMessage(
"method may only be called during problem creation stage for original constraints and variables\n");
17918 assert(consdata != NULL);
17920 vars = consdata->vars;
17923 while( i < consdata->nvars )
17925 if( vars[i] == var )
17963 assert(scip != NULL);
17964 assert(cons != NULL);
17965 assert(var != NULL);
17980 assert(cons != NULL);
17990 assert(consdata != NULL);
17992 return consdata->lhs;
18003 assert(cons != NULL);
18013 assert(consdata != NULL);
18015 return consdata->rhs;
18025 assert(scip != NULL);
18026 assert(cons != NULL);
18065 assert(cons != NULL);
18075 assert(consdata != NULL);
18077 return consdata->nvars;
18088 assert(cons != NULL);
18098 assert(consdata != NULL);
18100 return consdata->vars;
18111 assert(cons != NULL);
18121 assert(consdata != NULL);
18123 return consdata->vals;
18139 assert(cons != NULL);
18149 assert(consdata != NULL);
18151 if( consdata->row != NULL )
18166 assert(cons != NULL);
18176 assert(consdata != NULL);
18178 if( consdata->row != NULL )
18192 assert(cons != NULL);
18203 assert(consdata != NULL);
18205 if( consdata->row != NULL )
18219 assert(cons != NULL);
18230 assert(consdata != NULL);
18232 if( consdata->row != NULL )
18248 assert(cons != NULL);
18258 assert(consdata != NULL);
18260 return consdata->row;
18298 assert(scip != NULL);
18299 assert(cons != NULL);
18300 assert(upgdcons != NULL);
18322 assert(conshdlrdata != NULL);
18324 assert(consdata != NULL);
18327 if( consdata->upgraded )
18331 if( consdata->row != NULL )
18335 SCIPerrorMessage(
"cannot upgrade linear constraint that is already stored as row in the LP\n");
18372 for( i = 0; i < consdata->nvars; ++i )
18374 var = consdata->vars[i];
18375 val = consdata->vals[i];
18426 else if(
SCIPisEQ(scip, val, -1.0) )
18443 poscoeffsum += val;
18445 negcoeffsum += val;
18453 SCIPdebugMsg(scip,
"upgrading linear constraint <%s> (%d upgrade methods):\n",
18455 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",
18456 nposbin, nnegbin, nposint, nnegint, nposimpl, nnegimpl, nposcont, nnegcont,
18457 ncoeffspone, ncoeffsnone, ncoeffspint, ncoeffsnint, ncoeffspfrac, ncoeffsnfrac,
18458 poscoeffsum, negcoeffsum, integral);
18461 for( i = 0; i < conshdlrdata->nlinconsupgrades && *upgdcons == NULL; ++i )
18463 if( conshdlrdata->linconsupgrades[i]->active )
18465 SCIP_CALL( conshdlrdata->linconsupgrades[i]->linconsupgd(scip, cons, consdata->nvars,
18466 consdata->vars, consdata->vals, consdata->lhs, consdata->rhs,
18467 nposbin, nnegbin, nposint, nnegint, nposimpl, nnegimpl, nposimplbin, nnegimplbin, nposcont, nnegcont,
18468 ncoeffspone, ncoeffsnone, ncoeffspint, ncoeffsnint, ncoeffspfrac, ncoeffsnfrac,
18469 poscoeffsum, negcoeffsum, integral,
18475 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)
enum SCIP_LinConstype SCIP_LINCONSTYPE
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)
static SCIP_DECL_CONSDEACTIVE(consDeactiveLinear)
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)
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)
void SCIPlinConsStatsIncTypeCount(SCIP_LINCONSSTATS *linconsstats, SCIP_LINCONSTYPE linconstype, int increment)
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 SCIPsetConshdlrDeactive(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDEACTIVE((*consdeactive)))
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)
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)
SCIP_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
#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_Real SCIPrelDiff(SCIP_Real val1, SCIP_Real val2)
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)
void SCIPlinConsStatsReset(SCIP_LINCONSSTATS *linconsstats)
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)
SCIP_CONS ** SCIPgetConss(SCIP *scip)
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
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
static SCIP_RETCODE tightenVarUb(SCIP *scip, SCIP_CONS *cons, int pos, PROPRULE proprule, SCIP_Real newub, SCIP_Real oldub, SCIP_Bool *cutoff, int *nchgbds, SCIP_Bool force)
static void getMaxActivity(SCIP *scip, SCIP_CONSDATA *consdata, int posinf, int neginf, int poshuge, int neghuge, SCIP_Real delta, SCIP_Bool global, SCIP_Bool goodrelax, SCIP_Real *maxactivity, SCIP_Bool *isrelax, SCIP_Bool *issettoinfinity)
#define SCIPhashFour(a, b, c, d)
SCIP_Bool SCIPisSumRelLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
#define CONSHDLR_PROPFREQ
SCIP_Real SCIPgetDualsolLinear(SCIP *scip, SCIP_CONS *cons)
static SCIP_DECL_QUADCONSUPGD(upgradeConsQuadratic)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPaddConsLocal(SCIP *scip, SCIP_CONS *cons, SCIP_NODE *validnode)
static SCIP_DECL_CONSENFOLP(consEnfolpLinear)
SCIP_Bool SCIPdoNotMultaggrVar(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPdelConsLocal(SCIP *scip, SCIP_CONS *cons)
static void consdataGetActivityBounds(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_Bool goodrelax, SCIP_Real *minactivity, SCIP_Real *maxactivity, SCIP_Bool *minisrelax, SCIP_Bool *maxisrelax)
SCIP_RETCODE SCIPinferVarFixCons(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_CONS *infercons, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_RETCODE SCIPupgradeConsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_CONS **upgdcons)
static SCIP_DECL_CONSSEPALP(consSepalpLinear)
SCIP_RETCODE SCIPgetProbvarSum(SCIP *scip, SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
SCIP_Real * SCIPgetCoefsLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons)
static void consdataCalcMaxAbsval(SCIP_CONSDATA *consdata)
SCIP_RETCODE SCIPaddVarImplication(SCIP *scip, SCIP_VAR *var, SCIP_Bool varfixing, SCIP_VAR *implvar, SCIP_BOUNDTYPE impltype, SCIP_Real implbound, SCIP_Bool *infeasible, int *nbdchgs)
static INLINE uint32_t SCIPrealHashCode(double x)
#define DEFAULT_MULTAGGRREMOVE
static SCIP_RETCODE chgRhs(SCIP *scip, SCIP_CONS *cons, SCIP_Real rhs)
static SCIP_RETCODE conshdlrdataEnsureLinconsupgradesSize(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, int num)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
static void consdataUpdateDelCoef(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR *var, SCIP_Real val, SCIP_Bool checkreliability)
static SCIP_RETCODE consdataSort(SCIP *scip, SCIP_CONSDATA *consdata)
SCIP_RETCODE SCIPunlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
static void consdataUpdateAddCoef(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR *var, SCIP_Real val, SCIP_Bool checkreliability)
static int inferInfoGetProprule(INFERINFO inferinfo)
static SCIP_RETCODE consdataTightenCoefs(SCIP *scip, SCIP_CONS *cons, int *nchgcoefs, int *nchgsides)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_Real SCIPvarGetAggrConstant(SCIP_VAR *var)
SCIP_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
struct SCIP_EventData SCIP_EVENTDATA
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSFREE((*consfree)))
constraint handler for quadratic constraints
SCIP_CONSHDLRDATA * SCIPconshdlrGetData(SCIP_CONSHDLR *conshdlr)
static SCIP_RETCODE addConflictReasonVars(SCIP *scip, SCIP_VAR **vars, int nvars, SCIP_VAR *var, SCIP_Real bound)
SCIP_RETCODE SCIPmarkConsPropagate(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE delCoefPos(SCIP *scip, SCIP_CONS *cons, int pos)
static SCIP_RETCODE resolvePropagation(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *infervar, INFERINFO inferinfo, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_RESULT *result)
static int getInferInt(PROPRULE proprule, int pos)
SCIP_RETCODE SCIPgetIntParam(SCIP *scip, const char *name, int *value)
static SCIP_RETCODE checkPartialObjective(SCIP *scip, SCIP_CONS *cons, SCIP_CONSHDLRDATA *conshdlrdata)
static SCIP_RETCODE conshdlrdataIncludeUpgrade(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_LINCONSUPGRADE *linconsupgrade)
#define CONSHDLR_DELAYPROP
int SCIPconsGetNLocksPos(SCIP_CONS *cons)
int SCIPconshdlrGetPropFreq(SCIP_CONSHDLR *conshdlr)
SCIP_Real SCIPgetLowerbound(SCIP *scip)
#define SCIP_EVENTTYPE_LBTIGHTENED
static SCIP_Bool canTightenBounds(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define CONSHDLR_CHECKPRIORITY
static SCIP_RETCODE tightenVarBoundsEasy(SCIP *scip, SCIP_CONS *cons, int pos, SCIP_Bool *cutoff, int *nchgbds, SCIP_Bool force)
#define SCIPhashSignature64(a)
SCIP_RETCODE SCIPgetProbvarLinearSum(SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, int varssize, SCIP_Real *constant, int *requiredsize, SCIP_Bool mergemultiples)
SCIP_Real SCIPvarGetMultaggrConstant(SCIP_VAR *var)
SCIP_RETCODE SCIPhashtableRemove(SCIP_HASHTABLE *hashtable, void *element)
void SCIPupdateSolLPConsViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
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,...)
static SCIP_Bool isFiniteNonnegativeIntegral(SCIP *scip, SCIP_Real x)
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
static SCIP_RETCODE scaleCons(SCIP *scip, SCIP_CONS *cons, SCIP_Real scalar)
SCIP_RETCODE SCIPaddRow(SCIP *scip, SCIP_ROW *row, SCIP_Bool forcecut, SCIP_Bool *infeasible)
static SCIP_DECL_CONSINIT(consInitLinear)
SCIP_RETCODE SCIPsetConshdlrResprop(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSRESPROP((*consresprop)))
#define SCIPdebugGetSolVal(scip, var, val)
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
int SCIPconshdlrGetNConss(SCIP_CONSHDLR *conshdlr)
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
static SCIP_RETCODE retrieveParallelConstraints(SCIP_HASHTABLE *hashtable, SCIP_CONS **querycons, SCIP_CONS **parallelconss, int *nparallelconss)
#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 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_RETCODE addRelaxation(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff)
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)
SCIP_RETCODE SCIPhashtableSafeInsert(SCIP_HASHTABLE *hashtable, void *element)
static SCIP_RETCODE presolStuffing(SCIP *scip, SCIP_CONS *cons, SCIP_Bool singletonstuffing, SCIP_Bool singlevarstuffing, SCIP_Bool *cutoff, int *nfixedvars, int *nchgbds)
SCIP_RETCODE SCIPchgRowLhs(SCIP *scip, SCIP_ROW *row, SCIP_Real lhs)
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
static void consdataUpdateActivitiesGlbLb(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_Real oldlb, SCIP_Real newlb, SCIP_Real val, SCIP_Bool checkreliability)
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
static SCIP_Real consdataComputePseudoActivity(SCIP *scip, SCIP_CONSDATA *consdata)
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
SCIP_Real SCIPbdchginfoGetNewbound(SCIP_BDCHGINFO *bdchginfo)
static void consdataCalcActivities(SCIP *scip, SCIP_CONSDATA *consdata)
#define NONLINCONSUPGD_PRIORITY
SCIP_VAR * SCIPvarGetAggrVar(SCIP_VAR *var)
SCIP_RETCODE SCIPcreateVar(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype, SCIP_Bool initial, SCIP_Bool removable, SCIP_DECL_VARDELORIG((*vardelorig)), SCIP_DECL_VARTRANS((*vartrans)), SCIP_DECL_VARDELTRANS((*vardeltrans)), SCIP_DECL_VARCOPY((*varcopy)), SCIP_VARDATA *vardata)
static int getVarWeight(SCIP_VAR *var)
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
#define BMScopyMemoryArray(ptr, source, num)
int SCIPgetNRuns(SCIP *scip)
SCIP_Real SCIProwGetDualfarkas(SCIP_ROW *row)
SCIP_RETCODE SCIPlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRINT((*consprint)))
#define SCIP_EVENTTYPE_UBTIGHTENED
Constraint handler for linear constraints in their most general form, .
int SCIPgetNObjVars(SCIP *scip)
SCIP_Longint SCIPgetNConflictConssApplied(SCIP *scip)
void * SCIPhashtableRetrieve(SCIP_HASHTABLE *hashtable, void *key)
SCIP_RETCODE SCIPchgRhsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_Real rhs)
int SCIPvarGetMultaggrNVars(SCIP_VAR *var)
SCIP_Bool SCIPisSumRelGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPgetRowSolActivity(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
#define DEFAULT_MAXROUNDSROOT
#define SCIP_EVENTTYPE_GBDCHANGED
SCIP_RETCODE SCIPvarGetOrigvarSum(SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
SCIP_Real SCIPgetFeasibilityLinear(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol)
SCIP_RETCODE SCIPinferVarLbCons(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_CONS *infercons, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_RETCODE SCIPclassifyConstraintTypesLinear(SCIP *scip, SCIP_LINCONSSTATS *linconsstats)
#define DEFAULT_TIGHTENBOUNDSFREQ
#define SCIP_MAXTREEDEPTH
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)
int SCIPgetNConss(SCIP *scip)
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)
void SCIPmessageFPrintInfo(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *formatstr,...)
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)
static SCIP_RETCODE consPrintConsSol(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, FILE *file)
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
SCIP_Bool SCIPdoNotAggr(SCIP *scip)
static unsigned int getParallelConsKey(SCIP_CONS *cons)
#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_Bool isRangedRow(SCIP *scip, SCIP_Real lhs, SCIP_Real rhs)
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)
#define SCIP_CALL_ABORT(x)
static SCIP_DECL_CONSGETNVARS(consGetNVarsLinear)
SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
static SCIP_DECL_CONSEXIT(consExitLinear)
#define DEFAULT_RANGEDROWMAXDEPTH
SCIP_RETCODE SCIPsetConshdlrExitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITSOL((*consexitsol)))
#define SCIPcombineTwoInt(a, b)
SCIP_RETCODE SCIPwriteVarName(SCIP *scip, FILE *file, SCIP_VAR *var, SCIP_Bool type)
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)
SCIP_RETCODE SCIPchgCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
SCIP_Bool SCIPvarIsNegated(SCIP_VAR *var)
static void consdataUpdateActivitiesUb(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR *var, SCIP_Real oldub, SCIP_Real newub, SCIP_Real val, SCIP_Bool checkreliability)
static SCIP_RETCODE consdataFree(SCIP *scip, SCIP_CONSDATA **consdata)
#define SCIPreallocBufferArray(scip, ptr, num)
SCIP_RETCODE SCIPsetConshdlrProp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING proptiming)
SCIP_RETCODE SCIPsetConsInitial(SCIP *scip, SCIP_CONS *cons, SCIP_Bool initial)
#define SCIP_EVENTTYPE_BOUNDRELAXED
#define DEFAULT_RANGEDROWARTCONS
static SCIP_RETCODE dualPresolve(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff, int *nfixedvars, int *naggrvars, int *ndelconss)