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 )
1321 consdata->glbminactivity += consdata->vals[i] *
bound;
1325 consdata->validglbminact =
TRUE;
1328 consdata->lastglbminactivity = consdata->glbminactivity;
1341 consdata->glbmaxactivity = 0;
1343 for( i = consdata->nvars - 1; i >= 0; --i )
1348 consdata->glbmaxactivity += consdata->vals[i] *
bound;
1352 consdata->validglbmaxact =
TRUE;
1355 consdata->lastglbmaxactivity = consdata->glbmaxactivity;
1367 assert(consdata != NULL);
1368 assert(!consdata->validmaxabsval);
1371 consdata->validmaxabsval =
TRUE;
1372 consdata->maxabsval = 0.0;
1373 for( i = 0; i < consdata->nvars; ++i )
1375 absval = consdata->vals[i];
1377 if( absval > consdata->maxabsval )
1378 consdata->maxabsval = absval;
1391 assert(consdata != NULL);
1392 assert(!consdata->validminabsval);
1395 consdata->validminabsval =
TRUE;
1397 if( consdata->nvars > 0 )
1398 consdata->minabsval =
REALABS(consdata->vals[0]);
1400 consdata->minabsval = 0.0;
1402 for( i = 1; i < consdata->nvars; ++i )
1404 absval = consdata->vals[i];
1406 if( absval < consdata->minabsval )
1407 consdata->minabsval = absval;
1419 assert(!consdata->hasnonbinvalid);
1420 consdata->hasnonbinvar =
FALSE;
1421 consdata->hascontvar =
FALSE;
1423 for( v = consdata->nvars - 1; v >= 0; --v )
1429 consdata->hasnonbinvar =
TRUE;
1433 consdata->hascontvar =
TRUE;
1438 assert(consdata->hascontvar || v < 0);
1440 consdata->hasnonbinvalid =
TRUE;
1444 #ifdef CHECKMAXACTDELTA 1461 for( v = consdata->nvars - 1; v >= 0; --v )
1473 delta =
REALABS(consdata->vals[v]) * domain;
1475 if( delta > maxactdelta )
1477 maxactdelta = delta;
1480 assert(
SCIPisFeasEQ(scip, maxactdelta, consdata->maxactdelta));
1484 #define checkMaxActivityDelta(scip, consdata) 1497 consdata->maxactdelta = 0.0;
1499 if( !consdata->hasnonbinvalid )
1503 if( !consdata->hasnonbinvar )
1505 for( v = consdata->nvars - 1; v >= 0; --v )
1509 delta =
REALABS(consdata->vals[v]);
1511 if( delta > consdata->maxactdelta )
1513 consdata->maxactdelta = delta;
1514 consdata->maxactdeltavar = consdata->vars[v];
1521 for( v = consdata->nvars - 1; v >= 0; --v )
1533 consdata->maxactdeltavar = consdata->vars[v];
1538 delta =
REALABS(consdata->vals[v]) * domain;
1540 if( delta > consdata->maxactdelta )
1542 consdata->maxactdelta = delta;
1543 consdata->maxactdeltavar = consdata->vars[v];
1565 int* activityposinf;
1566 int* activityneginf;
1567 int* activityposhuge;
1568 int* activityneghuge;
1576 assert(scip != NULL);
1577 assert(consdata != NULL);
1578 assert(global || (var != NULL));
1579 assert(consdata->validactivities);
1584 assert(consdata->minactivityneginf >= 0);
1585 assert(consdata->minactivityposinf >= 0);
1586 assert(consdata->maxactivityneginf >= 0);
1587 assert(consdata->maxactivityposinf >= 0);
1588 assert(consdata->minactivityneghuge >= 0);
1589 assert(consdata->minactivityposhuge >= 0);
1590 assert(consdata->maxactivityneghuge >= 0);
1591 assert(consdata->maxactivityposhuge >= 0);
1596 assert(consdata->glbminactivityneginf >= 0);
1597 assert(consdata->glbminactivityposinf >= 0);
1598 assert(consdata->glbmaxactivityneginf >= 0);
1599 assert(consdata->glbmaxactivityposinf >= 0);
1600 assert(consdata->glbminactivityneghuge >= 0);
1601 assert(consdata->glbminactivityposhuge >= 0);
1602 assert(consdata->glbmaxactivityneghuge >= 0);
1603 assert(consdata->glbmaxactivityposhuge >= 0);
1620 activity = &(consdata->glbminactivity);
1621 lastactivity = &(consdata->lastglbminactivity);
1622 activityposinf = &(consdata->glbminactivityposinf);
1623 activityneginf = &(consdata->glbminactivityneginf);
1624 activityposhuge = &(consdata->glbminactivityposhuge);
1625 activityneghuge = &(consdata->glbminactivityneghuge);
1626 validact = consdata->validglbminact;
1630 activity = &(consdata->glbmaxactivity);
1631 lastactivity = &(consdata->lastglbmaxactivity);
1632 activityposinf = &(consdata->glbmaxactivityneginf);
1633 activityneginf = &(consdata->glbmaxactivityposinf);
1634 activityposhuge = &(consdata->glbmaxactivityposhuge);
1635 activityneghuge = &(consdata->glbmaxactivityneghuge);
1636 validact = consdata->validglbmaxact;
1643 activity = &(consdata->glbmaxactivity);
1644 lastactivity = &(consdata->lastglbmaxactivity);
1645 activityposinf = &(consdata->glbmaxactivityposinf);
1646 activityneginf = &(consdata->glbmaxactivityneginf);
1647 activityposhuge = &(consdata->glbmaxactivityposhuge);
1648 activityneghuge = &(consdata->glbmaxactivityneghuge);
1649 validact = consdata->validglbmaxact;
1653 activity = &(consdata->glbminactivity);
1654 lastactivity = &(consdata->lastglbminactivity);
1655 activityposinf = &(consdata->glbminactivityneginf);
1656 activityneginf = &(consdata->glbminactivityposinf);
1657 activityposhuge = &(consdata->glbminactivityposhuge);
1658 activityneghuge = &(consdata->glbminactivityneghuge);
1659 validact = consdata->validglbminact;
1676 activity = &(consdata->minactivity);
1677 lastactivity = &(consdata->lastminactivity);
1678 activityposinf = &(consdata->minactivityposinf);
1679 activityneginf = &(consdata->minactivityneginf);
1680 activityposhuge = &(consdata->minactivityposhuge);
1681 activityneghuge = &(consdata->minactivityneghuge);
1682 validact = consdata->validminact;
1686 activity = &(consdata->maxactivity);
1687 lastactivity = &(consdata->lastmaxactivity);
1688 activityposinf = &(consdata->maxactivityneginf);
1689 activityneginf = &(consdata->maxactivityposinf);
1690 activityposhuge = &(consdata->maxactivityposhuge);
1691 activityneghuge = &(consdata->maxactivityneghuge);
1692 validact = consdata->validmaxact;
1699 activity = &(consdata->maxactivity);
1700 lastactivity = &(consdata->lastmaxactivity);
1701 activityposinf = &(consdata->maxactivityposinf);
1702 activityneginf = &(consdata->maxactivityneginf);
1703 activityposhuge = &(consdata->maxactivityposhuge);
1704 activityneghuge = &(consdata->maxactivityneghuge);
1705 validact = consdata->validmaxact;
1709 activity = &(consdata->minactivity);
1710 lastactivity = &(consdata->lastminactivity);
1711 activityposinf = &(consdata->minactivityneginf);
1712 activityneginf = &(consdata->minactivityposinf);
1713 activityposhuge = &(consdata->minactivityposhuge);
1714 activityneghuge = &(consdata->minactivityneghuge);
1715 validact = consdata->validminact;
1720 oldcontribution = val * oldbound;
1721 newcontribution = val * newbound;
1728 if( oldbound > 0.0 )
1730 assert((*activityposinf) >= 1);
1733 if( finitenewbound || newbound < 0.0 )
1736 (*activityposinf)--;
1739 if( !finitenewbound && newbound < 0.0 )
1740 (*activityneginf)++;
1741 else if( hugevalnewcont )
1744 if( newcontribution > 0.0 )
1745 (*activityposhuge)++;
1747 (*activityneghuge)++;
1751 delta = newcontribution;
1757 assert(oldbound < 0.0);
1758 assert((*activityneginf) >= 1);
1761 if( finitenewbound || newbound > 0.0 )
1764 (*activityneginf)--;
1767 if( !finitenewbound && newbound > 0.0 )
1768 (*activityposinf)++;
1769 else if( hugevalnewcont )
1772 if( newcontribution > 0.0 )
1773 (*activityposhuge)++;
1775 (*activityneghuge)++;
1779 delta = newcontribution;
1786 if( oldcontribution > 0.0 )
1788 assert((*activityposhuge) >= 1);
1793 (*activityposhuge)--;
1795 if( !finitenewbound )
1798 if( newbound > 0.0 )
1799 (*activityposinf)++;
1802 (*activityneginf)++;
1804 else if( hugevalnewcont )
1807 if( newcontribution > 0.0 )
1808 (*activityposhuge)++;
1811 (*activityneghuge)++;
1815 delta = newcontribution;
1820 assert(oldcontribution < 0.0);
1821 assert((*activityneghuge) >= 1);
1826 (*activityneghuge)--;
1828 if( !finitenewbound )
1831 if( newbound > 0.0 )
1832 (*activityposinf)++;
1835 (*activityneginf)++;
1837 else if( hugevalnewcont )
1840 if( newcontribution > 0.0 )
1841 (*activityposhuge)++;
1844 (*activityneghuge)++;
1848 delta = newcontribution;
1854 if( !finitenewbound )
1859 if( newbound > 0.0 )
1861 (*activityposinf)++;
1862 delta = -oldcontribution;
1869 assert(newbound < 0.0 );
1871 (*activityneginf)++;
1872 delta = -oldcontribution;
1876 else if( hugevalnewcont )
1878 if( newcontribution > 0.0 )
1880 (*activityposhuge)++;
1881 delta = -oldcontribution;
1885 (*activityneghuge)++;
1886 delta = -oldcontribution;
1891 delta = newcontribution - oldcontribution;
1895 if( validact && (delta != 0.0) )
1900 (*activity) = (*activity) + delta;
1905 (*lastactivity) = (*activity);
1911 SCIPdebugMsg(scip,
"%s activity of linear constraint unreliable after update: %16.9g\n",
1912 (global ?
"global " :
""), (*activity));
1918 consdata->validglbminact =
FALSE;
1920 consdata->validglbmaxact =
FALSE;
1925 consdata->validminact =
FALSE;
1927 consdata->validmaxact =
FALSE;
1946 assert(scip != NULL);
1947 assert(consdata != NULL);
1948 assert(var != NULL);
1950 if( consdata->validactivities )
1971 assert(scip != NULL);
1972 assert(consdata != NULL);
1973 assert(var != NULL);
1975 if( consdata->validactivities )
1995 assert(scip != NULL);
1996 assert(consdata != NULL);
1998 if( consdata->validactivities )
2018 assert(scip != NULL);
2019 assert(consdata != NULL);
2021 if( consdata->validactivities )
2040 assert(scip != NULL);
2041 assert(consdata != NULL);
2042 assert(var != NULL);
2045 if( consdata->validmaxabsval )
2052 consdata->maxabsval =
MAX(consdata->maxabsval, absval);
2055 if( consdata->validminabsval )
2062 consdata->minabsval = MIN(consdata->minabsval, absval);
2066 if( consdata->validactivities )
2090 assert(scip != NULL);
2091 assert(consdata != NULL);
2092 assert(var != NULL);
2095 if( consdata->validmaxabsval )
2101 if(
SCIPisEQ(scip, absval, consdata->maxabsval) )
2103 consdata->validmaxabsval =
FALSE;
2109 if( consdata->validminabsval )
2115 if(
SCIPisEQ(scip, absval, consdata->minabsval) )
2117 consdata->validminabsval =
FALSE;
2123 if( consdata->validactivities )
2148 assert(scip != NULL);
2149 assert(consdata != NULL);
2150 assert(var != NULL);
2159 if( consdata->validmaxabsval )
2165 if(
SCIPisGE(scip, absval, consdata->maxabsval) )
2167 consdata->maxabsval = absval;
2174 if(
SCIPisEQ(scip, absval, consdata->maxabsval) )
2176 consdata->validmaxabsval =
FALSE;
2183 if( consdata->validminabsval )
2189 if(
SCIPisLE(scip, absval, consdata->minabsval) )
2191 consdata->minabsval = absval;
2198 if(
SCIPisEQ(scip, absval, consdata->minabsval) )
2200 consdata->validminabsval =
FALSE;
2217 delta =
REALABS(newval) * domain;
2219 if( delta > consdata->maxactdelta )
2221 consdata->maxactdelta = delta;
2222 consdata->maxactdeltavar = var;
2227 if( consdata->maxactdeltavar == var )
2243 assert(consdata != NULL);
2245 if( !consdata->validmaxabsval )
2247 assert(consdata->validmaxabsval);
2250 return consdata->maxabsval;
2259 assert(consdata != NULL);
2261 if( !consdata->validminabsval )
2263 assert(consdata->validminabsval);
2266 return consdata->minabsval;
2280 assert(scip != NULL);
2281 assert(consdata != NULL);
2282 assert(!consdata->validactivities);
2283 assert(consdata->minactivity >=
SCIP_INVALID || consdata->validminact);
2284 assert(consdata->maxactivity >=
SCIP_INVALID || consdata->validmaxact);
2285 assert(consdata->glbminactivity >=
SCIP_INVALID || consdata->validglbminact);
2286 assert(consdata->glbmaxactivity >=
SCIP_INVALID || consdata->validglbmaxact);
2288 consdata->validmaxabsval =
TRUE;
2289 consdata->validminabsval =
TRUE;
2291 consdata->validminact =
TRUE;
2292 consdata->validmaxact =
TRUE;
2293 consdata->validglbminact =
TRUE;
2294 consdata->validglbmaxact =
TRUE;
2295 consdata->maxabsval = 0.0;
2296 consdata->minabsval = (consdata->nvars == 0 ? 0.0 :
REALABS(consdata->vals[0]));
2297 consdata->minactivity = 0.0;
2298 consdata->maxactivity = 0.0;
2299 consdata->lastminactivity = 0.0;
2300 consdata->lastmaxactivity = 0.0;
2301 consdata->minactivityneginf = 0;
2302 consdata->minactivityposinf = 0;
2303 consdata->maxactivityneginf = 0;
2304 consdata->maxactivityposinf = 0;
2305 consdata->minactivityneghuge = 0;
2306 consdata->minactivityposhuge = 0;
2307 consdata->maxactivityneghuge = 0;
2308 consdata->maxactivityposhuge = 0;
2309 consdata->glbminactivity = 0.0;
2310 consdata->glbmaxactivity = 0.0;
2311 consdata->lastglbminactivity = 0.0;
2312 consdata->lastglbmaxactivity = 0.0;
2313 consdata->glbminactivityneginf = 0;
2314 consdata->glbminactivityposinf = 0;
2315 consdata->glbmaxactivityneginf = 0;
2316 consdata->glbmaxactivityposinf = 0;
2317 consdata->glbminactivityneghuge = 0;
2318 consdata->glbminactivityposhuge = 0;
2319 consdata->glbmaxactivityneghuge = 0;
2320 consdata->glbmaxactivityposhuge = 0;
2322 for( i = 0; i < consdata->nvars; ++i )
2325 consdata->lastminactivity = consdata->minactivity;
2326 consdata->lastmaxactivity = consdata->maxactivity;
2327 consdata->lastglbminactivity = consdata->glbminactivity;
2328 consdata->lastglbmaxactivity = consdata->glbmaxactivity;
2352 assert(scip != NULL);
2353 assert(consdata != NULL);
2354 assert(posinf >= 0);
2355 assert(neginf >= 0);
2356 assert(poshuge >= 0);
2357 assert(neghuge >= 0);
2358 assert(minactivity != NULL);
2359 assert(isrelax != NULL);
2360 assert(issettoinfinity != NULL);
2366 *issettoinfinity =
TRUE;
2370 else if( neginf > 0 )
2373 *issettoinfinity =
TRUE;
2377 else if( neghuge > 0 )
2380 *issettoinfinity =
TRUE;
2384 else if( !goodrelax && poshuge > 0 )
2387 *issettoinfinity =
TRUE;
2397 if( !consdata->validglbminact )
2399 assert(consdata->validglbminact);
2401 tmpactivity = consdata->glbminactivity;
2405 if( !consdata->validminact )
2407 assert(consdata->validminact);
2409 tmpactivity = consdata->minactivity;
2418 *minactivity = 1.0 * poshuge *
SCIPgetHugeValue(scip) + (tmpactivity - delta);
2419 *issettoinfinity =
FALSE;
2425 *minactivity = tmpactivity - delta;
2426 *issettoinfinity =
FALSE;
2453 assert(scip != NULL);
2454 assert(consdata != NULL);
2455 assert(posinf >= 0);
2456 assert(neginf >= 0);
2457 assert(poshuge >= 0);
2458 assert(neghuge >= 0);
2459 assert(maxactivity != NULL);
2460 assert(isrelax != NULL);
2461 assert(issettoinfinity != NULL);
2467 *issettoinfinity =
TRUE;
2471 else if( posinf > 0 )
2474 *issettoinfinity =
TRUE;
2478 else if( poshuge > 0 )
2481 *issettoinfinity =
TRUE;
2485 else if( !goodrelax && neghuge > 0 )
2488 *issettoinfinity =
TRUE;
2498 if( !consdata->validglbmaxact )
2500 assert(consdata->validglbmaxact);
2502 tmpactivity = consdata->glbmaxactivity;
2506 if( !consdata->validmaxact )
2508 assert(consdata->validmaxact);
2510 tmpactivity = consdata->maxactivity;
2519 *maxactivity = -1.0 * neghuge *
SCIPgetHugeValue(scip) + tmpactivity - delta;
2520 *issettoinfinity =
FALSE;
2526 *maxactivity = tmpactivity - delta;
2527 *issettoinfinity =
FALSE;
2552 assert(scip != NULL);
2553 assert(consdata != NULL);
2554 assert(minactivity != NULL);
2555 assert(maxactivity != NULL);
2557 if( !consdata->validactivities )
2560 assert(consdata->validminact);
2561 assert(consdata->validmaxact);
2565 assert(consdata->minactivityneginf >= 0);
2566 assert(consdata->minactivityposinf >= 0);
2567 assert(consdata->maxactivityneginf >= 0);
2568 assert(consdata->maxactivityposinf >= 0);
2570 getMinActivity(scip, consdata, consdata->minactivityposinf, consdata->minactivityneginf,
2571 consdata->minactivityposhuge, consdata->minactivityneghuge, 0.0,
FALSE, goodrelax,
2572 minactivity, minisrelax, &issettoinfinity);
2574 getMaxActivity(scip, consdata, consdata->maxactivityposinf, consdata->maxactivityneginf,
2575 consdata->maxactivityposhuge, consdata->maxactivityneghuge, 0.0,
FALSE, goodrelax,
2576 maxactivity, maxisrelax, &issettoinfinity);
2596 assert(scip != NULL);
2597 assert(consdata != NULL);
2598 assert(cancelvar != NULL);
2599 assert(resactivity != NULL);
2603 for( v = 0; v < consdata->nvars; ++v )
2605 var = consdata->vars[v];
2606 assert(var != NULL);
2607 if( var == cancelvar )
2610 val = consdata->vals[v];
2612 if( useglobalbounds )
2632 *resactivity += val*lb;
2638 *resactivity += val*ub;
2647 *resactivity += val*ub;
2653 *resactivity += val*lb;
2685 assert(scip != NULL);
2686 assert(consdata != NULL);
2687 assert(var != NULL);
2688 assert(minresactivity != NULL);
2689 assert(maxresactivity != NULL);
2690 assert(minisrelax != NULL);
2691 assert(maxisrelax != NULL);
2692 assert(isminsettoinfinity != NULL);
2693 assert(ismaxsettoinfinity != NULL);
2696 if( !consdata->validactivities )
2699 assert(consdata->validminact);
2700 assert(consdata->validmaxact);
2704 assert(consdata->minactivityneginf >= 0);
2705 assert(consdata->minactivityposinf >= 0);
2706 assert(consdata->maxactivityneginf >= 0);
2707 assert(consdata->maxactivityposinf >= 0);
2708 assert(consdata->minactivityneghuge >= 0);
2709 assert(consdata->minactivityposhuge >= 0);
2710 assert(consdata->maxactivityneghuge >= 0);
2711 assert(consdata->maxactivityposhuge >= 0);
2731 assert(consdata->minactivityposinf >= 1);
2733 getMinActivity(scip, consdata, consdata->minactivityposinf - 1, consdata->minactivityneginf,
2734 consdata->minactivityposhuge, consdata->minactivityneghuge, 0.0,
FALSE, goodrelax,
2735 minresactivity, minisrelax, isminsettoinfinity);
2739 assert(consdata->minactivityneginf >= 1);
2741 getMinActivity(scip, consdata, consdata->minactivityposinf, consdata->minactivityneginf - 1,
2742 consdata->minactivityposhuge, consdata->minactivityneghuge, 0.0,
FALSE, goodrelax,
2743 minresactivity, minisrelax, isminsettoinfinity);
2747 assert(consdata->minactivityposhuge >= 1);
2749 getMinActivity(scip, consdata, consdata->minactivityposinf, consdata->minactivityneginf,
2750 consdata->minactivityposhuge - 1, consdata->minactivityneghuge, 0.0,
FALSE, goodrelax,
2751 minresactivity, minisrelax, isminsettoinfinity);
2755 assert(consdata->minactivityneghuge >= 1);
2757 getMinActivity(scip, consdata, consdata->minactivityposinf, consdata->minactivityneginf,
2758 consdata->minactivityposhuge, consdata->minactivityneghuge - 1, 0.0,
FALSE, goodrelax,
2759 minresactivity, minisrelax, isminsettoinfinity);
2763 getMinActivity(scip, consdata, consdata->minactivityposinf, consdata->minactivityneginf,
2764 consdata->minactivityposhuge, consdata->minactivityneghuge, absval * minactbound,
FALSE, goodrelax,
2765 minresactivity, minisrelax, isminsettoinfinity);
2773 assert(consdata->maxactivityneginf >= 1);
2775 getMaxActivity(scip, consdata, consdata->maxactivityposinf, consdata->maxactivityneginf - 1,
2776 consdata->maxactivityposhuge, consdata->maxactivityneghuge, 0.0,
FALSE, goodrelax,
2777 maxresactivity, maxisrelax, ismaxsettoinfinity);
2781 assert(consdata->maxactivityposinf >= 1);
2783 getMaxActivity(scip, consdata, consdata->maxactivityposinf - 1, consdata->maxactivityneginf,
2784 consdata->maxactivityposhuge, consdata->maxactivityneghuge, 0.0,
FALSE, goodrelax,
2785 maxresactivity, maxisrelax, ismaxsettoinfinity);
2789 assert(consdata->maxactivityposhuge >= 1);
2791 getMaxActivity(scip, consdata, consdata->maxactivityposinf, consdata->maxactivityneginf,
2792 consdata->maxactivityposhuge - 1, consdata->maxactivityneghuge, 0.0,
FALSE, goodrelax,
2793 maxresactivity, maxisrelax, ismaxsettoinfinity);
2797 assert(consdata->maxactivityneghuge >= 1);
2799 getMaxActivity(scip, consdata, consdata->maxactivityposinf, consdata->maxactivityneginf,
2800 consdata->maxactivityposhuge, consdata->maxactivityneghuge - 1, 0.0,
FALSE, goodrelax,
2801 maxresactivity, maxisrelax, ismaxsettoinfinity);
2805 getMaxActivity(scip, consdata, consdata->maxactivityposinf, consdata->maxactivityneginf,
2806 consdata->maxactivityposhuge, consdata->maxactivityneghuge, absval * maxactbound,
FALSE, goodrelax,
2807 maxresactivity, maxisrelax, ismaxsettoinfinity);
2830 assert(scip != NULL);
2831 assert(consdata != NULL);
2832 assert((glbminactivity != NULL && minisrelax != NULL && isminsettoinfinity != NULL)
2833 || (glbmaxactivity != NULL && maxisrelax != NULL && ismaxsettoinfinity != NULL));
2835 if( !consdata->validactivities )
2838 assert(consdata->validglbminact);
2839 assert(consdata->validglbmaxact);
2843 assert(consdata->glbminactivityneginf >= 0);
2844 assert(consdata->glbminactivityposinf >= 0);
2845 assert(consdata->glbmaxactivityneginf >= 0);
2846 assert(consdata->glbmaxactivityposinf >= 0);
2847 assert(consdata->glbminactivityneghuge >= 0);
2848 assert(consdata->glbminactivityposhuge >= 0);
2849 assert(consdata->glbmaxactivityneghuge >= 0);
2850 assert(consdata->glbmaxactivityposhuge >= 0);
2852 if( glbminactivity != NULL )
2854 assert(isminsettoinfinity != NULL);
2855 assert(minisrelax != NULL);
2857 getMinActivity(scip, consdata, consdata->glbminactivityposinf, consdata->glbminactivityneginf,
2858 consdata->glbminactivityposhuge, consdata->glbminactivityneghuge, 0.0,
TRUE, goodrelax,
2859 glbminactivity, minisrelax, isminsettoinfinity);
2862 if( glbmaxactivity != NULL )
2864 assert(ismaxsettoinfinity != NULL);
2865 assert(maxisrelax != NULL);
2867 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf, consdata->glbmaxactivityneginf,
2868 consdata->glbmaxactivityposhuge, consdata->glbmaxactivityneghuge, 0.0,
TRUE, goodrelax,
2869 glbmaxactivity, maxisrelax, ismaxsettoinfinity);
2898 assert(scip != NULL);
2899 assert(consdata != NULL);
2900 assert(var != NULL);
2901 assert((minresactivity != NULL && minisrelax != NULL && isminsettoinfinity != NULL )
2902 || (maxresactivity != NULL && maxisrelax != NULL && ismaxsettoinfinity != NULL));
2905 if( !consdata->validactivities )
2910 assert(consdata->glbminactivityneginf >= 0);
2911 assert(consdata->glbminactivityposinf >= 0);
2912 assert(consdata->glbmaxactivityneginf >= 0);
2913 assert(consdata->glbmaxactivityposinf >= 0);
2928 if( minresactivity != NULL )
2930 assert(isminsettoinfinity != NULL);
2931 assert(minisrelax != NULL);
2938 assert(consdata->glbminactivityposinf >= 1);
2940 getMinActivity(scip, consdata, consdata->glbminactivityposinf - 1, consdata->glbminactivityneginf,
2941 consdata->glbminactivityposhuge, consdata->glbminactivityneghuge, 0.0,
TRUE, goodrelax,
2942 minresactivity, minisrelax, isminsettoinfinity);
2946 assert(consdata->glbminactivityneginf >= 1);
2948 getMinActivity(scip, consdata, consdata->glbminactivityposinf, consdata->glbminactivityneginf - 1,
2949 consdata->glbminactivityposhuge, consdata->glbminactivityneghuge, 0.0,
TRUE, goodrelax,
2950 minresactivity, minisrelax, isminsettoinfinity);
2954 assert(consdata->glbminactivityposhuge >= 1);
2956 getMinActivity(scip, consdata, consdata->glbminactivityposinf, consdata->glbminactivityneginf,
2957 consdata->glbminactivityposhuge - 1, consdata->glbminactivityneghuge, 0.0,
TRUE, goodrelax,
2958 minresactivity, minisrelax, isminsettoinfinity);
2962 assert(consdata->glbminactivityneghuge >= 1);
2964 getMinActivity(scip, consdata, consdata->glbminactivityposinf, consdata->glbminactivityneginf,
2965 consdata->glbminactivityposhuge, consdata->glbminactivityneghuge - 1, 0.0,
TRUE, goodrelax,
2966 minresactivity, minisrelax, isminsettoinfinity);
2970 getMinActivity(scip, consdata, consdata->glbminactivityposinf, consdata->glbminactivityneginf,
2971 consdata->glbminactivityposhuge, consdata->glbminactivityneghuge, absval * minactbound,
TRUE,
2972 goodrelax, minresactivity, minisrelax, isminsettoinfinity);
2976 if( maxresactivity != NULL )
2978 assert(ismaxsettoinfinity != NULL);
2979 assert(maxisrelax != NULL);
2986 assert(consdata->glbmaxactivityneginf >= 1);
2988 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf, consdata->glbmaxactivityneginf - 1,
2989 consdata->glbmaxactivityposhuge, consdata->glbmaxactivityneghuge, 0.0,
TRUE, goodrelax,
2990 maxresactivity, maxisrelax, ismaxsettoinfinity);
2994 assert(consdata->glbmaxactivityposinf >= 1);
2996 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf - 1, consdata->glbmaxactivityneginf,
2997 consdata->glbmaxactivityposhuge, consdata->glbmaxactivityneghuge, 0.0,
TRUE, goodrelax,
2998 maxresactivity, maxisrelax, ismaxsettoinfinity);
3002 assert(consdata->glbmaxactivityposhuge >= 1);
3004 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf, consdata->glbmaxactivityneginf,
3005 consdata->glbmaxactivityposhuge - 1, consdata->glbmaxactivityneghuge, 0.0,
TRUE, goodrelax,
3006 maxresactivity, maxisrelax, ismaxsettoinfinity);
3010 assert(consdata->glbmaxactivityneghuge >= 1);
3012 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf, consdata->glbmaxactivityneginf,
3013 consdata->glbmaxactivityposhuge, consdata->glbmaxactivityneghuge - 1, 0.0,
TRUE, goodrelax,
3014 maxresactivity, maxisrelax, ismaxsettoinfinity);
3018 getMaxActivity(scip, consdata, consdata->glbmaxactivityposinf, consdata->glbmaxactivityneginf,
3019 consdata->glbmaxactivityposhuge, consdata->glbmaxactivityneghuge, absval * maxactbound,
TRUE,
3020 goodrelax, maxresactivity, maxisrelax, ismaxsettoinfinity);
3035 assert(scip != NULL);
3036 assert(consdata != NULL);
3052 for( v = 0; v < consdata->nvars; ++v )
3056 if( consdata->vals[v] < 0 )
3066 activity += consdata->vals[v] * solval;
3068 assert(nneginf >= 0 && nposinf >= 0);
3070 SCIPdebugMsg(scip,
"activity of linear constraint: %.15g, %d positive infinity values, %d negative infinity values \n", activity, nposinf, nneginf);
3073 if( nposinf > 0 && nneginf > 0 )
3074 activity = (consdata->rhs + consdata->lhs) / 2;
3075 else if( nposinf > 0 )
3077 else if( nneginf > 0 )
3080 SCIPdebugMsg(scip,
"corrected activity of linear constraint: %.15g\n", activity);
3085 else if( activity < 0 )
3103 assert(scip != NULL);
3104 assert(consdata != NULL);
3111 return MIN(consdata->rhs - activity, activity - consdata->lhs);
3121 uint64_t varsignature;
3126 assert(consdata != NULL);
3127 assert(consdata->validsignature);
3132 val = consdata->vals[pos];
3133 if( (val > 0.0 && ub > 0.0) || (val < 0.0 && lb < 0.0) )
3134 consdata->possignature |= varsignature;
3135 if( (val > 0.0 && lb < 0.0) || (val < 0.0 && ub > 0.0) )
3136 consdata->negsignature |= varsignature;
3145 assert(consdata != NULL);
3147 if( !consdata->validsignature )
3151 consdata->validsignature =
TRUE;
3152 consdata->possignature = 0;
3153 consdata->negsignature = 0;
3154 for( i = 0; i < consdata->nvars; ++i )
3165 assert(consdata != NULL);
3166 assert(0 <= ind1 && ind1 < consdata->nvars);
3167 assert(0 <= ind2 && ind2 < consdata->nvars);
3169 return SCIPvarCompare(consdata->vars[ind1], consdata->vars[ind2]);
3187 assert(perm != NULL);
3188 assert(consdata != NULL);
3192 for( v = 0; v < nvars; ++v )
3196 varv = consdata->vars[v];
3197 valv = consdata->vals[v];
3198 if( consdata->eventdata != NULL )
3199 eventdatav = consdata->eventdata[v];
3203 assert(0 <= perm[i] && perm[i] < nvars);
3204 assert(perm[i] != i);
3205 consdata->vars[i] = consdata->vars[perm[i]];
3206 consdata->vals[i] = consdata->vals[perm[i]];
3207 if( consdata->eventdata != NULL )
3209 consdata->eventdata[i] = consdata->eventdata[perm[i]];
3210 consdata->eventdata[i]->varpos = i;
3216 while( perm[i] != v );
3217 consdata->vars[i] = varv;
3218 consdata->vals[i] = valv;
3219 if( consdata->eventdata != NULL )
3221 consdata->eventdata[i] = eventdatav;
3222 consdata->eventdata[i]->varpos = i;
3229 for( v = 0; v < nvars; ++v )
3231 assert(perm[v] == v);
3232 assert(consdata->eventdata == NULL || consdata->eventdata[v]->varpos == v);
3252 assert(scip != NULL);
3253 assert(consdata != NULL);
3256 if( consdata->nvars <= 1 )
3258 consdata->sorted =
TRUE;
3259 consdata->binvarssorted =
TRUE;
3269 SCIPsort(perm, consdataCompVar, (
void*)consdata, consdata->nvars);
3276 consdata->sorted =
TRUE;
3277 consdata->binvarssorted =
FALSE;
3288 nvars = consdata->nvars;
3289 vars = consdata->vars;
3290 vals = consdata->vals;
3291 eventdata = consdata->eventdata;
3292 assert(vars != NULL || nvars == 0);
3293 assert(vals != NULL || nvars == 0);
3297 for( v = 0; v < nvars; ++v )
3299 assert( vars != NULL);
3300 assert( vals != NULL);
3309 tmpvar = vars[lastbin];
3310 tmpval = vals[lastbin];
3312 vars[lastbin] = vars[v];
3313 vals[lastbin] = vals[v];
3318 if( eventdata != NULL )
3322 tmpeventdata = eventdata[lastbin];
3323 eventdata[lastbin] = eventdata[v];
3324 eventdata[lastbin]->varpos = lastbin;
3325 eventdata[v] = tmpeventdata;
3326 eventdata[v]->varpos = v;
3332 assert(lastbin == v);
3337 consdata->nbinvars = lastbin;
3341 for( v = 0; v < nvars; ++v )
3343 assert(vars != NULL);
3344 assert(eventdata == NULL || eventdata[v]->varpos == v);
3349 if( consdata->nbinvars > 1 )
3354 assert(lastbin == consdata->nbinvars);
3355 assert(lastbin <= nvars);
3356 assert(vals != NULL);
3362 for( v = 0; v < lastbin; ++v )
3364 absvals[v] = ABS(vals[v]);
3377 consdata->binvarssorted =
TRUE;
3380 consdata->sorted = (consdata->sorted && consdata->nbinvars == 0);
3403 assert(scip != NULL);
3404 assert(cons != NULL);
3412 assert(consdata != NULL);
3413 assert(consdata->nvars == 0 || (consdata->vars != NULL && consdata->vals != NULL));
3417 if(
SCIPisEQ(scip, consdata->lhs, lhs) )
3421 if(
SCIPisEQ(scip, lhs, consdata->rhs) )
3423 consdata->rhs = lhs;
3424 assert(consdata->row == NULL);
3437 vars = consdata->vars;
3438 vals = consdata->vals;
3440 for( v = 0; v < consdata->nvars; ++v )
3442 assert(vars[v] != NULL);
3462 vars = consdata->vars;
3463 vals = consdata->vals;
3465 for( v = 0; v < consdata->nvars; ++v )
3467 assert(vars[v] != NULL);
3485 consdata->boundstightened = 0;
3486 consdata->presolved =
FALSE;
3487 consdata->cliquesadded =
FALSE;
3488 consdata->implsadded =
FALSE;
3498 consdata->lhs = lhs;
3499 consdata->changed =
TRUE;
3500 consdata->normalized =
FALSE;
3501 consdata->upgradetried =
FALSE;
3502 consdata->rangedrowpropagated = 0;
3506 if( consdata->row != NULL )
3524 assert(scip != NULL);
3525 assert(cons != NULL);
3533 assert(consdata != NULL);
3534 assert(consdata->nvars == 0 || (consdata->vars != NULL && consdata->vals != NULL));
3538 if(
SCIPisEQ(scip, consdata->rhs, rhs) )
3542 if(
SCIPisEQ(scip, rhs, consdata->lhs) )
3544 consdata->lhs = rhs;
3545 assert(consdata->row == NULL);
3560 vars = consdata->vars;
3561 vals = consdata->vals;
3563 for( v = 0; v < consdata->nvars; ++v )
3565 assert(vars[v] != NULL);
3585 vars = consdata->vars;
3586 vals = consdata->vals;
3588 for( v = 0; v < consdata->nvars; ++v )
3590 assert(vars[v] != NULL);
3608 consdata->boundstightened = 0;
3609 consdata->presolved =
FALSE;
3610 consdata->cliquesadded =
FALSE;
3611 consdata->implsadded =
FALSE;
3621 consdata->rhs = rhs;
3622 consdata->changed =
TRUE;
3623 consdata->normalized =
FALSE;
3624 consdata->upgradetried =
FALSE;
3625 consdata->rangedrowpropagated = 0;
3628 if( consdata->row != NULL )
3648 assert(scip != NULL);
3649 assert(cons != NULL);
3650 assert(var != NULL);
3657 assert(consdata != NULL);
3667 assert(var != NULL);
3671 consdata->vars[consdata->nvars] = var;
3672 consdata->vals[consdata->nvars] = val;
3681 if( consdata->eventdata != NULL )
3689 assert(conshdlrdata != NULL);
3690 assert(conshdlrdata->eventhdlr != NULL);
3693 consdata->eventdata[consdata->nvars-1] = NULL;
3714 consdata->maxactdeltavar = var;
3721 if( delta > consdata->maxactdelta )
3723 consdata->maxactdelta = delta;
3724 consdata->maxactdeltavar = var;
3739 consdata->boundstightened = 0;
3740 consdata->presolved =
FALSE;
3741 consdata->removedfixings = consdata->removedfixings &&
SCIPvarIsActive(var);
3743 if( consdata->validsignature )
3746 consdata->changed =
TRUE;
3747 consdata->normalized =
FALSE;
3748 consdata->upgradetried =
FALSE;
3749 consdata->cliquesadded =
FALSE;
3750 consdata->implsadded =
FALSE;
3751 consdata->rangedrowpropagated = 0;
3753 if( consdata->nvars == 1 )
3755 consdata->binvarssorted =
TRUE;
3756 consdata->sorted =
TRUE;
3757 consdata->merged =
TRUE;
3761 consdata->binvarssorted = consdata->binvarssorted && !
SCIPvarIsBinary(var);
3762 consdata->sorted = consdata->sorted
3763 && (
SCIPvarCompare(consdata->vars[consdata->nvars-2], consdata->vars[consdata->nvars-1]) <= 0);
3764 consdata->merged =
FALSE;
3768 if( consdata->hasnonbinvalid && !consdata->hascontvar )
3774 consdata->hasnonbinvar =
TRUE;
3777 consdata->hascontvar =
TRUE;
3782 if( consdata->row != NULL )
3802 assert(scip != NULL);
3803 assert(cons != NULL);
3806 assert(consdata != NULL);
3807 assert(0 <= pos && pos < consdata->nvars);
3809 var = consdata->vars[pos];
3810 val = consdata->vals[pos];
3811 assert(var != NULL);
3825 assert(conshdlrdata != NULL);
3826 assert(conshdlrdata->eventhdlr != NULL);
3829 if( consdata->eventdata != NULL )
3832 assert(consdata->eventdata[pos] == NULL);
3837 if( pos != consdata->nvars-1 )
3839 consdata->binvarssorted = consdata->binvarssorted && !
SCIPvarIsBinary(consdata->vars[pos]);
3841 consdata->vars[pos] = consdata->vars[consdata->nvars-1];
3842 consdata->vals[pos] = consdata->vals[consdata->nvars-1];
3844 if( consdata->eventdata != NULL )
3846 consdata->eventdata[pos] = consdata->eventdata[consdata->nvars-1];
3847 assert(consdata->eventdata[pos] != NULL);
3848 consdata->eventdata[pos]->varpos = pos;
3850 consdata->sorted = consdata->sorted && (pos + 2 >= consdata->nvars || (
SCIPvarCompare(consdata->vars[pos], consdata->vars[pos + 1]) <= 0));
3857 if( consdata->nvars <= 1 )
3869 if( consdata->maxactdeltavar == var )
3872 consdata->maxactdeltavar = NULL;
3883 consdata->boundstightened = 0;
3884 consdata->presolved =
FALSE;
3885 consdata->validsignature =
FALSE;
3886 consdata->changed =
TRUE;
3887 consdata->normalized =
FALSE;
3888 consdata->upgradetried =
FALSE;
3889 consdata->cliquesadded =
FALSE;
3890 consdata->implsadded =
FALSE;
3891 consdata->rangedrowpropagated = 0;
3896 consdata->hasnonbinvalid =
FALSE;
3900 if( consdata->row != NULL )
3924 assert(scip != NULL);
3925 assert(cons != NULL);
3929 assert(consdata != NULL);
3930 assert(0 <= pos && pos < consdata->nvars);
3933 var = consdata->vars[pos];
3934 val = consdata->vals[pos];
3935 assert(var != NULL);
3951 consdata->vals[pos] = newval;
3953 consdata->binvarssorted = consdata->binvarssorted && !
SCIPvarIsBinary(var);
3965 consdata->boundstightened = 0;
3966 consdata->presolved =
FALSE;
3967 consdata->validsignature = consdata->validsignature && (newval * val > 0.0);
3968 consdata->changed =
TRUE;
3969 consdata->normalized =
FALSE;
3970 consdata->upgradetried =
FALSE;
3971 consdata->cliquesadded =
FALSE;
3972 consdata->implsadded =
FALSE;
3973 consdata->rangedrowpropagated = 0;
3991 assert(scip != NULL);
3992 assert(cons != NULL);
3995 assert(consdata != NULL);
3996 assert(consdata->row == NULL);
4000 for( i = consdata->nvars - 1; i >= 0; --i )
4002 newval = scalar * consdata->vals[i];
4012 SCIPwarningMessage(scip,
"coefficient %.15g of variable <%s> in linear constraint <%s> scaled to zero (scalar: %.15g)\n",
4017 consdata->vals[i] = newval;
4025 lhs = consdata->lhs;
4026 consdata->lhs = -consdata->rhs;
4027 consdata->rhs = -lhs;
4032 newval = absscalar * consdata->lhs;
4040 consdata->lhs = newval;
4044 newval = absscalar * consdata->rhs;
4052 consdata->rhs = newval;
4056 consdata->cliquesadded =
FALSE;
4057 consdata->implsadded =
FALSE;
4075 assert(scip != NULL);
4076 assert(conshdlr != NULL);
4077 assert(conss != NULL);
4078 assert(nconss >= 0);
4082 for( i = 0; i < nconss; i++ )
4087 if( consdata->varsdeleted )
4090 for( v = consdata->nvars - 1; v >= 0; --v )
4097 consdata->varsdeleted =
FALSE;
4149 assert(scip != NULL);
4150 assert(cons != NULL);
4158 assert(consdata != NULL);
4161 if( consdata->normalized )
4165 vals = consdata->vals;
4166 nvars = consdata->nvars;
4167 vars = consdata->vars;
4168 assert(nvars == 0 || vars != NULL);
4169 assert(nvars == 0 || vals != NULL);
4173 consdata->normalized =
TRUE;
4177 assert(vars != NULL);
4178 assert(vals != NULL);
4189 if( !
SCIPisEQ(scip, maxabsval, 1.0) )
4195 for( v = nvars - 1; v >= 0; --v )
4199 abscoefsequ =
FALSE;
4207 SCIPdebugMsg(scip,
"divide linear constraint with %g, because all coefficents are in absolute value the same\n", maxabsval);
4211 if( consdata->validmaxabsval )
4213 if( !
SCIPisEQ(scip, consdata->maxabsval, 1.0) )
4214 consdata->maxabsval = 1.0;
4215 if( !
SCIPisEQ(scip, consdata->minabsval, 1.0) )
4216 consdata->minabsval = 1.0;
4227 vals = consdata->vals;
4228 nvars = consdata->nvars;
4229 vars = consdata->vars;
4231 assert(nvars == 0 || vars != NULL);
4232 assert(nvars == 0 || vals != NULL);
4239 consdata->normalized =
TRUE;
4243 assert(vars != NULL);
4244 assert(vals != NULL);
4257 if( !consdata->hasnonbinvalid )
4261 if( !consdata->hascontvar )
4274 for( v = nvars - 1; v >= 0; --v )
4323 for( i = 0; i < nvars; ++i )
4330 if( nposcoeffs > nnegcoeffs )
4332 else if( nposcoeffs < nnegcoeffs )
4342 assert(mult == +1 || mult == -1);
4346 SCIPdebugMsg(scip,
"multiply linear constraint with -1.0\n");
4351 assert(nvars == consdata->nvars);
4361 for( i = 0; i < nvars && success && scm <= maxmult; ++i )
4366 success =
SCIPrealToRational(vals[i], -epsilon, epsilon , maxmult, &nominator, &denominator);
4376 onlyintegral =
TRUE;
4379 for( i = nvars - 1; i >= 0; --i )
4383 onlyintegral =
FALSE;
4389 success = success && (scm <= maxmult || (scm == 1 && onlyintegral));
4390 if( success && scm != 1 )
4393 SCIPdebugMsg(scip,
"scale linear constraint with %" SCIP_LONGINT_FORMAT
" to make coefficients integral\n", scm);
4397 if( consdata->validmaxabsval )
4402 consdata->validmaxabsval =
FALSE;
4408 if( consdata->validminabsval )
4413 consdata->validminabsval =
FALSE;
4420 vals = consdata->vals;
4421 nvars = consdata->nvars;
4422 assert(nvars == 0 || vals != NULL);
4428 if( success && nvars >= 1 )
4434 for( i = 1; i < nvars && gcd > 1; ++i )
4443 SCIPdebugMsg(scip,
"divide linear constraint by greatest common divisor %" SCIP_LONGINT_FORMAT
"\n", gcd);
4447 if( consdata->validmaxabsval )
4451 if( consdata->validminabsval )
4459 consdata->normalized =
TRUE;
4479 assert(scip != NULL);
4480 assert(cons != NULL);
4483 assert(consdata != NULL);
4485 if( consdata->merged )
4495 v = consdata->nvars-1;
4498 var = consdata->vars[v];
4499 if( consdata->vars[v-1] == var )
4501 valsum = consdata->vals[v];
4506 valsum += consdata->vals[v];
4508 while( v >= 1 && consdata->vars[v-1] == var );
4511 assert(consdata->vars[v] == var);
4519 if( consdata->maxactdeltavar == var )
4522 consdata->maxactdeltavar = NULL;
4533 consdata->merged =
TRUE;
4559 assert(scip != NULL);
4560 assert(cons != NULL);
4562 if( infeasible != NULL )
4563 *infeasible =
FALSE;
4566 assert(consdata != NULL);
4568 if( !consdata->removedfixings )
4573 lhssubtrahend = 0.0;
4574 rhssubtrahend = 0.0;
4580 while( v < consdata->nvars )
4582 var = consdata->vars[v];
4583 val = consdata->vals[v];
4604 if( val * fixedval > 0.0 )
4610 if( infeasible != NULL )
4623 lhssubtrahend += val * fixedval;
4629 if( val * fixedval > 0.0 )
4631 if( infeasible != NULL )
4648 rhssubtrahend += val * fixedval;
4659 assert(activevar != NULL);
4661 assert(activevar != NULL);
4671 lhssubtrahend += activeconstant;
4673 rhssubtrahend += activeconstant;
4684 for( i = 0; i < naggrvars; ++i )
4691 lhssubtrahend += val * aggrconst;
4693 rhssubtrahend += val * aggrconst;
4703 lhssubtrahend += val * aggrconst;
4705 rhssubtrahend += val * aggrconst;
4751 consdata->removedfixings =
TRUE;
4764 assert(consdata->removedfixings);
4768 for( v = 0; v < consdata->nvars; ++v )
4796 assert(scip != NULL);
4797 assert(cons != NULL);
4801 assert(consdata != NULL);
4803 vars = consdata->vars;
4804 vals = consdata->vals;
4805 nvars = consdata->nvars;
4807 assert(vars != NULL || nvars == 0);
4808 assert(vals != NULL || nvars == 0);
4810 assert(-1 <= inferpos && inferpos < nvars);
4811 assert((infervar == NULL) == (inferpos == -1));
4812 assert(inferpos == -1 || vars[inferpos] == infervar);
4834 if( infervar != NULL )
4836 assert(vals != NULL);
4839 &minisrelax, NULL, &isminsettoinfinity, NULL);
4842 NULL, &maxisrelax, NULL, &ismaxsettoinfinity);
4848 &minisrelax, NULL, &isminsettoinfinity, NULL);
4851 NULL, &maxisrelax, NULL, &ismaxsettoinfinity);
4855 if( (reasonisrhs && !isminsettoinfinity && !minisrelax) || (!reasonisrhs && !ismaxsettoinfinity && !maxisrelax) )
4860 resactisinf =
FALSE;
4865 if( infervar != NULL )
4867 assert(vals != NULL);
4877 rescap = consdata->rhs - minresactivity;
4887 rescap = consdata->lhs - maxresactivity;
4890 if( reasonisrhs == (vals[inferpos] > 0.0) )
4896 rescap = (reasonisrhs ? consdata->rhs - minresactivity : consdata->lhs - maxresactivity);
4901 for( i = 0; i < nvars; ++i )
4903 assert( vars != NULL && vals != NULL );
4906 if( vars[i] == infervar ||
SCIPisZero(scip, vals[i]) )
4915 if( reasonisrhs == (vals[i] > 0.0) )
4934 for( i = 0; i < nvars; ++i )
4936 assert(vars != NULL);
4937 assert(vals != NULL);
4940 if( vars[i] == infervar ||
SCIPisZero(scip, vals[i]) )
4943 if( reasonisrhs == (vals[i] > 0.0) )
4976 assert(scip != NULL);
4977 assert(cons != NULL);
4980 assert(consdata != NULL);
4981 vars = consdata->vars;
4982 nvars = consdata->nvars;
4983 assert(vars != NULL || nvars == 0);
4984 assert(-1 <= inferpos && inferpos < nvars);
4985 assert((infervar == NULL) == (inferpos == -1));
4986 assert(inferpos == -1 || vars != NULL);
4987 assert(inferpos == -1 || vars[inferpos] == infervar);
4990 for( v = nvars - 1; v >= 0; --v )
4992 assert(vars != NULL);
4995 if( vars[v] == infervar )
4997 assert(vars[v] != NULL);
5038 assert(scip != NULL);
5041 for( v = nvars - 1; v >= 0; --v )
5043 assert(vars != NULL);
5097 assert(scip != NULL);
5098 assert(cons != NULL);
5099 assert(result != NULL);
5102 assert(consdata != NULL);
5103 vars = consdata->vars;
5104 nvars = consdata->nvars;
5106 vals = consdata->vals;
5107 assert(vars != NULL);
5108 assert(vals != NULL);
5113 if( inferpos >= nvars || vars[inferpos] != infervar )
5117 for( inferpos = 0; inferpos < nvars && vars[inferpos] != infervar; ++inferpos )
5120 assert(inferpos < nvars);
5121 assert(vars[inferpos] == infervar);
5159 SCIPerrorMessage(
"invalid inference information %d in linear constraint <%s> at position %d for %s bound of variable <%s>\n",
5206 assert(consdata != NULL);
5208 infcountmin = consdata->minactivityneginf
5209 + consdata->minactivityposinf
5210 + consdata->minactivityneghuge
5211 + consdata->minactivityposhuge;
5212 infcountmax = consdata->maxactivityneginf
5213 + consdata->maxactivityposinf
5214 + consdata->maxactivityneghuge
5215 + consdata->maxactivityposhuge;
5217 if( infcountmin > 1 && infcountmax > 1 )
5243 assert(cons != NULL);
5247 assert(consdata != NULL);
5248 var = consdata->vars[pos];
5249 assert(var != NULL);
5258 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, activity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newub=%.15g\n",
5259 SCIPconsGetName(cons),
SCIPvarGetName(var), lb, oldub, consdata->vals[pos], consdata->minactivity, consdata->maxactivity, consdata->lhs, consdata->rhs, newub);
5268 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
5276 else if( tightened )
5279 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, new bds=[%.15g,%.15g]\n",
5286 consdata->upgradetried =
FALSE;
5312 assert(cons != NULL);
5316 assert(consdata != NULL);
5317 var = consdata->vars[pos];
5318 assert(var != NULL);
5327 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, activity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newlb=%.15g\n",
5328 SCIPconsGetName(cons),
SCIPvarGetName(var), oldlb, ub, consdata->vals[pos], consdata->minactivity, consdata->maxactivity, consdata->lhs, consdata->rhs, newlb);
5337 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
5345 else if( tightened )
5348 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, new bds=[%.15g,%.15g]\n",
5355 consdata->upgradetried =
FALSE;
5380 assert(scip != NULL);
5381 assert(cons != NULL);
5382 assert(cutoff != NULL);
5383 assert(nchgbds != NULL);
5390 assert(consdata != NULL);
5391 assert(0 <= pos && pos < consdata->nvars);
5395 var = consdata->vars[pos];
5396 assert(var != NULL);
5402 val = consdata->vals[pos];
5403 lhs = consdata->lhs;
5404 rhs = consdata->rhs;
5414 if( !consdata->validactivities )
5416 assert(consdata->validactivities);
5417 if( !consdata->validminact )
5419 assert(consdata->validminact);
5420 if( !consdata->validmaxact )
5422 assert(consdata->validmaxact);
5435 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, minactivity=%.15g > rhs=%.15g\n",
5442 slack = rhs - consdata->minactivity;
5450 alpha = val * (ub - lb);
5458 newub = lb + (slack / val);
5464 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
5484 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, maxactivity=%.15g < lhs=%.15g\n",
5491 slack = consdata->maxactivity - lhs;
5499 alpha = val * (ub - lb);
5507 newlb = ub - (slack / val);
5513 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
5532 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, minactivity=%.15g > rhs=%.15g\n",
5539 slack = rhs - consdata->minactivity;
5547 alpha = val * (lb - ub);
5555 newlb = ub + slack / val;
5561 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
5580 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, maxactivity=%.15g < lhs=%.15g\n",
5587 slack = consdata->maxactivity - lhs;
5595 alpha = val * (lb - ub);
5603 newub = lb - (slack / val);
5609 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
5635 assert(scip != NULL);
5636 assert(cons != NULL);
5639 assert(consdata != NULL);
5718 assert(scip != NULL);
5719 assert(cons != NULL);
5720 assert(cutoff != NULL);
5721 assert(nfixedvars != NULL);
5722 assert(nchgbds != NULL);
5723 assert(naddconss != NULL);
5730 assert(consdata != NULL);
5733 if( consdata->rangedrowpropagated == 2 )
5737 if( consdata->nvars < 3 )
5746 assert(conshdlr != NULL);
5748 assert(conshdlrdata != NULL);
5754 consdata->rangedrowpropagated = 2;
5761 if( consdata->rangedrowpropagated > 0 )
5764 consdata->rangedrowpropagated = 1;
5769 for( v = consdata->nvars - 1; v >= 0; --v )
5772 assert(!
SCIPisZero(scip, consdata->vals[v]));
5787 lhs = consdata->lhs - fixedact;
5788 rhs = consdata->rhs - fixedact;
5789 nunfixedvars = consdata->nvars - nfixedconsvars;
5834 absval =
REALABS(consdata->vals[v]);
5836 if( absminbincoef > absval )
5837 absminbincoef = absval;
5840 gcdisone = gcdisone &&
SCIPisEQ(scip,
REALABS(consdata->vals[v]), 1.0);
5841 possiblegcd =
FALSE;
5842 infcheckvars[ninfcheckvars] = consdata->vars[v];
5843 infcheckvals[ninfcheckvars] = consdata->vals[v];
5859 if( v == consdata->nvars )
5863 if( ncontvars + 2 > nunfixedvars )
5876 for( ; v < consdata->nvars; ++v )
5885 absval =
REALABS(consdata->vals[v]);
5887 if( absminbincoef > absval )
5888 absminbincoef = absval;
5897 gcdisone = gcdisone &&
SCIPisEQ(scip,
REALABS(consdata->vals[v]), 1.0);
5898 possiblegcd =
FALSE;
5899 infcheckvars[ninfcheckvars] = consdata->vars[v];
5900 infcheckvals[ninfcheckvars] = consdata->vals[v];
5909 assert(
REALABS(consdata->vals[v]) > 1.5);
5912 assert(gcdtmp >= 1);
5916 infcheckvars[ninfcheckvars] = consdata->vars[v];
5917 infcheckvals[ninfcheckvars] = consdata->vals[v];
5932 if( ninfcheckvars == 0 )
5937 minactinfvarsinvalid =
FALSE;
5938 maxactinfvarsinvalid =
FALSE;
5939 maxactinfvars = 0.0;
5940 minactinfvars = 0.0;
5943 for( v = ninfcheckvars - 1; v >= 0; --v )
5950 if( infcheckvals[v] < 0.0 )
5951 maxactinfvarsinvalid =
TRUE;
5953 minactinfvarsinvalid =
TRUE;
5957 if( infcheckvals[v] < 0.0 )
5958 maxactinfvars += infcheckvals[v] * lb;
5960 minactinfvars += infcheckvals[v] * lb;
5965 if( infcheckvals[v] > 0.0 )
5966 maxactinfvarsinvalid =
TRUE;
5968 minactinfvarsinvalid =
TRUE;
5972 if( infcheckvals[v] > 0.0 )
5973 maxactinfvars += infcheckvals[v] * ub;
5975 minactinfvars += infcheckvals[v] * ub;
5980 minactinfvarsinvalid =
TRUE;
5982 maxactinfvarsinvalid =
TRUE;
5984 if( minactinfvarsinvalid || maxactinfvarsinvalid )
5987 assert(!minactinfvarsinvalid && !maxactinfvarsinvalid);
5989 SCIPdebugMsg(scip,
"minactinfvarsinvalid = %u, minactinfvars = %g, maxactinfvarsinvalid = %u, maxactinfvars = %g, gcd = %lld, ninfcheckvars = %d, ncontvars = %d\n",
5990 minactinfvarsinvalid, minactinfvars, maxactinfvarsinvalid, maxactinfvars, gcd, ninfcheckvars, ncontvars);
6004 SCIPisGT(scip,
SCIPceil(scip, (lhs - maxactinfvars) / gcd) * gcd, rhs - minactinfvars) )
6015 else if( ncontvars == 0 )
6022 v = ninfcheckvars - 1;
6024 assert(gcdinfvars >= 2);
6026 for( ; v >= 0 && gcdinfvars >= 2; --v )
6034 SCIPdebugMsg(scip,
"gcdinfvars =%lld, possiblegcd = %u\n", gcdinfvars, possiblegcd);
6037 if( gcdinfvars >= 1 )
6048 while(
SCIPisLE(scip, value, maxactinfvars) )
6050 value2 = value + gcd * (
SCIPceil(scip, (lhs - value) / gcd));
6065 value += gcdinfvars;
6067 assert(nsols < 2 || minvalue <= maxvalue);
6078 while(
SCIPisGE(scip, value, minactinfvars) )
6080 value2 = value + gcd * (
SCIPfloor(scip, (rhs - value) / gcd));
6085 assert(maxvalue > minvalue);
6088 value -= gcdinfvars;
6090 assert(maxvalue > secondsolval);
6093 SCIPdebugMsg(scip,
"here nsols %s %d, minsolvalue = %g, maxsolvalue = %g, ninfcheckvars = %d, nunfixedvars = %d\n",
6094 nsols > 2 ?
">=" :
"=", nsols, minvalue, maxvalue, ninfcheckvars, nunfixedvars);
6099 SCIPdebugMsg(scip,
"gcdinfvars = %lld, gcd = %lld, correctedlhs = %g, correctedrhs = %g\n",
6100 gcdinfvars, gcd, lhs, rhs);
6111 else if( nsols == 1 )
6113 assert(minvalue == maxvalue);
6116 if( ninfcheckvars == 1 )
6122 SCIPdebugMsg(scip,
"fixing single variable <%s> with bounds [%.15g,%.15g] to %.15g\n",
6143 if( ninfcheckvars == nunfixedvars - 1 )
6150 assert(ninfcheckvars > 0);
6153 for( v = 0; v < consdata->nvars - 1; ++v )
6157 if( w >= ninfcheckvars || consdata->vars[v] != infcheckvars[w] )
6163 assert((nfixedconsvars == 0) ? (consdata->nvars - v - 1 == ninfcheckvars - w) :
TRUE);
6165 for( ; v2 < consdata->nvars && w2 < ninfcheckvars; ++v2 )
6170 assert(consdata->vars[v2] == infcheckvars[w2]);
6173 assert(w2 == ninfcheckvars);
6179 if( consdata->vals[v] < 0 )
6181 bound =
SCIPfloor(scip, (lhs - maxvalue) / consdata->vals[v]);
6185 bound =
SCIPceil(scip, (lhs - maxvalue) / consdata->vals[v]);
6188 SCIPdebugMsg(scip,
"fixing variable <%s> with bounds [%.15g,%.15g] to %.15g\n",
6201 consdata->vars[v], bound) );
6217 assert(v == consdata->nvars - 1);
6220 if( consdata->vals[v] < 0 )
6222 bound =
SCIPfloor(scip, (lhs - maxvalue) / consdata->vals[v]);
6226 bound =
SCIPceil(scip, (lhs - maxvalue) / consdata->vals[v]);
6229 SCIPdebugMsg(scip,
"fixing variable <%s> with bounds [%.15g,%.15g] to %.15g\n",
6242 consdata->vars[v], bound) );
6249 else if( addartconss && (
SCIPisGT(scip, minvalue, minactinfvars) ||
SCIPisLT(scip, maxvalue, maxactinfvars)) )
6257 ++conshdlrdata->naddconss;
6259 SCIPdebugMsg(scip,
"adding artificial constraint %s\n", name);
6262 maxvalue, maxvalue,
TRUE,
TRUE,
TRUE,
FALSE,
TRUE,
TRUE,
FALSE,
FALSE,
TRUE,
FALSE) );
6279 if( ninfcheckvars == 1 )
6287 if( infcheckvals[0] < 0 )
6289 newlb = maxvalue/infcheckvals[0];
6290 newub = minvalue/infcheckvals[0];
6294 newlb = minvalue/infcheckvals[0];
6295 newub = maxvalue/infcheckvals[0];
6297 assert(newlb < newub);
6302 SCIPdebugMsg(scip,
"tightening lower bound of variable <%s> from %g to %g\n",
6323 SCIPdebugMsg(scip,
"tightening upper bound of variable <%s> from %g to %g\n",
6342 else if( ninfcheckvars == nunfixedvars - 1 )
6350 assert(ninfcheckvars > 0);
6351 assert(minvalue < maxvalue);
6354 for( v = 0; v < consdata->nvars - 1; ++v )
6358 if( w >= ninfcheckvars || consdata->vars[v] != infcheckvars[w] )
6364 assert((nfixedconsvars == 0) ? (consdata->nvars - v - 1 == ninfcheckvars - w) :
TRUE);
6366 for( ; v2 < consdata->nvars && w2 < ninfcheckvars; ++v2 )
6371 assert(consdata->vars[v2] == infcheckvars[w2]);
6374 assert(w2 == ninfcheckvars);
6380 if( consdata->vals[v] < 0 )
6382 newlb =
SCIPfloor(scip, (rhs - minvalue) / consdata->vals[v]);
6383 newub =
SCIPfloor(scip, (lhs - maxvalue) / consdata->vals[v]);
6387 newlb =
SCIPceil(scip, (lhs - maxvalue) / consdata->vals[v]);
6388 newub =
SCIPceil(scip, (rhs - minvalue) / consdata->vals[v]);
6390 assert(
SCIPisLE(scip, newlb, newub));
6395 SCIPdebugMsg(scip,
"tightening lower bound of variable <%s> from %g to %g\n",
6407 consdata->vars[v], newlb) );
6417 SCIPdebugMsg(scip,
"tightening upper bound of variable <%s> from %g to %g\n",
6429 consdata->vars[v], newub) );
6446 assert(v == consdata->nvars - 1);
6449 if( consdata->vals[v] < 0 )
6451 newlb =
SCIPfloor(scip, (rhs - minvalue) / consdata->vals[v]);
6452 newub =
SCIPfloor(scip, (lhs - maxvalue) / consdata->vals[v]);
6456 newlb =
SCIPceil(scip, (lhs - maxvalue) / consdata->vals[v]);
6457 newub =
SCIPceil(scip, (rhs - minvalue) / consdata->vals[v]);
6459 assert(
SCIPisLE(scip, newlb, newub));
6464 SCIPdebugMsg(scip,
"tightening lower bound of variable <%s> from %g to %g\n",
6485 SCIPdebugMsg(scip,
"tightening upper bound of variable <%s> from %g to %g\n",
6507 else if( addartconss && (
SCIPisGT(scip, minvalue, minactinfvars) ||
SCIPisLT(scip, maxvalue, maxactinfvars)) )
6514 assert(maxvalue > minvalue);
6516 if(
SCIPisGT(scip, minvalue, minactinfvars) )
6521 if(
SCIPisLT(scip, maxvalue, maxactinfvars) )
6530 ++conshdlrdata->naddconss;
6532 SCIPdebugMsg(scip,
"adding artificial constraint %s\n", name);
6549 else if( addartconss && ncontvars < ninfcheckvars )
6556 for( v = 0; v < consdata->nvars; ++v )
6558 if( w < ninfcheckvars && consdata->vars[v] == infcheckvars[w] )
6568 if( consdata->vals[v] > 0.0 )
6569 maxact += consdata->vals[v];
6571 minact += consdata->vals[v];
6579 if( consdata->vals[v] > 0.0 )
6621 assert(maxact > minact);
6622 assert(w == ninfcheckvars);
6624 newlhs = lhs - maxact;
6625 newrhs = rhs - minact;
6626 assert(newlhs < newrhs);
6630 ++conshdlrdata->naddconss;
6632 SCIPdebugMsg(scip,
"adding artificial constraint %s\n", name);
6679 assert(scip != NULL);
6680 assert(cons != NULL);
6681 assert(cutoff != NULL);
6682 assert(nchgbds != NULL);
6689 assert(consdata != NULL);
6690 assert(0 <= pos && pos < consdata->nvars);
6694 var = consdata->vars[pos];
6700 val = consdata->vals[pos];
6701 lhs = consdata->lhs;
6702 rhs = consdata->rhs;
6704 &minisrelax, &maxisrelax, &isminsettoinfinity, &ismaxsettoinfinity);
6705 assert(var != NULL);
6717 if( !isminsettoinfinity && !
SCIPisInfinity(scip, rhs) && !minisrelax )
6721 newub = (rhs - minresactivity)/val;
6730 if( activityunreliable )
6733 newub = (rhs - minresactivity)/val;
6736 && (!force || !
SCIPisLT(scip, newub, ub)));
6739 if( !activityunreliable )
6742 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, resactivity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newub=%.15g\n",
6745 &infeasible, &tightened) );
6748 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
6763 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, new bds=[%.15g,%.15g]\n",
6770 if( !ismaxsettoinfinity && !
SCIPisInfinity(scip, -lhs) && !maxisrelax )
6774 newlb = (lhs - maxresactivity)/val;
6782 newlb = (lhs - maxresactivity)/val;
6786 && (!force || !
SCIPisGT(scip, newlb, lb))) )
6791 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, resactivity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newlb=%.15g\n",
6794 &infeasible, &tightened) );
6797 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
6811 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, new bds=[%.15g,%.15g]\n",
6820 if( !isminsettoinfinity && !
SCIPisInfinity(scip, rhs) && !minisrelax )
6824 newlb = (rhs - minresactivity)/val;
6831 if( activityunreliable )
6834 newlb = (rhs - minresactivity)/val;
6838 && (!force || !
SCIPisGT(scip, newlb, lb)));
6841 if( !activityunreliable )
6844 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, resactivity=[%.15g,%.15g], sides=[%.15g,%.15g] -> newlb=%.15g\n",
6847 &infeasible, &tightened) );
6850 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
6864 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, new bds=[%.15g,%.15g]\n",
6871 if( !ismaxsettoinfinity && !
SCIPisInfinity(scip, -lhs) && !maxisrelax )
6875 newub = (lhs - maxresactivity)/val;
6883 newub = (lhs - maxresactivity)/val;
6887 && (!force || !
SCIPisLT(scip, newub, ub))) )
6892 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, old bds=[%.15g,%.15g], val=%.15g, resactivity=[%.15g,%.15g], sides=[%.15g,%.15g], newub=%.15g\n",
6895 &infeasible, &tightened) );
6898 SCIPdebugMsg(scip,
"linear constraint <%s>: cutoff <%s>, new bds=[%.15g,%.15g]\n",
6912 SCIPdebugMsg(scip,
"linear constraint <%s>: tighten <%s>, new bds=[%.15g,%.15g]\n",
6922 #define MAXTIGHTENROUNDS 10 6936 unsigned int tightenmode;
6942 int oldnchgbdstotal;
6948 assert(scip != NULL);
6949 assert(cons != NULL);
6950 assert(nchgbds != NULL);
6951 assert(cutoff != NULL);
6972 assert(consdata != NULL);
6974 nvars = consdata->nvars;
6984 if( !force && (consdata->boundstightened >= tightenmode) )
6991 assert(consdata->binvarssorted);
7024 if(
SCIPisLE(scip, consdata->maxactdelta, MIN(slack, surplus)) )
7029 easycase =
SCIPisLT(scip, consdata->maxactdelta, maxeasyactivitydelta);
7036 oldnchgbdstotal = *nchgbds;
7039 for( nrounds = 0; (force || consdata->boundstightened < tightenmode) && nrounds <
MAXTIGHTENROUNDS; ++nrounds )
7042 consdata->boundstightened = (
unsigned int)tightenmode;
7048 while( v < nvars && v != lastchange && !(*cutoff) )
7050 oldnchgbds = *nchgbds;
7064 if( *nchgbds > oldnchgbds )
7069 else if( consdata->binvarssorted && v < consdata->nbinvars - 1
7071 v = consdata->nbinvars;
7078 *nchgbds - oldnchgbdstotal, nrounds);
7079 oldnchgbdstotal += oldnchgbds;
7084 if( force &&
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
7110 assert(scip != NULL);
7111 assert(cons != NULL);
7112 assert(violated != NULL);
7118 assert(consdata != NULL);
7122 if( consdata->row != NULL )
7134 SCIPdebugMsg(scip,
" consdata activity=%.15g (lhs=%.15g, rhs=%.15g, row=%p, checklprows=%u, rowinlp=%u, sol=%p, hascurrentnodelp=%u)\n",
7135 activity, consdata->lhs, consdata->rhs, (
void*)consdata->row, checklprows,
7136 consdata->row == NULL ? 0 :
SCIProwIsInLP(consdata->row), (
void*)sol,
7140 lhsviol = consdata->lhs - activity;
7141 rhsviol = activity - consdata->rhs;
7145 if( (lhsviol > 0) && (lhsviol > rhsviol) )
7150 else if( rhsviol > 0 )
7161 assert(sol == NULL);
7172 else if( !consdata->checkabsolute && (
SCIPisFeasLT(scip, activity, consdata->lhs) ||
SCIPisFeasGT(scip, activity, consdata->rhs)) )
7175 if( !checkrelmaxabs )
7199 for( v = 0; v < consdata->nvars; ++v )
7201 if( consdata->vals != NULL )
7203 coef = consdata->vals[v];
7209 absval =
REALABS( coef * solval );
7210 maxabs =
MAX( maxabs, absval );
7217 if( (consdata->lhs - activity) <= (1e-15 * maxabs) )
7219 SCIPdebugMsg(scip,
" lhs violated due to random noise: violation=%16.9g, maxabs=%16.9g\n",
7220 consdata->lhs - activity, maxabs);
7232 if( (consdata->lhs - activity) <= (
SCIPfeastol(scip) * maxabs) )
7234 SCIPdebugMsg(scip,
" lhs violated absolutely (violation=%16.9g), but feasible when using relative tolerance w.r.t. maximum absolute value (%16.9g)\n",
7235 consdata->lhs - activity, maxabs);
7271 if( (activity - consdata->rhs) <= (1e-15 * maxabs) )
7273 SCIPdebugMsg(scip,
" rhs violated due to random noise: violation=%16.9g, maxabs=%16.9g\n",
7274 activity - consdata->rhs, maxabs);
7286 if( (activity - consdata->rhs) <= (
SCIPfeastol(scip) * maxabs) )
7288 SCIPdebugMsg(scip,
" rhs violated absolutely (violation=%16.9g), but feasible when using relative tolerance w.r.t. maximum absolute value (%16.9g)\n",
7289 activity - consdata->rhs, maxabs);
7323 else if( consdata->checkabsolute &&
7360 assert(scip != NULL);
7361 assert(cons != NULL);
7364 assert(consdata != NULL);
7365 assert(consdata->row == NULL);
7385 assert(scip != NULL);
7386 assert(cons != NULL);
7389 assert(consdata != NULL);
7391 if( consdata->row == NULL )
7396 assert(consdata->row != NULL);
7398 if( consdata->nvars == 0 )
7420 assert( pr == 0 || cr == 0 );
7446 assert(scip != NULL);
7447 assert(conshdlrdata != NULL);
7448 assert(cons != NULL);
7449 assert(cutoff != NULL);
7452 assert(ncuts != NULL);
7453 assert(consdata != NULL);
7458 SCIP_CALL(
checkCons(scip, cons, sol, (sol != NULL), conshdlrdata->checkrelmaxabs, &violated) );
7469 if( !separateall && sol == NULL )
7482 consdata->vals, +1.0, consdata->rhs, sol, cutoff, ncuts) );
7490 consdata->vals, -1.0, -consdata->lhs, sol, cutoff, ncuts) );
7500 consdata->vals, +1.0, consdata->rhs, sol, cutoff, ncuts) );
7505 consdata->vals, -1.0, -consdata->lhs, sol, cutoff, ncuts) );
7510 if( *ncuts > oldncuts )
7537 assert(scip != NULL);
7538 assert(cons != NULL);
7539 assert(cutoff != NULL);
7540 assert(nchgbds != NULL);
7545 assert(consdata != NULL);
7547 if( consdata->eventdata == NULL )
7553 assert(conshdlr != NULL);
7556 assert(conshdlrdata != NULL);
7560 assert(consdata->eventdata != NULL);
7579 oldnchgbds = *nchgbds;
7583 if( *nchgbds > oldnchgbds )
7590 if( rangedrowpropagation && tightenbounds && !(*cutoff) )
7609 SCIPdebugMsg(scip,
"linear constraint <%s> found %d bound changes and %d fixings\n",
SCIPconsGetName(cons), *nchgbds - oldnchgbds, nfixedvars);
7612 if( nfixedvars > 0 )
7613 *nchgbds += 2*nfixedvars;
7623 SCIPdebugMsg(scip,
"linear constraint <%s> is infeasible (rhs): activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
7624 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
7632 else if(
SCIPisFeasLT(scip, maxactivity, consdata->lhs) )
7634 SCIPdebugMsg(scip,
"linear constraint <%s> is infeasible (lhs): activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
7635 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
7643 else if(
SCIPisGE(scip, minactivity, consdata->lhs) &&
SCIPisLE(scip, maxactivity, consdata->rhs) )
7645 SCIPdebugMsg(scip,
"linear constraint <%s> is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
7646 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
7649 if( consdata->nvars > 0 )
7683 assert(scip != NULL);
7684 assert(cons != NULL);
7685 assert(cutoff != NULL);
7686 assert(nfixedvars != NULL);
7689 assert(consdata != NULL);
7691 for( v = 0; v < consdata->nvars; ++v )
7693 assert(consdata->vars != NULL);
7694 var = consdata->vars[v];
7706 SCIPdebugMsg(scip,
"converting variable <%s> with fixed bounds [%.15g,%.15g] into fixed variable fixed at %.15g\n",
7730 assert(consdata->removedfixings);
7735 #define MAX_CLIQUE_NONZEROS_PER_CONS 1000000 7827 int cliquenonzerosadded;
7834 assert(scip != NULL);
7835 assert(cons != NULL);
7836 assert(nfixedvars != NULL);
7837 assert(nchgbds != NULL);
7838 assert(cutoff != NULL);
7842 assert(consdata != NULL);
7844 if( consdata->nvars < 2 )
7853 if( !consdata->implsadded )
7865 nvars = consdata->nvars;
7866 vars = consdata->vars;
7867 vals = consdata->vals;
7870 if( !consdata->validactivities )
7872 assert(consdata->validactivities);
7876 finitenegminact = (consdata->glbminactivityneginf == 0 && consdata->glbminactivityneghuge == 0);
7877 finitenegmaxact = (consdata->glbmaxactivityneginf == 0 && consdata->maxactivityneghuge == 0);
7878 finiteposminact = (consdata->glbminactivityposinf == 0 && consdata->glbminactivityposhuge == 0);
7879 finiteposmaxact = (consdata->glbmaxactivityposinf == 0 && consdata->glbmaxactivityposhuge == 0);
7880 finiteminact = (finitenegminact && finiteposminact);
7881 finitemaxact = (finitenegmaxact && finiteposmaxact);
7883 if( (finiterhs || finitelhs) && (finitenegminact || finiteposminact || finitenegmaxact || finiteposmaxact) )
7888 int oldnchgbds = *nchgbds;
7894 if( (finitenegminact || finiteposminact) && !consdata->validglbminact )
7897 assert(consdata->validglbminact);
7900 if( (finitenegmaxact || finiteposmaxact) && !consdata->validglbmaxact )
7903 assert(consdata->validglbmaxact);
7905 assert(consdata->validglbminact || consdata->validglbmaxact);
7910 for( v = nvars - 1; v >= 0; --v )
7918 if( value > maxabscontrib )
7920 maxabscontrib = value;
7931 if( value > maxabscontrib )
7933 maxabscontrib = value;
7942 assert(0 <= position && position < nvars);
7944 if( !
SCIPisEQ(scip, maxabscontrib, 1.0) && !allbinary )
7950 if( finiterhs && finiteminact &&
SCIPisEQ(scip, consdata->glbminactivity, consdata->rhs - maxabscontrib) )
7952 for( v = nvars - 1; v >= 0; --v )
7964 *nchgbds += nbdchgs;
7971 *nchgbds += nbdchgs;
7991 if( finitelhs && finitemaxact &&
SCIPisEQ(scip, consdata->glbmaxactivity, consdata->lhs - maxabscontrib) )
7993 for( v = nvars - 1; v >= 0; --v )
8005 *nchgbds += nbdchgs;
8012 *nchgbds += nbdchgs;
8031 SCIPdebugMsg(scip,
"extracted %d implications from constraint %s which led to %d bound changes, %scutoff detetcted\n", nimpls,
SCIPconsGetName(cons), *nchgbds - oldnchgbds, *cutoff ?
"" :
"no ");
8037 if( *nchgbds - oldnchgbds > 0 )
8058 consdata->implsadded =
TRUE;
8062 if( consdata->cliquesadded )
8065 consdata->cliquesadded =
TRUE;
8066 cliquenonzerosadded = 0;
8072 nvars = consdata->nvars;
8073 vars = consdata->vars;
8074 vals = consdata->vals;
8079 if( !consdata->validactivities )
8081 assert(consdata->validactivities);
8085 finitenegminact = (consdata->glbminactivityneginf == 0 && consdata->glbminactivityneghuge == 0);
8086 finitenegmaxact = (consdata->glbmaxactivityneginf == 0 && consdata->maxactivityneghuge == 0);
8087 finiteposminact = (consdata->glbminactivityposinf == 0 && consdata->glbminactivityposhuge == 0);
8088 finiteposmaxact = (consdata->glbmaxactivityposinf == 0 && consdata->glbmaxactivityposhuge == 0);
8089 finiteminact = (finitenegminact && finiteposminact);
8090 finitemaxact = (finitenegmaxact && finiteposmaxact);
8095 if( (finiterhs || finitelhs) && (finitenegminact || finiteposminact || finitenegmaxact || finiteposmaxact) )
8099 int nposbinvars = 0;
8100 int nnegbinvars = 0;
8101 int allonebinary = 0;
8107 for( i = 0; i < nvars; ++i )
8116 binvars[nposbinvars + nnegbinvars] = vars[i];
8117 binvarvals[nposbinvars + nnegbinvars] = vals[i];
8124 assert(nposbinvars + nnegbinvars <= nvars);
8130 assert(nposbinvars + nnegbinvars <= nvars);
8135 if( allonebinary < nvars && (nposbinvars >= 2 || nnegbinvars >= 2) )
8138 int oldnchgbds = *nchgbds;
8144 if( (finitenegminact || finiteposminact) && !consdata->validglbminact )
8147 assert(consdata->validglbminact);
8150 if( (finitenegmaxact || finiteposmaxact) && !consdata->validglbmaxact )
8153 assert(consdata->validglbmaxact);
8155 assert(consdata->validglbminact || consdata->validglbmaxact);
8161 if( finiterhs && finitenegminact && nposbinvars >= 2 )
8164 threshold = consdata->rhs - consdata->glbminactivity;
8173 if(
SCIPisFeasGT(scip, binvarvals[i] + binvarvals[j], threshold) )
8177 while( j < nposbinvars )
8179 if( !
SCIPisFeasGT(scip, binvarvals[j-1] + binvarvals[j], threshold) )
8191 *nchgbds += nbdchgs;
8193 cliquenonzerosadded += j;
8198 if( !stopped && !(*cutoff) && j < nposbinvars )
8201 int lastfit = j - 2;
8202 assert(lastfit >= i);
8208 while( lastfit >= i && j < nposbinvars )
8211 if(
SCIPisFeasGT(scip, binvarvals[lastfit] + binvarvals[j], threshold) )
8213 clqvars[lastfit + 1] = binvars[j];
8224 *nchgbds += nbdchgs;
8226 cliquenonzerosadded += (lastfit - i + 2);
8245 if( !stopped && !*cutoff && *nchgbds - oldnchgbds > 0 )
8266 if( !consdata->validactivities )
8268 assert(consdata->validactivities);
8270 nvars = consdata->nvars;
8271 vars = consdata->vars;
8272 vals = consdata->vals;
8278 for( i = 0; i < nvars; ++i )
8287 binvars[nposbinvars + nnegbinvars] = vars[i];
8288 binvarvals[nposbinvars + nnegbinvars] = vals[i];
8295 assert(nposbinvars + nnegbinvars <= nvars);
8301 assert(nposbinvars + nnegbinvars <= nvars);
8306 oldnchgbds = *nchgbds;
8310 if( !stopped && !(*cutoff) && finitelhs && finiteposmaxact && nnegbinvars >= 2 )
8313 threshold = consdata->lhs - consdata->glbmaxactivity;
8315 i = nposbinvars + nnegbinvars - 1;
8322 if(
SCIPisFeasLT(scip, binvarvals[i] + binvarvals[j], threshold) )
8326 while( j >= nposbinvars )
8328 if( !
SCIPisFeasLT(scip, binvarvals[j+1] + binvarvals[j], threshold) )
8341 *nchgbds += nbdchgs;
8343 cliquenonzerosadded += (i - j);
8348 if( !stopped && !(*cutoff) && jstart >= nposbinvars )
8351 int lastfit = jstart + 1;
8352 assert(lastfit < i);
8359 while( lastfit <= i && j >= nposbinvars )
8362 if(
SCIPisFeasLT(scip, binvarvals[lastfit] + binvarvals[j], threshold) )
8364 assert(lastfit - jstart - 2 >= 0 && lastfit - jstart - 2 < i);
8365 clqvars[lastfit - jstart - 2] = binvars[j];
8367 assert(i - lastfit + 2 >= 2);
8377 *nchgbds += nbdchgs;
8379 cliquenonzerosadded += (i - lastfit + 2);
8398 if( !stopped && !*cutoff && *nchgbds - oldnchgbds > 0 )
8419 if( !consdata->validactivities )
8421 assert(consdata->validactivities);
8423 nvars = consdata->nvars;
8424 vars = consdata->vars;
8425 vals = consdata->vals;
8431 for( i = 0; i < nvars; ++i )
8440 binvars[nposbinvars + nnegbinvars] = vars[i];
8441 binvarvals[nposbinvars + nnegbinvars] = vals[i];
8448 assert(nposbinvars + nnegbinvars <= nvars);
8454 assert(nposbinvars + nnegbinvars <= nvars);
8459 oldnchgbds = *nchgbds;
8463 if( !(*cutoff) && finiterhs && finiteminact && nnegbinvars >= 2 )
8472 threshold = consdata->rhs - consdata->glbminactivity;
8474 i = nposbinvars + nnegbinvars - 1;
8482 if(
SCIPisFeasGT(scip, -binvarvals[i] - binvarvals[j], threshold) )
8486 while( j >= nposbinvars )
8488 if( !
SCIPisFeasGT(scip, -binvarvals[j+1] - binvarvals[j], threshold) )
8501 *nchgbds += nbdchgs;
8503 cliquenonzerosadded += (i - j);
8508 if( !stopped && !(*cutoff) && jstart >= nposbinvars )
8511 int lastfit = j + 1;
8512 assert(lastfit < i);
8519 while( lastfit <= i && j >= nposbinvars )
8522 if(
SCIPisFeasGT(scip, -binvarvals[lastfit] - binvarvals[j], threshold) )
8524 assert(lastfit - jstart - 2 >= 0 && lastfit - jstart - 2 < i);
8525 clqvars[lastfit - jstart - 2] = binvars[j];
8527 assert(i - lastfit + 2 >= 2);
8537 *nchgbds += nbdchgs;
8539 cliquenonzerosadded += (i - lastfit + 2);
8560 if( !stopped && !*cutoff && *nchgbds - oldnchgbds > 0 )
8581 if( !consdata->validactivities )
8583 assert(consdata->validactivities);
8585 nvars = consdata->nvars;
8586 vars = consdata->vars;
8587 vals = consdata->vals;
8593 for( i = 0; i < nvars; ++i )
8602 binvars[nposbinvars + nnegbinvars] = vars[i];
8603 binvarvals[nposbinvars + nnegbinvars] = vals[i];
8610 assert(nposbinvars + nnegbinvars <= nvars);
8616 assert(nposbinvars + nnegbinvars <= nvars);
8623 if( !stopped && !(*cutoff) && finitelhs && finitemaxact && nposbinvars >= 2 )
8632 threshold = consdata->lhs - consdata->glbmaxactivity;
8639 assert(!
SCIPisFeasLT(scip, -binvarvals[i], threshold));
8642 if(
SCIPisFeasLT(scip, -binvarvals[i] - binvarvals[j], threshold) )
8646 while( j < nposbinvars )
8648 if( !
SCIPisFeasLT(scip, -binvarvals[j-1] - binvarvals[j], threshold) )
8660 *nchgbds += nbdchgs;
8662 cliquenonzerosadded += j;
8667 if( !stopped && !(*cutoff) && j < nposbinvars )
8670 int lastfit = j - 2;
8671 assert(lastfit >= i);
8677 while( lastfit >= i && j < nposbinvars )
8680 if(
SCIPisFeasLT(scip, -binvarvals[lastfit] - binvarvals[j], threshold) )
8682 clqvars[lastfit + 1] = binvars[j];
8693 *nchgbds += nbdchgs;
8695 cliquenonzerosadded += (lastfit - i + 2);
8727 for( i = 0; i < nvars; ++i )
8731 else if(
SCIPisEQ(scip, vals[i], +1.0) )
8733 else if(
SCIPisEQ(scip, vals[i], -1.0) )
8742 if( lhsclique || rhsclique )
8747 SCIPdebugMsg(scip,
"linear constraint <%s>: adding clique with %d vars (%d pos, %d neg)\n",
8751 for( i = 0; i < nvars; ++i )
8752 values[i] = (rhsclique == (vals[i] > 0.0));
8759 *nchgbds += nbdchgs;
8778 assert(scip != NULL);
8779 assert(cons != NULL);
8780 assert(nchgsides != NULL);
8783 assert(consdata != NULL);
8788 for( i = 0; i < consdata->nvars && integral; ++i )
8795 SCIPdebugMsg(scip,
"linear constraint <%s>: make sides integral: sides=[%.15g,%.15g]\n",
8800 if( !consdata->upgraded )
8806 if( !consdata->upgraded )
8809 SCIPdebugMsg(scip,
"linear constraint <%s>: new integral sides: sides=[%.15g,%.15g]\n",
8880 assert(scip != NULL);
8881 assert(cons != NULL);
8882 assert(nchgcoefs != NULL);
8883 assert(nchgsides != NULL);
8886 assert(consdata != NULL);
8890 if( (consdata->validmaxabsval && consdata->maxabsval >
MAXVALRECOMP)
8891 || (consdata->validminabsval && consdata->minabsval <
MINVALRECOMP) )
8900 minleftactivity = 0.0;
8901 maxleftactivity = 0.0;
8905 while( i < consdata->nvars )
8907 var = consdata->vars[i];
8912 val = consdata->vals[i];
8920 SCIPisGE(scip, minactivity + val, consdata->lhs) &&
SCIPisLE(scip, maxactivity - val, consdata->rhs) )
8928 lval = consdata->lhs - minactivity;
8929 rval = maxactivity - consdata->rhs;
8932 if( consdata->nvars == 2 )
8935 otherval = consdata->vals[1-i];
8937 if( !
SCIPisInfinity(scip, -consdata->lhs) && consdata->minactivityneginf + consdata->minactivityneginf == 0 )
8939 lval = consdata->lhs - val*lb;
8943 if( !
SCIPisInfinity(scip,consdata->rhs) && consdata->maxactivityneginf + consdata->maxactivityneginf == 0 )
8945 rval = val*ub - consdata->rhs;
8950 newval =
MAX(lval, rval);
8954 newlhs = consdata->lhs - val * lb;
8955 newlhs += newval * lb;
8956 newrhs = consdata->rhs - val * ub;
8957 newrhs += newval * ub;
8961 SCIPdebugMsg(scip,
"linear constraint <%s>: change coefficient %+.15g<%s> to %+.15g<%s>, act=[%.15g,%.15g], side=[%.15g,%.15g]\n",
8963 minactivity, maxactivity, consdata->lhs, consdata->rhs);
8986 assert(
SCIPisEQ(scip, consdata->lhs, newlhs));
8995 assert(
SCIPisEQ(scip, consdata->rhs, newrhs));
9008 minleftactivity += val * lb;
9018 maxleftactivity += val * ub;
9026 SCIPisGE(scip, minactivity - val, consdata->lhs) &&
SCIPisLE(scip, maxactivity + val, consdata->rhs) )
9034 lval = minactivity - consdata->lhs;
9035 rval = consdata->rhs - maxactivity;
9038 if( consdata->nvars == 2 )
9041 otherval = consdata->vals[1-i];
9043 if( !
SCIPisInfinity(scip,-consdata->lhs) && consdata->minactivityneginf + consdata->minactivityneginf == 0 )
9045 lval = val*ub - consdata->lhs;
9049 if( !
SCIPisInfinity(scip,consdata->rhs) && consdata->maxactivityneginf + consdata->maxactivityneginf == 0 )
9051 rval = consdata->rhs - val*lb;
9056 newval = MIN(lval, rval);
9060 newlhs = consdata->lhs - val * ub;
9061 newlhs += newval * ub;
9062 newrhs = consdata->rhs - val * lb;
9063 newrhs += newval * lb;
9067 SCIPdebugMsg(scip,
"linear constraint <%s>: change coefficient %+.15g<%s> to %+.15g<%s>, act=[%.15g,%.15g], side=[%.15g,%.15g]\n",
9069 minactivity, maxactivity, consdata->lhs, consdata->rhs);
9092 assert(
SCIPisEQ(scip, consdata->lhs, newlhs));
9101 assert(
SCIPisEQ(scip, consdata->rhs, newrhs));
9114 minleftactivity += val * ub;
9124 maxleftactivity += val * lb;
9131 SCIPdebugMsg(scip,
"minleftactivity = %.15g, rhs = %.15g\n",
9132 minleftactivity, consdata->rhs);
9133 SCIPdebugMsg(scip,
"maxleftactivity = %.15g, lhs = %.15g\n",
9134 maxleftactivity, consdata->lhs);
9161 aggrlhs = consdata->lhs - minactivity + minleftactivity;
9162 aggrrhs = consdata->rhs - maxactivity + maxleftactivity;
9180 while( i < consdata->nvars )
9182 var = consdata->vars[i];
9183 minleftactivitypart = 0.0;
9184 maxleftactivitypart = 0.0;
9189 val = consdata->vals[i];
9197 SCIPisLT(scip, minactivity + val, consdata->lhs) ||
SCIPisGT(scip, maxactivity - val, consdata->rhs) )
9199 SCIPdebugMsg(scip,
"minactivity = %g\tval = %g\tlhs = %g\n", minactivity, val, consdata->lhs);
9200 SCIPdebugMsg(scip,
"maxactivity = %g\tval = %g\trhs = %g\n", maxactivity, val, consdata->rhs);
9201 SCIPdebugMsg(scip,
"linear constraint <%s>: remove variable <%s> with coefficient <%g> from constraint since it is redundant\n",
9204 minleftactivitypart = val * lb;
9205 maxleftactivitypart = val * ub;
9224 SCIPisLT(scip, minactivity - val, consdata->lhs) ||
SCIPisGT(scip, maxactivity + val, consdata->rhs) )
9226 SCIPdebugMsg(scip,
"linear constraint <%s>: remove variable <%s> with coefficient <%g> from constraint since it is redundant\n",
9229 minleftactivitypart = val * ub;
9230 maxleftactivitypart = val * lb;
9252 newlhs = consdata->lhs - minleftactivitypart;
9253 newrhs = consdata->rhs - maxleftactivitypart;
9260 assert(
SCIPisEQ(scip, consdata->lhs, newlhs));
9267 assert(
SCIPisEQ(scip, consdata->rhs, newrhs));
9293 assert(scip != NULL);
9294 assert(cons != NULL);
9295 assert(cutoff != NULL);
9296 assert(nfixedvars != NULL);
9297 assert(ndelconss != NULL);
9300 assert(consdata != NULL);
9301 assert(consdata->nvars == 1);
9302 assert(
SCIPisEQ(scip, consdata->lhs, consdata->rhs));
9305 var = consdata->vars[0];
9306 val = consdata->vals[0];
9310 SCIPdebugMsg(scip,
"linear equality <%s>: fix <%s> == %.15g\n",
9326 if( !consdata->upgraded )
9347 assert(scip != NULL);
9348 assert(cons != NULL);
9349 assert(cutoff != NULL);
9350 assert(naggrvars != NULL);
9351 assert(ndelconss != NULL);
9354 assert(consdata != NULL);
9355 assert(consdata->nvars == 2);
9356 assert(
SCIPisEQ(scip, consdata->lhs, consdata->rhs));
9358 SCIPdebugMsg(scip,
"linear constraint <%s>: aggregate %.15g<%s> + %.15g<%s> == %.15g\n",
9360 consdata->vals[1],
SCIPvarGetName(consdata->vars[1]), consdata->rhs);
9364 consdata->rhs, &infeasible, &redundant, &aggregated) );
9383 if( !consdata->upgraded )
9404 assert(scip != NULL);
9405 assert(consdata != NULL);
9406 assert(newlhs != NULL);
9407 assert(newrhs != NULL);
9413 if( slackcoef > 0.0 )
9418 *newrhs = consdata->rhs - slackcoef * slackvarlb;
9422 *newlhs = consdata->lhs - slackcoef * slackvarub;
9429 *newlhs = consdata->rhs - slackcoef * slackvarlb;
9433 *newrhs = consdata->lhs - slackcoef * slackvarub;
9435 assert(
SCIPisLE(scip, *newlhs, *newrhs));
9438 #define MAXMULTIAGGRQUOTIENT 1e+03 9480 int maxnlocksremove;
9490 assert(scip != NULL);
9491 assert(cons != NULL);
9492 assert(cutoff != NULL);
9493 assert(naggrvars != NULL);
9496 assert(consdata != NULL);
9497 assert(consdata->nvars > 2);
9498 assert(
SCIPisEQ(scip, consdata->lhs, consdata->rhs));
9507 lhs = consdata->lhs;
9508 rhs = consdata->rhs;
9510 if( consdata->nvars == 3 )
9515 maxnlocksremove = 3;
9517 else if( consdata->nvars == 4 )
9522 maxnlocksremove = 2;
9527 maxnlocksremove = 1;
9546 vars = consdata->vars;
9547 vals = consdata->vals;
9550 bestnlocks = INT_MAX;
9551 bestremovescons =
FALSE;
9552 bestslackdomrng = 0.0;
9553 coefszeroone =
TRUE;
9554 coefsintegral =
TRUE;
9555 varsintegral =
TRUE;
9563 for( v = 0; v < consdata->nvars; ++v )
9573 assert(vars != NULL);
9574 assert(vals != NULL);
9587 if( absval < minabsval )
9589 if( absval > maxabsval )
9597 coefszeroone = coefszeroone &&
SCIPisEQ(scip, absval, 1.0);
9625 if( nlocks > maxnlocksremove )
9629 if( (iscont || (coefsintegral && varsintegral &&
SCIPisEQ(scip, absval, 1.0))) &&
9643 slackdomrng = (varub - varlb)*absval;
9647 better = (slacktype > bestslacktype) || (bestslackpos == -1);
9648 if( !better && slacktype == bestslacktype )
9650 better = (nlocks < bestnlocks);
9651 if( nlocks == bestnlocks && !bestremovescons )
9653 better =
SCIPisGT(scip, slackdomrng, bestslackdomrng);
9654 equal = !better &&
SCIPisGE(scip, slackdomrng, bestslackdomrng);
9658 if( better || equal )
9672 &minisrelax, &maxisrelax, &isminsettoinfinity, &ismaxsettoinfinity);
9677 if( minisrelax || maxisrelax )
9697 if( conshdlrdata->multaggrremove && !removescons )
9701 if( bestremovescons && !removescons )
9707 if( !removescons && nlocks > maxnlocksstay )
9710 better = better || (!bestremovescons && removescons);
9714 bestslacktype = slacktype;
9715 bestnlocks = nlocks;
9716 bestslackdomrng = slackdomrng;
9717 bestremovescons = removescons;
9737 for( v = 0; v < consdata->nvars; ++v )
9739 if( v != bestslackpos )
9772 assert(!samevar || (supinf > 0 && infinf > 0));
9776 if( (samevar && (supinf > 1 || infinf > 1)) || (!samevar && supinf > 0 && infinf > 0) )
9778 SCIPdebugMsg(scip,
"do not perform multi-aggregation: infimum and supremum are both infinite\n");
9787 if( bestslackpos >= 0
9789 || (coefsintegral && varsintegral && nimplvars == 0)) )
9802 assert(bestslackpos < consdata->nvars);
9811 slackvar = vars[bestslackpos];
9812 slackcoef = vals[bestslackpos];
9814 aggrconst = consdata->rhs/slackcoef;
9817 assert(
SCIPisLE(scip, newlhs, newrhs));
9827 for( v = 0; v < consdata->nvars; ++v )
9829 scalars[v] = -consdata->vals[v]/slackcoef;
9832 SCIPdebugMsgPrint(scip,
" %+.15g, bounds of <%s>: [%.15g,%.15g], nlocks=%d, maxnlocks=%d, removescons=%u\n",
9834 bestnlocks, bestremovescons ? maxnlocksremove : maxnlocksstay, bestremovescons);
9838 &infeasible, &aggregated) );
9855 if( bestremovescons )
9860 if( !consdata->upgraded )
9864 else if( ncontvars == 1 )
9868 assert(0 <= contvarpos && contvarpos < consdata->nvars);
9869 var = vars[contvarpos];
9878 SCIPdebugMsg(scip,
"linear constraint <%s>: converting continuous variable <%s> to implicit integer variable\n",
9899 absval =
REALABS(vals[contvarpos]);
9910 #ifdef WITH_DEBUG_SOLUTION 9911 if( SCIPdebugIsMainscip(scip) )
9920 SCIPdebugMsg(scip,
"linear constraint <%s>: aggregating continuous variable <%s> to newly created implicit integer variable <%s>, aggregation factor = %g\n",
9928 SCIPdebugMsg(scip,
"infeasible aggregation of variable <%s> to implicit variable <%s>, domain is empty\n",
9950 consdata->boundstightened = 0;
9951 consdata->rangedrowpropagated = 0;
9952 consdata->presolved =
FALSE;
9955 else if( ncontvars == 0 && nimplvars == 0 && nintvars == 1 && !coefszeroone )
9962 assert(varsintegral);
9963 assert(0 <= intvarpos && intvarpos < consdata->nvars);
9964 var = vars[intvarpos];
9972 SCIPdebugMsg(scip,
"linear constraint <%s>: converting integer variable <%s> to implicit integer variable\n",
10006 vars = consdata->vars;
10007 nvars = consdata->nvars;
10009 assert(vars != NULL);
10011 for( v = 0; v < nvars; ++v )
10015 assert(var != NULL);
10021 assert(var != NULL);
10035 val = consdata->vals[v];
10042 (*scale) = val / -objval;
10046 else if(
SCIPisEQ(scip, -objval * (*scale), val) )
10054 (*scale) = val / objval;
10056 else if( !
SCIPisEQ(scip, objval * (*scale), val) )
10082 assert(scip != NULL);
10083 assert(cons != NULL);
10084 assert(conshdlrdata != NULL);
10087 assert(consdata != NULL);
10088 assert(
SCIPisEQ(scip, consdata->lhs, consdata->rhs));
10090 nvars = consdata->nvars;
10094 if( nvars > nobjvars || nvars == 0 )
10098 if( (nvars < nobjvars && !conshdlrdata->detectpartialobjective) ||
10099 (nvars == nobjvars && (!conshdlrdata->detectcutoffbound || !conshdlrdata->detectlowerbound)) )
10102 offset = consdata->rhs;
10112 vars = consdata->vars;
10113 assert(vars != NULL);
10117 SCIPdebugMsg(scip,
"linear equality constraint <%s> == %g (offset %g) is a subset of the objective function\n",
10121 for( v = 0; v < nvars; ++v )
10150 SCIPdebugMsg(scip,
"update cutoff bound <%g>\n", cutoffbound);
10159 assert(consdata != NULL);
10194 assert(scip != NULL);
10195 assert(cons != NULL);
10196 assert(conshdlrdata != NULL);
10199 assert(consdata != NULL);
10202 if(
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
10205 nvars = consdata->nvars;
10220 if( nobjvars == 0 )
10233 if( conshdlrdata->detectcutoffbound && rhsfinite )
10237 primalbound = (consdata->rhs - offset) / scale;
10239 SCIPdebugMsg(scip,
"constraint <%s> is parallel to objective function and provides a cutoff bound <%g>\n",
10245 if( conshdlrdata->detectlowerbound && lhsfinite )
10249 lowerbound = (consdata->lhs - offset) / scale;
10251 SCIPdebugMsg(scip,
"constraint <%s> is parallel to objective function and provides a lower bound <%g>\n",
10257 if( (conshdlrdata->detectcutoffbound && (conshdlrdata->detectlowerbound || !lhsfinite)) ||
10258 (conshdlrdata->detectlowerbound && !rhsfinite) )
10267 if( conshdlrdata->detectlowerbound && rhsfinite )
10271 lowerbound = (consdata->rhs - offset) / scale;
10273 SCIPdebugMsg(scip,
"constraint <%s> is parallel to objective function and provides a lower bound <%g>\n",
10279 if( conshdlrdata->detectcutoffbound && lhsfinite )
10283 primalbound = (consdata->lhs - offset) / scale;
10285 SCIPdebugMsg(scip,
"constraint <%s> is parallel to objective function and provides a cutoff bound <%g>\n",
10291 if( (conshdlrdata->detectcutoffbound && (conshdlrdata->detectlowerbound || !rhsfinite)) ||
10292 (conshdlrdata->detectlowerbound && !lhsfinite) )
10318 assert(scip != NULL);
10319 assert(cons != NULL);
10320 assert(conshdlrdata != NULL);
10321 assert(cutoff != NULL);
10322 assert(nfixedvars != NULL);
10323 assert(naggrvars != NULL);
10324 assert(ndelconss != NULL);
10327 assert(consdata != NULL);
10328 assert(consdata->removedfixings);
10331 if( !
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
10335 if( consdata->nvars == 1 )
10340 else if( consdata->nvars == 2 )
10370 assert(scip != NULL);
10371 assert(consdata != NULL);
10372 assert(0 <= pos && pos < consdata->nvars);
10374 for( v = 0; v < consdata->nvars; ++v )
10397 assert(scip != NULL);
10398 assert(minval != NULL);
10399 assert(maxval != NULL);
10404 *minval = -maxresactivity;
10406 *minval = (side - maxresactivity)/val;
10409 *maxval = -minresactivity;
10411 *maxval = (side - minresactivity)/val;
10416 *minval = minresactivity;
10418 *minval = (side - minresactivity)/val;
10421 *maxval = maxresactivity;
10423 *maxval = (side - maxresactivity)/val;
10450 assert(scip != NULL);
10451 assert(cons != NULL);
10452 assert(cutoff != NULL);
10453 assert(nfixedvars != NULL);
10454 assert(naggrvars != NULL);
10455 assert(ndelconss != NULL);
10465 assert(consdata != NULL);
10488 if( consdata->nvars <= 2 )
10489 maxotherlocks = INT_MAX;
10490 else if( consdata->nvars == 3 )
10492 else if( consdata->nvars == 4 )
10498 if( lhsexists && rhsexists && maxotherlocks < INT_MAX )
10501 for( i = 0; i < consdata->nvars && bestisint; ++i )
10512 var = consdata->vars[i];
10516 if( bestpos >= 0 && isint )
10528 val = consdata->vals[i];
10565 if( agglhs || aggrhs )
10578 &minisrelax, &maxisrelax, &isminsettoinfinity, &ismaxsettoinfinity);
10579 assert(
SCIPisLE(scip, minresactivity, maxresactivity));
10585 assert((!minisrelax || isminsettoinfinity) && (!maxisrelax || ismaxsettoinfinity));
10592 assert(
SCIPisLE(scip, minval, maxval));
10600 recalculated =
FALSE;
10601 oldmaxresactivity = maxresactivity;
10602 oldminresactivity = minresactivity;
10608 recalculated = !
SCIPisEQ(scip, oldminresactivity, minresactivity);
10609 isminsettoinfinity =
TRUE;
10616 recalculated = recalculated || !
SCIPisEQ(scip, oldmaxresactivity, maxresactivity);
10617 ismaxsettoinfinity =
TRUE;
10623 assert(
SCIPisLE(scip, minresactivity, maxresactivity));
10628 assert(
SCIPisLE(scip, minval, maxval));
10652 assert(
SCIPisLE(scip,minval,maxval));
10660 recalculated =
FALSE;
10661 oldmaxresactivity = maxresactivity;
10662 oldminresactivity = minresactivity;
10668 recalculated = !
SCIPisEQ(scip, oldminresactivity, minresactivity);
10675 recalculated = recalculated || !
SCIPisEQ(scip, oldmaxresactivity, maxresactivity);
10683 assert(
SCIPisLE(scip,minval,maxval));
10723 assert(!bestislhs || lhsexists);
10724 assert(bestislhs || rhsexists);
10726 bestvar = consdata->vars[bestpos];
10727 bestval = consdata->vals[bestpos];
10728 assert(bestisint ==
10744 for( j = 0; j < consdata->nvars; ++j )
10750 aggrvars[naggrs] = consdata->vars[j];
10751 aggrcoefs[naggrs] = -consdata->vals[j]/consdata->vals[bestpos];
10754 absaggrcoef =
REALABS(aggrcoefs[naggrs]);
10757 if( absaggrcoef < epsilon )
10759 SCIPdebugMsg(scip,
"do not perform multi-aggregation: too large aggregation coefficients\n");
10772 aggrcoefs[naggrs] =
SCIPfloor(scip, aggrcoefs[naggrs]+0.5);
10807 assert(!samevar || (supinf > 0 && infinf > 0));
10809 aggrconst = (bestislhs ? consdata->lhs/bestval : consdata->rhs/bestval);
10812 assert(naggrs == consdata->nvars-1);
10818 aggrconst =
SCIPfloor(scip, aggrconst+0.5);
10821 aggregated =
FALSE;
10822 infeasible =
FALSE;
10825 if( (samevar && supinf == 1 && infinf == 1) || (!samevar && (supinf == 0 || infinf == 0)) )
10836 SCIPdebugMsg(scip,
"do not perform multi-aggregation: infimum and supremum are both infinite\n");
10855 if( !consdata->upgraded )
10868 #define BINWEIGHT 1 10869 #define INTWEIGHT 4 10870 #define CONTWEIGHT 8 10919 assert( scip != NULL );
10920 assert( cons != NULL );
10923 assert( consdata != NULL );
10950 lhs = consdata->lhs;
10951 vars = consdata->vars;
10952 vals = consdata->vals;
10953 nvars = consdata->nvars;
10962 for( v = 0; v < nvars && noddvars < 3; ++v )
10977 if( noddvars == 0 )
10989 if( noddvars == 1 )
10991 assert( var1 != NULL );
10993 SCIPdebugMsg(scip,
"linear constraint <%s>: try fixing variable <%s> to <%g>\n",
11013 else if( noddvars == 2 )
11015 assert( var1 != NULL );
11016 assert( var2 != NULL );
11022 SCIPdebugMsg(scip,
"linear constraint <%s>: try aggregation of variables <%s> and <%s>\n",
11026 lhsodd ? 1.0 : 0.0, &infeasible, &redundant, &aggregated) );
11080 assert(consdata != NULL);
11081 assert(0 <= ind1 && ind1 < consdata->nvars);
11082 assert(0 <= ind2 && ind2 < consdata->nvars);
11090 if( vartype2 != vartype1 )
11100 value =
REALABS(consdata->vals[ind2]) -
REALABS(consdata->vals[ind1]);
11103 return (value > 0 ? +1 : (value < 0 ? -1 : 0));
11139 assert(consdata != NULL);
11141 nvars = consdata->nvars;
11147 vals = consdata->vals;
11148 vars = consdata->vars;
11149 assert(vars != NULL);
11150 assert(vals != NULL);
11152 lhs = consdata->lhs;
11153 rhs = consdata->rhs;
11161 for( v = nvars - 1; v >= 0; --v )
11167 secondminval = minval;
11170 else if( secondminval > vals[v] || secondminval ==
SCIP_INVALID )
11171 secondminval = vals[v];
11190 for( v = nvars - 1; v >= 0; --v )
11194 (*nchgcoefs) += nvars;
11269 assert(scip != NULL);
11270 assert(cons != NULL);
11271 assert(nchgcoefs != NULL);
11272 assert(nchgsides != NULL);
11282 assert(consdata != NULL);
11284 nvars = consdata->nvars;
11308 consdata->normalized =
FALSE;
11312 assert(nvars == consdata->nvars);
11314 if( !consdata->normalized )
11317 lhs = consdata->lhs;
11318 rhs = consdata->rhs;
11332 SCIPdebug( oldnchgcoefs = *nchgcoefs; )
11333 SCIPdebug( oldnchgsides = *nchgsides; )
11336 if( haslhs && hasrhs )
11342 assert(haslhs != hasrhs);
11354 SCIPsort(perm, consdataCompSim, (
void*)consdata, nvars);
11358 consdata->sorted =
FALSE;
11359 consdata->binvarssorted =
FALSE;
11361 vars = consdata->vars;
11362 vals = consdata->vals;
11363 assert(vars != NULL);
11364 assert(vals != NULL);
11380 SCIPdebugMsg(scip,
"starting simplification of coefficients\n");
11385 &isminrelax, &ismaxrelax, &isminsettoinfinity, &ismaxsettoinfinity);
11388 if( isminsettoinfinity || ismaxsettoinfinity )
11391 assert(!isminrelax);
11392 assert(!ismaxrelax);
11393 assert(maxactsub > minactsub);
11399 side = haslhs ? lhs : rhs;
11429 while( v < nvars &&
SCIPisEQ(scip, side, vals[v]) )
11453 if(
SCIPisEQ(scip, side, -vals[v]) )
11468 for( w = 0; w < v; ++w )
11473 assert(vals[w] > 0);
11476 maxactsub -= ub * vals[w];
11477 minactsub -= lb * vals[w];
11478 assert(maxactsub > minactsub);
11506 maxactsub -= ub * vals[0];
11507 minactsub -= lb * vals[0];
11511 maxactsub -= lb * vals[0];
11512 minactsub -= ub * vals[0];
11514 assert(maxactsub > minactsub);
11519 allcoefintegral =
TRUE;
11522 for( ; v < nvars - 1; ++v )
11529 allcoefintegral =
FALSE;
11548 maxactsub -= ub * vals[v];
11549 minactsub -= lb * vals[v];
11553 maxactsub -= lb * vals[v];
11554 minactsub -= ub * vals[v];
11556 assert(
SCIPisGE(scip, maxactsub, minactsub));
11572 if( (offsetv == -1 && hasrhs && maxactsub <= siderest &&
SCIPisFeasGT(scip, minactsub, siderest - gcd)) || (haslhs &&
SCIPisFeasLT(scip, maxactsub, siderest) && minactsub >= siderest - gcd) )
11578 assert(v < nvars || (offsetv >= 0 && gcd > 1));
11598 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",
11599 v, nvars, minactsub, maxactsub, redundant, hasrhs, siderest, gcd, offsetv);
11602 if( v < nvars && (redundant ||
11603 (offsetv == -1 && hasrhs && maxactsub <= siderest &&
SCIPisFeasGT(scip, minactsub, siderest - gcd)) ||
11604 (haslhs &&
SCIPisFeasLT(scip, maxactsub, siderest) && minactsub >= siderest - gcd)) )
11614 for( w = v; w < nvars; ++w )
11625 tmpmaxactsub += ub * vals[w];
11626 tmpminactsub += lb * vals[w];
11630 tmpmaxactsub += lb * vals[w];
11631 tmpminactsub += ub * vals[w];
11633 assert(tmpmaxactsub >= tmpminactsub);
11638 assert(offsetv == -1);
11652 assert((hasrhs &&
SCIPisLE(scip, tmpmaxactsub, siderest) && tmpminactsub > siderest - gcd) || (haslhs && tmpmaxactsub < siderest &&
SCIPisGE(scip, tmpminactsub, siderest - gcd)));
11655 SCIPdebugMsg(scip,
"removing %d last variables from constraint <%s>, because they never change anything on the feasibility of this constraint\n",
11659 for( w = nvars - 1; w >= v; --w )
11663 (*nchgcoefs) += (nvars - v);
11671 assert(vars == consdata->vars);
11672 assert(vals == consdata->vals);
11673 assert(w < consdata->nvars);
11676 gcd = (
SCIP_Longint)(gcd / (oldcoef/vals[w]) + feastol);
11684 rhs = consdata->rhs;
11691 lhs = consdata->lhs;
11694 assert(offsetv == -1 ||
SCIPisEQ(scip, vals[offsetv], consdata->lhs));
11702 nvars = consdata->nvars;
11703 assert(nvars >= 2);
11705 allcoefintegral =
TRUE;
11709 for( w = offsetv + 1; w < nvars; ++w )
11718 if( offsetv >= 0 && gcd == 1 )
11728 for( v = nvars - 1; v > offsetv; --v )
11736 allcoefintegral =
FALSE;
11762 if( candpos == -1 )
11772 assert(v > offsetv || candpos > offsetv);
11778 candpos = nvars - 1;
11781 if( gcd > 1 && allcoefintegral && !redundant )
11784 allcoefintegral =
FALSE;
11788 if( offsetv >= 0 && gcd > 1 && allcoefintegral )
11790 assert(offsetv + 1 < nvars);
11791 assert(0 <= candpos && candpos < nvars);
11799 for( w = offsetv + 1; w < nvars; ++w )
11814 assert(rest < gcd);
11817 restcoef = ((
SCIP_Longint)(vals[candpos] + feastol)) % gcd;
11818 assert(restcoef >= 1);
11819 assert(restcoef < gcd);
11824 if( restcoef > rest )
11825 newcoef = vals[candpos] - restcoef + gcd;
11827 newcoef = vals[candpos] - restcoef;
11832 if( rest == 0 || restcoef < rest )
11833 newcoef = vals[candpos] - restcoef;
11835 newcoef = vals[candpos] - restcoef + gcd;
11846 notchangable =
TRUE;
11887 for( w = offsetv; w >= 0; --w )
11889 assert(vals[w] > 0);
11893 (*nchgcoefs) += (offsetv + 1);
11896 if( !notchangable )
11900 assert(vars == consdata->vars);
11901 assert(vals == consdata->vals);
11904 nvars = consdata->nvars;
11905 assert(nvars >= 2);
11909 lhs = consdata->lhs;
11910 rhs = consdata->rhs;
11924 allcoefintegral =
TRUE;
11926 for( v = nvars - 1; v >= 0; --v )
11931 allcoefintegral =
FALSE;
11948 if( allcoefintegral )
11959 for( v = nvars - 1; v >= 0; --v )
11982 frac += (val -
SCIPfloor(scip, val)) * ub;
11989 if(
SCIPisGT(scip, frac, siderest) )
11995 SCIPdebugMsg(scip,
"rounding all non-integral coefficients and the right hand side down\n");
12000 for( v = nvars - 1; v >= 0; --v )
12037 if( allcoefintegral )
12052 for( v = nvars - 1; v >= 0; --v )
12083 frac += (val -
SCIPfloor(scip, val)) * ub;
12091 if(
SCIPisGE(scip, frac, 1 + siderest) )
12100 SCIPdebugMsg(scip,
"rounding all non-integral coefficients and the left hand side down\n");
12105 for( v = nvars - 1; v >= 0; --v )
12143 assert(vars == consdata->vars);
12144 assert(vals == consdata->vals);
12146 rhs = consdata->rhs;
12147 lhs = consdata->lhs;
12154 nvars = consdata->nvars;
12158 allcoefintegral =
TRUE;
12161 for( v = nvars - 1; v >= 0; --v )
12168 if( !allcoefintegral )
12183 assert(nvars >= 2);
12188 SCIPdebug( oldnchgcoefs = *nchgcoefs; )
12189 SCIPdebug( oldnchgsides = *nchgsides; )
12202 for( v = nvars - 1; v >= 0; --v )
12209 if( foundbin == -1 )
12235 foundbin = nvars - 1;
12238 if( gcd == 1 || foundbin == -1)
12241 assert((onlybin && gcd == -1) || (!onlybin && gcd > 1));
12249 for( v = foundbin; v >= 0; --v )
12278 if( candpos == -1 )
12286 if( onlybin && v == foundbin - 1 )
12287 candpos2 = foundbin;
12292 if( onlybin && candpos == v + 1 && candpos2 == v + 2 )
12294 assert(candpos2 == nvars - 1);
12297 candpos = candpos2;
12320 assert(candpos >= 0 && candpos < nvars);
12337 assert(rest < gcd);
12340 if( vals[candpos] < 0 )
12342 restcoef = ((
SCIP_Longint)(vals[candpos] - feastol)) % gcd;
12343 assert(restcoef <= -1);
12347 restcoef = ((
SCIP_Longint)(vals[candpos] + feastol)) % gcd;
12348 assert(restcoef >= 1);
12349 assert(restcoef < gcd);
12361 if( restcoef > rest )
12362 newcoef = vals[candpos] - restcoef + gcd;
12364 newcoef = vals[candpos] - restcoef;
12376 if( rest == 0 || restcoef < rest )
12377 newcoef = vals[candpos] - restcoef;
12379 newcoef = vals[candpos] - restcoef + gcd;
12383 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));
12399 assert(vars == consdata->vars);
12400 assert(vals == consdata->vals);
12404 rhs = consdata->rhs;
12405 lhs = consdata->lhs;
12409 nvars = consdata->nvars;
12411 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));
12413 while( nvars >= 2 );
12433 int* diffidx0minus1,
12434 int* diffidx1minus0,
12436 int commonidxweight,
12437 int diffidx0minus1weight,
12438 int diffidx1minus0weight,
12461 assert(scip != NULL);
12462 assert(cons0 != NULL);
12463 assert(cons1 != NULL);
12464 assert(commonidx0 != NULL);
12465 assert(commonidx1 != NULL);
12466 assert(diffidx0minus1 != NULL);
12467 assert(diffidx1minus0 != NULL);
12468 assert(nvarscommon >= 1);
12469 assert(commonidxweight >= nvarscommon);
12470 assert(nchgcoefs != NULL);
12471 assert(aggregated != NULL);
12480 assert(consdata0 != NULL);
12481 assert(consdata0->nvars >= 1);
12482 assert(
SCIPisLE(scip, consdata0->lhs, consdata0->rhs));
12483 assert(diffidx0minus1weight >= consdata0->nvars - nvarscommon);
12487 assert(consdata1 != NULL);
12488 assert(consdata1->nvars >= 1);
12489 assert(
SCIPisEQ(scip, consdata1->lhs, consdata1->rhs));
12490 assert(diffidx1minus0weight >= consdata1->nvars - nvarscommon);
12492 *aggregated =
FALSE;
12498 bestvarweight = commonidxweight + diffidx0minus1weight;
12499 bestnvars = consdata0->nvars;
12501 bestscalarsum = 0.0;
12502 commonvarlindependent =
TRUE;
12503 for( v = 0; v < nvarscommon; ++v )
12505 assert(consdata0->vars[commonidx0[v]] == consdata1->vars[commonidx1[v]]);
12506 a = consdata1->vals[commonidx1[v]];
12507 b = -consdata0->vals[commonidx0[v]];
12513 varweight = diffidx0minus1weight + diffidx1minus0weight;
12514 nvars = consdata0->nvars + consdata1->nvars - 2*nvarscommon;
12516 betterscalarsum = (scalarsum < bestscalarsum);
12517 for( i = 0; i < nvarscommon
12518 && (varweight < bestvarweight || (varweight == bestvarweight && betterscalarsum)); ++i )
12520 aggrcoef = a * consdata0->vals[commonidx0[i]] + b * consdata1->vals[commonidx1[i]];
12523 varweight +=
getVarWeight(consdata0->vars[commonidx0[i]]);
12527 if( varweight < bestvarweight || (varweight == bestvarweight && betterscalarsum) )
12530 bestvarweight = varweight;
12532 bestscalarsum = scalarsum;
12539 if( commonvarlindependent && v > 0 )
12540 commonvarlindependent =
SCIPisEQ(scip,
12541 consdata1->vals[commonidx1[v]] * consdata0->vals[commonidx0[0]],
12542 consdata1->vals[commonidx1[0]] * consdata0->vals[commonidx0[v]]);
12559 if( consdata1->vals[commonidx1[bestv]] > 0.0 )
12561 a = consdata1->vals[commonidx1[bestv]];
12562 b = -consdata0->vals[commonidx0[bestv]];
12566 a = -consdata1->vals[commonidx1[bestv]];
12567 b = consdata0->vals[commonidx0[bestv]];
12576 assert(commonvarlindependent);
12577 if( consdata1->vals[commonidx1[0]] > 0.0 )
12579 a = consdata1->vals[commonidx1[0]];
12580 b = -consdata0->vals[commonidx0[0]];
12584 a = -consdata1->vals[commonidx1[0]];
12585 b = consdata0->vals[commonidx0[0]];
12606 SCIPdebug( bestvarweight = diffidx0minus1weight + diffidx1minus0weight; )
12607 bestnvars = consdata0->nvars + consdata1->nvars - 2*nvarscommon;
12610 SCIPdebugMsg(scip,
"aggregate linear constraints <%s> := %.15g*<%s> + %.15g*<%s> -> nvars: %d -> %d, weight: %d -> %d\n",
12612 consdata0->nvars, bestnvars, commonidxweight + diffidx0minus1weight, bestvarweight);
12622 if( !commonvarlindependent )
12624 for( i = 0; i < nvarscommon; ++i )
12626 assert(0 <= commonidx0[i] && commonidx0[i] < consdata0->nvars);
12627 assert(0 <= commonidx1[i] && commonidx1[i] < consdata1->nvars);
12629 aggrcoef = a * consdata0->vals[commonidx0[i]] + b * consdata1->vals[commonidx1[i]];
12632 assert(newnvars < bestnvars);
12633 newvars[newnvars] = consdata0->vars[commonidx0[i]];
12634 newvals[newnvars] = aggrcoef;
12643 for( i = 0; i < nvarscommon; ++i )
12645 assert(0 <= commonidx0[i] && commonidx0[i] < consdata0->nvars);
12646 assert(0 <= commonidx1[i] && commonidx1[i] < consdata1->nvars);
12648 aggrcoef = a * consdata0->vals[commonidx0[i]] + b * consdata1->vals[commonidx1[i]];
12655 for( i = 0; i < consdata0->nvars - nvarscommon; ++i )
12657 assert(0 <= diffidx0minus1[i] && diffidx0minus1[i] < consdata0->nvars);
12659 aggrcoef = a * consdata0->vals[diffidx0minus1[i]];
12661 assert(newnvars < bestnvars);
12662 newvars[newnvars] = consdata0->vars[diffidx0minus1[i]];
12663 newvals[newnvars] = aggrcoef;
12668 for( i = 0; i < consdata1->nvars - nvarscommon; ++i )
12670 assert(0 <= diffidx1minus0[i] && diffidx1minus0[i] < consdata1->nvars);
12672 aggrcoef = b * consdata1->vals[diffidx1minus0[i]];
12674 assert(newnvars < bestnvars);
12675 newvars[newnvars] = consdata1->vars[diffidx1minus0[i]];
12676 newvals[newnvars] = aggrcoef;
12679 assert(newnvars == bestnvars);
12687 newlhs = a * consdata0->lhs + b * consdata1->lhs;
12691 newrhs = a * consdata0->rhs + b * consdata1->rhs;
12701 assert(newconsdata != NULL);
12704 newconsdata->upgraded = consdata0->upgraded;
12718 if( !consdata0->upgraded )
12719 (*nchgcoefs) += consdata0->nvars + consdata1->nvars - nvarscommon;
12720 *aggregated =
TRUE;
12759 assert(key1 != NULL);
12760 assert(key2 != NULL);
12763 assert(consdata1->sorted);
12764 assert(consdata2->sorted);
12766 scip = (
SCIP*)userptr;
12767 assert(scip != NULL);
12774 if( consdata1->nvars != consdata2->nvars )
12778 for( i = 0; i < consdata1->nvars; ++i )
12780 if( consdata1->vars[i] != consdata2->vars[i] )
12782 assert(
SCIPvarCompare(consdata1->vars[i], consdata2->vars[i]) == 1 ||
12786 assert(
SCIPvarCompare(consdata1->vars[i], consdata2->vars[i]) == 0);
12790 cons1scale = COPYSIGN(1.0/consdata1->maxabsval, consdata1->vals[0]);
12791 cons2scale = COPYSIGN(1.0/consdata2->maxabsval, consdata2->vals[0]);
12794 for( i = 0; i < consdata1->nvars; ++i )
12799 val1 = consdata1->vals[i] * cons1scale;
12800 val2 = consdata2->vals[i] * cons2scale;
12821 scip = (
SCIP*)userptr;
12822 assert(scip != NULL);
12825 assert(key != NULL);
12827 assert(consdata != NULL);
12828 assert(consdata->nvars > 0);
12830 assert(consdata->sorted);
12835 assert(minidx >= 0 && minidx <= maxidx);
12836 scale = COPYSIGN(1.0/consdata->maxabsval, consdata->vals[0]);
12855 assert(cons != NULL);
12858 assert(consdata != NULL);
12860 return (((
unsigned int)consdata->upgraded)<<31) + (
unsigned int)
SCIPconsGetPos(cons);
12874 int* nparallelconss
12878 unsigned int querykey;
12880 *nparallelconss = 0;
12887 if( conskey < querykey )
12889 parallelconss[(*nparallelconss)++] = *querycons;
12890 *querycons = parallelcons;
12891 querykey = conskey;
12895 parallelconss[(*nparallelconss)++] = parallelcons;
12906 if( *querycons == parallelcons )
12942 int nparallelconss;
12946 assert(scip != NULL);
12947 assert(blkmem != NULL);
12948 assert(conss != NULL);
12949 assert(firstchange != NULL);
12950 assert(cutoff != NULL);
12951 assert(ndelconss != NULL);
12952 assert(nchgsides != NULL);
12955 hashtablesize = nconss;
12957 hashGetKeyLinearcons, hashKeyEqLinearcons, hashKeyValLinearcons, (
void*) scip) );
12962 for( c = 0; c < nconss; ++c )
12978 assert(consdata0 != NULL);
12980 assert(consdata0->sorted);
12989 if( nparallelconss != 0 )
12999 lhs = consdata0->lhs;
13000 rhs = consdata0->rhs;
13002 for( i = 0; i < nparallelconss; ++i )
13008 consdel = parallelconss[i];
13017 assert(consdatadel != NULL);
13018 assert(consdata0->nvars >= 1 && consdata0->nvars == consdatadel->nvars);
13020 assert(consdatadel->sorted);
13021 assert(consdata0->vars[0] == consdatadel->vars[0]);
13023 scale = consdata0->vals[0] / consdatadel->vals[0];
13024 assert(scale != 0.0);
13032 SCIP_Real scale0 = 1.0 / consdata0->maxabsval;
13033 SCIP_Real scaledel = COPYSIGN(1.0 / consdatadel->maxabsval, scale);
13035 for( k = 0; k < consdata0->nvars; ++k )
13037 assert(
SCIPisEQ(scip, scale0 * consdata0->vals[k], scaledel * consdatadel->vals[k]));
13045 SCIPdebugMsg(scip,
"aggregate linear constraints <%s> and <%s> with equal coefficients into single ranged row\n",
13051 lhs =
MAX(scale * consdatadel->lhs, lhs);
13054 rhs = MIN(scale * consdatadel->rhs, rhs);
13059 SCIPdebugMsg(scip,
"aggregate linear constraints <%s> and <%s> with negated coefficients into single ranged row\n",
13065 lhs =
MAX(scale * consdatadel->rhs, lhs);
13068 rhs = MIN(scale * consdatadel->lhs, rhs);
13075 assert( ! consdata0->upgraded || consdatadel->upgraded );
13077 if( !consdatadel->upgraded )
13091 rhs = (lhs + rhs)/2;
13100 if( consdata0->changed &&
SCIPconsGetPos(cons0) < *firstchange )
13106 #ifdef SCIP_MORE_DEBUG 13107 SCIPinfoMessage(scip, NULL,
"linear pairwise comparison hashtable statistics:\n");
13139 int* diffidx0minus1;
13140 int* diffidx1minus0;
13141 uint64_t possignature0;
13142 uint64_t negsignature0;
13145 int diffidx1minus0size;
13151 assert(scip != NULL);
13152 assert(conss != NULL);
13153 assert(firstchange <= chkind);
13154 assert(cutoff != NULL);
13155 assert(ndelconss != NULL);
13156 assert(nchgsides != NULL);
13157 assert(nchgcoefs != NULL);
13160 cons0 = conss[chkind];
13161 assert(cons0 != NULL);
13166 assert(consdata0 != NULL);
13167 assert(consdata0->nvars >= 1);
13168 cons0isequality =
SCIPisEQ(scip, consdata0->lhs, consdata0->rhs);
13175 possignature0 = consdata0->possignature;
13176 negsignature0 = consdata0->negsignature;
13183 diffidx1minus0size = consdata0->nvars;
13185 cons0lhs = consdata0->lhs;
13186 cons0rhs = consdata0->rhs;
13187 cons0upgraded = consdata0->upgraded;
13190 cons0changed = consdata0->changed;
13191 consdata0->changed =
FALSE;
13192 for( c = (cons0changed ? 0 : firstchange); c < chkind && !(*cutoff) && conss[chkind] != NULL; ++c )
13196 uint64_t possignature1;
13197 uint64_t negsignature1;
13209 int commonidxweight;
13210 int diffidx0minus1weight;
13211 int diffidx1minus0weight;
13215 assert(cons0lhs == consdata0->lhs);
13216 assert(cons0rhs == consdata0->rhs);
13217 assert(cons0upgraded == consdata0->upgraded);
13222 if( cons1 == NULL )
13229 assert(consdata1 != NULL);
13236 if( !cons0changed && !consdata1->changed )
13241 if( cons0upgraded && consdata1->upgraded )
13244 assert(consdata1->nvars >= 1);
13251 possignature1 = consdata1->possignature;
13252 negsignature1 = consdata1->negsignature;
13255 coefsequal = (possignature0 == possignature1) && (negsignature0 == negsignature1);
13256 coefsnegated = (possignature0 == negsignature1) && (negsignature0 == possignature1);
13257 cons0dominateslhs =
SCIPisGE(scip, cons0lhs, consdata1->lhs)
13258 && ((possignature0 | possignature1) == possignature1)
13259 && ((negsignature0 | negsignature1) == negsignature0);
13260 cons1dominateslhs =
SCIPisGE(scip, consdata1->lhs, cons0lhs)
13261 && ((possignature0 | possignature1) == possignature0)
13262 && ((negsignature0 | negsignature1) == negsignature1);
13263 cons0dominatesrhs =
SCIPisLE(scip, cons0rhs, consdata1->rhs)
13264 && ((possignature0 | possignature1) == possignature0)
13265 && ((negsignature0 | negsignature1) == negsignature1);
13266 cons1dominatesrhs =
SCIPisLE(scip, consdata1->rhs, cons0rhs)
13267 && ((possignature0 | possignature1) == possignature1)
13268 && ((negsignature0 | negsignature1) == negsignature0);
13269 cons1isequality =
SCIPisEQ(scip, consdata1->lhs, consdata1->rhs);
13270 tryaggregation = (cons0isequality || cons1isequality) && (maxaggrnormscale > 0.0);
13271 if( !cons0dominateslhs && !cons1dominateslhs && !cons0dominatesrhs && !cons1dominatesrhs
13272 && !coefsequal && !coefsnegated && !tryaggregation )
13276 if( tryaggregation && consdata1->nvars > diffidx1minus0size )
13279 diffidx1minus0size = consdata1->nvars;
13305 commonidxweight = 0;
13307 diffidx0minus1weight = 0;
13309 diffidx1minus0weight = 0;
13312 while( (v0 < consdata0->nvars || v1 < consdata1->nvars)
13313 && (cons0dominateslhs || cons1dominateslhs || cons0dominatesrhs || cons1dominatesrhs
13314 || coefsequal || coefsnegated || tryaggregation) )
13322 if( v0 < consdata0->nvars && v1 < consdata1->nvars )
13323 varcmp =
SCIPvarCompare(consdata0->vars[v0], consdata1->vars[v1]);
13324 else if( v0 < consdata0->nvars )
13333 var = consdata0->vars[v0];
13334 val0 = consdata0->vals[v0];
13336 if( tryaggregation )
13338 diffidx0minus1[nvars0minus1] = v0;
13343 coefsequal =
FALSE;
13344 coefsnegated =
FALSE;
13349 var = consdata1->vars[v1];
13351 val1 = consdata1->vals[v1];
13352 if( tryaggregation )
13354 diffidx1minus0[nvars1minus0] = v1;
13359 coefsequal =
FALSE;
13360 coefsnegated =
FALSE;
13365 assert(consdata0->vars[v0] == consdata1->vars[v1]);
13366 var = consdata0->vars[v0];
13367 val0 = consdata0->vals[v0];
13368 val1 = consdata1->vals[v1];
13369 if( tryaggregation )
13371 commonidx0[nvarscommon] = v0;
13372 commonidx1[nvarscommon] = v1;
13378 coefsequal = coefsequal && (
SCIPisEQ(scip, val0, val1));
13379 coefsnegated = coefsnegated && (
SCIPisEQ(scip, val0, -val1));
13389 assert(var != NULL);
13396 cons0dominatesrhs =
FALSE;
13397 cons1dominateslhs =
FALSE;
13401 cons0dominateslhs =
FALSE;
13402 cons1dominatesrhs =
FALSE;
13405 else if(
SCIPisLT(scip, val0, val1) )
13409 cons0dominateslhs =
FALSE;
13410 cons1dominatesrhs =
FALSE;
13414 cons0dominatesrhs =
FALSE;
13415 cons1dominateslhs =
FALSE;
13421 if( coefsequal || coefsnegated )
13436 SCIPdebugMsg(scip,
"aggregate linear constraints <%s> and <%s> with %s coefficients into single ranged row\n",
13444 lhs =
MAX(consdata0->lhs, consdata1->lhs);
13445 rhs = MIN(consdata0->rhs, consdata1->rhs);
13450 lhs =
MAX(consdata0->lhs, -consdata1->rhs);
13451 rhs = MIN(consdata0->rhs, -consdata1->lhs);
13462 if( consdata0->upgraded )
13464 assert(!consdata1->upgraded);
13467 consdatastay = consdata1;
13471 consdatadel = consdata0;
13472 consinddel = chkind;
13478 consdatastay = consdata0;
13482 consdatadel = consdata1;
13489 if( !consdata0->upgraded )
13491 assert(consstay == cons0);
13492 cons0lhs = consdata0->lhs;
13493 cons0rhs = consdata0->rhs;
13499 assert( !consdatastay->upgraded );
13502 conss[consinddel] = NULL;
13503 if( !consdatadel->upgraded )
13511 if( cons1dominateslhs && (!cons0isequality || cons1dominatesrhs ||
SCIPisInfinity(scip, consdata0->rhs) ) )
13514 SCIPdebugMsg(scip,
"left hand side of linear constraint <%s> is dominated by <%s>:\n",
13520 if(
SCIPisFeasGT(scip, consdata1->lhs, consdata0->rhs) )
13531 cons0lhs = consdata0->lhs;
13532 cons0isequality =
FALSE;
13533 if( !consdata0->upgraded )
13542 else if( cons0dominateslhs && (!cons1isequality || cons0dominatesrhs ||
SCIPisInfinity(scip, consdata1->rhs)) )
13545 SCIPdebugMsg(scip,
"left hand side of linear constraint <%s> is dominated by <%s>:\n",
13551 if(
SCIPisFeasGT(scip, consdata0->lhs, consdata1->rhs) )
13562 cons1isequality =
FALSE;
13563 if( !consdata1->upgraded )
13572 if( cons1dominatesrhs && (!cons0isequality || cons1dominateslhs ||
SCIPisInfinity(scip, -consdata0->lhs)) )
13575 SCIPdebugMsg(scip,
"right hand side of linear constraint <%s> is dominated by <%s>:\n",
13581 if(
SCIPisFeasLT(scip, consdata1->rhs, consdata0->lhs) )
13592 cons0rhs = consdata0->rhs;
13593 cons0isequality =
FALSE;
13594 if( !consdata0->upgraded )
13603 else if( cons0dominatesrhs && (!cons1isequality || cons0dominateslhs ||
SCIPisInfinity(scip, -consdata1->lhs)) )
13606 SCIPdebugMsg(scip,
"right hand side of linear constraint <%s> is dominated by <%s>:\n",
13612 if(
SCIPisFeasLT(scip, consdata0->rhs, consdata1->lhs) )
13623 cons1isequality =
FALSE;
13624 if( !consdata1->upgraded )
13640 conss[chkind] = NULL;
13641 if( !consdata0->upgraded )
13656 if( !consdata1->upgraded )
13669 if( tryaggregation )
13673 assert(consdata0->nvars == nvarscommon + nvars0minus1);
13674 assert(consdata1->nvars == nvarscommon + nvars1minus0);
13676 aggregated =
FALSE;
13677 if( cons1isequality && !consdata0->upgraded && commonidxweight > diffidx1minus0weight )
13681 nvarscommon, commonidxweight, diffidx0minus1weight, diffidx1minus0weight, maxaggrnormscale,
13682 nchgcoefs, &aggregated) );
13689 conss[chkind] = NULL;
13692 if( !aggregated && cons0isequality && !consdata1->upgraded && commonidxweight > diffidx0minus1weight )
13696 nvarscommon, commonidxweight, diffidx1minus0weight, diffidx0minus1weight, maxaggrnormscale,
13697 nchgcoefs, &aggregated) );
13757 assert(scip != NULL);
13758 assert(cons != NULL);
13759 assert(nfixedvars != NULL);
13767 if( singlevarstuffing )
13783 rhs = -consdata->lhs;
13786 maxactivity = -minactivity;
13787 minactivity = -tmp;
13792 rhs = consdata->rhs;
13796 nvars = consdata->nvars;
13797 vars = consdata->vars;
13798 vals = consdata->vals;
13801 if( singletonstuffing )
13803 for( v = 0; v < nvars; ++v )
13819 assert(singletonstuffing);
13827 mincondactivity = 0.0;
13828 maxcondactivity = 0.0;
13830 for( v = 0; v < nvars; ++v )
13836 val = factor * vals[v];
13853 maxcondactivity += val * lb;
13854 mincondactivity += val * lb;
13855 swapped[v] =
FALSE;
13856 ratios[nsingletons] = obj / val;
13857 varpos[nsingletons] = v;
13872 maxcondactivity += val * ub;
13873 mincondactivity += val * ub;
13875 ratios[nsingletons] = obj / val;
13876 varpos[nsingletons] = v;
13893 maxcondactivity += val * lb;
13894 mincondactivity += val * lb;
13911 maxcondactivity += val * ub;
13912 mincondactivity += val * ub;
13928 maxcondactivity += val * ub;
13929 mincondactivity += val * lb;
13933 maxcondactivity += val * lb;
13934 mincondactivity += val * ub;
13938 if( tryfixing && nsingletons > 0 && (
SCIPisGT(scip, rhs, maxcondactivity) ||
SCIPisLE(scip, rhs, mincondactivity)) )
13943 int oldnfixedvars = *nfixedvars;
13944 int oldnchgbds = *nchgbds;
13950 for( v = 0; v < nsingletons; ++v )
13954 val = factor * vals[idx];
13959 assert((val < 0) == swapped[idx]);
13973 delta = -(lb - ub) * val;
13975 delta = (ub - lb) * val;
13979 if(
SCIPisLE(scip, delta, rhs - maxcondactivity) )
14005 else if(
SCIPisLE(scip, rhs, mincondactivity) )
14026 maxcondactivity += delta;
14027 mincondactivity += delta;
14031 if( *nfixedvars - oldnfixedvars > 0 || *nchgbds - oldnchgbds > 0 )
14033 SCIPdebugMsg(scip,
"### stuffing fixed %d variables and changed %d bounds\n", *nfixedvars - oldnfixedvars, *nchgbds - oldnchgbds);
14077 int bestindex = -1;
14078 int bestuplocks = 0;
14079 int bestdownlocks = 1;
14085 SCIPdebug( oldnfixedvars = *nfixedvars; )
14088 for( v = 0; v < nvars; ++v )
14092 val = factor * vals[v];
14120 if( ratio > bestratio || ((ratio == bestratio) && downlocks == 0 && (bestdownlocks > 0
14125 if( bestindex != -1 )
14128 if( bestuplocks > 1 )
14135 secondbestratio = bestratio;
14138 bestdownlocks = downlocks;
14139 bestuplocks = uplocks;
14146 if( bestdownlocks > 0 && bestuplocks > 1 )
14161 if( ratio > secondbestratio )
14163 secondbestratio = ratio;
14169 if( bestindex != -1 && bestdownlocks == 0 )
14174 var = vars[bestindex];
14176 val = factor * vals[bestindex];
14189 SCIP_Real activitydelta = (maxactivity - rhs) - (bestvarfloor * -val);
14192 tryfixing =
SCIPisLE(scip, obj, -activitydelta * secondbestratio);
14194 bounddelta =
SCIPceil(scip, (maxactivity - rhs)/-val);
14198 bounddelta = (maxactivity - rhs)/-val;
14200 tryfixing = tryfixing &&
SCIPisLE(scip, bounddelta, ub - lb);
14206 if(
SCIPisEQ(scip, lb + bounddelta, ub) )
14213 SCIPdebugMsg(scip,
"tighten the lower bound of <%s> from %g to %g (ub=%g)\n",
SCIPvarGetName(var), lb, lb + bounddelta, ub);
14226 SCIP_Real activitydelta = (maxactivity - rhs) - (bestvarfloor * val);
14229 tryfixing =
SCIPisLE(scip, -obj, activitydelta * secondbestratio);
14231 bounddelta =
SCIPceil(scip, (maxactivity - rhs)/val);
14235 bounddelta = (maxactivity - rhs)/val;
14237 tryfixing = tryfixing &&
SCIPisLE(scip, bounddelta, ub - lb);
14243 if(
SCIPisEQ(scip, ub - bounddelta, lb) )
14250 SCIPdebugMsg(scip,
"tighten the upper bound of <%s> from %g to %g (lb=%g)\n",
SCIPvarGetName(var), ub, ub - bounddelta, lb);
14266 for( v = 0; v < nvars; ++v )
14268 SCIPdebugMsg(scip,
"%+g <%s>([%g,%g],%g,[%d,%d],%s)\n", factor * vals[v],
SCIPvarGetName(vars[v]),
SCIPvarGetLbGlobal(vars[v]),
14272 SCIPdebugMsg(scip,
"<= %g\n", factor > 0 ? consdata->rhs : -consdata->lhs);
14274 for( v = 0; v < nvars; ++v )
14276 if( v == bestindex )
14279 if( factor * vals[v] < 0 )
14297 SCIPdebugMsg(scip,
"### new stuffing fixed %d vars, tightened %d bounds\n", *nfixedvars - oldnfixedvars, *nchgbds - oldnchgbds);
14349 assert(scip != NULL);
14350 assert(nconss == 0 || conss != NULL);
14351 assert(nchgbds != NULL);
14360 if( nbinvars == nvars )
14365 nintvars = nvars - ncontvars;
14368 nvars = nvars - nbinvars;
14380 for( v = 0; v < nvars; ++v )
14392 for( v = 0; v < ncontvars; v++ )
14399 var = vars[v + nintvars - nbinvars];
14419 for( c = 0; c < nconss; ++c )
14437 assert(consdata != NULL);
14446 for( i = 0; i < consdata->nvars; ++i )
14450 var = consdata->vars[i];
14455 assert(0 <= contv && contv < ncontvars);
14456 isimplint[contv] =
FALSE;
14469 hasimpliedpotential =
FALSE;
14472 for( i = 0; i < consdata->nvars; ++i )
14486 var = consdata->vars[i];
14487 val = consdata->vals[i];
14501 isminsettoinfinity =
TRUE;
14502 ismaxsettoinfinity =
TRUE;
14508 &minisrelax, &maxisrelax, &isminsettoinfinity, &ismaxsettoinfinity);
14514 assert((!minisrelax || isminsettoinfinity) && (!maxisrelax || ismaxsettoinfinity));
14527 assert(0 <= arrayindex && arrayindex < nvars);
14529 newredlb = redlb[arrayindex];
14530 newredub = redub[arrayindex];
14536 nlocksdown[arrayindex] += nlockspos;
14537 newredlb = (isminsettoinfinity ?
SCIPinfinity(scip) : (consdata->lhs - minresactivity)/val);
14542 nlocksup[arrayindex] += nlockspos;
14543 newredub = (ismaxsettoinfinity ? -
SCIPinfinity(scip) : (consdata->rhs - maxresactivity)/val);
14551 nlocksup[arrayindex] += nlockspos;
14552 newredub = (isminsettoinfinity ? -
SCIPinfinity(scip) : (consdata->lhs - minresactivity)/val);
14557 nlocksdown[arrayindex] += nlockspos;
14558 newredlb = (ismaxsettoinfinity ?
SCIPinfinity(scip) : (consdata->rhs - maxresactivity)/val);
14566 newredlb =
SCIPceil(scip, newredlb);
14572 redlb[arrayindex] =
MAX(redlb[arrayindex], newredlb);
14573 redub[arrayindex] = MIN(redub[arrayindex], newredub);
14580 assert(nconscontvars < ncontvars);
14582 conscontvars[nconscontvars] = var;
14586 assert(0 <= contv && contv < ncontvars);
14587 hasimpliedpotential = hasimpliedpotential || isimplint[contv];
14592 if( hasimpliedpotential )
14594 if( nconscontvars > 1 || !integralcoefs )
14599 for( i = 0; i < nconscontvars; i++ )
14603 assert(0 <= contv && contv < ncontvars);
14604 isimplint[contv] =
FALSE;
14618 assert(nconscontvars == 1);
14619 assert(0 <= contvarpos && contvarpos < consdata->nvars);
14620 var = consdata->vars[contvarpos];
14621 val = consdata->vals[contvarpos];
14623 assert(0 <= contv && contv < ncontvars);
14624 assert(isimplint[contv]);
14627 if( !
SCIPisEQ(scip, absval, 1.0) )
14628 isimplint[contv] =
FALSE;
14634 if( obj * val >= 0.0 && lhsexists )
14637 isimplint[contv] = isimplint[contv] &&
SCIPisIntegral(scip, consdata->lhs);
14639 if( obj * val <= 0.0 && rhsexists )
14642 isimplint[contv] = isimplint[contv] &&
SCIPisIntegral(scip, consdata->rhs);
14651 for( v = 0; v < nvars; ++v )
14679 SCIPdebugMsg(scip,
"variable <%s> only locked down in linear constraints: dual presolve <%s>[%.15g,%.15g] <= %.15g\n",
14683 assert(!infeasible);
14686 redub[v] = MIN(redub[v], ub);
14706 SCIPdebugMsg(scip,
"variable <%s> only locked up in linear constraints: dual presolve <%s>[%.15g,%.15g] >= %.15g\n",
14710 assert(!infeasible);
14713 redlb[v] =
MAX(redlb[v], lb);
14721 for( v = nintvars - nbinvars; v < nvars; ++v )
14727 assert(var != NULL);
14732 assert(0 <= v - nintvars + nbinvars && v - nintvars + nbinvars < ncontvars);
14735 if( isimplint[v - nintvars + nbinvars]
14751 SCIPdebugMsg(scip,
"dual presolve: converting continuous variable <%s>[%g,%g] to implicit integer\n",
14787 assert(scip != NULL);
14788 assert(conshdlr != NULL);
14790 assert(result != NULL);
14793 assert(conshdlrdata != NULL);
14795 checkrelmaxabs = conshdlrdata->checkrelmaxabs;
14797 SCIPdebugMsg(scip,
"Enforcement method of linear constraints for %s solution\n", sol == NULL ?
"LP" :
"relaxation");
14805 for( c = 0; c < nusefulconss; ++c )
14821 for( c = nusefulconss; c < nconss && *result ==
SCIP_FEASIBLE; ++c )
14836 SCIPdebugMsg(scip,
"-> constraints checked, %s\n", *result ==
SCIP_FEASIBLE ?
"all constraints feasible" :
"infeasibility detected");
14849 assert(scip != NULL);
14850 assert(conshdlr != NULL);
14867 assert(scip != NULL);
14868 assert(conshdlr != NULL);
14873 assert(conshdlrdata != NULL);
14890 assert(scip != NULL);
14894 assert(conshdlrdata != NULL);
14895 assert(conshdlrdata->eventhdlr != NULL);
14896 assert(nconss == 0 || conss != NULL);
14899 for( c = 0; c < nconss; ++c )
14916 assert(scip != NULL);
14920 assert(conshdlrdata != NULL);
14921 assert(conshdlrdata->eventhdlr != NULL);
14924 for( c = nconss - 1; c >= 0; --c )
14929 assert(consdata != NULL);
14931 if( consdata->eventdata != NULL )
14935 assert(consdata->eventdata == NULL);
14951 assert(scip != NULL);
14964 assert(scip != NULL);
14987 assert(scip != NULL);
14988 assert(linconsstats != NULL);
14990 assert(conshdlr != NULL);
15008 for( c = 0; c < nconss; c++ )
15018 assert(cons != NULL);
15026 assert(consdata != NULL);
15027 rhs = consdata->rhs;
15028 lhs = consdata->lhs;
15032 for( i = 0; i < consdata->nvars; i++ )
15034 assert(!
SCIPisZero(scip, consdata->vals[i]));
15038 if( consdata->nvars == 0 )
15058 if( consdata->nvars == 1 )
15068 if( consdata->nvars == 2 &&
SCIPisEQ(scip, lhs, rhs) )
15078 if( consdata->nvars == 2 )
15083 if(
SCIPisEQ(scip, consdata->vals[0], -consdata->vals[1])
15111 scale =
REALABS(consdata->vals[0]);
15114 for( i = 0; i < consdata->nvars && !unmatched; i++ )
15119 unmatched = unmatched || !
SCIPisEQ(scip,
REALABS(consdata->vals[i]), scale);
15121 if( consdata->vals[i] < 0.0 )
15129 b = rhs/scale + nnegbinvars;
15150 b = rhs/scale + nnegbinvars;
15175 b = lhs/scale + nnegbinvars;
15205 for( i = 0; i < consdata->nvars && !unmatched; i++ )
15210 unmatched = unmatched || !
SCIPisIntegral(scip, consdata->vals[i]);
15213 b -= consdata->vals[i];
15233 for( i = 0; i < consdata->nvars && !matched; i++ )
15238 SCIPdebugMsg(scip,
"classified as %s: ", matched ?
"BINPACKING" :
"KNAPSACK");
15261 for( i = 0; i < consdata->nvars && !unmatched; i++ )
15265 unmatched = unmatched || !
SCIPisIntegral(scip, consdata->vals[i]);
15266 unmatched = unmatched ||
SCIPisNegative(scip, consdata->vals[i]);
15288 for( i = 0; i < consdata->nvars && !unmatched; i++ )
15321 #ifdef SCIP_STATISTIC 15330 assert(scip != NULL);
15332 #ifdef SCIP_STATISTIC 15335 assert(conshdlrdata != NULL);
15340 for( c = 0; c < nconss; ++c )
15348 assert(consdata != NULL);
15350 if( consdata->upgraded )
15357 if(
SCIPisLT(scip, consdata->maxactdelta, conshdlrdata->maxeasyactivitydelta) )
15362 SCIPstatisticMessage(
"below threshold: %d / %d ratio= %g\n", ngoodconss, nallconss, (100.0 * ngoodconss / nallconss));
15366 for( c = 0; c < nconss; ++c )
15374 assert(consdata != NULL);
15376 if( consdata->upgraded )
15400 assert(scip != NULL);
15403 for( c = 0; c < nconss; ++c )
15408 assert(consdata != NULL);
15410 if( consdata->row != NULL )
15426 if( ncutsadded > 0 )
15429 "(restart) converted %d cuts from the global cut pool into linear constraints\n", ncutsadded);
15451 assert(scip != NULL);
15452 assert(conshdlr != NULL);
15457 assert(consdata != NULL);
15461 assert(conshdlrdata != NULL);
15462 assert(conshdlrdata->eventhdlr != NULL);
15465 if( consdata->eventdata != NULL )
15470 assert(consdata->eventdata == NULL);
15481 assert(scip != NULL);
15482 assert(conshdlr != NULL);
15485 if( (*consdata)->eventdata != NULL )
15490 assert(conshdlrdata != NULL);
15494 assert((*consdata)->eventdata == NULL);
15513 assert(scip != NULL);
15514 assert(conshdlr != NULL);
15517 assert(sourcecons != NULL);
15518 assert(targetcons != NULL);
15521 assert(sourcedata != NULL);
15522 assert(sourcedata->row == NULL);
15525 SCIP_CALL(
consdataCreate(scip, &targetdata, sourcedata->nvars, sourcedata->vars, sourcedata->vals, sourcedata->lhs, sourcedata->rhs) );
15544 assert(scip != NULL);
15547 *infeasible =
FALSE;
15549 for( c = 0; c < nconss && !(*infeasible); ++c )
15576 assert(scip != NULL);
15577 assert(conshdlr != NULL);
15579 assert(result != NULL);
15582 assert(conshdlrdata != NULL);
15591 if( (depth == 0 && conshdlrdata->maxroundsroot >= 0 && nrounds >= conshdlrdata->maxroundsroot)
15592 || (depth > 0 && conshdlrdata->maxrounds >= 0 && nrounds >= conshdlrdata->maxrounds) )
15596 maxsepacuts = (depth == 0 ? conshdlrdata->maxsepacutsroot : conshdlrdata->maxsepacuts);
15602 maxbound = glblowerbound + conshdlrdata->maxcardbounddist * (cutoffbound - glblowerbound);
15603 separatecards =
SCIPisLE(scip, loclowerbound, maxbound);
15611 for( c = 0; c < nusefulconss && ncuts < maxsepacuts && !cutoff; ++c )
15614 SCIP_CALL(
separateCons(scip, conss[c], conshdlrdata, NULL, separatecards, conshdlrdata->separateall, &ncuts, &cutoff) );
15620 else if( ncuts > 0 )
15642 assert(scip != NULL);
15643 assert(conshdlr != NULL);
15645 assert(result != NULL);
15648 assert(conshdlrdata != NULL);
15657 if( (depth == 0 && conshdlrdata->maxroundsroot >= 0 && nrounds >= conshdlrdata->maxroundsroot)
15658 || (depth > 0 && conshdlrdata->maxrounds >= 0 && nrounds >= conshdlrdata->maxrounds) )
15662 maxsepacuts = (depth == 0 ? conshdlrdata->maxsepacutsroot : conshdlrdata->maxsepacuts);
15669 for( c = 0; c < nusefulconss && ncuts < maxsepacuts && !cutoff; ++c )
15678 else if( ncuts > 0 )
15715 assert(scip != NULL);
15716 assert(conshdlr != NULL);
15718 assert(result != NULL);
15721 assert(conshdlrdata != NULL);
15723 checkrelmaxabs = conshdlrdata->checkrelmaxabs;
15728 if( objinfeasible )
15730 SCIPdebugMsg(scip,
"-> pseudo solution is objective infeasible, return.\n");
15738 for( c = 0; c < nconss && !violated; ++c )
15748 SCIPdebugMsg(scip,
"-> constraints checked, %s\n", *result ==
SCIP_FEASIBLE ?
"all constraints feasible" :
"infeasibility detected");
15762 assert(scip != NULL);
15763 assert(conshdlr != NULL);
15765 assert(result != NULL);
15770 assert(conshdlrdata != NULL);
15772 checkrelmaxabs = conshdlrdata->checkrelmaxabs;
15777 for( c = 0; c < nconss && (*result ==
SCIP_FEASIBLE || completely); ++c )
15780 SCIP_CALL(
checkCons(scip, conss[c], sol, checklprows, checkrelmaxabs, &violated) );
15792 assert( consdata != NULL);
15800 SCIPinfoMessage(scip, NULL,
"activity invalid due to positive and negative infinity contributions\n");
15801 else if(
SCIPisFeasLT(scip, activity, consdata->lhs) )
15802 SCIPinfoMessage(scip, NULL,
"violation: left hand side is violated by %.15g\n", consdata->lhs - activity);
15803 else if(
SCIPisFeasGT(scip, activity, consdata->rhs) )
15804 SCIPinfoMessage(scip, NULL,
"violation: right hand side is violated by %.15g\n", activity - consdata->rhs);
15825 assert(scip != NULL);
15826 assert(conshdlr != NULL);
15828 assert(result != NULL);
15831 assert(conshdlrdata != NULL);
15837 tightenbounds =
TRUE;
15842 int tightenboundsfreq;
15847 tightenboundsfreq = propfreq * conshdlrdata->tightenboundsfreq;
15848 tightenbounds = (conshdlrdata->tightenboundsfreq >= 0)
15849 && ((tightenboundsfreq == 0 && depth == 0) || (tightenboundsfreq >= 1 && (depth % tightenboundsfreq == 0)));
15852 rangedrowpropagation = conshdlrdata->rangedrowpropagation;
15854 rangedrowpropagation = rangedrowpropagation && (depth <= conshdlrdata->rangedrowmaxdepth);
15855 rangedrowfreq = propfreq * conshdlrdata->rangedrowfreq;
15856 rangedrowpropagation = rangedrowpropagation && (depth % rangedrowfreq == 0);
15863 for( i = 0; i < nmarkedconss && !cutoff; i++ )
15867 conshdlrdata->maxeasyactivitydelta, conshdlrdata->sortvars, &cutoff, &nchgbds) );
15873 else if( nchgbds > 0 )
15882 #define MAXCONSPRESOLROUNDS 10 15903 int firstupgradetry;
15906 assert(scip != NULL);
15907 assert(conshdlr != NULL);
15909 assert(result != NULL);
15915 oldnfixedvars = *nfixedvars;
15916 oldnaggrvars = *naggrvars;
15917 oldnchgbds = *nchgbds;
15918 oldndelconss = *ndelconss;
15919 oldnupgdconss = *nupgdconss;
15920 oldnchgcoefs = *nchgcoefs;
15921 oldnchgsides = *nchgsides;
15925 assert(conshdlrdata != NULL);
15928 firstchange = INT_MAX;
15929 firstupgradetry = INT_MAX;
15930 for( c = 0; c < nconss && !cutoff && !
SCIPisStopped(scip); ++c )
15935 infeasible =
FALSE;
15940 assert(consdata != NULL);
15942 if( consdata->eventdata == NULL )
15946 assert(consdata->eventdata != NULL);
15951 assert(
SCIPgetNRuns(scip) > 0 || nrounds > 0 || consdata->boundstightened == 0);
15952 assert(
SCIPgetNRuns(scip) > 0 || nrounds > 0 || !consdata->presolved);
15965 assert(consdata->removedfixings);
15972 if( firstchange == INT_MAX && consdata->changed )
15976 if( firstupgradetry == INT_MAX && !consdata->upgradetried )
15977 firstupgradetry = c;
15980 if( consdata->presolved )
15998 consdata->presolved =
TRUE;
16008 if(
SCIPisFeasGT(scip, consdata->lhs, consdata->rhs) )
16010 SCIPdebugMsg(scip,
"linear constraint <%s> is infeasible: sides=[%.15g,%.15g]\n",
16017 SCIP_CALL(
tightenBounds(scip, cons, conshdlrdata->maxeasyactivitydelta, conshdlrdata->sortvars, &cutoff, nchgbds) );
16030 SCIPdebugMsg(scip,
"linear constraint <%s> is infeasible: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
16031 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
16037 SCIPdebugMsg(scip,
"linear constraint <%s> is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
16038 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
16042 if( !consdata->upgraded )
16048 SCIPdebugMsg(scip,
"linear constraint <%s> left hand side is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
16049 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
16051 if( !consdata->upgraded )
16056 SCIPdebugMsg(scip,
"linear constraint <%s> right hand side is redundant: activitybounds=[%.15g,%.15g], sides=[%.15g,%.15g]\n",
16057 SCIPconsGetName(cons), minactivity, maxactivity, consdata->lhs, consdata->rhs);
16059 if( !consdata->upgraded )
16062 assert(consdata->nvars >= 1);
16065 if( consdata->nvars == 0 )
16067 if(
SCIPisFeasGT(scip, consdata->lhs, consdata->rhs) )
16069 SCIPdebugMsg(scip,
"empty linear constraint <%s> is infeasible: sides=[%.15g,%.15g]\n",
16075 SCIPdebugMsg(scip,
"empty linear constraint <%s> is redundant: sides=[%.15g,%.15g]\n",
16080 if( !consdata->upgraded )
16090 if( conshdlrdata->simplifyinequalities )
16096 if( conshdlrdata->aggregatevariables )
16107 if( conshdlrdata->rangedrowpropagation )
16109 int lastnfixedvars;
16111 lastnfixedvars = *nfixedvars;
16116 if( lastnfixedvars < *nfixedvars )
16127 nfixedvars, nchgbds, &cutoff) );
16132 if(
SCIPisFeasGT(scip, consdata->lhs, consdata->rhs) )
16134 SCIPdebugMsg(scip,
"empty linear constraint <%s> is infeasible: sides=[%.15g,%.15g]\n",
16140 SCIPdebugMsg(scip,
"empty linear constraint <%s> is redundant: sides=[%.15g,%.15g]\n",
16145 if( !consdata->upgraded )
16170 if( firstchange == INT_MAX && consdata->changed )
16174 if( firstupgradetry == INT_MAX && !consdata->upgradetried )
16175 firstupgradetry = c;
16180 (conshdlrdata->singletonstuffing || conshdlrdata->singlevarstuffing) &&
SCIPallowDualReds(scip) )
16183 conshdlrdata->singlevarstuffing, &cutoff, nfixedvars, nchgbds) );
16186 if( consdata->nvars == 0 )
16188 if(
SCIPisFeasGT(scip, consdata->lhs, consdata->rhs) )
16190 SCIPdebugMsg(scip,
"empty linear constraint <%s> is infeasible: sides=[%.15g,%.15g]\n",
16196 SCIPdebugMsg(scip,
"empty linear constraint <%s> is redundant: sides=[%.15g,%.15g]\n",
16201 if( !consdata->upgraded )
16214 assert(firstchange >= 0);
16216 if( firstchange < nconss && conshdlrdata->presolusehashing )
16220 ndelconss, nchgsides) );
16223 if( firstchange < nconss && conshdlrdata->presolpairwise )
16227 int firstchangenew;
16230 npaircomparisons = 0;
16231 oldndelconss = *ndelconss;
16232 oldnchgsides = *nchgsides;
16233 oldnchgcoefs = *nchgcoefs;
16239 firstchangenew = -1;
16240 for( c = 0; c < nconss; ++c )
16243 if( c == firstchange )
16244 firstchangenew = nusefulconss;
16250 usefulconss[nusefulconss] = conss[c];
16253 firstchange = firstchangenew;
16254 assert(firstchangenew >= 0 && firstchangenew <= nusefulconss);
16256 for( c = firstchange; c < nusefulconss && !cutoff && !
SCIPisStopped(scip); ++c )
16259 if( usefulconss[c] == NULL )
16262 npaircomparisons += (
SCIPconsGetData(conss[c])->changed) ? c : (c - firstchange);
16266 &cutoff, ndelconss, nchgsides, nchgcoefs) );
16268 if( npaircomparisons > conshdlrdata->nmincomparisons )
16270 assert(npaircomparisons > 0);
16271 if( ((*ndelconss - oldndelconss) + (*nchgsides - oldnchgsides)/2.0 + (*nchgcoefs - oldnchgcoefs)/10.0) / ((
SCIP_Real) npaircomparisons) < conshdlrdata->mingainpernmincomp )
16273 oldndelconss = *ndelconss;
16274 oldnchgsides = *nchgsides;
16275 oldnchgcoefs = *nchgcoefs;
16276 npaircomparisons = 0;
16287 if( !cutoff && firstupgradetry < nconss
16288 && *nfixedvars == oldnfixedvars && *naggrvars == oldnaggrvars && *nchgbds == oldnchgbds && *ndelconss == oldndelconss
16289 && *nupgdconss == oldnupgdconss && *nchgcoefs == oldnchgcoefs && *nchgsides == oldnchgsides
16304 for( c = firstupgradetry; c < nconss && !
SCIPisStopped(scip); ++c )
16313 assert(consdata != NULL);
16316 if( consdata->upgradetried )
16319 if( !consdata->presolved )
16322 consdata->upgradetried =
TRUE;
16328 if( upgdcons != NULL )
16338 assert(!consdata->upgraded);
16339 consdata->upgraded =
TRUE;
16344 if(
SCIPisLT(scip, consdata->lhs, consdata->rhs)
16345 || !conshdlrdata->presolpairwise
16346 || (conshdlrdata->maxaggrnormscale == 0.0) )
16358 else if( *nfixedvars > oldnfixedvars || *naggrvars > oldnaggrvars || *nchgbds > oldnchgbds || *ndelconss > oldndelconss
16359 || *nupgdconss > oldnupgdconss || *nchgcoefs > oldnchgcoefs || *nchgsides > oldnchgsides )
16373 assert(scip != NULL);
16374 assert(cons != NULL);
16375 assert(result != NULL);
16392 assert(scip != NULL);
16393 assert(cons != NULL);
16395 assert(consdata != NULL);
16401 for( i = 0; i < consdata->nvars; ++i )
16435 assert(scip != NULL);
16436 assert(conshdlr != NULL);
16437 assert(conss != NULL || nconss == 0);
16451 assert(scip != NULL);
16452 assert(conshdlr != NULL);
16453 assert(cons != NULL);
16466 const char* consname;
16469 assert(scip != NULL);
16470 assert(sourcescip != NULL);
16471 assert(sourcecons != NULL);
16485 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, global, valid) );
16486 assert(cons != NULL || *valid ==
FALSE);
16499 char** firstoperator,
16500 char** secondoperator,
16506 assert(str != NULL);
16507 assert(firstoperator != NULL);
16508 assert(secondoperator != NULL);
16510 *firstoperator = NULL;
16511 *secondoperator = NULL;
16517 while( *curr && *success )
16530 if( curr[1] ==
'=' )
16539 if( strncmp(curr,
"[free]", 6) == 0 )
16555 if( *firstoperator == NULL )
16557 *firstoperator = curr;
16561 if( *secondoperator != NULL )
16566 else if( strncmp(*firstoperator,
"<=", 2) != 0 )
16568 SCIPerrorMessage(
"Two operators in line that is not a ranged row: %s", str);
16571 else if( strncmp(curr,
"<=", 2) != 0 )
16573 SCIPerrorMessage(
"Bad second operator, expected ranged row specification: %s", str);
16577 *secondoperator = curr;
16587 if( *firstoperator == NULL )
16616 assert(scip != NULL);
16617 assert(success != NULL);
16618 assert(str != NULL);
16619 assert(name != NULL);
16620 assert(cons != NULL);
16626 (*success) =
FALSE;
16633 while( isspace((
unsigned char)*str) )
16642 if( ! operatorsuccess )
16645 varstrptr = (
char *)str;
16646 lhsstrptr = rhsstrptr = NULL;
16647 assert(firstop != NULL);
16653 assert(firstop[1] ==
'=');
16655 if( secondop != NULL )
16657 assert(secondop[0] ==
'<' && secondop[1] ==
'=');
16658 lhsstrptr = (
char *)str;
16659 varstrptr = firstop + 2;
16660 rhsstrptr = secondop + 2;
16666 varstrptr = (
char *)str;
16667 rhsstrptr = firstop + 2;
16671 assert(firstop[1] ==
'=');
16672 assert(secondop == NULL);
16674 lhsstrptr = firstop + 2;
16677 assert(firstop[1] ==
'=');
16678 assert(secondop == NULL);
16680 rhsstrptr = firstop + 2;
16681 lhsstrptr = firstop + 2;
16684 assert(strncmp(firstop,
"[free]", 6) == 0);
16685 assert(secondop == NULL);
16690 SCIPerrorMessage(
"Parsing has wrong operator character '%c', should be one of <=>[", *firstop);
16695 if( lhsstrptr != NULL )
16699 SCIPerrorMessage(
"error parsing left hand side number from <%s>\n", lhsstrptr);
16704 if( rhsstrptr == lhsstrptr )
16709 if( rhsstrptr != NULL && rhsstrptr != lhsstrptr )
16713 SCIPerrorMessage(
"error parsing right hand side number from <%s>\n", lhsstrptr);
16723 assert(varstrptr != NULL);
16728 if( *success && requsize > coefssize )
16731 coefssize = requsize;
16736 assert(!*success || requsize <= coefssize);
16746 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
16763 assert(consdata != NULL);
16765 if( varssize < consdata->nvars )
16766 (*success) =
FALSE;
16769 assert(vars != NULL);
16786 assert(consdata != NULL);
16788 (*nvars) = consdata->nvars;
16807 assert(scip != NULL);
16808 assert(eventhdlr != NULL);
16809 assert(eventdata != NULL);
16811 assert(event != NULL);
16813 cons = eventdata->cons;
16814 assert(cons != NULL);
16816 assert(consdata != NULL);
16832 varpos = eventdata->varpos;
16833 assert(0 <= varpos && varpos < consdata->nvars);
16836 assert(var != NULL);
16837 assert(consdata->vars[varpos] == var);
16838 val = consdata->vals[varpos];
16857 consdata->presolved =
FALSE;
16858 consdata->rangedrowpropagated = 0;
16866 if( consdata->maxactdeltavar == var )
16869 consdata->maxactdeltavar = NULL;
16873 if( consdata->boundstightened > 0)
16875 switch( eventtype )
16879 consdata->boundstightened = 0;
16883 consdata->boundstightened = 0;
16905 delta =
REALABS(val) * domain;
16907 if( delta > consdata->maxactdelta )
16909 consdata->maxactdelta = delta;
16910 consdata->maxactdeltavar = var;
16917 consdata->presolved =
FALSE;
16918 consdata->removedfixings =
FALSE;
16919 consdata->rangedrowpropagated = 0;
16922 if( consdata->maxactdeltavar == var )
16925 consdata->maxactdeltavar = NULL;
16934 consdata->presolved =
FALSE;
16943 varpos = eventdata->varpos;
16944 assert(0 <= varpos && varpos < consdata->nvars);
16947 assert(var != NULL);
16948 assert(consdata->vars[varpos] == var);
16949 val = consdata->vals[varpos];
16951 consdata->rangedrowpropagated = 0;
16965 consdata->varsdeleted =
TRUE;
16984 assert(scip != NULL);
16985 assert(conflicthdlr != NULL);
16987 assert(bdchginfos != NULL || nbdchginfos == 0);
16988 assert(result != NULL);
17003 for( i = 0; i < nbdchginfos; ++i )
17005 assert(bdchginfos != NULL);
17024 if( i == nbdchginfos )
17037 if( upgdcons != NULL )
17069 assert(scip != NULL);
17070 assert(cons != NULL);
17071 assert(nupgdconss != NULL);
17072 assert(upgdconss != NULL);
17084 if( upgdconsssize < 1 )
17103 assert(upgdconsdata != NULL);
17106 upgdconsdata->checkabsolute =
TRUE;
17120 assert(nupgdconss != NULL);
17121 assert(upgdconss != NULL);
17133 if( upgdconsssize < 1 )
17150 assert(upgdconsdata != NULL);
17153 upgdconsdata->checkabsolute =
TRUE;
17175 assert(scip != NULL);
17179 eventExecLinear, NULL) );
17183 conflictExecLinear, NULL) );
17191 consEnfolpLinear, consEnfopsLinear, consCheckLinear, consLockLinear,
17194 assert(conshdlr != NULL);
17235 "multiplier on propagation frequency, how often the bounds are tightened (-1: never, 0: only at root)",
17239 "maximal number of separation rounds per node (-1: unlimited)",
17243 "maximal number of separation rounds per node in the root node (-1: unlimited)",
17247 "maximal number of cuts separated per separation round",
17251 "maximal number of cuts separated per separation round in the root node",
17255 "should pairwise constraint comparison be performed in presolving?",
17259 "should hash table be used for detecting redundant constraints in advance",
17263 "number for minimal pairwise presolve comparisons",
17267 "minimal gain per minimal pairwise presolve comparisons to repeat pairwise comparison round",
17271 "maximal allowed relative gain in maximum norm for constraint aggregation (0.0: disable constraint aggregation)",
17275 "maximum activity delta to run easy propagation on linear constraint (faster, but numerically less stable)",
17279 "maximal relative distance from current node's dual bound to primal bound compared to best node's dual bound for separating knapsack cardinality cuts",
17283 "should all constraints be subject to cardinality cut generation instead of only the ones with non-zero dual value?",
17287 "should presolving search for aggregations in equations",
17291 "should presolving try to simplify inequalities",
17295 "should dual presolving steps be performed?",
17299 "should stuffing of singleton continuous variables be performed?",
17303 "should single variable stuffing be performed, which tries to fulfill constraints using the cheapest variable?",
17306 "constraints/" CONSHDLR_NAME "/sortvars",
"apply binaries sorting in decr. order of coeff abs value?",
17310 "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)?",
17314 "should presolving try to detect constraints parallel to the objective function defining an upper bound and prevent these constraints from entering the LP?",
17318 "should presolving try to detect constraints parallel to the objective function defining a lower bound and prevent these constraints from entering the LP?",
17322 "should presolving try to detect subsets of constraints parallel to the objective function?",
17326 "should presolving and propagation try to improve bounds, detect infeasibility, and extract sub-constraints from ranged rows and equations?",
17330 "should presolving and propagation extract sub-constraints from ranged rows and equations?",
17334 "maximum depth to apply ranged row propagation",
17338 "frequency for applying ranged row propagation",
17342 "should multi-aggregations only be performed if the constraint can be removed afterwards?",
17353 const char* conshdlrname
17362 assert(scip != NULL);
17363 assert(linconsupgd != NULL);
17364 assert(conshdlrname != NULL );
17368 if( conshdlr == NULL )
17375 assert(conshdlrdata != NULL);
17390 paramname, paramdesc,
17438 assert(scip != NULL);
17439 assert(cons != NULL);
17443 if( conshdlr == NULL )
17468 if( requiredsize > nconsvars )
17474 assert(requiredsize <= nconsvars);
17480 if( constant < 0.0 )
17487 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);
17497 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);
17513 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);
17523 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);
17553 assert(consdata != NULL);
17562 assert(consdata != NULL);
17566 SCIP_CALL(
SCIPcreateCons(scip, cons, name, conshdlr, consdata, initial, separate, enforce, check, propagate,
17567 local, modifiable, dynamic, removable, stickingatnode) );
17591 assert(scip != NULL);
17648 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
17656 if( sourcecoefs != NULL )
17663 for( v = 0; v < nvars; ++v )
17676 if( requiredsize > nvars )
17682 assert(requiredsize <= nvars);
17687 for( v = 0; v < nvars; ++v )
17691 assert(vars[v] != NULL);
17698 for( v = 0; v < nvars && success; ++v )
17704 assert(!(success) || vars[v] != NULL);
17717 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
17737 assert(scip != NULL);
17738 assert(cons != NULL);
17739 assert(var != NULL);
17772 if( requiredsize > nconsvars )
17778 assert(requiredsize <= nconsvars);
17782 assert(consdata != NULL);
17784 lhs = consdata->lhs;
17785 rhs = consdata->rhs;
17791 if( constant < 0.0 )
17798 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));
17808 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));
17824 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));
17834 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));
17864 for( v = nconsvars - 1; v >= 0; --v )
17903 assert(scip != NULL);
17904 assert(cons != NULL);
17905 assert(var != NULL);
17915 SCIPerrorMessage(
"method may only be called during problem creation stage for original constraints and variables\n");
17920 assert(consdata != NULL);
17922 vars = consdata->vars;
17925 while( i < consdata->nvars )
17927 if( vars[i] == var )
17965 assert(scip != NULL);
17966 assert(cons != NULL);
17967 assert(var != NULL);
17982 assert(cons != NULL);
17992 assert(consdata != NULL);
17994 return consdata->lhs;
18005 assert(cons != NULL);
18015 assert(consdata != NULL);
18017 return consdata->rhs;
18027 assert(scip != NULL);
18028 assert(cons != NULL);
18067 assert(cons != NULL);
18077 assert(consdata != NULL);
18079 return consdata->nvars;
18090 assert(cons != NULL);
18100 assert(consdata != NULL);
18102 return consdata->vars;
18113 assert(cons != NULL);
18123 assert(consdata != NULL);
18125 return consdata->vals;
18141 assert(cons != NULL);
18151 assert(consdata != NULL);
18153 if( consdata->row != NULL )
18168 assert(cons != NULL);
18178 assert(consdata != NULL);
18180 if( consdata->row != NULL )
18194 assert(cons != NULL);
18205 assert(consdata != NULL);
18207 if( consdata->row != NULL )
18221 assert(cons != NULL);
18232 assert(consdata != NULL);
18234 if( consdata->row != NULL )
18250 assert(cons != NULL);
18260 assert(consdata != NULL);
18262 return consdata->row;
18300 assert(scip != NULL);
18301 assert(cons != NULL);
18302 assert(upgdcons != NULL);
18324 assert(conshdlrdata != NULL);
18326 assert(consdata != NULL);
18329 if( consdata->upgraded )
18333 if( consdata->row != NULL )
18337 SCIPerrorMessage(
"cannot upgrade linear constraint that is already stored as row in the LP\n");
18374 for( i = 0; i < consdata->nvars; ++i )
18376 var = consdata->vars[i];
18377 val = consdata->vals[i];
18428 else if(
SCIPisEQ(scip, val, -1.0) )
18445 poscoeffsum += val;
18447 negcoeffsum += val;
18455 SCIPdebugMsg(scip,
"upgrading linear constraint <%s> (%d upgrade methods):\n",
18457 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",
18458 nposbin, nnegbin, nposint, nnegint, nposimpl, nnegimpl, nposcont, nnegcont,
18459 ncoeffspone, ncoeffsnone, ncoeffspint, ncoeffsnint, ncoeffspfrac, ncoeffsnfrac,
18460 poscoeffsum, negcoeffsum, integral);
18463 for( i = 0; i < conshdlrdata->nlinconsupgrades && *upgdcons == NULL; ++i )
18465 if( conshdlrdata->linconsupgrades[i]->active )
18467 SCIP_CALL( conshdlrdata->linconsupgrades[i]->linconsupgd(scip, cons, consdata->nvars,
18468 consdata->vars, consdata->vals, consdata->lhs, consdata->rhs,
18469 nposbin, nnegbin, nposint, nnegint, nposimpl, nnegimpl, nposimplbin, nnegimplbin, nposcont, nnegcont,
18470 ncoeffspone, ncoeffsnone, ncoeffspint, ncoeffsnint, ncoeffspfrac, ncoeffsnfrac,
18471 poscoeffsum, negcoeffsum, integral,
18477 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)