SCIP_ConshdlrData
218#ifdef WITH_CARDINALITY_UPGRADE 231 int* cliquepartition;
232 int* negcliquepartition;
239 intncliqueslastnegpart;
240 intncliqueslastpart;
244 unsigned intpresolvedtiming:5;
245 unsigned intsorted:1;
246 unsigned intcliquepartitioned:1;
247 unsigned intnegcliquepartitioned:1;
248 unsigned intmerged:1;
249 unsigned intcliquesadded:1;
250 unsigned intvarsdeleted:1;
251 unsigned intexistmultaggr:1;
328 if( sortkeypair1->key1 < sortkeypair2->key1 )
330 else if( sortkeypair1->key1 > sortkeypair2->key1 )
332 else if( sortkeypair1->key2 < sortkeypair2->key2 )
334 else if( sortkeypair1->key2 > sortkeypair2->key2 )
349assert(eventdata !=
NULL);
352(*eventdata)->cons = cons;
353(*eventdata)->weight = weight;
365assert(eventdata !=
NULL);
378assert(consdata !=
NULL);
379assert(consdata->nvars == 0 || consdata->vars !=
NULL);
380assert(consdata->nvars == 0 || consdata->weights !=
NULL);
381assert(consdata->nvars == 0 || consdata->eventdata !=
NULL);
382assert(consdata->nvars == 0 || (consdata->cliquepartition !=
NULL&& consdata->negcliquepartition !=
NULL));
384 if( !consdata->sorted )
394(
void**)consdata->vars,
395(
void**)consdata->eventdata,
396consdata->cliquepartition,
397consdata->negcliquepartition,
400v = consdata->nvars - 1;
406 while(
w>= 0 && consdata->weights[v] == consdata->weights[
w] )
413(
void**)(&(consdata->vars[
w+1])),
414(
void**)(&(consdata->eventdata[
w+1])),
415&(consdata->cliquepartition[
w+1]),
416&(consdata->negcliquepartition[
w+1]),
424 if( consdata->cliquepartitioned )
428 for( pos = 0; pos < consdata->nvars; ++pos )
432 if( consdata->cliquepartition[pos] > lastcliquenum )
434consdata->cliquepartitioned =
FALSE;
437 else if( consdata->cliquepartition[pos] == lastcliquenum )
442 if( consdata->negcliquepartitioned )
446 for( pos = 0; pos < consdata->nvars; ++pos )
450 if( consdata->negcliquepartition[pos] > lastcliquenum )
452consdata->negcliquepartitioned =
FALSE;
455 else if( consdata->negcliquepartition[pos] == lastcliquenum )
460consdata->sorted =
TRUE;
466 for( i = 0; i < consdata->nvars-1; ++i )
467assert(consdata->weights[i] >= consdata->weights[i+1]);
484assert(consdata !=
NULL);
485assert(consdata->nvars == 0 || (consdata->cliquepartition !=
NULL&& consdata->negcliquepartition !=
NULL));
488ispartitionoutdated = (conshdlrdata->updatecliquepartitions && consdata->ncliques > 1
489&&
SCIPgetNCliques(
scip) >= (int)(conshdlrdata->clqpartupdatefac * consdata->ncliqueslastpart));
491 if( normalclique && ( !consdata->cliquepartitioned || ispartitionoutdated ) )
494consdata->cliquepartitioned =
TRUE;
499isnegpartitionoutdated = (conshdlrdata->updatecliquepartitions && consdata->nnegcliques > 1
500&&
SCIPgetNCliques(
scip) >= (int)(conshdlrdata->clqpartupdatefac * consdata->ncliqueslastnegpart));
502 if( negatedclique && (!consdata->negcliquepartitioned || isnegpartitionoutdated) )
505consdata->negcliquepartitioned =
TRUE;
508assert(!consdata->cliquepartitioned || consdata->ncliques <= consdata->nvars);
509assert(!consdata->negcliquepartitioned || consdata->nnegcliques <= consdata->nvars);
551assert(cons !=
NULL);
552assert(consdata !=
NULL);
553assert(consdata->nvars == 0 || consdata->vars !=
NULL);
554assert(consdata->nvars == 0 || consdata->weights !=
NULL);
555assert(consdata->nvars == 0 || consdata->eventdata !=
NULL);
557 for( i = 0; i < consdata->nvars; i++)
561eventhdlr, consdata->eventdata[i], &consdata->eventdata[i]->filterpos) );
577assert(consdata !=
NULL);
578assert(consdata->nvars == 0 || consdata->vars !=
NULL);
579assert(consdata->nvars == 0 || consdata->weights !=
NULL);
580assert(consdata->nvars == 0 || consdata->eventdata !=
NULL);
582 for( i = 0; i < consdata->nvars; i++)
585eventhdlr, consdata->eventdata[i], consdata->eventdata[i]->filterpos) );
601assert(consdata !=
NULL);
602assert(consdata->nvars <= consdata->varssize);
604 if( num > consdata->varssize )
619assert(consdata->eventdata ==
NULL);
620assert(consdata->cliquepartition ==
NULL);
621assert(consdata->negcliquepartition ==
NULL);
623consdata->varssize = newsize;
625assert(num <= consdata->varssize);
638assert(consdata !=
NULL);
639assert(var !=
NULL);
641consdata->weightsum += weightdelta;
644consdata->onesweightsum += weightdelta;
646assert(consdata->weightsum >= 0);
647assert(consdata->onesweightsum >= 0);
664assert(consdata !=
NULL);
669(*consdata)->vars =
NULL;
670(*consdata)->weights =
NULL;
671(*consdata)->nvars = 0;
682 for( v = 0; v <
nvars; ++v )
684assert(vars[v] !=
NULL);
688assert( weights[v] >= 0 );
690 if( weights[v] > 0 )
697constant += weights[v];
701varsbuffer[k] = vars[v];
702weightsbuffer[k] = weights[v];
708assert(constant >= 0);
710(*consdata)->nvars = k;
724(*consdata)->varssize = (*consdata)->nvars;
725(*consdata)->capacity = capacity - constant;
726(*consdata)->eventdata =
NULL;
727(*consdata)->cliquepartition =
NULL;
728(*consdata)->negcliquepartition =
NULL;
729(*consdata)->row =
NULL;
730(*consdata)->nlrow =
NULL;
731(*consdata)->weightsum = 0;
732(*consdata)->onesweightsum = 0;
733(*consdata)->ncliques = 0;
734(*consdata)->nnegcliques = 0;
735(*consdata)->presolvedtiming = 0;
736(*consdata)->sorted =
FALSE;
737(*consdata)->cliquepartitioned =
FALSE;
738(*consdata)->negcliquepartitioned =
FALSE;
739(*consdata)->ncliqueslastpart = -1;
740(*consdata)->ncliqueslastnegpart = -1;
741(*consdata)->merged =
FALSE;
742(*consdata)->cliquesadded =
FALSE;
743(*consdata)->varsdeleted =
FALSE;
744(*consdata)->existmultaggr =
FALSE;
751 for( v = 0; v < (*consdata)->nvars; v++ )
754assert(var !=
NULL);
765 for( v = 0; v < (*consdata)->nvars; ++v )
768 updateWeightSums(*consdata, (*consdata)->vars[v], (*consdata)->weights[v]);
784assert(consdata !=
NULL);
785assert(*consdata !=
NULL);
787 if( (*consdata)->row !=
NULL)
791 if( (*consdata)->nlrow !=
NULL)
795 if( (*consdata)->eventdata !=
NULL)
800 if( (*consdata)->negcliquepartition !=
NULL)
804 if( (*consdata)->cliquepartition !=
NULL)
808 if( (*consdata)->vars !=
NULL)
813 for( v = 0; v < (*consdata)->nvars; v++ )
815assert((*consdata)->vars[v] !=
NULL);
819assert( (*consdata)->weights !=
NULL);
820assert( (*consdata)->varssize > 0 );
841assert(consdata !=
NULL);
842assert(0 <= item && item < consdata->
nvars);
844oldweight = consdata->weights[item];
845weightdiff = newweight - oldweight;
846consdata->weights[item] = newweight;
851 if( consdata->eventdata !=
NULL)
853assert(consdata->eventdata[item] !=
NULL);
854assert(consdata->eventdata[item]->weight == oldweight);
855consdata->eventdata[item]->weight = newweight;
858consdata->presolvedtiming = 0;
859consdata->sorted =
FALSE;
862 if( oldweight < newweight )
864consdata->cliquesadded =
FALSE;
879assert(consdata !=
NULL);
880assert(consdata->row ==
NULL);
887 for( i = 0; i < consdata->nvars; ++i )
906assert( cutoff !=
NULL);
910assert(consdata !=
NULL);
912 if( consdata->row ==
NULL)
916assert(consdata->row !=
NULL);
946assert(consdata !=
NULL);
948 if( consdata->nlrow ==
NULL)
954 for( i = 0; i < consdata->nvars; ++i )
955coefs[i] = (
SCIP_Real)consdata->weights[i];
958consdata->nvars, consdata->vars, coefs,
NULL,
961assert(consdata->nlrow !=
NULL);
987assert(violated !=
NULL);
990assert(consdata !=
NULL);
992 SCIPdebugMsg(
scip,
"checking knapsack constraint <%s> for feasibility of solution %p (lprows=%u)\n",
1014 for( v = consdata->nvars - 1; v >= 0; --v )
1019hugesum += consdata->weights[v] *
SCIPgetSolVal(
scip, sol, consdata->vars[v]);
1021normsum += consdata->weights[v] *
SCIPgetSolVal(
scip, sol, consdata->vars[v]);
1027 if( normsum > consdata->capacity )
1029absviol = normsum - consdata->capacity;
1065#define IDX(j,d) ((j)*(intcap)+(d)) 1108 intgreedymedianpos;
1113 int* allcurrminweight;
1126assert(weights !=
NULL);
1127assert(profits !=
NULL);
1128assert(capacity >= 0);
1129assert(items !=
NULL);
1130assert(nitems >= 0);
1131assert(success !=
NULL);
1136 for( j = nitems - 1; j >= 0; --j )
1137assert(weights[j] >= 0);
1143 if( solval !=
NULL)
1147 if( solitems !=
NULL)
1149assert(items !=
NULL);
1150assert(nsolitems !=
NULL);
1151assert(nonsolitems !=
NULL);
1152assert(nnonsolitems !=
NULL);
1168 for( j = 0; j < nitems; ++j )
1173 if( weights[j] > capacity )
1175 if( solitems !=
NULL)
1176nonsolitems[(*nnonsolitems)++] = items[j];
1179 else if( profits[j] <= 0.0 )
1181 if( solitems !=
NULL)
1182nonsolitems[(*nnonsolitems)++] = items[j];
1185 else if( weights[j] == 0 )
1187 if( solitems !=
NULL)
1188solitems[(*nsolitems)++] = items[j];
1190 if( solval !=
NULL)
1191*solval += profits[j];
1196myweights[nmyitems] = weights[j];
1197myprofits[nmyitems] = profits[j];
1198myitems[nmyitems] = items[j];
1201 if( myweights[nmyitems] < minweight )
1202minweight = myweights[nmyitems];
1205 if( myweights[nmyitems] > maxweight )
1206maxweight = myweights[nmyitems];
1208weightsum += myweights[nmyitems];
1215 for( j = 0; j < nmyitems && intprofits; ++j )
1219 if( nmyitems == 0 )
1227 if( weightsum > 0 && weightsum <= capacity )
1229 SCIPdebugMsg(
scip,
"After preprocessing all items fit into knapsack.\n");
1231 for( j = nmyitems - 1; j >= 0; --j )
1233 if( solitems !=
NULL)
1234solitems[(*nsolitems)++] = myitems[j];
1236 if( solval !=
NULL)
1237*solval += myprofits[j];
1243assert(0 < minweight && minweight <= capacity );
1244assert(0 < maxweight && maxweight <= capacity);
1248 if( maxweight > 1 )
1251gcd = myweights[nmyitems - 1];
1252 for( j = nmyitems - 2; j >= 0 && gcd >= 2; --j )
1260 for( j = nmyitems - 1; j >= 0; --j )
1262myweights[j] /= gcd;
1263eqweights = eqweights && (myweights[j] == 1);
1271assert(minweight <= capacity);
1274 if( minweight > capacity / 2 )
1278 SCIPdebugMsg(
scip,
"Only one item fits into knapsack, so take the best.\n");
1283 for( j = nmyitems - 2; j >= 0; --j )
1285 if( myprofits[j] > myprofits[p] )
1290 if( solitems !=
NULL)
1292assert(nsolitems !=
NULL&& nonsolitems !=
NULL&& nnonsolitems !=
NULL);
1294solitems[(*nsolitems)++] = myitems[p];
1295 for( j = nmyitems - 1; j >= 0; --j )
1298nonsolitems[(*nnonsolitems)++] = myitems[j];
1302 if( solval !=
NULL)
1303*solval += myprofits[p];
1318 if( solitems !=
NULL|| solval !=
NULL)
1324assert(nsolitems !=
NULL&& nonsolitems !=
NULL&& nnonsolitems !=
NULL);
1327 for( i = capacity - 1; i >= 0; --i )
1329 if( solitems !=
NULL)
1330solitems[(*nsolitems)++] = myitems[i];
1331addval += myprofits[i];
1334 if( solitems !=
NULL)
1337 for( i = nmyitems - 1; i >= capacity; --i )
1338nonsolitems[(*nnonsolitems)++] = myitems[i];
1342 if( solval !=
NULL)
1344assert(addval > 0.0);
1359 for( j = 0; j < nmyitems; ++j )
1361tempsort[j] = myprofits[j]/((
SCIP_Real) myweights[j]);
1362realweights[j] = (
SCIP_Real)myweights[j];
1366(
SCIP_Real)capacity, nmyitems, &greedymedianpos);
1372greedysolweight = 0;
1373greedysolvalue = 0.0;
1376 for( j = 0; j < greedymedianpos; ++j )
1378assert(myweights[j] <= capacity);
1381greedysolweight += myweights[j];
1382greedysolvalue += myprofits[j];
1385assert(0 < greedysolweight && greedysolweight <= capacity);
1386assert(greedysolvalue > 0.0);
1391greedyupperbound = greedysolvalue + myprofits[j] * (
SCIP_Real) (capacity - greedysolweight)/((
SCIP_Real) myweights[j]);
1394 if( greedysolweight == capacity ||
SCIPisGE(
scip, greedysolvalue, greedyupperbound) )
1399 if( solitems !=
NULL)
1403assert(nsolitems !=
NULL&& nonsolitems !=
NULL&& nnonsolitems !=
NULL);
1406 for( l = 0; l < j; ++l )
1407solitems[(*nsolitems)++] = myitems[l];
1408 for( ; l < nmyitems; ++l )
1409nonsolitems[(*nnonsolitems)++] = myitems[l];
1412 if( solval !=
NULL)
1414assert(greedysolvalue > 0.0);
1415*solval += greedysolvalue;
1422capacity -= (minweight - 1);
1425 if( capacity >= INT_MAX )
1427 SCIPdebugMsg(
scip,
"Capacity is to big, so we cannot handle it here.\n");
1432assert(capacity < INT_MAX);
1434intcap = (int)capacity;
1435assert(intcap >= 0);
1436assert(nmyitems > 0);
1437assert(
sizeof(
size_t) >=
sizeof(
int));
1442 if( intcap < 0 || (intcap > 0 && (((
size_t)nmyitems) > (SIZE_MAX / (
size_t)intcap /
sizeof(*optvalues)) || ((
size_t)nmyitems) * ((
size_t)intcap) *
sizeof(*optvalues) > ((
size_t)INT_MAX) )) )
1444 SCIPdebugMsg(
scip,
"Too much memory (%lu) would be consumed.\n", (
unsigned long) (((
size_t)nmyitems) * ((
size_t)intcap) *
sizeof(*optvalues)));
1472assert(myweights[0] - minweight < INT_MAX);
1473currminweight = (int) (myweights[0] - minweight);
1474allcurrminweight[0] = currminweight;
1477 for( d = currminweight; d < intcap; ++d )
1478optvalues[d] = myprofits[0];
1481 for( j = 1; j < nmyitems; ++j )
1486intweight = (int)(myweights[j] - minweight);
1487assert(0 <= intweight && intweight < intcap);
1490 for( d = currminweight; d < intweight && d < intcap; ++d )
1491optvalues[
IDX(j,d)] = optvalues[
IDX(j-1,d)];
1494 for( d = intweight; d < intcap; ++d )
1497 if( d < currminweight )
1498optvalues[
IDX(j,d)] = myprofits[j];
1503 if( d - myweights[j] < currminweight )
1504sumprofit = myprofits[j];
1506sumprofit = optvalues[
IDX(j-1,(
int)(d-myweights[j]))] + myprofits[j];
1508optvalues[
IDX(j,d)] =
MAX(sumprofit, optvalues[
IDX(j-1,d)]);
1513 if( intweight < currminweight )
1514currminweight = intweight;
1516allcurrminweight[j] = currminweight;
1520 if( solitems !=
NULL)
1522assert(nsolitems !=
NULL&& nonsolitems !=
NULL&& nnonsolitems !=
NULL);
1525 SCIPdebugMsg(
scip,
"Fill the solution vector after solving exactly.\n");
1528 for( j = nmyitems - 1; j > 0; --j )
1531 if( d < allcurrminweight[j] )
1539 if( d < allcurrminweight[j-1] || optvalues[
IDX(j,d)] > optvalues[
IDX(j-1,d)] )
1541solitems[(*nsolitems)++] = myitems[j];
1544assert(myweights[j] <= (INT_MAX + (
SCIP_Longint) d));
1545d = (int)(d - myweights[j]);
1549nonsolitems[(*nnonsolitems)++] = myitems[j];
1553 if( d >= allcurrminweight[j] )
1556solitems[(*nsolitems)++] = myitems[j];
1561assert(d < allcurrminweight[j]);
1563 for( ; j >= 0; --j )
1564nonsolitems[(*nnonsolitems)++] = myitems[j];
1567assert(*nsolitems + *nnonsolitems == nitems);
1571 if( solval !=
NULL)
1572*solval += optvalues[
IDX(nmyitems-1,intcap-1)];
1610assert(weights !=
NULL);
1611assert(profits !=
NULL);
1612assert(capacity >= 0);
1613assert(items !=
NULL);
1614assert(nitems >= 0);
1616 if( solitems !=
NULL)
1621 if( solval !=
NULL)
1627 for( j = nitems - 1; j >= 0; --j )
1629tempsort[j] = profits[j]/((
SCIP_Real) weights[j]);
1630realweights[j] = (
SCIP_Real)weights[j];
1638 for( j = 0; j < nitems && solitemsweight + weights[j] <= capacity; ++j )
1640 if( solitems !=
NULL)
1641solitems[(*nsolitems)++] = items[j];
1643 if( solval !=
NULL)
1644(*solval) += profits[j];
1645solitemsweight += weights[j];
1647 if( solitems !=
NULL)
1649 for( ; j < nitems; j++ )
1650nonsolitems[(*nnonsolitems)++] = items[j];
1669 intnnontrivialgubconss;
1672nnontrivialgubconss = 0;
1677 for( c = 0; c < gubset->
ngubconss; c++ )
1697 if( solvals !=
NULL)
1699gubsolval += solvals[currentvar];
1709 if( solvals !=
NULL)
1718nnontrivialgubconss++;
1734assert(gubcons !=
NULL);
1742(*gubcons)->ngubvars = 0;
1755assert(gubcons !=
NULL);
1756assert((*gubcons)->gubvars !=
NULL);
1757assert((*gubcons)->gubvarsstatus !=
NULL);
1774assert(gubcons !=
NULL);
1810assert(gubcons !=
NULL);
1812assert(
gubvarsidx>= 0 && gubvarsidx < gubcons->ngubvars);
1853assert(gubset !=
NULL);
1855assert(oldgubcons >= 0 && oldgubcons < gubset->
ngubconss);
1856assert(newgubcons >= 0 && newgubcons < gubset->
ngubconss);
1857assert(oldgubcons != newgubcons);
1874gubset->
gubvarsidx[replacevar] = oldgubvaridx;
1887 SCIPdebugMsg(
scip,
"deleting empty GUB cons<%d> from current GUB set\n", oldgubcons);
1889GUBsetPrint(
scip, gubset, vars,
NULL);
1896 if( oldgubcons != gubset->
ngubconss-1 )
1944assert(gubset !=
NULL);
1981assert(gubset !=
NULL);
1983assert(weights !=
NULL);
1984assert(capacity >= 0);
1992(*gubset)->ngubconss =
nvars;
1993(*gubset)->nvars =
nvars;
1996 for( i = 0; i <
nvars; i++ )
2005(*gubset)->gubconssidx[i] = i;
2006(*gubset)->gubvarsidx[i] = 0;
2007assert((*gubset)->gubconss[i]->ngubvars == 1);
2010 if( weights[i] > capacity )
2027assert(gubset !=
NULL);
2028assert((*gubset)->gubconss !=
NULL);
2029assert((*gubset)->gubconsstatus !=
NULL);
2030assert((*gubset)->gubconssidx !=
NULL);
2031assert((*gubset)->gubvarsidx !=
NULL);
2034 for( i = (*gubset)->ngubconss-1; i >= 0; --i )
2036assert((*gubset)->gubconss[i] !=
NULL);
2066assert(gubset !=
NULL);
2071 for( i = 0; i < gubset->
nvars; i++ )
2078 SCIPdebugMsg(
scip,
" var<%d> should be in GUB<%d> at position<%d>, but stored is var<%d> instead\n", i,
2079gubconsidx, gubvaridx, gubset->
gubconss[gubconsidx]->
gubvars[gubvaridx] );
2085 for( i = 0; i < gubset->
ngubconss; i++ )
2095var1negated =
FALSE;
2102var2negated =
FALSE;
2107 SCIPdebugMsg(
scip,
" GUB<%d>: var<%d,%s> and var<%d,%s> do not share a clique\n", i, j,
2110 SCIPdebugMsg(
scip,
" GUB<%d>: var<%d,%s> and var<%d,%s> do not share a clique\n", i, j,
2140 int*
constcliquepartition,
2141 int*
constncliques,
2152 intmaxncliquevarscomp;
2159assert(
nvars== 0 || cliquepartition !=
NULL);
2160assert(ncliques !=
NULL);
2178 for( i =
nvars- 1; i >= 0; --i )
2180tmpvalues[i] =
TRUE;
2181cliquepartition[i] = -1;
2192 for( i = 0; i <
nvars; i++ )
2197varseq[
nvars-1-nignorevars] = i;
2203varseq[nvarsused] = i;
2208assert(nvarsused + nignorevars ==
nvars);
2217 for( i = 0; i <
nvars; ++i )
2219 if( cliquepartition[varseq[i]] == -1 )
2224cliquepartition[varseq[i]] = *ncliques;
2225cliquevars[0] = tmpvars[varseq[i]];
2226cliquevalues[0] = tmpvalues[varseq[i]];
2235 for( j = i + 1; j < nvarsused; ++j )
2238 if( cliquepartition[varseq[j]] == -1 &&
SCIPvarIsActive(tmpvars[varseq[j]]) )
2243 for( k = ncliquevars - 1; k >= 0; --k )
2246cliquevalues[k],
TRUE) )
2253cliquepartition[varseq[j]] = cliquepartition[varseq[i]];
2254cliquevars[ncliquevars] = tmpvars[varseq[j]];
2255cliquevalues[ncliquevars] = tmpvalues[varseq[j]];
2265assert(cliquepartition[varseq[i]] >= 0 && cliquepartition[varseq[i]] < i + 1);
2268 if( i *
nvars> maxncliquevarscomp )
2272 for( ; i <
nvars; ++i )
2274 if( cliquepartition[varseq[i]] == -1 )
2276cliquepartition[varseq[i]] = *ncliques;
2301 int* cliquepartition;
2304 intcurrentgubconsidx;
2311assert(gubset !=
NULL);
2312assert(vars !=
NULL);
2315assert(
nvars>= 0);
2327 for( i = 0; i < ncliques; i++ )
2330gubfirstvar[i] = -1;
2333 for( i = 0; i <
nvars; i++ )
2335assert(cliquepartition[i] >= 0);
2337cliqueidx = cliquepartition[i];
2342 if( gubfirstvar[cliqueidx] == -1 )
2351gubfirstvar[cliqueidx] = i;
2356assert(gubfirstvar[cliqueidx] >= 0 && gubfirstvar[cliqueidx] < i);
2361newgubconsidx = gubset->
gubconssidx[gubfirstvar[cliqueidx]];
2362assert(newgubconsidx != currentgubconsidx);
2371GUBsetPrint(
scip, gubset, vars, solvals);
2401 int* nnoncovervars,
2424assert(vars !=
NULL);
2426assert(weights !=
NULL);
2427assert(capacity >= 0);
2428assert(solvals !=
NULL);
2429assert(covervars !=
NULL);
2430assert(noncovervars !=
NULL);
2431assert(ncovervars !=
NULL);
2432assert(nnoncovervars !=
NULL);
2433assert(coverweight !=
NULL);
2434assert(found !=
NULL);
2435assert(ntightened !=
NULL);
2436assert(fractional !=
NULL);
2451*fractional =
TRUE;
2462fixedonesweight = 0;
2465 for( j = 0; j <
nvars; j++ )
2470 if( weights[j] > capacity )
2473assert(!infeasible);
2481fixedones[nfixedones] = j;
2483fixedonesweight += weights[j];
2488fixedzeros[nfixedzeros] = j;
2497itemsweight += weights[j];
2500assert(nfixedones + nfixedzeros + nitems ==
nvars- (*ntightened));
2505assert(nitems >= 0);
2508*fractional =
FALSE;
2511assert(*fractional);
2529 for( j = 0; j < nitems; j++ )
2531transweights[j] = weights[items[j]];
2532transprofits[j] = 1.0 - solvals[items[j]];
2535transcapacity = fixedonesweight + itemsweight - capacity - 1;
2540 if( transcapacity < 0 )
2564 for( j = 0; j < nitems; j++ )
2566transprofits[j] *= weights[items[j]];
2578noncovervars, covervars, nnoncovervars, ncovervars,
NULL) );
2582 for( j = 0; j < *ncovervars; j++ )
2584(*coverweight) += weights[covervars[j]];
2588 for( j = 0; j < nfixedones; j++ )
2590covervars[*ncovervars] = fixedones[j];
2592(*coverweight) += weights[fixedones[j]];
2596 for( j = 0; j < nfixedzeros; j++ )
2598noncovervars[*nnoncovervars] = fixedzeros[j];
2601assert((*ncovervars) + (*nnoncovervars) ==
nvars- (*ntightened));
2602assert((*coverweight) > capacity);
2635assert(weights !=
NULL);
2636assert(covervars !=
NULL);
2637assert(ncovervars > 0);
2639minweight = weights[covervars[minweightidx]];
2642 for( i = 0; i < j; i++ )
2644assert(weights[covervars[i]] > minweight);
2645 if( weights[covervars[i]] <= minweight )
2650 for( i = 0; i < j; i++ )
2652assert(coverweight - weights[covervars[i]] <= capacity);
2653 if( coverweight - weights[covervars[i]] > capacity )
2679assert(ncovervars >= 0);
2680assert(solvals !=
NULL);
2681assert(covervars !=
NULL);
2682assert(varsC1 !=
NULL);
2683assert(varsC2 !=
NULL);
2684assert(nvarsC1 !=
NULL);
2685assert(nvarsC2 !=
NULL);
2689 for( j = 0; j < ncovervars; j++ )
2696varsC2[*nvarsC2] = covervars[j];
2702assert(
SCIPisLT(
scip, solvals[covervars[j]], 1.0));
2703varsC1[*nvarsC1] = covervars[j];
2707assert((*nvarsC1) + (*nvarsC2) == ncovervars);
2726assert(*nvarsC1 >= 0 && *nvarsC1 <= 1);
2727assert(*nvarsC2 > 0);
2733 for( j = 0; j < *nvarsC2; j++ )
2734sortkeysC2[j] = (
SCIP_Real) weights[varsC2[j]];
2738assert(*nvarsC2 == 1 || weights[varsC2[(*nvarsC2)-1]] <= weights[varsC2[(*nvarsC2)-2]]);
2739 while( *nvarsC1 < 2 && *nvarsC2 > 0 )
2741varsC1[*nvarsC1] = varsC2[(*nvarsC2)-1];
2766assert(*nvarsC1 >= 0 && *nvarsC1 <= 1);
2767assert(*nvarsC2 > 0);
2773 for( j = 0; j < *nvarsC2; j++ )
2774sortkeysC2[j] = (
SCIP_Real) weights[varsC2[j]];
2778assert(*nvarsC2 == 1 || weights[varsC2[(*nvarsC2)-1]] <= weights[varsC2[(*nvarsC2)-2]]);
2779varsC1[*nvarsC1] = varsC2[(*nvarsC2)-1];
2809assert(nnoncovervars >= 0);
2810assert(solvals !=
NULL);
2811assert(noncovervars !=
NULL);
2812assert(varsF !=
NULL);
2813assert(varsR !=
NULL);
2814assert(nvarsF !=
NULL);
2815assert(nvarsR !=
NULL);
2820 for( j = 0; j < nnoncovervars; j++ )
2825varsR[*nvarsR] = noncovervars[j];
2832varsF[*nvarsF] = noncovervars[j];
2836assert((*nvarsF) + (*nvarsR) == nnoncovervars);
2862assert(solvals !=
NULL);
2863assert(weights !=
NULL);
2864assert(varsF !=
NULL);
2865assert(varsC2 !=
NULL);
2866assert(varsR !=
NULL);
2867assert(nvarsF >= 0);
2868assert(nvarsC2 >= 0);
2869assert(nvarsR >= 0);
2883 for( j = 0; j < nvarsF; j++ )
2885sortkeypairsF[j] = &(sortkeypairsFstore[j]);
2886sortkeypairsF[j]->key1 = solvals[varsF[j]];
2887sortkeypairsF[j]->key2 = (
SCIP_Real) weights[varsF[j]];
2893 for( j = 0; j < nvarsC2; j++ )
2894sortkeysC2[j] = (
SCIP_Real) weights[varsC2[j]];
2899 for( j = 0; j < nvarsR; j++ )
2900sortkeysR[j] = (
SCIP_Real) weights[varsR[j]];
2950 int* ngubconscapexceed,
2951 int* maxgubvarssize
2959 int* nC1varsingubcons;
2967 intnvarsprocessed = 0;
2979assert(gubset !=
NULL);
2980assert(solvals !=
NULL);
2981assert(weights !=
NULL);
2982assert(varsC1 !=
NULL);
2983assert(varsC2 !=
NULL);
2984assert(varsF !=
NULL);
2985assert(varsR !=
NULL);
2986assert(nvarsC1 > 0);
2987assert(nvarsC2 >= 0);
2988assert(nvarsF >= 0);
2989assert(nvarsR >= 0);
2990assert(gubconsGC1 !=
NULL);
2991assert(gubconsGC2 !=
NULL);
2992assert(gubconsGFC1 !=
NULL);
2993assert(gubconsGR !=
NULL);
2994assert(ngubconsGC1 !=
NULL);
2995assert(ngubconsGC2 !=
NULL);
2996assert(ngubconsGFC1 !=
NULL);
2997assert(ngubconsGR !=
NULL);
2998assert(maxgubvarssize !=
NULL);
3039 for( j = 0; j < nvarsC1; j++ )
3042sortkeysC1[j] = (
SCIP_Real) weights[varsC1[j]];
3055 for( j = 0; j < nvarsF; j++ )
3067 for( j = 0; j < nvarsC2; j++ )
3070sortkeysC2[j] = (
SCIP_Real) weights[varsC2[j]];
3082 for( j = 0; j < nvarsR; j++ )
3085sortkeysR[j] = (
SCIP_Real) weights[varsR[j]];
3094assert(nvarsC1 > 0);
3118sortkeypairsGFC1[i] = &(sortkeypairsGFC1store[i]);
3119sortkeypairsGFC1[i]->key1 = 0.0;
3120sortkeypairsGFC1[i]->key2 = 0.0;
3126*ngubconscapexceed = 0;
3127*maxgubvarssize = 0;
3130 for( i = 0; i < gubset->
ngubconss; i++ )
3140 for( i = 0; i < nvarsC1; i++ )
3142 intnvarsC1capexceed;
3144nvarsC1capexceed = 0;
3150assert(gubconsidx >= 0 && gubconsidx <
ngubconss);
3156targetvar = gubset->
gubconss[gubconsidx]->
gubvars[nC1varsingubcons[gubconsidx]];
3158nC1varsingubcons[gubconsidx]++;
3172gubconswithF =
FALSE;
3190gubconswithF =
TRUE;
3192sortkeypairsGFC1[*ngubconsGFC1]->key1 += 1.0;
3194 if( solvals[gubset->
gubconss[gubconsidx]->
gubvars[j]] > sortkeypairsGFC1[*ngubconsGFC1]->key2 )
3195sortkeypairsGFC1[*ngubconsGFC1]->key2 = solvals[gubset->
gubconss[gubconsidx]->
gubvars[j]];
3206gubconsGC1[*ngubconsGC1] = gubconsidx;
3223 if( !gubconswithF )
3258assert(gubconswithF);
3261gubconsGFC1[*ngubconsGFC1] = gubconsidx;
3266gubconsGFC1[*ngubconsGFC1] = gubconsidx;
3275 for( i = 0; i < nvarsC2; i++ )
3281assert(gubconsidx >= 0 && gubconsidx <
ngubconss);
3283assert(varidx == 0);
3291gubconsGC2[*ngubconsGC2] = gubconsidx;
3307 for( i = 0; i < nvarsF; i++ )
3313assert(gubconsidx >= 0 && gubconsidx <
ngubconss);
3340sortkeypairsGFC1[*ngubconsGFC1]->key1 += 1.0;
3342 if( solvals[gubset->
gubconss[gubconsidx]->
gubvars[j]] > sortkeypairsGFC1[*ngubconsGFC1]->key2 )
3343sortkeypairsGFC1[*ngubconsGFC1]->key2 = solvals[gubset->
gubconss[gubconsidx]->
gubvars[j]];
3348gubconsGFC1[*ngubconsGFC1] = gubconsidx;
3359 for( i = 0; i < nvarsR; i++ )
3365assert(gubconsidx >= 0 && gubconsidx <
ngubconss);
3385gubconsGR[*ngubconsGR] = gubconsidx;
3392assert(nvarsprocessed == nvarsC1 + nvarsC2 + nvarsF + nvarsR);
3395(*ngubconscapexceed) =
ngubconss- (ngubconsGOC1 + (*ngubconsGC2) + (*ngubconsGFC1) + (*ngubconsGR));
3396assert(*ngubconscapexceed >= 0);
3409assert(check == *ngubconscapexceed);
3414 if( (*ngubconsGFC1) > 0 )
3416 SCIPsortDownPtrInt((
void**)sortkeypairsGFC1, gubconsGFC1, compSortkeypairs, (*ngubconsGFC1));
3435 int* minweightslen,
3436 int* minweightssize,
3442assert(minweightsptr !=
NULL);
3443assert(*minweightsptr !=
NULL);
3444assert(minweightslen !=
NULL);
3445assert(*minweightslen >= 0);
3446assert(minweightssize !=
NULL);
3447assert(*minweightssize >= 0);
3449 if( newlen > *minweightssize )
3456*minweightssize = newsize;
3458assert(newlen <= *minweightssize);
3461 for( j = *minweightslen; j < newlen; ++j )
3463*minweightslen = newlen;
3513assert(vars !=
NULL);
3514assert(
nvars>= 0);
3515assert(weights !=
NULL);
3516assert(capacity >= 0);
3517assert(solvals !=
NULL);
3518assert(varsM1 !=
NULL);
3519assert(varsM2 !=
NULL);
3520assert(varsF !=
NULL);
3521assert(varsR !=
NULL);
3522assert(nvarsM1 >= 0 && nvarsM1 <=
nvars- ntightened);
3523assert(nvarsM2 >= 0 && nvarsM2 <=
nvars- ntightened);
3524assert(nvarsF >= 0 && nvarsF <=
nvars- ntightened);
3525assert(nvarsR >= 0 && nvarsR <=
nvars- ntightened);
3526assert(nvarsM1 + nvarsM2 + nvarsF + nvarsR ==
nvars- ntightened);
3527assert(alpha0 >= 0);
3528assert(liftcoefs !=
NULL);
3529assert(cutact !=
NULL);
3530assert(liftrhs !=
NULL);
3533minweightssize = nvarsM1 + 1;
3544 for( j = 0; j < nvarsM1; j++ )
3546assert(liftcoefs[varsM1[j]] == 0);
3547liftcoefs[varsM1[j]] = 1;
3548sortkeys[j] = (
SCIP_Real) (weights[varsM1[j]]);
3549(*cutact) += solvals[varsM1[j]];
3561 for(
w= 1;
w<= nvarsM1;
w++ )
3562minweights[
w] = minweights[
w-1] + weights[varsM1[
w-1]];
3563minweightslen = nvarsM1 + 1;
3566fixedonesweight = 0;
3567 for( j = 0; j < nvarsM2; j++ )
3568fixedonesweight += weights[varsM2[j]];
3569assert(fixedonesweight >= 0);
3575 for( j = 0; j < nvarsF; j++ )
3583weight = weights[liftvar];
3584assert(liftvar >= 0 && liftvar <
nvars);
3591 if( capacity - fixedonesweight - weight < 0 )
3599 else if( minweights[*liftrhs] <= capacity - fixedonesweight - weight )
3612assert((*liftrhs) + 1 >= minweightslen || minweights[(*liftrhs) + 1] > capacity - fixedonesweight - weight);
3614right = (*liftrhs) + 1;
3615 while( left < right - 1 )
3617middle = (left + right) / 2;
3618assert(0 <= middle && middle < minweightslen);
3619 if( minweights[middle] <= capacity - fixedonesweight - weight )
3624assert(left == right - 1);
3625assert(0 <= left && left < minweightslen);
3626assert(minweights[left] <= capacity - fixedonesweight - weight );
3627assert(left == minweightslen - 1 || minweights[left+1] > capacity - fixedonesweight - weight);
3631assert(z <= *liftrhs);
3635liftcoef = (*liftrhs) - z;
3636liftcoefs[liftvar] = liftcoef;
3637assert(liftcoef >= 0 && liftcoef <= (*liftrhs) + 1);
3640 if( liftcoef == 0 )
3644(*cutact) += liftcoef * solvals[liftvar];
3658 for(
w= minweightslen - 1;
w>= 0;
w-- )
3663min =
MIN(minweights[
w], weight);
3664minweights[
w] = min;
3668assert(
w>= liftcoef);
3669min =
MIN(minweights[
w], minweights[
w- liftcoef] + weight);
3670minweights[
w] = min;
3674assert(minweights[0] == 0);
3677 for( j = 0; j < nvarsM2; j++ )
3687liftvar = varsM2[j];
3688weight = weights[liftvar];
3690assert(liftvar >= 0 && liftvar <
nvars);
3697right = minweightslen;
3698 while( left < right - 1 )
3700middle = (left + right) / 2;
3701assert(0 <= middle && middle < minweightslen);
3702 if( minweights[middle] <= capacity - fixedonesweight + weight )
3707assert(left == right - 1);
3708assert(0 <= left && left < minweightslen);
3709assert(minweights[left] <= capacity - fixedonesweight + weight );
3710assert(left == minweightslen - 1 || minweights[left+1] > capacity - fixedonesweight + weight);
3714assert(z >= *liftrhs);
3717liftcoef = z - (*liftrhs);
3718liftcoefs[liftvar] = liftcoef;
3719assert(liftcoef >= 0);
3722fixedonesweight -= weight;
3725(*liftrhs) += liftcoef;
3726assert(*liftrhs >= alpha0);
3729 if( liftcoef == 0 )
3733(*cutact) += liftcoef * solvals[liftvar];
3747 for(
w= minweightslen - 1;
w>= 0;
w-- )
3752min =
MIN(minweights[
w], weight);
3753minweights[
w] = min;
3757assert(
w>= liftcoef);
3758min =
MIN(minweights[
w], minweights[
w- liftcoef] + weight);
3759minweights[
w] = min;
3763assert(fixedonesweight == 0);
3764assert(*liftrhs >= alpha0);
3767 for( j = 0; j < nvarsR; j++ )
3775weight = weights[liftvar];
3776assert(liftvar >= 0 && liftvar <
nvars);
3779assert(capacity - weight >= 0);
3780assert((*liftrhs) + 1 >= minweightslen || minweights[(*liftrhs) + 1] > capacity - weight);
3785 if( minweights[*liftrhs] <= capacity - weight )
3798right = (*liftrhs) + 1;
3799 while( left < right - 1)
3801middle = (left + right) / 2;
3802assert(0 <= middle && middle < minweightslen);
3803 if( minweights[middle] <= capacity - weight )
3808assert(left == right - 1);
3809assert(0 <= left && left < minweightslen);
3810assert(minweights[left] <= capacity - weight );
3811assert(left == minweightslen - 1 || minweights[left+1] > capacity - weight);
3815assert(z <= *liftrhs);
3819liftcoef = (*liftrhs) - z;
3820liftcoefs[liftvar] = liftcoef;
3821assert(liftcoef >= 0 && liftcoef <= *liftrhs);
3824 if( liftcoef == 0 )
3828(*cutact) += liftcoef * solvals[liftvar];
3834 for(
w= *liftrhs;
w>= 0;
w-- )
3839min =
MIN(minweights[
w], weight);
3840minweights[
w] = min;
3844assert(
w>= liftcoef);
3845min =
MIN(minweights[
w], minweights[
w- liftcoef] + weight);
3846minweights[
w] = min;
3873 return(val1 + val2);
3895assert(unfinished[w2] == 0);
3896 for( w1 = 0; w1 < minweightslen; w1++ )
3897minweights[w1] = finished[w1];
3900 for( w2 = 1; w2 < minweightslen; w2++ )
3905 for( w1 = 0; w1 < minweightslen - w2; w1++ )
3910 if( temp <= minweights[w1+w2] )
3911minweights[w1+w2] = temp;
3935 intngubconscapexceed,
3989assert(gubset !=
NULL);
3992assert(gubset !=
NULL);
3998assert(vars !=
NULL);
3999assert(
nvars>= 0);
4000assert(weights !=
NULL);
4001assert(capacity >= 0);
4002assert(solvals !=
NULL);
4003assert(gubconsGC1 !=
NULL);
4004assert(gubconsGC2 !=
NULL);
4005assert(gubconsGFC1 !=
NULL);
4006assert(gubconsGR !=
NULL);
4007assert(ngubconsGC1 >= 0 && ngubconsGC1 <=
ngubconss- ngubconscapexceed);
4008assert(ngubconsGC2 >= 0 && ngubconsGC2 <=
ngubconss- ngubconscapexceed);
4009assert(ngubconsGFC1 >= 0 && ngubconsGFC1 <=
ngubconss- ngubconscapexceed);
4010assert(ngubconsGR >= 0 && ngubconsGR <=
ngubconss- ngubconscapexceed);
4011assert(alpha0 >= 0);
4012assert(liftcoefs !=
NULL);
4013assert(cutact !=
NULL);
4014assert(liftrhs !=
NULL);
4016minweightssize = ngubconsGC1+1;
4035 for( j = 0; j < ngubconsGC1; j++ )
4039gubconsGOC1[ngubconsGOC1] = gubconsGC1[j];
4045gubconsGNC1[ngubconsGNC1] = gubconsGC1[j];
4052assert(varidx >= 0 && varidx <
nvars);
4053assert(liftcoefs[varidx] == 0);
4055liftcoefs[varidx] = 1;
4056(*cutact) += solvals[varidx];
4060assert(ngubconsGOC1 + ngubconsGFC1 + ngubconsGC2 + ngubconsGR ==
ngubconss- ngubconscapexceed);
4061assert(ngubconsGOC1 + ngubconsGNC1 == ngubconsGC1);
4082assert(ngubconsGOC1 <= ngubconsGC1);
4084 for(
w= 1;
w<= ngubconsGOC1;
w++ )
4086liftgubconsidx = gubconsGOC1[
w-1];
4093assert(varidx >= 0 && varidx <
nvars);
4094assert(liftcoefs[varidx] == 1);
4096min = weights[varidx];
4097finished[
w] = finished[
w-1] + min;
4104assert(varidx >= 0 && varidx <
nvars);
4105assert(liftcoefs[varidx] == 1);
4106assert(weights[varidx] >= min);
4110 for(
w= ngubconsGOC1+1;
w<= ngubconsGC1;
w++ )
4118assert(ngubconsGNC1 <= ngubconsGC1);
4120 for(
w= 1;
w<= ngubconsGNC1;
w++ )
4122liftgubconsidx = gubconsGNC1[
w-1];
4129assert(varidx >= 0 && varidx <
nvars);
4130assert(liftcoefs[varidx] == 1);
4132min = weights[varidx];
4133unfinished[
w] = unfinished[
w-1] + min;
4140assert(varidx >= 0 && varidx <
nvars);
4141assert(liftcoefs[varidx] == 1);
4142assert(weights[varidx] >= min );
4146 for(
w= ngubconsGNC1 + 1;
w<= ngubconsGC1;
w++ )
4154assert(ngubconsGOC1 + ngubconsGNC1 == ngubconsGC1);
4156 for(
w= 1;
w<= ngubconsGC1;
w++ )
4158liftgubconsidx = gubconsGC1[
w-1];
4166assert(varidx >= 0 && varidx <
nvars);
4167assert(liftcoefs[varidx] == 1);
4169min = weights[varidx];
4170minweights[
w] = minweights[
w-1] + min;
4177assert(varidx >= 0 && varidx <
nvars);
4178assert(liftcoefs[varidx] == 1);
4179assert(weights[varidx] >= min);
4183minweightslen = ngubconsGC1 + 1;
4186fixedonesweight = 0;
4187 for( j = 0; j < ngubconsGC2; j++ )
4192assert(varidx >= 0 && varidx <
nvars);
4195fixedonesweight += weights[varidx];
4197assert(fixedonesweight >= 0);
4203 for( j = 0; j < ngubconsGFC1; j++ )
4205liftgubconsidx = gubconsGFC1[j];
4206assert(liftgubconsidx >= 0 && liftgubconsidx <
ngubconss);
4216assert(ngubconsGNC1 > 0);
4229weight = weights[liftgubvars[0]];
4231weightdiff2 = unfinished[ngubconsGNC1] - weight;
4233 for(
w= ngubconsGNC1-1;
w>= 1;
w-- )
4235weightdiff1 = weightdiff2;
4236weightdiff2 = unfinished[
w] - weight;
4238 if( unfinished[
w] < weightdiff1 )
4239unfinished[
w] = weightdiff1;
4247assert(minweights[0] == 0);
4268weight = weights[liftvar];
4270assert(liftvar >= 0 && liftvar <
nvars);
4271assert(capacity - weight >= 0);
4276liftgubvars[nliftgubvars] = liftvar;
4282 if( capacity - fixedonesweight - weight < 0 )
4290 else if( minweights[*liftrhs] <= capacity - fixedonesweight - weight )
4299assert((*liftrhs) + 1 >= minweightslen || minweights[(*liftrhs) + 1] > capacity - fixedonesweight - weight);
4301right = (*liftrhs) + 1;
4302 while( left < right - 1 )
4304middle = (left + right) / 2;
4305assert(0 <= middle && middle < minweightslen);
4306 if( minweights[middle] <= capacity - fixedonesweight - weight )
4311assert(left == right - 1);
4312assert(0 <= left && left < minweightslen);
4313assert(minweights[left] <= capacity - fixedonesweight - weight);
4314assert(left == minweightslen - 1 || minweights[left+1] > capacity - fixedonesweight - weight);
4318assert(z <= *liftrhs);
4322liftcoef = (*liftrhs) - z;
4323liftcoefs[liftvar] = liftcoef;
4324assert(liftcoef >= 0 && liftcoef <= (*liftrhs) + 1);
4327(*cutact) += liftcoef * solvals[liftvar];
4330sumliftcoef += liftcoefs[liftvar];
4336assert(nliftgubvars > nliftgubC1);
4342 if( sumliftcoef == 0 )
4346weight = weights[liftgubvars[0]];
4351 for(
w= minweightslen-1;
w>= 1;
w-- )
4356finished[
w] =
MIN(finished[
w], tmpval);
4359minweights[
w] =
MIN(minweights[
w], tmpval);
4374tmplen = minweightslen;
4375tmpsize = minweightssize;
4377tmplen = minweightslen;
4378tmpsize = minweightssize;
4392 for(
w= minweightslen-1;
w>= 0;
w-- )
4397 for( k = 0; k < nliftgubvars; k++ )
4399liftcoef = liftcoefs[liftgubvars[k]];
4400weight = weights[liftgubvars[k]];
4404minfinished =
MIN(finished[
w], weight);
4405minminweight =
MIN(minweights[
w], weight);
4407finished[
w] = minfinished;
4408minweights[
w] = minminweight;
4414assert(
w>= liftcoef);
4417minfinished =
MIN(finished[
w], tmpval);
4420minminweight =
MIN(minweights[
w], tmpval);
4422finished[
w] = minfinished;
4423minweights[
w] = minminweight;
4427assert(minweights[0] == 0);
4429assert(ngubconsGNC1 == 0);
4436 for( j = 0; j < ngubconsGC2; j++ )
4438liftgubconsidx = gubconsGC2[j];
4440assert(liftgubconsidx >=0 && liftgubconsidx <
ngubconss);
4446weight = weights[liftvar];
4448assert(liftvar >= 0 && liftvar <
nvars);
4456right = minweightslen;
4457 while( left < right - 1 )
4459middle = (left + right) / 2;
4460assert(0 <= middle && middle < minweightslen);
4461 if( minweights[middle] <= capacity - fixedonesweight + weight )
4466assert(left == right - 1);
4467assert(0 <= left && left < minweightslen);
4468assert(minweights[left] <= capacity - fixedonesweight + weight);
4469assert(left == minweightslen - 1 || minweights[left + 1] > capacity - fixedonesweight + weight);
4473assert(z >= *liftrhs);
4476liftcoef = z - (*liftrhs);
4477liftcoefs[liftvar] = liftcoef;
4478assert(liftcoef >= 0);
4481fixedonesweight -= weight;
4484(*liftrhs) += liftcoef;
4485assert(*liftrhs >= alpha0);
4488 if( liftcoef == 0 )
4492(*cutact) += liftcoef * solvals[liftvar];
4506 for(
w= minweightslen - 1;
w>= 0;
w-- )
4510min =
MIN(minweights[
w], weight);
4511minweights[
w] = min;
4517assert(
w>= liftcoef);
4520min =
MIN(minweights[
w], tmpval);
4521minweights[
w] = min;
4525assert(fixedonesweight == 0);
4526assert(*liftrhs >= alpha0);
4529 for( j = 0; j < ngubconsGR; j++ )
4531liftgubconsidx = gubconsGR[j];
4533assert(liftgubconsidx >=0 && liftgubconsidx <
ngubconss);
4543weight = weights[liftvar];
4545assert(liftvar >= 0 && liftvar <
nvars);
4546assert(capacity - weight >= 0);
4547assert((*liftrhs) + 1 >= minweightslen || minweights[(*liftrhs) + 1] > capacity - weight);
4552liftgubvars[nliftgubvars] = liftvar;
4558 if( minweights[*liftrhs] <= capacity - weight )
4567right = (*liftrhs) + 1;
4568 while( left < right - 1 )
4570middle = (left + right) / 2;
4571assert(0 <= middle && middle < minweightslen);
4572 if( minweights[middle] <= capacity - weight )
4577assert(left == right - 1);
4578assert(0 <= left && left < minweightslen);
4579assert(minweights[left] <= capacity - weight);
4580assert(left == minweightslen - 1 || minweights[left + 1] > capacity - weight);
4584assert(z <= *liftrhs);
4587liftcoef = (*liftrhs) - z;
4588liftcoefs[liftvar] = liftcoef;
4589assert(liftcoef >= 0 && liftcoef <= (*liftrhs) + 1);
4592(*cutact) += liftcoef * solvals[liftvar];
4595sumliftcoef += liftcoefs[liftvar];
4600assert(nliftgubvars >= 1);
4603 if( sumliftcoef == 0 )
4609 for(
w= *liftrhs;
w>= 0;
w-- )
4611 for( k = 0; k < nliftgubvars; k++ )
4613liftcoef = liftcoefs[liftgubvars[k]];
4614weight = weights[liftgubvars[k]];
4618min =
MIN(minweights[
w], weight);
4619minweights[
w] = min;
4625assert(
w>= liftcoef);
4628min =
MIN(minweights[
w], tmpval);
4629minweights[
w] = min;
4633assert(minweights[0] == 0);
4692assert(vars !=
NULL);
4693assert(
nvars>= 0);
4694assert(weights !=
NULL);
4695assert(capacity >= 0);
4696assert(solvals !=
NULL);
4697assert(covervars !=
NULL);
4698assert(noncovervars !=
NULL);
4699assert(ncovervars > 0 && ncovervars <=
nvars);
4700assert(nnoncovervars >= 0 && nnoncovervars <=
nvars- ntightened);
4701assert(ncovervars + nnoncovervars ==
nvars- ntightened);
4702assert(liftcoefs !=
NULL);
4703assert(cutact !=
NULL);
4718 for( j = 0; j < ncovervars; j++ )
4720assert(liftcoefs[covervars[j]] == 0.0);
4721liftcoefs[covervars[j]] = 1.0;
4722sortkeys[j] = (
SCIP_Real) weights[covervars[j]];
4723(*cutact) += solvals[covervars[j]];
4728lambda = coverweight - capacity;
4732maxweightsums[0] = 0;
4733 for(
h= 1;
h<= ncovervars;
h++ )
4735maxweightsums[
h] = maxweightsums[
h-1] + weights[covervars[
h-1]];
4736intervalends[
h-1] = maxweightsums[
h] - lambda;
4737rhos[
h-1] =
MAX(0, weights[covervars[
h-1]] - weights[covervars[0]] + lambda);
4741 for( j = 0; j < nnoncovervars; j++ )
4742sortkeys[j] = (
SCIP_Real) (weights[noncovervars[j]]);
4747 for( j = 0; j < nnoncovervars; j++ )
4753liftvar = noncovervars[j];
4754weight = weights[liftvar];
4756 while( intervalends[
h] < weight )
4763 if( weight <= intervalends[
h-1] + rhos[
h] )
4767tmp1 = (
SCIP_Real) (intervalends[
h-1] + rhos[
h] - weight);
4769liftcoef =
h- ( tmp1 / tmp2 );
4776assert(liftcoefs[liftvar] == 0.0);
4777liftcoefs[liftvar] = liftcoef;
4780(*cutact) += liftcoef * solvals[liftvar];
4808 int* nonmincovervars,
4810 intnnonmincovervars,
4829assert( cutoff !=
NULL);
4845assert(nvarsC1 + nvarsC2 == nmincovervars);
4846assert(nmincovervars > 0);
4847assert(nvarsC1 >= 0);
4850 if( nvarsC1 < 2 && nvarsC2 > 0)
4853assert(nvarsC1 >= 1);
4855assert(nvarsC2 == 0 || nvarsC1 >= 1);
4862assert(nvarsF + nvarsR == nnonmincovervars);
4863assert(nvarsC1 + nvarsC2 + nvarsF + nvarsR ==
nvars- ntightened);
4866 if( gubset ==
NULL)
4885varsF, varsR, nvarsC1, nvarsC2, nvarsF, nvarsR, nvarsC1 - 1, liftcoefs, &cutact, &liftrhs) );
4922nvarsC2, nvarsF, nvarsR, gubconsGC1, gubconsGC2, gubconsGFC1, gubconsGR, &ngubconsGC1, &ngubconsGC2,
4923&ngubconsGFC1, &ngubconsGR, &nconstightened, &maxgubvarssize) );
4939gubconsGC2, gubconsGFC1, gubconsGR, ngubconsGC1, ngubconsGC2, ngubconsGFC1, ngubconsGR,
4940 MIN(nvarsC1 - 1, ngubconsGC1), liftcoefs, &cutact, &liftrhs, maxgubvarssize) );
4957assert( cons ==
NULL|| sepa ==
NULL);
4965 else if( sepa !=
NULL)
4978assert(nvarsC1 + nvarsC2 + nvarsF + nvarsR ==
nvars- ntightened);
4979 for( j = 0; j < nvarsC1; j++ )
4983 for( j = 0; j < nvarsC2; j++ )
4985 if( liftcoefs[varsC2[j]] > 0 )
4990 for( j = 0; j < nvarsF; j++ )
4992 if( liftcoefs[varsF[j]] > 0 )
4997 for( j = 0; j < nvarsR; j++ )
4999 if( liftcoefs[varsR[j]] > 0 )
5042 int* nonfeassetvars,
5044 intnnonfeassetvars,
5063assert( cutoff !=
NULL);
5079assert(nvarsT1 + nvarsT2 == nfeassetvars);
5082 if( nvarsT1 == 0 && nvarsT2 > 0)
5085assert(nvarsT1 == 1);
5087assert(nvarsT2 == 0 || nvarsT1 > 0);
5094assert(nvarsF + nvarsR == nnonfeassetvars);
5095assert(nvarsT1 + nvarsT2 + nvarsF + nvarsR ==
nvars- ntightened);
5114 SCIP_CALL(
sequentialUpAndDownLifting(
scip, vars,
nvars, ntightened, weights, capacity, solvals, varsT1, varsT2, varsF, varsR,
5115nvarsT1, nvarsT2, nvarsF, nvarsR, nvarsT1, liftcoefs, &cutact, &liftrhs) );
5124assert( cons ==
NULL|| sepa ==
NULL);
5132 else if( sepa !=
NULL)
5145assert(nvarsT1 + nvarsT2 + nvarsF + nvarsR ==
nvars- ntightened);
5146 for( j = 0; j < nvarsT1; j++ )
5150 for( j = 0; j < nvarsT2; j++ )
5152 if( liftcoefs[varsT2[j]] > 0 )
5157 for( j = 0; j < nvarsF; j++ )
5159 if( liftcoefs[varsF[j]] > 0 )
5164 for( j = 0; j < nvarsR; j++ )
5166 if( liftcoefs[varsR[j]] > 0 )
5209 int* nonmincovervars,
5211 intnnonmincovervars,
5222assert( cutoff !=
NULL);
5240nonmincovervars, nmincovervars, nnonmincovervars, mincoverweight, realliftcoefs, &cutact) );
5241liftrhs = nmincovervars - 1;
5251assert( cons ==
NULL|| sepa ==
NULL);
5259 else if( sepa !=
NULL)
5272assert(nmincovervars + nnonmincovervars ==
nvars- ntightened);
5273 for( j = 0; j < nmincovervars; j++ )
5277 for( j = 0; j < nnonmincovervars; j++ )
5320 int* nnoncovervars,
5334assert(covervars !=
NULL);
5335assert(noncovervars !=
NULL);
5336assert(ncovervars !=
NULL);
5337assert(*ncovervars > 0);
5338assert(nnoncovervars !=
NULL);
5339assert(*nnoncovervars >= 0);
5340assert(coverweight !=
NULL);
5341assert(*coverweight > 0);
5342assert(*coverweight > capacity);
5346nsortkeypairs = *ncovervars;
5355assert(*ncovervars == nsortkeypairs);
5358 for( j = 0; j < *ncovervars; j++ )
5361sortkeypairssorted[j] = sortkeypairs[j];
5363sortkeypairs[j]->key1 = solvals[covervars[j]];
5364sortkeypairs[j]->key2 = (
SCIP_Real) weights[covervars[j]];
5369 for( j = 0; j < *ncovervars; j++ )
5372sortkeypairssorted[j] = sortkeypairs[j];
5374sortkeypairs[j]->key1 = (solvals[covervars[j]] - 1.0) / ((
SCIP_Real) weights[covervars[j]]);
5375sortkeypairs[j]->key2 = (
SCIP_Real) (-weights[covervars[j]]);
5378 SCIPsortPtrInt((
void**)sortkeypairssorted, covervars, compSortkeypairs, *ncovervars);
5382minweight = weights[covervars[minweightidx]];
5383 for( j = 1; j < *ncovervars; j++ )
5385 if( weights[covervars[j]] <= minweight )
5388minweight = weights[covervars[minweightidx]];
5391assert(minweightidx >= 0 && minweightidx < *ncovervars);
5392assert(minweight > 0 && minweight <= *coverweight);
5396 while( j < *ncovervars && ((*coverweight) - minweight > capacity) )
5398assert(minweightidx >= j);
5399assert(
checkMinweightidx(weights, capacity, covervars, *ncovervars, *coverweight, minweightidx, j));
5402 if( (*coverweight) - weights[covervars[j]] <= capacity )
5409noncovervars[*nnoncovervars] = covervars[j];
5413(*coverweight) -= weights[covervars[j]];
5414 for( k = j; k < (*ncovervars) - 1; k++ )
5415covervars[k] = covervars[k+1];
5419 if( j == minweightidx )
5422minweight = weights[covervars[minweightidx]];
5423 for( k = 1; k < *ncovervars; k++ )
5425 if( weights[covervars[k]] <= minweight )
5428minweight = weights[covervars[minweightidx]];
5431assert(minweight > 0 && minweight <= *coverweight);
5432assert(minweightidx >= 0 && minweightidx < *ncovervars);
5436assert(minweightidx > j);
5441assert((*coverweight) > capacity);
5442assert((*coverweight) - minweight <= capacity);
5445 for( j = nsortkeypairs-1; j >= 0; j-- )
5474 int* nnoncovervars,
5487assert(covervars !=
NULL);
5488assert(noncovervars !=
NULL);
5489assert(ncovervars !=
NULL);
5490assert(*ncovervars > 0);
5491assert(nnoncovervars !=
NULL);
5492assert(*nnoncovervars >= 0);
5493assert(coverweight !=
NULL);
5494assert(*coverweight > 0);
5495assert(*coverweight > capacity);
5496assert(*ncovervars + *nnoncovervars ==
nvars- ntightened);
5497assert(cutoff !=
NULL);
5511 for( j = 0; j < *ncovervars; j++ )
5513sortkeys[j] = solvals[covervars[j]];
5519 for( j = 0; j < *ncovervars; j++ )
5521sortkeys[j] = (solvals[covervars[j]] - 1.0) / ((
SCIP_Real) weights[covervars[j]]);
5529 while( *ncovervars >= 2 )
5532noncovervars[*nnoncovervars] = covervars[0];
5536(*coverweight) -= weights[covervars[0]];
5537 for( k = 0; k < (*ncovervars) - 1; k++ )
5538covervars[k] = covervars[k+1];
5541assert(*ncovervars + *nnoncovervars ==
nvars- ntightened);
5542 if( (*coverweight) <= capacity )
5545covervars, noncovervars, *ncovervars, *nnoncovervars, sol, cutoff, ncuts) );
5586assert(capacity >= 0);
5587assert(cutoff !=
NULL);
5588assert(ncuts !=
NULL);
5595assert(vars !=
NULL);
5597assert(weights !=
NULL);
5617 SCIPdebugMsg(
scip,
"separate cuts for knapsack constraint originated by cons <%s>:\n",
5619 for( i = 0; i <
nvars; ++i )
5648modtransused =
TRUE;
5650&nnoncovervars, &coverweight, &coverfound, modtransused, &ntightened, &fractional) );
5652assert(!coverfound || !fractional || ncovervars + nnoncovervars ==
nvars- ntightened);
5657 SCIPdebugMsg(
scip,
" LMCI1-GUB terminated by no variable with fractional LP value.\n");
5672&nnoncovervars, &coverweight, modtransused) );
5679solvals, covervars, noncovervars, ncovervars, nnoncovervars, sol, gubset, cutoff, ncuts) );
5687solvals, covervars, noncovervars, ncovervars, nnoncovervars, sol,
NULL, cutoff, ncuts) );
5707modtransused =
TRUE;
5709&nnoncovervars, &coverweight, &coverfound, modtransused, &ntightened, &fractional) );
5710assert(!coverfound || !fractional || ncovervars + nnoncovervars ==
nvars- ntightened);
5723&nnoncovervars, &coverweight, modtransused) );
5727solvals, covervars, noncovervars, ncovervars, nnoncovervars, sol,
NULL, cutoff, ncuts) );
5734solvals, covervars, noncovervars, ncovervars, nnoncovervars, coverweight, sol, cutoff, ncuts) );
5749modtransused =
FALSE;
5751&nnoncovervars, &coverweight, &coverfound, modtransused, &ntightened, &fractional) );
5753assert(!coverfound || ncovervars + nnoncovervars ==
nvars- ntightened);
5762 SCIP_CALL(
getFeasibleSet(
scip, cons, sepa, vars,
nvars, ntightened, weights, capacity, solvals, covervars, noncovervars,
5763&ncovervars, &nnoncovervars, &coverweight, modtransused, sol, cutoff, ncuts) );
5810assert(nknapvars > 0);
5811assert(knapvars !=
NULL);
5812assert(cutoff !=
NULL);
5826 if( nbinvars == 0 )
5835 if( conshdlr ==
NULL)
5837noknapsackconshdlr =
TRUE;
5845noknapsackconshdlr =
FALSE;
5847assert(conshdlrdata !=
NULL);
5848usegubs = conshdlrdata->usegubs;
5855 if( conshdlrdata->reals1size == 0 )
5858conshdlrdata->reals1size = 1;
5859conshdlrdata->reals1[0] = 0.0;
5862assert(conshdlrdata->reals1size > 0);
5868 if( conshdlrdata->reals1size < nbinvars )
5870 intoldsize = conshdlrdata->reals1size;
5872conshdlrdata->reals1size = nbinvars;
5874 BMSclearMemoryArray(&(conshdlrdata->reals1[oldsize]), conshdlrdata->reals1size - oldsize);
5876binvals = conshdlrdata->reals1;
5880 for( tmp = nbinvars - 1; tmp >= 0; --tmp )
5882assert(binvals[tmp] == 0);
5900 for( i = 0; i < nknapvars; i++ )
5917 SCIPdebugMsg(
scip,
"Solution value %.15g <%s> outside domain [0.0, 1.0]\n",
5923 if( !noknapsackconshdlr )
5925assert(tmpindices !=
NULL);
5932 else if( valscale * knapvals[i] > 0.0 )
5951 for( j = 0; j < nvlb; j++ )
5962 SCIPdebugMsg(
scip,
"variable bound <%s>[%g,%g] >= %g<%s>[%g,%g] + %g implies local cutoff\n",
5982 if( bestlbtype == -1 )
5984rhs -= valscale * knapvals[i] * bestlbsol;
5985 SCIPdebugMsg(
scip,
" -> non-binary variable %+.15g<%s>(%.15g) replaced with lower bound %.15g (rhs=%.15g)\n",
5991rhs -= valscale * knapvals[i] * dvlb[bestlbtype];
5992binvals[
SCIPvarGetProbindex(zvlb[bestlbtype])] += valscale * knapvals[i] * bvlb[bestlbtype];
5997 if( !noknapsackconshdlr )
5999assert(tmpindices !=
NULL);
6004 SCIPdebugMsg(
scip,
" -> non-binary variable %+.15g<%s>(%.15g) replaced with variable lower bound %+.15g<%s>(%.15g) %+.15g (rhs=%.15g)\n",
6020assert(valscale * knapvals[i] < 0.0);
6031 for( j = 0; j < nvub; j++ )
6042 SCIPdebugMsg(
scip,
"variable bound <%s>[%g,%g] <= %g<%s>[%g,%g] + %g implies local cutoff\n",
6062 if( bestubtype == -1 )
6064rhs -= valscale * knapvals[i] * bestubsol;
6065 SCIPdebugMsg(
scip,
" -> non-binary variable %+.15g<%s>(%.15g) replaced with upper bound %.15g (rhs=%.15g)\n",
6071rhs -= valscale * knapvals[i] * dvub[bestubtype];
6072binvals[
SCIPvarGetProbindex(zvub[bestubtype])] += valscale * knapvals[i] * bvub[bestubtype];
6077 if( !noknapsackconshdlr )
6079assert(tmpindices !=
NULL);
6084 SCIPdebugMsg(
scip,
" -> non-binary variable %+.15g<%s>(%.15g) replaced with variable upper bound %+.15g<%s>(%.15g) %+.15g (rhs=%.15g)\n",
6113rhs = rhs * intscalar;
6118 for( i = 0; i < nbinvars; i++ )
6148consvals[nconsvars] = val;
6149consvars[nconsvars] = var;
6153 if( nconsvars > 0 )
6157assert(consvars !=
NULL);
6158assert(consvals !=
NULL);
6167 for( i = 0; i < nconsvars; ++i )
6174capacity, rhs, act, minact, maxact);
6178 if( minact > capacity )
6180 SCIPdebugMsg(
scip,
"minactivity of knapsack relaxation implies local cutoff\n");
6185 if( maxact > capacity )
6188 SCIP_CALL(
SCIPseparateKnapsackCuts(
scip, cons, sepa, consvars, nconsvars, consvals, capacity, sol, usegubs, cutoff, ncuts) );
6194 if( noknapsackconshdlr)
6201 for( --tmp; tmp >= 0; --tmp)
6203assert(tmpindices !=
NULL);
6204binvals[tmpindices[tmp]] = 0;
6229assert(ncuts !=
NULL);
6230assert(cutoff !=
NULL);
6234assert(consdata !=
NULL);
6247 else if( sepacuts )
6250consdata->capacity, sol, usegubs, cutoff, ncuts) );
6268assert(consdata !=
NULL);
6273 if( consdata->row !=
NULL)
6282consdata->capacity -= weight;
6293consdata->vars[consdata->nvars] = var;
6294consdata->weights[consdata->nvars] = weight;
6309assert(conshdlrdata !=
NULL);
6312conshdlrdata->eventhdlr, consdata->eventdata[consdata->nvars-1],
6313&consdata->eventdata[consdata->nvars-1]->filterpos) );
6316consdata->existmultaggr =
TRUE;
6320consdata->presolvedtiming = 0;
6321consdata->cliquesadded =
FALSE;
6327consdata->sorted =
FALSE;
6328consdata->cliquepartitioned =
FALSE;
6329consdata->negcliquepartitioned =
FALSE;
6330consdata->merged =
FALSE;
6348assert(consdata !=
NULL);
6349assert(0 <= pos && pos < consdata->
nvars);
6351var = consdata->vars[pos];
6352assert(var !=
NULL);
6356 if( consdata->row !=
NULL)
6370assert(conshdlrdata !=
NULL);
6372conshdlrdata->eventhdlr, consdata->eventdata[pos], consdata->eventdata[pos]->filterpos) );
6376consdata->presolvedtiming = 0;
6377consdata->sorted = (consdata->sorted && pos == consdata->nvars - 1);
6384consdata->vars[pos] = consdata->vars[consdata->nvars-1];
6385consdata->weights[pos] = consdata->weights[consdata->nvars-1];
6386 if( consdata->eventdata !=
NULL)
6387consdata->eventdata[pos] = consdata->eventdata[consdata->nvars-1];
6393 if( consdata->cliquepartitioned )
6395assert(consdata->cliquepartition !=
NULL);
6398 if( consdata->cliquepartition[consdata->nvars - 1] != consdata->nvars - 1 )
6402oldcliqenum = consdata->cliquepartition[pos];
6403consdata->cliquepartition[pos] = consdata->cliquepartition[consdata->nvars-1];
6406 if( consdata->cliquepartition[pos] > pos )
6407consdata->cliquepartitioned =
FALSE;
6411 intcliquenumbefore;
6415 if( oldcliqenum > consdata->cliquepartition[pos] )
6417 for( i = 0; i < consdata->nvars; ++i )
6418 if( oldcliqenum == consdata->cliquepartition[i] )
6420 else if( oldcliqenum < consdata->cliquepartition[i] )
6422consdata->cliquepartitioned =
FALSE;
6428 if( i == consdata->nvars )
6429--(consdata->ncliques);
6433 else if( oldcliqenum < consdata->cliquepartition[pos] )
6435cliquenumbefore = consdata->cliquepartition[pos] - 1;
6436 for( i = pos - 1; i >= 0 && i >= cliquenumbefore && consdata->cliquepartition[i] < cliquenumbefore; --i );
6438 if( i < cliquenumbefore )
6439consdata->cliquepartitioned =
FALSE;
6442 else if( pos == consdata->nvars - 1)
6444cliquenumbefore = consdata->cliquepartition[pos];
6445 for( i = pos - 1; i >= 0 && i >= cliquenumbefore && consdata->cliquepartition[i] < cliquenumbefore; --i );
6447 if( i < cliquenumbefore )
6448--(consdata->ncliques);
6454--(consdata->ncliques);
6457 if( consdata->negcliquepartitioned )
6459assert(consdata->negcliquepartition !=
NULL);
6462 if( consdata->negcliquepartition[consdata->nvars-1] != consdata->nvars - 1 )
6466oldcliqenum = consdata->negcliquepartition[pos];
6467consdata->negcliquepartition[pos] = consdata->negcliquepartition[consdata->nvars-1];
6470 if( consdata->negcliquepartition[pos] > pos )
6471consdata->negcliquepartitioned =
FALSE;
6475 intcliquenumbefore;
6479 if( oldcliqenum > consdata->negcliquepartition[pos] )
6481 for( i = 0; i < consdata->nvars; ++i )
6482 if( oldcliqenum == consdata->negcliquepartition[i] )
6484 else if( oldcliqenum < consdata->negcliquepartition[i] )
6486consdata->negcliquepartitioned =
FALSE;
6492 if( i == consdata->nvars )
6493--(consdata->nnegcliques);
6497 else if( oldcliqenum < consdata->negcliquepartition[pos] )
6499cliquenumbefore = consdata->negcliquepartition[pos] - 1;
6500 for( i = pos - 1; i >= 0 && i >= cliquenumbefore && consdata->negcliquepartition[i] < cliquenumbefore; --i );
6502 if( i < cliquenumbefore )
6503consdata->negcliquepartitioned =
FALSE;
6506 else if( pos == consdata->nvars - 1)
6508cliquenumbefore = consdata->negcliquepartition[pos];
6509 for( i = pos - 1; i >= 0 && i >= cliquenumbefore && consdata->negcliquepartition[i] < cliquenumbefore; --i );
6511 if( i < cliquenumbefore )
6512--(consdata->nnegcliques);
6518--(consdata->nnegcliques);
6521--(consdata->nvars);
6537assert(consdata !=
NULL);
6539 for( v = consdata->nvars-1; v >= 0; --v )
6541 if( consdata->weights[v] == 0 )
6564assert(conshdlr !=
NULL);
6565assert(conss !=
NULL);
6566assert(nconss >= 0);
6570 for( i = 0; i < nconss; i++ )
6575 if( consdata->varsdeleted )
6578 for( v = consdata->nvars - 1; v >= 0; --v )
6585consdata->varsdeleted =
FALSE;
6605assert(cons !=
NULL);
6606assert(cutoff !=
NULL);
6609assert(consdata !=
NULL);
6613 if( consdata->merged )
6616 if( consdata->nvars <= 1 )
6618consdata->merged =
TRUE;
6622assert(consdata->vars !=
NULL|| consdata->nvars == 0);
6626consdata->cliquepartition, consdata->negcliquepartition, SCIPvarCompActiveAndNegated, consdata->nvars);
6629consdata->sorted =
FALSE;
6631v = consdata->nvars - 1;
6644var1 = consdata->vars[v];
6652assert(var1 !=
NULL);
6654var2 = consdata->vars[prev];
6662assert(var2 !=
NULL);
6667 if( negated1 == negated2 )
6670 consdataChgWeight(consdata, prev, consdata->weights[v] + consdata->weights[prev]);
6676 else if( consdata->weights[v] == consdata->weights[prev] )
6679consdata->capacity -= consdata->weights[v];
6685 else if( consdata->weights[v] < consdata->weights[prev] )
6687consdata->capacity -= consdata->weights[v];
6688 consdataChgWeight(consdata, prev, consdata->weights[prev] - consdata->weights[v]);
6689assert(consdata->weights[prev] > 0);
6694consdata->capacity -= consdata->weights[prev];
6695 consdataChgWeight(consdata, v, consdata->weights[v] - consdata->weights[prev]);
6696assert(consdata->weights[v] > 0);
6699 if( consdata->nvars != v )
6703 if( prev == 0 || (var1 != consdata->vars[prev - 1] && var1 !=
SCIPvarGetNegatedVar(consdata->vars[prev - 1])) )
6707consdata->cliquesadded =
FALSE;
6714consdata->cliquesadded =
FALSE;
6720consdata->merged =
TRUE;
6723 if( consdata->onesweightsum > consdata->capacity )
6770assert(consdata !=
NULL);
6772 nvars= consdata->nvars;
6773vars = consdata->vars;
6785 for( v = 0; v <
nvars; ++v )
6791assert(var !=
NULL);
6799applicable =
FALSE;
6828items, solitems, nonsolitems, &nsolitems, &nnonsolitems, &solval, &success) );
6835 for( v = 0; v < nsolitems; ++v )
6837var = vars[solitems[v]];
6838assert(var !=
NULL);
6840 SCIPdebugMsg(
scip,
"variable <%s> only locked up in knapsack constraints: dual presolve <%s>[%.15g,%.15g] >= 1.0\n",
6843assert(!infeasible);
6848 for( v = 0; v < nnonsolitems; ++v )
6850var = vars[nonsolitems[v]];
6851assert(var !=
NULL);
6853 SCIPdebugMsg(
scip,
"variable <%s> has no down locks: dual presolve <%s>[%.15g,%.15g] <= 0.0\n",
6856assert(!infeasible);
6898assert(cons !=
NULL);
6899assert(conshdlrdata !=
NULL);
6902assert(consdata !=
NULL);
6904 nvars= consdata->nvars;
6916 if( nobjvars == 0 )
6919vars = consdata->vars;
6920assert(vars !=
NULL);
6926 for( v = 0; v <
nvars&& applicable; ++v )
6930assert(var !=
NULL);
6936assert(var !=
NULL);
6943applicable =
FALSE;
6948weight = (
SCIP_Real)consdata->weights[v];
6955scale = weight / -objval;
6962applicable =
FALSE;
6967scale = weight / objval;
6969 else if( !
SCIPisEQ(
scip, objval * scale, weight) )
6970applicable =
FALSE;
6984cutoffbound = (consdata->capacity - offset) / scale;
6986 SCIPdebugMsg(
scip,
"constraint <%s> is parallel to objective function and provids a cutoff bound <%g>\n",
6994 SCIPdebugMsg(
scip,
"constraint <%s> is parallel to objective function and provids a cutoff bound <%g>\n",
7020lowerbound = (consdata->capacity - offset) / scale;
7022 SCIPdebugMsg(
scip,
"constraint <%s> is parallel to objective function and provids a lower bound <%g>\n",
7040 int* cliquestartposs,
7047 int* cliquepartition;
7059assert(consdata !=
NULL);
7060assert(vars !=
NULL);
7061assert(weights !=
NULL);
7062assert(cliquestartposs !=
NULL);
7064origweights = consdata->weights;
7065origvars = consdata->vars;
7066norigvars = consdata->nvars;
7068assert(origvars !=
NULL|| norigvars == 0);
7069assert(origweights !=
NULL|| norigvars == 0);
7071 if( norigvars == 0 )
7074 if( usenegatedclique )
7076assert(consdata->negcliquepartitioned);
7078cliquepartition = consdata->negcliquepartition;
7079ncliques = consdata->nnegcliques;
7083assert(consdata->cliquepartitioned);
7085cliquepartition = consdata->cliquepartition;
7086ncliques = consdata->ncliques;
7089assert(cliquepartition !=
NULL);
7090assert(ncliques > 0);
7097 for( v = norigvars - 1; v >= 0; --v )
7099assert(0 <= cliquepartition[v] && cliquepartition[v] < ncliques);
7100++(cliquecount[cliquepartition[v]]);
7114 for( c = 0; c < ncliques; ++c )
7123varpointers[c] = (
SCIP_VAR**) (vars + nextpos);
7124cliquestartposs[c] = nextpos;
7125weightpointers[c] = (
SCIP_Longint*) (weights + nextpos);
7126assert(cliquecount[c] > 0);
7127nextpos += cliquecount[c];
7128assert(nextpos > 0);
7130assert(nextpos == norigvars);
7131cliquestartposs[c] = nextpos;
7134 for( v = 0; v < norigvars; ++v )
7136*(varpointers[cliquepartition[v]]) = origvars[v];
7137++(varpointers[cliquepartition[v]]);
7138*(weightpointers[cliquepartition[v]]) = origweights[v];
7139++(weightpointers[cliquepartition[v]]);
7142 for( v = 0; v < norigvars; ++v )
7144assert(vars[v] !=
NULL);
7145assert(weights[v] > 0);
7171assert(cons !=
NULL);
7174assert(consdata !=
NULL);
7175assert(consdata->nvars == 0 || consdata->vars !=
NULL);
7177 if( cutoff !=
NULL)
7184 if( consdata->onesweightsum > consdata->capacity )
7188 if( cutoff !=
NULL)
7195consdata->existmultaggr =
FALSE;
7198 while( v < consdata->
nvars)
7202var = consdata->vars[v];
7208consdata->capacity -= consdata->weights[v];
7210consdata->cliquesadded =
FALSE;
7225weight = consdata->weights[v];
7229assert(repvar !=
NULL);
7235assert(workvar !=
NULL);
7278assert((aggrvars !=
NULL&& aggrscalars !=
NULL) || naggrvars == 0);
7282 SCIPerrorMessage(
"try to resolve a multi-aggregation with a non-integral value for weight*aggrconst = %g\n", weight*aggrconst);
7290 for( i = naggrvars - 1; i >= 0; --i )
7292assert(aggrvars !=
NULL);
7293assert(aggrscalars !=
NULL);
7297 SCIPerrorMessage(
"try to resolve a multi-aggregation with a non-binary %svariable <%s> with bounds [%g,%g]\n",
7303 SCIPerrorMessage(
"try to resolve a multi-aggregation with a non-integral value for weight*aggrscalars = %g\n", weight*aggrscalars[i]);
7310assert(negvar !=
NULL);
7328 if( consdata->capacity < 0 )
7330 if( cutoff !=
NULL)
7338 else if( repvar != var )
7350assert(consdata->onesweightsum == 0);
7358 if( cutoff !=
NULL&& !(*cutoff) )
7393 int* cliquestartposs;
7394 int* cliqueendposs;
7400assert(cons !=
NULL);
7401assert(cutoff !=
NULL);
7402assert(redundant !=
NULL);
7403assert(nfixedvars !=
NULL);
7406assert(consdata !=
NULL);
7409*redundant =
FALSE;
7421 for( i = 0; i < consdata->nvars && consdata->merged; ++i )
7427usenegatedclique = usenegatedclique && consdata->merged;
7432cliquestartposs =
NULL;
7433secondmaxweights =
NULL;
7435 nvars= consdata->nvars;
7441localminweightsum = 0;
7450 if( usenegatedclique &&
nvars> 0 )
7454assert(conshdlrdata !=
NULL);
7458nnegcliques = consdata->nnegcliques;
7461 if( nnegcliques ==
nvars)
7464usenegatedclique =
FALSE;
7480 for( c = 0; c < nnegcliques; ++c )
7482cliqueendposs[c] = cliquestartposs[c+1] - 1;
7483assert(cliqueendposs[c] - cliquestartposs[c] >= 0);
7497 if( nnegcliques - c ==
nvars- i )
7499minweightsum += localminweightsum;
7500localminweightsum = 0;
7508 if( cliquestartposs[c] == i )
7510assert(myweights[i] > 0);
7512minweightsum += localminweightsum;
7513localminweightsum = 0;
7528assert(myweights[i] > 0);
7532assert(myweights[i] <= myweights[cliquestartposs[c - 1]]);
7539cliquestartposs[c - 1] = i;
7545 if( secondmaxweights[c - 1] == 0 )
7546secondmaxweights[c - 1] = myweights[i];
7548localminweightsum += myweights[i];
7555 for( v = cliquestartposs[c - 1]; v < cliquestartposs[c]; ++v )
7592localminweightsum = 0;
7594i = cliqueendposs[c - 1];
7603minweightsum += localminweightsum;
7609 if( !(*cutoff) && consdata->capacity >= minweightsum + consdata->onesweightsum )
7614 for( c = 0; c < nnegcliques; ++c )
7618 intendvarposclique;
7619 intstartvarposclique;
7621assert(myvars !=
NULL);
7622assert(nnegcliques == consdata->nnegcliques);
7623assert(myweights !=
NULL);
7624assert(secondmaxweights !=
NULL);
7625assert(cliquestartposs !=
NULL);
7627endvarposclique = cliqueendposs[c];
7628startvarposclique = cliquestartposs[c];
7630maxvar = myvars[startvarposclique];
7636maxcliqueweight = myweights[startvarposclique];
7637maxvarfixed =
FALSE;
7642 if( consdata->onesweightsum + minweightsum + (maxcliqueweight - secondmaxweights[c]) > consdata->capacity )
7645 SCIP_Longintoldonesweightsum = consdata->onesweightsum;
7647assert(maxcliqueweight >= secondmaxweights[c]);
7653assert(consdata->onesweightsum == oldonesweightsum);
7654assert(!infeasible);
7657maxvarfixed =
TRUE;
7662 else if( nnegcliques - c ==
nvars- startvarposclique )
7672 else if( consdata->onesweightsum + minweightsum + (maxcliqueweight - consdata->weights[
nvars- 1]) <= consdata->capacity )
7676 for( i = endvarposclique; i > startvarposclique; --i )
7685assert(maxcliqueweight >= myweights[i]);
7686assert(i == endvarposclique || myweights[i] >= myweights[i+1]);
7694 if( maxvarfixed || consdata->onesweightsum + minweightsum - myweights[i] + maxcliqueweight > consdata->capacity )
7697 SCIP_Longintoldonesweightsum = consdata->onesweightsum;
7701assert(consdata->onesweightsum == oldonesweightsum + myweights[i]);
7702assert(!infeasible);
7710minweightsum -= myweights[i];
7711assert(minweightsum >= 0);
7719 for( ; i > startvarposclique; --i )
7722 SCIP_Boolexceedscapacity = consdata->onesweightsum + minweightsum - myweights[i] + maxcliqueweight > consdata->capacity;
7724assert(i == endvarposclique || myweights[i] >= myweights[i+1]);
7725assert(varisfixed || !exceedscapacity);
7737assert(consdata->negcliquepartitioned || minweightsum == 0);
7741assert(usenegatedclique || minweightsum == 0);
7743 if( consdata->capacity < minweightsum + consdata->onesweightsum )
7746consdata->onesweightsum, consdata->capacity);
7761 for( i = 0; i <
nvars&& weight <= consdata->capacity; i++ )
7766weight += consdata->weights[i];
7777 if( !usenegatedclique )
7779assert(consdata->sorted);
7780residualcapacity = consdata->capacity - consdata->onesweightsum;
7783 for( i = 0; i <
nvars&& consdata->weights[i] > residualcapacity; ++i )
7792assert(consdata->onesweightsum + consdata->weights[i] > consdata->capacity);
7796assert(!infeasible);
7807 SCIP_Longintunfixedweightsum = consdata->onesweightsum;
7810 for( i = 0; i <
nvars; ++i )
7814unfixedweightsum += consdata->weights[i];
7817 if( unfixedweightsum > consdata->capacity )
7823 SCIPconsGetName(cons), consdata->weightsum, unfixedweightsum, consdata->capacity);
7846assert(cons !=
NULL);
7847assert(ndelconss !=
NULL);
7848assert(naddconss !=
NULL);
7851assert(consdata !=
NULL);
7852assert(consdata->nvars > 1);
7855 if( consdata->nvars == 2 )
7928assert(cons !=
NULL);
7929assert(nchgcoefs !=
NULL);
7930assert(nchgsides !=
NULL);
7931assert(naddconss !=
NULL);
7934assert(consdata !=
NULL);
7935assert(0 < frontsum && frontsum < consdata->weightsum);
7936assert(0 < splitpos && splitpos < consdata->
nvars);
7939assert(conshdlrdata !=
NULL);
7941vars = consdata->vars;
7942weights = consdata->weights;
7943 nvars= consdata->nvars;
7944capacity = consdata->capacity;
7951assert(weights[
w] <= weights[
w-1]);
7955 if( consdata->nvars - 1 == splitpos )
7958assert(frontsum + weights[splitpos] > capacity);
7961 if( consdata->weightsum - weights[splitpos] <= capacity )
7969 for(
w=
nvars- 1;
w> splitpos; --
w)
7971consdata->capacity -= weights[
w];
7974assert(
w== splitpos);
7977*nchgcoefs += (
nvars- splitpos);
7981 for( ;
w>= 0 && gcd > 1; --
w)
7989 for(
w= splitpos;
w>= 0; --
w)
7993(*nchgcoefs) +=
nvars;
7995consdata->capacity /= gcd;
8003 for(
w= consdata->nvars - 1;
w> 0; --
w)
8004assert(weights[
w] <= weights[
w- 1]);
8011 else if( conshdlrdata->disaggregation && frontsum + weights[splitpos + 1] <= capacity )
8017len =
nvars- (splitpos + 1);
8034 for(
w= 0;
w< len; ++
w)
8036assert(clqpart[
w] >= 0 && clqpart[
w] <=
w);
8037 if( clqpart[
w] == cliquenum )
8039maxactduetoclq += weights[
w+ splitpos + 1];
8047 if( frontsum + maxactduetoclq <= capacity )
8053assert(maxactduetoclq < weights[splitpos]);
8060 for( c = 0; c < nclq; ++c )
8063 for(
w= 0;
w< len; ++
w)
8065 if( clqpart[
w] == c )
8067clqvars[nclqvars] = vars[
w+ splitpos + 1];
8093 for(
w=
nvars- 1;
w> splitpos; --
w)
8098consdata->capacity -= maxactduetoclq;
8099assert(frontsum <= consdata->capacity);
8102assert(
w== splitpos);
8105weights = consdata->weights;
8109 for( ;
w>= 0 && gcd > 1; --
w)
8117 for(
w= splitpos;
w>= 0; --
w)
8121(*nchgcoefs) +=
nvars;
8123consdata->capacity /= gcd;
8134 for(
w= consdata->nvars - 1;
w> 0; --
w)
8135assert(weights[
w] <= weights[
w- 1]);
8179assert(cons !=
NULL);
8180assert(ndelconss !=
NULL);
8181assert(nchgcoefs !=
NULL);
8182assert(nchgsides !=
NULL);
8183assert(naddconss !=
NULL);
8186assert(consdata !=
NULL);
8187assert(consdata->nvars >= 2);
8188assert(consdata->weightsum > consdata->capacity);
8190noldchgcoefs = *nchgcoefs;
8191vars = consdata->vars;
8192weights = consdata->weights;
8193 nvars= consdata->nvars;
8194capacity = consdata->capacity;
8198 for( v = 0; v <
nvars&& sum + weights[v] <= capacity; ++v )
8204 if( v ==
nvars- 1 )
8212 if( v <
nvars- 1 )
8216assert(consdata->nvars > 1);
8219 if( v == consdata->nvars - 1 )
8229 if( *nchgcoefs > noldchgcoefs )
8232assert(vars == consdata->vars);
8233assert(weights == consdata->weights);
8234assert(
nvars== consdata->nvars);
8235assert(capacity == consdata->capacity);
8238assert(conshdlrdata !=
NULL);
8243 if( consdata->cliquepartition[v] < v )
8251maxactduetoclqfront = 0;
8253clqpart = consdata->cliquepartition;
8259assert(clqpart[
w] >= 0 && clqpart[
w] <=
w);
8260 if( clqpart[
w] == cliquenum )
8262 if( maxactduetoclqfront + weights[
w] <= capacity )
8264maxactduetoclqfront += weights[
w];
8270sumfront += weights[
w];
8277 if( conshdlrdata->disaggregation &&
w==
nvars)
8284assert(maxactduetoclqfront <= capacity);
8288ncliques = consdata->ncliques;
8293 for( c = 0; c < ncliques; ++c )
8298 if( clqpart[
w] == c )
8300clqvars[nclqvars] = vars[
w];
8356assert(nchgcoefs !=
NULL);
8357assert(nchgsides !=
NULL);
8361assert(consdata !=
NULL);
8362assert(consdata->row ==
NULL);
8363assert(consdata->onesweightsum == 0);
8364assert(consdata->weightsum > consdata->capacity);
8365assert(consdata->nvars >= 1);
8370gcd = consdata->weights[consdata->nvars-1];
8371 for( i = consdata->nvars-2; i >= 0 && gcd >= 2; --i )
8383 for( i = 0; i < consdata->nvars; ++i )
8387consdata->capacity /= gcd;
8388(*nchgcoefs) += consdata->nvars;
8393 for( i = consdata->nvars - 1; i > 0; --i )
8394assert(consdata->weights[i] <= consdata->weights[i - 1]);
8396consdata->sorted =
TRUE;
8445assert(cons !=
NULL);
8446assert(ndelconss !=
NULL);
8447assert(nchgcoefs !=
NULL);
8448assert(nchgsides !=
NULL);
8449assert(naddconss !=
NULL);
8452oldnchgsides = *nchgsides;
8456assert(consdata !=
NULL);
8457assert(consdata->weightsum > consdata->capacity);
8458assert(consdata->nvars >= 2);
8459assert(consdata->sorted);
8462assert(consdata->merged);
8464 nvars= consdata->nvars;
8465weights = consdata->weights;
8466capacity = consdata->capacity;
8468oldnchgcoefs = *nchgcoefs;
8471 if( weights[
nvars- 1] + weights[
nvars- 2] > capacity )
8498 if( consdata->weightsum - weights[
nvars- 1] <= consdata->capacity )
8508 if( consdata->weightsum - capacity > weights[0] + weights[1] )
8529 while( v <
nvars&& weights[v] + weights[
nvars- 1] > capacity )
8533assert(vbig <
nvars- 1);
8537 while( v <
nvars&& exceedsum <= capacity )
8539exceedsum += weights[v];
8544 if( exceedsum > capacity )
8546assert(vbig > 0 || v <
nvars);
8552assert(newweight > 0);
8555 for( v = 0; v < vbig; ++v )
8557 if( weights[v] > newweight )
8565 for( ; v <
nvars; ++v )
8567 if( weights[v] > 1 )
8574consdata->capacity = newweight;
8580 for( v =
nvars- 1; v > 0; --v )
8581assert(weights[v] <= weights[v-1]);
8592 intnexceed = v - vbig;
8594assert(nexceed > 1);
8598exceedsumback += weights[
w];
8605 if( exceedsumback > capacity )
8610assert(exceedsumback - weights[
nvars- 1] <= capacity);
8613 for( v = 0; v < vbig; ++v )
8615 if( weights[v] > newweight )
8623 for( ; v <
nvars; ++v )
8625 if( weights[v] > 1 )
8632consdata->capacity = newweight;
8638 for( v =
nvars- 1; v > 0; --v )
8639assert(weights[v] <= weights[v-1]);
8650assert(vbig > 0 && vbig <
nvars);
8668 for( v = 0; v < vbig; ++v )
8669resweightsum -= weights[v];
8671assert(exceedsum == resweightsum);
8673assert(newweight > 0);
8676 for( v = 0; v < vbig; ++v )
8678 if( weights[v] > newweight )
8686 for( ; v <
nvars; ++v )
8688 if( weights[v] > 1 )
8695consdata->capacity = newweight;
8701 for( v =
nvars- 1; v > 0; --v )
8702assert(weights[v] <= weights[v-1]);
8710dualcapacity = consdata->weightsum - capacity;
8720 while( weights[v] > dualcapacity )
8722reductionsum += (weights[v] - dualcapacity);
8730 while( v <
nvars&& weights[v] == dualcapacity )
8738 if( v >=
nvars- 1 )
8741 if( v ==
nvars- 1 )
8754 if( weights[
nvars- 1] + weights[
nvars- 2] >= dualcapacity )
8768 if( v > 0 && weights[
nvars- 2] > 1 )
8773 for(
w= 0;
w< v; ++
w)
8775 if( weights[
w] > 2 )
8782assert(weights[0] == 2);
8783assert(weights[v - 1] == 2);
8791 if( weights[
w] > 1 )
8797assert(ncoefchg > 0);
8799(*nchgcoefs) += ncoefchg;
8802consdata->capacity = (-2 + v * 2 +
nvars- v);
8803assert(consdata->capacity > 0);
8804assert(weights[0] <= consdata->capacity);
8805assert(consdata->weightsum > consdata->capacity);
8811assert(weights[
nvars- 2] == 1);
8825assert(weights[
nvars- 1] + weights[
nvars- 2] <= capacity);
8833 while( weights[v] > newweight )
8835reductionsum += (weights[v] - newweight);
8840(*nchgcoefs) += (v - startv);
8843 while( weights[v] == newweight )
8849restsumweights += weights[
w];
8852restsumweights = consdata->weightsum;
8854 if( restsumweights < dualcapacity )
8864 for(
w=
nvars- 1;
w>= v; --
w)
8872 for( ;
w>= 0; --
w)
8873assert(weights[
w] == dualcapacity);
8896 for(
w=
nvars- 1;
w>= v; --
w)
8898 if( weights[
w] > 1 )
8909assert(newweight > 1);
8910 for( ;
w>= startv; --
w)
8912 if( weights[
w] > newweight )
8918assert(weights[
w] == newweight);
8923assert(newweight > 2);
8924 for( ;
w>= 0; --
w)
8926 if( weights[
w] > newweight )
8932assert(weights[
w] == newweight);
8937 if( consdata->capacity > newcap )
8939consdata->capacity = newcap;
8943assert(consdata->capacity == newcap);
8948assert(consdata->weightsum - consdata->capacity == (
SCIP_Longint)
nvars- v + 1);
8955assert(weights[
w] <= weights[
w- 1]);
8962 while( end >= 0 && weights[end] == weights[end + 1] )
8974 if( 2 * weights[end] > dualcapacity )
8979 for(
w= end + 1;
w<
nvars; ++
w)
8980restsumweights += weights[
w];
8982 if( restsumweights * 2 <= dualcapacity )
8985 while( v < end && restsumweights + weights[v] >= dualcapacity )
8992 if( (dualcapacity & 1) == 0 )
8994newweight = dualcapacity / 2;
8997 for( ; v <= end; ++v )
8999 if( weights[v] > newweight )
9001reductionsum += (weights[v] - newweight);
9016 for(
w= 0;
w< v; ++
w)
9021newweight = dualcapacity;
9023 for( ; v <= end; ++v )
9025reductionsum += (2 * weights[v] - newweight);
9030 for(
w= end + 1;
w<
nvars; ++
w)
9034(*nchgcoefs) +=
nvars;
9037consdata->capacity *= 2;
9052 for( k = 0; k < 4; ++k )
9058sumcoef = weights[
nvars- 1] + weights[
nvars- 2];
9061assert(
nvars>= 3);
9062sumcoef = weights[
nvars- 1] + weights[
nvars- 3];
9065assert(
nvars>= 4);
9068sumcoefcase =
TRUE;
9069sumcoef = weights[
nvars- 1] + weights[
nvars- 4];
9073sumcoefcase =
FALSE;
9074sumcoef = weights[
nvars- 2] + weights[
nvars- 3];
9078assert(
nvars>= 5);
9093minweight = weights[end];
9094 while( minweight <= sumcoef )
9096newweight = dualcapacity - minweight;
9102 while( weights[v] + minweight > dualcapacity && 2 * minweight <= dualcapacity )
9104reductionsum += (weights[v] - newweight);
9109(*nchgcoefs) += (v - startv);
9112 while( weights[v] + minweight == dualcapacity )
9120 while( end >= 0 && weights[end] == weights[end + 1] )
9126minweight = weights[end];
9133 if( sumcoef < minweight )
9135minweight = sumcoef;
9136newweight = dualcapacity - minweight;
9141 while( weights[v] + minweight > dualcapacity && 2 * minweight <= dualcapacity )
9143reductionsum += (weights[v] - newweight);
9148(*nchgcoefs) += (v - startv);
9151 while( weights[v] + minweight == dualcapacity )
9162 if( 2 * weights[end] > dualcapacity )
9167 for(
w= end + 1;
w<
nvars; ++
w)
9168restsumweights += weights[
w];
9170 if( restsumweights * 2 <= dualcapacity )
9173 while( v < end && restsumweights + weights[v] >= dualcapacity )
9180 if( (dualcapacity & 1) == 0 )
9182newweight = dualcapacity / 2;
9185 for( ; v <= end; ++v )
9187 if( weights[v] > newweight )
9189reductionsum += (weights[v] - newweight);
9204 for(
w= 0;
w< v; ++
w)
9209newweight = dualcapacity;
9211 for( ; v <= end; ++v )
9213reductionsum += (2 * weights[v] - newweight);
9218 for(
w= end + 1;
w<
nvars; ++
w)
9222(*nchgcoefs) +=
nvars;
9225consdata->capacity *= 2;
9234 if( 2 * sumcoef > dualcapacity )
9242 if( reductionsum > 0 )
9246consdata->capacity -= reductionsum;
9249assert(consdata->weightsum - dualcapacity == consdata->capacity);
9251assert(weights[0] <= consdata->capacity);
9258assert(weights[
w] <= weights[
w- 1]);
9261 if( oldnchgcoefs < *nchgcoefs )
9270assert(oldnchgcoefs == *nchgcoefs);
9271assert(oldnchgsides == *nchgsides);
9298assert(cons !=
NULL);
9299assert(nfixedvars !=
NULL);
9300assert(ndelconss !=
NULL);
9301assert(nchgcoefs !=
NULL);
9304assert(consdata !=
NULL);
9306 nvars= consdata->nvars;
9311assert(consdata->capacity >= 0);
9322vars = consdata->vars;
9323weights = consdata->weights;
9324capacity = consdata->capacity;
9328 while( v <
nvars&& weights[v] > capacity )
9331assert(!infeasible);
9351 for( --v; v >= 0; --v )
9359assert(vars == consdata->vars);
9360assert(weights == consdata->weights);
9362assert(consdata->sorted);
9363assert(weights[0] <= capacity);
9426assert(cons !=
NULL);
9427assert(nfixedvars !=
NULL);
9428assert(ndelconss !=
NULL);
9429assert(nchgcoefs !=
NULL);
9430assert(nchgsides !=
NULL);
9431assert(naddconss !=
NULL);
9432assert(cutoff !=
NULL);
9436assert( consdata !=
NULL);
9442assert(consdata->merged);
9446assert(consdata->capacity >= 0);
9468weights = consdata->weights;
9469 nvars= consdata->nvars;
9473 for( v =
nvars- 1; v > 0; --v )
9474assert(weights[v] <= weights[v-1]);
9478gcd = weights[
nvars- 1];
9479 for( v =
nvars- 2; v >= 0 && gcd > 1; --v )
9487 for( v =
nvars- 1; v >= 0; --v )
9491(*nchgcoefs) +=
nvars;
9493consdata->capacity /= gcd;
9496assert(consdata->nvars ==
nvars);
9502 for( v =
nvars- 1; v > 0; --v )
9503assert(weights[v] <= weights[v-1]);
9509 SCIPdebug( oldnchgcoefs = *nchgcoefs; )
9510 SCIPdebug( oldnchgsides = *nchgsides; )
9512vars = consdata->vars;
9513weights = consdata->weights;
9514 nvars= consdata->nvars;
9517 if( weights[
nvars- 1] == 1 && weights[
nvars- 2] == 1 )
9524 while( weights[v] == consdata->capacity )
9531 if( v ==
nvars- 1 )
9543 for( v =
nvars- 1; v >= offsetv; --v )
9545weight = weights[v];
9546assert(weight >= 1);
9567 if( candpos == -1 )
9573 if( v ==
nvars- 2 )
9579 if( candpos == v + 1 && candpos2 == v + 2 )
9581assert(candpos2 ==
nvars- 1);
9606assert(((candpos >= offsetv) || (candpos == -1 && offsetv > 0)) && candpos <
nvars);
9609rest = consdata->capacity % gcd;
9613 if( candpos == -1 )
9619consdata->capacity -= rest;
9623 for( v = 0; v < offsetv; ++v )
9628*nchgcoefs += offsetv;
9633restweight = weights[candpos] % gcd;
9634assert(restweight >= 1);
9635assert(restweight < gcd);
9638 if( restweight > rest )
9639newweight = weights[candpos] - restweight + gcd;
9641newweight = weights[candpos] - restweight;
9645 SCIPdebugMsg(
scip,
"gcd = %" SCIP_LONGINT_FORMAT ", rest = %" SCIP_LONGINT_FORMAT ", restweight = %" SCIP_LONGINT_FORMAT "; possible new weight of variable <%s> %" SCIP_LONGINT_FORMAT ", possible new capacity %" SCIP_LONGINT_FORMAT ", offset of coefficients as big as capacity %d\n", gcd, rest, restweight,
SCIPvarGetName(vars[candpos]), newweight, consdata->capacity - rest, offsetv);
9650 if( newweight == 0 && offsetv > 0 )
9656consdata->capacity -= rest;
9660 for( v = 0; v < offsetv; ++v )
9665*nchgcoefs += offsetv;
9668 if( newweight == 0 )
9672assert(consdata->nvars ==
nvars- 1);
9682assert(consdata->vars == vars);
9683assert(consdata->nvars ==
nvars);
9684assert(consdata->weights == weights);
9688 for( v =
nvars- 1; v >= 0; --v )
9692(*nchgcoefs) +=
nvars;
9694consdata->capacity /= gcd;
9699 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));
9701 while(
nvars>= 2 );
9717 int* zeroitemssize,
9728assert(liftcands !=
NULL);
9729assert(liftcands[value] !=
NULL);
9730assert(nliftcands !=
NULL);
9731assert(firstidxs !=
NULL);
9732assert(firstidxs[value] !=
NULL);
9733assert(zeroweightsums !=
NULL);
9734assert(zeroweightsums[value] !=
NULL);
9735assert(zeroitems !=
NULL);
9736assert(nextidxs !=
NULL);
9737assert(zeroitemssize !=
NULL);
9738assert(nzeroitems !=
NULL);
9739assert(*nzeroitems <= *zeroitemssize);
9741assert(memlimitreached !=
NULL);
9743nzeros = *nzeroitems;
9746 if( nzeros == *zeroitemssize )
9753 SCIPdebugMsg(
scip,
"memory limit of %d bytes reached in knapsack preprocessing - abort collecting zero items\n",
9755*memlimitreached =
TRUE;
9758*zeroitemssize *= 2;
9763assert(nzeros < *zeroitemssize);
9765 if( *memlimitreached )
9766*memlimitreached =
FALSE;
9769(*zeroitems)[nzeros] = knapsackidx;
9770(*nextidxs)[nzeros] = firstidxs[value][probindex];
9771 if( firstidxs[value][probindex] == 0 )
9773liftcands[value][nliftcands[value]] = probindex;
9774++nliftcands[value];
9776firstidxs[value][probindex] = nzeros;
9778zeroweightsums[value][probindex] += knapsackweight;
9783#define MAX_CLIQUELENGTH 50 9839assert(nchgcoefs !=
NULL);
9843assert(consdata !=
NULL);
9844assert(consdata->row ==
NULL);
9845assert(consdata->weightsum > consdata->capacity);
9846assert(consdata->nvars > 0);
9847assert(consdata->merged);
9849 nvars= consdata->nvars;
9863assert(nbinvars > 0);
9868assert(conshdlr !=
NULL);
9870assert(conshdlrdata !=
NULL);
9877assert(conshdlrdata->ints1size > 0);
9878assert(conshdlrdata->ints2size > 0);
9879assert(conshdlrdata->longints1size > 0);
9880assert(conshdlrdata->longints2size > 0);
9886 if( conshdlrdata->ints1size < nbinvars )
9888 intoldsize = conshdlrdata->ints1size;
9890conshdlrdata->ints1size = nbinvars;
9894 if( conshdlrdata->ints2size < nbinvars )
9896 intoldsize = conshdlrdata->ints2size;
9898conshdlrdata->ints2size = nbinvars;
9902 if( conshdlrdata->longints1size < nbinvars )
9904 intoldsize = conshdlrdata->longints1size;
9906conshdlrdata->longints1size = nbinvars;
9908 BMSclearMemoryArray(&(conshdlrdata->longints1[oldsize]), conshdlrdata->longints1size - oldsize);
9910 if( conshdlrdata->longints2size < nbinvars )
9912 intoldsize = conshdlrdata->longints2size;
9914conshdlrdata->longints2size = nbinvars;
9916 BMSclearMemoryArray(&(conshdlrdata->longints2[oldsize]), conshdlrdata->longints2size - oldsize);
9919firstidxs[0] = conshdlrdata->ints1;
9920firstidxs[1] = conshdlrdata->ints2;
9921zeroweightsums[0] = conshdlrdata->longints1;
9922zeroweightsums[1] = conshdlrdata->longints2;
9926 for( tmp = nbinvars - 1; tmp >= 0; --tmp )
9928assert(firstidxs[0][tmp] == 0);
9929assert(firstidxs[1][tmp] == 0);
9930assert(zeroweightsums[0][tmp] == 0);
9931assert(zeroweightsums[1][tmp] == 0);
9944assert(conshdlrdata->bools1size > 0);
9945assert(conshdlrdata->bools2size > 0);
9951 if( conshdlrdata->bools1size < nbinvars )
9953 intoldsize = conshdlrdata->bools1size;
9955conshdlrdata->bools1size = nbinvars;
9957 BMSclearMemoryArray(&(conshdlrdata->bools1[oldsize]), conshdlrdata->bools1size - oldsize);
9959 if( conshdlrdata->bools2size < nbinvars )
9961 intoldsize = conshdlrdata->bools2size;
9963conshdlrdata->bools2size = nbinvars;
9965 BMSclearMemoryArray(&(conshdlrdata->bools2[oldsize]), conshdlrdata->bools2size - oldsize);
9968zeroiteminserted[0] = conshdlrdata->bools1;
9969zeroiteminserted[1] = conshdlrdata->bools2;
9973 for( tmp = nbinvars - 1; tmp >= 0; --tmp )
9975assert(zeroiteminserted[0][tmp] == 0);
9976assert(zeroiteminserted[1][tmp] == 0);
9990memlimitreached =
FALSE;
9991 for( i = 0; i < consdata->nvars && !memlimitreached; ++i )
10004var = consdata->vars[i];
10005weight = consdata->weights[i];
10009assert(0 <= varprobindex && varprobindex < nbinvars);
10012zeroweightsums[!value][varprobindex] += weight;
10013tmpboolindices3[tmp3] = !value;
10014tmpindices3[tmp3] = varprobindex;
10024assert(0 <= probindex && probindex < nbinvars);
10026implvalue = !value;
10029assert( !zeroiteminserted[implvalue][probindex] );
10031 if( firstidxs[implvalue][probindex] == 0 )
10033tmpboolindices2[tmp2] = implvalue;
10034tmpindices2[tmp2] = probindex;
10038&zeroitems, &nextidxs, &zeroitemssize, &nzeroitems, probindex, implvalue, i, weight,
10039&memlimitreached) );
10040zeroiteminserted[implvalue][probindex] =
TRUE;
10041tmpboolindices[tmp] = implvalue;
10042tmpindices[tmp] = probindex;
10049 for( j = 0; j < ncliques && !memlimitreached; ++j )
10065 for( k = ncliquevars - 1; k >= 0; --k )
10070 if( var == cliquevars[k] )
10074 if( probindex == -1 )
10077assert(0 <= probindex && probindex < nbinvars);
10078implvalue = cliquevalues[k];
10081 if( !zeroiteminserted[implvalue][probindex] )
10083 if( firstidxs[implvalue][probindex] == 0 )
10085tmpboolindices2[tmp2] = implvalue;
10086tmpindices2[tmp2] = probindex;
10091&zeroitems, &nextidxs, &zeroitemssize, &nzeroitems, probindex, implvalue, i, weight,
10092&memlimitreached) );
10093zeroiteminserted[implvalue][probindex] =
TRUE;
10094tmpboolindices[tmp] = implvalue;
10095tmpindices[tmp] = probindex;
10098 if( memlimitreached )
10104 for( --tmp; tmp >= 0; --tmp)
10105zeroiteminserted[tmpboolindices[tmp]][tmpindices[tmp]] =
FALSE;
10110assert(consdata->sorted);
10113assert(conshdlrdata->bools3size > 0);
10119 if( conshdlrdata->bools3size < consdata->nvars )
10121 intoldsize = conshdlrdata->bools3size;
10123conshdlrdata->bools3size = consdata->nvars;;
10125 BMSclearMemoryArray(&(conshdlrdata->bools3[oldsize]), conshdlrdata->bools3size - oldsize);
10128cliqueused = conshdlrdata->bools3;
10132 for( tmp = consdata->nvars - 1; tmp >= 0; --tmp )
10133assert(cliqueused[tmp] == 0);
10136maxcliqueweightsum = 0;
10140 for( i = 0; i < consdata->nvars; ++i )
10142cliquenum = consdata->cliquepartition[i];
10143assert(0 <= cliquenum && cliquenum < consdata->
nvars);
10145 if( !cliqueused[cliquenum] )
10147maxcliqueweightsum += consdata->weights[i];
10148cliqueused[cliquenum] =
TRUE;
10149tmpindices[tmp] = cliquenum;
10154 for( --tmp; tmp >= 0; --tmp)
10155cliqueused[tmp] =
FALSE;
10157assert(conshdlrdata->bools4size > 0);
10163 if( conshdlrdata->bools4size < consdata->nvars )
10165 intoldsize = conshdlrdata->bools4size;
10167conshdlrdata->bools4size = consdata->nvars;
10169 BMSclearMemoryArray(&conshdlrdata->bools4[oldsize], conshdlrdata->bools4size - oldsize);
10172itemremoved = conshdlrdata->bools4;
10176 for( tmp = consdata->nvars - 1; tmp >= 0; --tmp )
10177assert(itemremoved[tmp] == 0);
10188 for( val = 0; val < 2 && addweightsum < consdata->capacity; ++val )
10190 for( i = 0; i < nliftcands[val] && addweightsum < consdata->capacity; ++i )
10199probindex = liftcands[val][i];
10200assert(0 <= probindex && probindex < nbinvars);
10203 if( firstidxs[val][probindex] == 0
10204|| maxcliqueweightsum - zeroweightsums[val][probindex] + addweightsum >= consdata->capacity )
10208 for( idx = firstidxs[val][probindex]; idx != 0; idx = nextidxs[idx] )
10210assert(0 < idx && idx < nzeroitems);
10211assert(0 <= zeroitems[idx] && zeroitems[idx] < consdata->nvars);
10212itemremoved[zeroitems[idx]] =
TRUE;
10216cliqueweightsum = addweightsum;
10217 for( j = 0; j < consdata->nvars; ++j )
10219cliquenum = consdata->cliquepartition[j];
10220assert(0 <= cliquenum && cliquenum < consdata->
nvars);
10221 if( !itemremoved[j] )
10223 if( !cliqueused[cliquenum] )
10225cliqueweightsum += consdata->weights[j];
10226cliqueused[cliquenum] =
TRUE;
10227tmpindices[tmp] = cliquenum;
10231 if( cliqueweightsum >= consdata->capacity )
10237 if( cliqueweightsum < consdata->capacity )
10243assert(naddvars < 2*nbinvars);
10244var = binvars[probindex];
10245 if( val ==
FALSE)
10249weight = consdata->capacity - cliqueweightsum;
10250addvars[naddvars] = var;
10251addweights[naddvars] = weight;
10252addweightsum += weight;
10260 for( idx = firstidxs[val][probindex]; idx != 0; idx = nextidxs[idx] )
10262assert(0 < idx && idx < nzeroitems);
10263assert(0 <= zeroitems[idx] && zeroitems[idx] < consdata->nvars);
10264itemremoved[zeroitems[idx]] =
FALSE;
10267 for( --tmp; tmp >= 0; --tmp)
10268cliqueused[tmpindices[tmp]] =
FALSE;
10273 for( --tmp3; tmp3 >= 0; --tmp3)
10274zeroweightsums[tmpboolindices3[tmp3]][tmpindices3[tmp3]] = 0;
10277 for( --tmp2; tmp2 >= 0; --tmp2)
10279zeroweightsums[tmpboolindices2[tmp2]][tmpindices2[tmp2]] = 0;
10280firstidxs[tmpboolindices2[tmp2]][tmpindices2[tmp2]] = 0;
10284 for( i = 0; i < naddvars; ++i )
10288*nchgcoefs += naddvars;
10290 if( naddvars > 0 )
10386assert(nchgcoefs !=
NULL);
10387assert(nchgsides !=
NULL);
10391assert(conshdlrdata !=
NULL);
10394assert(consdata !=
NULL);
10395assert(consdata->row ==
NULL);
10396assert(consdata->onesweightsum == 0);
10397assert(consdata->weightsum > consdata->capacity);
10398assert(consdata->nvars > 0);
10409assert(consdata->merged);
10414 for( i = 0; i < consdata->nvars; ++i )
10418weight = consdata->weights[i];
10419 if( consdata->weightsum - weight < consdata->capacity )
10421newweight = consdata->weightsum - consdata->capacity;
10423consdata->capacity -= (weight - newweight);
10426assert(!consdata->sorted);
10429consdata->capacity + (weight-newweight), consdata->capacity);
10435 while( !consdata->sorted && consdata->weightsum > consdata->capacity );
10439 if( consdata->weightsum <= consdata->capacity )
10443 while( pos < consdata->
nvars&& consdata->weights[pos] == consdata->capacity )
10447weights = consdata->weights;
10448 nvars= consdata->nvars;
10449capacity = consdata->capacity;
10452pos <
nvars&& weights[pos] + weights[pos + 1] > capacity )
10459 for( k = 0; k < 4; ++k )
10461newweight = capacity - sumcoef;
10467sumcoef = weights[
nvars- 1];
10468backpos =
nvars- 1;
10471sumcoef = weights[
nvars- 2];
10472backpos =
nvars- 2;
10475 if( weights[
nvars- 3] < weights[
nvars- 1] + weights[
nvars- 2] )
10477sumcoefcase =
TRUE;
10478sumcoef = weights[
nvars- 3];
10479backpos =
nvars- 3;
10483sumcoefcase =
FALSE;
10484sumcoef = weights[
nvars- 1] + weights[
nvars- 2];
10485backpos =
nvars- 2;
10492 if( weights[
nvars- 4] < weights[
nvars- 1] + weights[
nvars- 2] )
10494sumcoef = weights[
nvars- 4];
10495backpos =
nvars- 4;
10499sumcoef = weights[
nvars- 1] + weights[
nvars- 2];
10500backpos =
nvars- 2;
10505sumcoef = weights[
nvars- 3];
10506backpos =
nvars- 3;
10511 if( backpos <= pos )
10515maxweight = weights[pos];
10517 while( 2 * maxweight > capacity && maxweight + sumcoef > capacity )
10519assert(newweight > weights[pos]);
10527assert(pos <
nvars);
10529maxweight = weights[pos];
10531 if( backpos <= pos )
10534(*nchgcoefs) += (pos - startpos);
10537 while( pos <
nvars&& weights[pos] + sumcoef == capacity )
10548 if( pos + 1 == backpos && weights[pos] > sumcoef &&
10549((k == 0) || (k == 1 && weights[
nvars- 1] + sumcoef + weights[pos] > capacity)) )
10551newweight = capacity - sumcoef;
10552assert(newweight > weights[pos]);
10562 if( backpos <= pos )
10570 if( conshdlrdata->disaggregation && consdata->nvars - pos <= MAX_USECLIQUES_SIZE && consdata->
nvars>= 2 &&
10571pos > 0 && (
SCIP_Longint)consdata->nvars - pos <= consdata->capacity &&
10572consdata->weights[pos - 1] == consdata->capacity && (pos == consdata->nvars || consdata->weights[pos] == 1) )
10586 if( pos == consdata->nvars )
10607len = consdata->nvars - pos;
10614assert(nclq <= len);
10618 for(
w= 0;
w< nclq; ++
w)
10619assert(clqpart[
w] <=
w);
10628 for(
w= pos - 1;
w>= 0; --
w)
10629clqvars[
w] = consdata->vars[
w];
10632 for( c = 0; c < nclq; ++c )
10636 for(
w= c;
w< len; ++
w)
10638 if( clqpart[
w] == c )
10640assert(nclqvars < pos + len - nclq + 1);
10641clqvars[nclqvars] = consdata->vars[
w+ pos];
10646assert(nclqvars > 1);
10674 int* newweightidxs;
10688assert(consdata->merged);
10697 if( consdata->cliquepartition[consdata->nvars - 1] == consdata->nvars - 1 )
10701cliqueweightsum = 0;
10704 for( i = 0; i < consdata->nvars; ++i )
10708cliquenum = consdata->cliquepartition[i];
10709assert(0 <= cliquenum && cliquenum <= ncliques);
10711weight = consdata->weights[i];
10712assert(weight > 0);
10714 if( cliquenum == ncliques )
10716maxcliqueweights[ncliques] = weight;
10717cliqueweightsum += weight;
10721assert(maxcliqueweights[cliquenum] >= weight);
10725zeroweights =
FALSE;
10726 for( i = 0; i < ncliques; ++i )
10730delta = consdata->capacity - (cliqueweightsum - maxcliqueweights[i]);
10743 SCIPconsGetName(cons), i, maxcliqueweights[i], cliqueweightsum, consdata->capacity, delta);
10744newcapacity = consdata->capacity - delta;
10745forceclique =
FALSE;
10748newmincliqueweight = newcapacity + 1;
10749 for( j = 0; j < i; ++j )
10750assert(consdata->cliquepartition[j] < i);
10752 for( j = i; j < consdata->nvars; ++j )
10754 if( consdata->cliquepartition[j] == i )
10756newweight = consdata->weights[j] - delta;
10757newweight =
MAX(newweight, 0);
10760assert(nnewweights < consdata->
nvars);
10761newweightvals[nnewweights] = newweight;
10762newweightidxs[nnewweights] = j;
10766assert(newweight <= newmincliqueweight);
10767newmincliqueweight = newweight;
10773 if( nnewweights > 1 )
10776j = newweightidxs[nnewweights - 2];
10777assert(0 <= j && j < consdata->
nvars);
10778assert(consdata->cliquepartition[j] == i);
10779j = newweightidxs[nnewweights - 1];
10780assert(0 <= j && j < consdata->
nvars);
10781assert(consdata->cliquepartition[j] == i);
10784newminweightsuminclique = newweightvals[nnewweights - 2];
10785newminweightsuminclique += newweightvals[nnewweights - 1];
10792 if( newminweightsuminclique <= newcapacity )
10793forceclique =
TRUE;
10797 if( conshdlrdata->disaggregation || !forceclique )
10800consdata->capacity, newcapacity, forceclique);
10801consdata->capacity = newcapacity;
10804 for( k = 0; k < nnewweights; ++k )
10806j = newweightidxs[k];
10807assert(0 <= j && j < consdata->
nvars);
10808assert(consdata->cliquepartition[j] == i);
10812 SCIPvarGetName(consdata->vars[j]), consdata->weights[j], newweightvals[k]);
10815assert(!consdata->sorted);
10816zeroweights = zeroweights || (newweightvals[k] == 0);
10830 for( k = 0; k < nnewweights; ++k )
10831cliquevars[k] = consdata->vars[newweightidxs[k]];
10854 while( !consdata->sorted && consdata->weightsum > consdata->capacity );
10862 if( consdata->weightsum <= consdata->capacity )
10874 if( consdata->weightsum <= consdata->capacity )
10880assert(consdata->merged);
10882minweight = consdata->weights[consdata->nvars-1];
10883 for( i = 0; i < consdata->nvars-1; ++i )
10887weight = consdata->weights[i];
10888assert(weight >= minweight);
10889 if( minweight + weight > consdata->capacity )
10891 if( weight < consdata->capacity )
10895assert(consdata->sorted);
10897assert(i == 0 || consdata->weights[i-1] >= consdata->weights[i]);
10898consdata->sorted =
TRUE;
10907 if( consdata->nvars >= 2 )
10911minweight = consdata->weights[consdata->nvars-2];
10912weight = consdata->weights[consdata->nvars-1];
10913assert(minweight >= weight);
10914 if( minweight + weight > consdata->capacity && weight < consdata->capacity )
10918assert(consdata->sorted);
10920assert(minweight >= consdata->weights[consdata->nvars-1]);
10921consdata->sorted =
TRUE;
10940 for(
b= 0;
b< ncliquevars; ++
b)
10952 int*
constnbdchgs
10961 int* gaincliquepartition;
10967 intnposcliquevars;
10971 intlastcliqueused;
10977assert(cons !=
NULL);
10978assert(cutoff !=
NULL);
10979assert(nbdchgs !=
NULL);
10984assert(consdata !=
NULL);
10986 nvars= consdata->nvars;
10989 if( consdata->cliquesadded ||
nvars== 0 )
11000assert(consdata->merged);
11003assert(conshdlrdata !=
NULL);
11007nnegcliques = consdata->nnegcliques;
11010 if( nnegcliques ==
nvars)
11022minactduetonegcliques = 0;
11025 for( v = 0; v <
nvars; ++v )
11027assert(0 <= consdata->negcliquepartition[v] && consdata->negcliquepartition[v] <= nnegcliques);
11028assert(consdata->weights[v] > 0);
11030 if( consdata->negcliquepartition[v] == nnegcliques )
11033maxweights[consdata->negcliquepartition[v]] = consdata->weights[v];
11036minactduetonegcliques += consdata->weights[v];
11039nposcliquevars = 0;
11042 if( minactduetonegcliques > 0 )
11045freecapacity = consdata->capacity - minactduetonegcliques;
11049 SCIPconsGetName(cons), consdata->capacity, minactduetonegcliques, freecapacity);
11052 for( v = 0; v <
nvars; ++v )
11054 if( !cliqueused[consdata->negcliquepartition[v]] )
11056cliqueused[consdata->negcliquepartition[v]] =
TRUE;
11057 for(
w= v + 1;
w<
nvars; ++
w)
11061 if( consdata->negcliquepartition[v] == consdata->negcliquepartition[
w]
11062&& consdata->weights[v] > consdata->weights[
w] )
11064poscliquevars[nposcliquevars] = consdata->vars[
w];
11065gainweights[nposcliquevars] = maxweights[consdata->negcliquepartition[v]] - consdata->weights[
w];
11066gaincliquepartition[nposcliquevars] = consdata->negcliquepartition[v];
11074 if( nposcliquevars > 0 )
11079 for( v = 0; v < nposcliquevars; ++v )
11083lastweight = gainweights[v];
11084beforelastweight = -1;
11085lastcliqueused = gaincliquepartition[v];
11088cliqueused[gaincliquepartition[v]] =
TRUE;
11092 for(
w= v + 1; w < nposcliquevars && !cliqueused[gaincliquepartition[w]] && gainweights[w] + lastweight > freecapacity; ++
w)
11094beforelastweight = lastweight;
11095lastweight = gainweights[
w];
11096lastcliqueused = gaincliquepartition[
w];
11097cliqueused[gaincliquepartition[
w]] =
TRUE;
11102 if( ncliquevars > 1 )
11104 SCIPdebug( printClique(cliquevars, ncliquevars) );
11105assert(beforelastweight > 0);
11111*nbdchgs += thisnbdchgs;
11114cliqueused[lastcliqueused] =
FALSE;
11117 for( ++
w; w < nposcliquevars && !cliqueused[gaincliquepartition[w]] && beforelastweight + gainweights[w] > freecapacity; ++
w)
11120 SCIPdebug( printClique(cliquevars, ncliquevars) );
11124*nbdchgs += thisnbdchgs;
11159 int*
constnbdchgs
11171 if( ! sorteditems )
11175lastweight = weights[0];
11178 for( i = 1; i < nitems && weights[i] + lastweight > capacity; ++i )
11180lastweight = weights[i];
11184 if( ncliquevars > 1 )
11188 intcompareweightidx;
11193 SCIPdebug( printClique(items, ncliquevars) );
11199*nbdchgs += thisnbdchgs;
11200nnzadded = ncliquevars;
11203 if( ncliquevars == nitems )
11211compareweightidx = ncliquevars - 2;
11212assert(i == nitems || weights[i] + weights[ncliquevars - 1] <= capacity);
11215minclqsize = (int)(cliqueextractfactor * ncliquevars);
11216minclqsize =
MAX(minclqsize, 2);
11220 while( compareweightidx >= 0 && i < nitems && ! (*cutoff)
11221&& ncliquevars >= minclqsize
11222&& nnzadded <= 2 * nitems
11225compareweight = weights[compareweightidx];
11226assert(compareweight > 0);
11229 if( compareweight + weights[i] > capacity )
11231assert(compareweightidx == ncliquevars -2);
11232cliquevars[ncliquevars - 1] = items[i];
11233 SCIPdebug( printClique(cliquevars, ncliquevars) );
11236nnzadded += ncliquevars;
11240*nbdchgs += thisnbdchgs;
11248compareweightidx--;
11266 int*
constnbdchgs
11278 intnposcliquevars;
11283assert(cons !=
NULL);
11284assert(cutoff !=
NULL);
11285assert(nbdchgs !=
NULL);
11290assert(consdata !=
NULL);
11292 nvars= consdata->nvars;
11295 if( consdata->cliquesadded ||
nvars== 0 )
11306assert(consdata->merged);
11309assert(conshdlrdata !=
NULL);
11313nnegcliques = consdata->nnegcliques;
11314assert(nnegcliques <=
nvars);
11323minactduetonegcliques = 0;
11326 if( nnegcliques <
nvars)
11330 for( i = 0; i <
nvars; ++i )
11334cliquenum = consdata->negcliquepartition[i];
11335assert(0 <= cliquenum && cliquenum <= nnegcliques);
11337weight = consdata->weights[i];
11338assert(weight > 0);
11340 if( cliquenum == nnegcliques )
11344minactduetonegcliques += weight;
11345 if( secondmaxweights[cliquenum] == 0 )
11346secondmaxweights[cliquenum] = weight;
11352 if( minactduetonegcliques > 0 )
11355freecapacity = consdata->capacity - minactduetonegcliques;
11359 SCIPconsGetName(cons), consdata->capacity, minactduetonegcliques, freecapacity);
11367nposcliquevars = 0;
11369 for( i =
nvars- 1; i >= 0; --i )
11372cliquenum = consdata->negcliquepartition[i];
11373 if( consdata->weights[i] > secondmaxweights[cliquenum] )
11375poscliquevars[nposcliquevars] = consdata->vars[i];
11376gainweights[nposcliquevars] = consdata->weights[i] - secondmaxweights[cliquenum];
11382 if( nposcliquevars > 1 )
11399consdata->cliquesadded =
TRUE;
11428assert(consdata1->sorted);
11429assert(consdata2->sorted);
11436 if( consdata1->nvars != consdata2->nvars )
11439 for( i = consdata1->nvars - 1; i >= 0; --i )
11442 if( consdata1->vars[i] != consdata2->vars[i] )
11444assert(
SCIPvarCompare(consdata1->vars[i], consdata2->vars[i]) == 1 ||
11448assert(
SCIPvarCompare(consdata1->vars[i], consdata2->vars[i]) == 0);
11451 if( consdata1->weights[i] != consdata2->weights[i] )
11466uint64_t firstweight;
11472assert(consdata !=
NULL);
11473assert(consdata->nvars > 0);
11486assert(minidx >= 0 && mididx >= 0 && maxidx >= 0);
11489firstweight = (uint64_t)consdata->weights[0];
11490 return SCIPhashSix(consdata->nvars, minidx, mididx, maxidx, firstweight>>32, firstweight);
11511assert(blkmem !=
NULL);
11512assert(conss !=
NULL);
11513assert(ndelconss !=
NULL);
11516hashtablesize = nconss;
11519hashGetKeyKnapsackcons, hashKeyEqKnapsackcons, hashKeyValKnapsackcons, (
void*)
scip) );
11522 for( c = nconss - 1; c >= 0; --c )
11534assert(consdata0 !=
NULL);
11535 if( consdata0->nvars == 0 )
11537 if( consdata0->capacity < 0 )
11553 if( cons1 !=
NULL)
11567assert(consdata1 !=
NULL);
11568assert(consdata0->nvars > 0 && consdata0->nvars == consdata1->nvars);
11570assert(consdata0->sorted && consdata1->sorted);
11571assert(consdata0->vars[0] == consdata1->vars[0]);
11572assert(consdata0->weights[0] == consdata1->weights[0]);
11574 SCIPdebugMsg(
scip,
"knapsack constraints <%s> and <%s> with equal coefficients\n",
11578 if( consdata0->capacity < consdata1->capacity )
11634assert(conss !=
NULL);
11635assert(firstchange <= chkind);
11636assert(ndelconss !=
NULL);
11639cons0 = conss[chkind];
11640assert(cons0 !=
NULL);
11645assert(consdata0 !=
NULL);
11646assert(consdata0->nvars >= 1);
11647assert(consdata0->merged);
11653 if( consdata0->capacity == 0 )
11669assert(cons1 !=
NULL);
11674assert(consdata1 !=
NULL);
11680assert(consdata1->nvars >= 1);
11681assert(consdata1->merged);
11687 if( consdata1->capacity == 0 )
11690quotient = ((
SCIP_Real) consdata0->capacity) / ((
SCIP_Real) consdata1->capacity);
11692 if( consdata0->nvars > consdata1->nvars )
11694iscons0incons1contained =
FALSE;
11695iscons1incons0contained =
TRUE;
11696v = consdata1->nvars - 1;
11698 else if( consdata0->nvars < consdata1->nvars )
11700iscons0incons1contained =
TRUE;
11701iscons1incons0contained =
FALSE;
11702v = consdata0->nvars - 1;
11706iscons0incons1contained =
TRUE;
11707iscons1incons0contained =
TRUE;
11708v = consdata0->nvars - 1;
11719v0 = consdata0->nvars - 1;
11720v1 = consdata1->nvars - 1;
11724assert(iscons0incons1contained || iscons1incons0contained);
11729iscons1incons0contained =
FALSE;
11730 if( !iscons0incons1contained )
11734 else if( v1 < v0 )
11736iscons0incons1contained =
FALSE;
11737 if( !iscons1incons0contained )
11741assert(v == v0 || v == v1);
11746 if( consdata0->vars[v0] == consdata1->vars[v1] )
11751iscons1incons0contained =
FALSE;
11752 if( !iscons0incons1contained )
11756 else if( iscons0incons1contained &&
SCIPisGT(
scip, ((
SCIP_Real) consdata0->weights[v0]) / quotient, (
SCIP_Real) consdata1->weights[v1]) )
11758iscons0incons1contained =
FALSE;
11759 if( !iscons1incons0contained )
11769 if( iscons0incons1contained && iscons1incons0contained )
11771iscons0incons1contained =
FALSE;
11772iscons1incons0contained =
FALSE;
11775assert(iscons0incons1contained ? (v1 >= v0) : iscons1incons0contained);
11776assert(iscons1incons0contained ? (v1 <= v0) : iscons0incons1contained);
11778 if( iscons0incons1contained )
11787assert(!iscons1incons0contained || !iscons0incons1contained || v0 == -1 || v1 == -1);
11789 if( iscons1incons0contained )
11800 else if( iscons0incons1contained )
11838 SCIPdebugMsg(
scip,
"knapsack enforcement of %d/%d constraints for %s solution\n", nusefulconss, nconss,
11839sol ==
NULL?
"LP":
"relaxation");
11843assert(conshdlrdata !=
NULL);
11844maxncuts = (
SCIPgetDepth(
scip) == 0 ? conshdlrdata->maxsepacutsroot : conshdlrdata->maxsepacuts);
11847 for( i = 0; i < nusefulconss && ncuts < maxncuts && ! cutoff; i++ )
11859 for( i = nusefulconss; i < nconss && ncuts == 0 && ! cutoff; i++ )
11873 else if( ncuts > 0 )
11949 for( v = 0; v <
nvars; ++v )
11955transvars[v] = vars[v];
11956weights[v] = weight;
11961weights[v] = -weight;
11962capacity -= weight;
11964assert(transvars[v] !=
NULL);
11969initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
11984assert(upgdcons !=
NULL);
11993upgrade = (nposbin + nnegbin + nposimplbin + nnegimplbin ==
nvars)
11994&& (ncoeffspone + ncoeffsnone + ncoeffspint + ncoeffsnint ==
nvars)
12033assert(cons !=
NULL);
12034assert(graph !=
NULL);
12035assert(success !=
NULL);
12038assert(consdata !=
NULL);
12039assert(graph !=
NULL);
12043nlocvars = consdata->nvars;
12048 for( i = 0; i < consdata->nvars; ++i )
12050vars[i] = consdata->vars[i];
12051vals[i] = (
SCIP_Real) consdata->weights[i];
12076assert(conshdlr !=
NULL);
12097assert(conshdlrdata !=
NULL);
12116assert( conshdlr !=
NULL);
12119assert(conshdlrdata !=
NULL);
12125conshdlrdata->reals1size =
nvars;
12137assert( conshdlr !=
NULL);
12140assert(conshdlrdata !=
NULL);
12143conshdlrdata->reals1size = 0;
12157assert(conshdlr !=
NULL);
12158assert(nconss == 0 || conss !=
NULL);
12161assert(conshdlrdata !=
NULL);
12175conshdlrdata->ints1size =
nvars;
12176conshdlrdata->ints2size =
nvars;
12177conshdlrdata->longints1size =
nvars;
12178conshdlrdata->longints2size =
nvars;
12179conshdlrdata->bools1size =
nvars;
12180conshdlrdata->bools2size =
nvars;
12181conshdlrdata->bools3size =
nvars;
12182conshdlrdata->bools4size =
nvars;
12184#ifdef WITH_CARDINALITY_UPGRADE 12185conshdlrdata->upgradedcard =
FALSE;
12200assert(conshdlr !=
NULL);
12202 for( c = 0; c < nconss; ++c )
12212assert(conshdlrdata !=
NULL);
12223conshdlrdata->ints1size = 0;
12224conshdlrdata->ints2size = 0;
12225conshdlrdata->longints1size = 0;
12226conshdlrdata->longints2size = 0;
12227conshdlrdata->bools1size = 0;
12228conshdlrdata->bools2size = 0;
12229conshdlrdata->bools3size = 0;
12230conshdlrdata->bools4size = 0;
12243 for( c = 0; c < nconss; ++c )
12262 for( c = 0; c < nconss; ++c )
12265assert(consdata !=
NULL);
12267 if( consdata->row !=
NULL)
12272 if( consdata->nlrow !=
NULL)
12287assert(conshdlr !=
NULL);
12292assert(conshdlrdata !=
NULL);
12293assert(conshdlrdata->eventhdlr !=
NULL);
12310assert(conshdlr !=
NULL);
12313assert(sourcecons !=
NULL);
12314assert(targetcons !=
NULL);
12317assert(sourcedata !=
NULL);
12318assert(sourcedata->row ==
NULL);
12322assert(conshdlrdata !=
NULL);
12323assert(conshdlrdata->eventhdlr !=
NULL);
12327sourcedata->nvars, sourcedata->vars, sourcedata->weights, sourcedata->capacity) );
12349*infeasible =
FALSE;
12351 for( i = 0; i < nconss && !(*infeasible); i++ )
12384assert(conshdlrdata !=
NULL);
12389 SCIPdebugMsg(
scip,
"knapsack separation of %d/%d constraints, round %d (max %d/%d)\n",
12390nusefulconss, nconss, nrounds, conshdlrdata->maxroundsroot, conshdlrdata->maxrounds);
12393 if( (depth == 0 && conshdlrdata->maxroundsroot >= 0 && nrounds >= conshdlrdata->maxroundsroot)
12394|| (depth > 0 && conshdlrdata->maxrounds >= 0 && nrounds >= conshdlrdata->maxrounds) )
12399sepacardfreq = sepafreq * conshdlrdata->sepacardfreq;
12400sepacardinality = (conshdlrdata->sepacardfreq >= 0)
12401&& ((sepacardfreq == 0 && depth == 0) || (sepacardfreq >= 1 && (depth % sepacardfreq == 0)));
12407maxbound = glblowerbound + conshdlrdata->maxcardbounddist * (cutoffbound - glblowerbound);
12408sepacardinality = sepacardinality &&
SCIPisLE(
scip, loclowerbound, maxbound);
12412maxsepacuts = (depth == 0 ? conshdlrdata->maxsepacutsroot : conshdlrdata->maxsepacuts);
12419 for( i = 0; i < nusefulconss && ncuts < maxsepacuts && !
SCIPisStopped(
scip); i++ )
12427 else if( ncuts > 0 )
12453assert(conshdlrdata !=
NULL);
12458 SCIPdebugMsg(
scip,
"knapsack separation of %d/%d constraints, round %d (max %d/%d)\n",
12459nusefulconss, nconss, nrounds, conshdlrdata->maxroundsroot, conshdlrdata->maxrounds);
12462 if( (depth == 0 && conshdlrdata->maxroundsroot >= 0 && nrounds >= conshdlrdata->maxroundsroot)
12463|| (depth > 0 && conshdlrdata->maxrounds >= 0 && nrounds >= conshdlrdata->maxrounds) )
12468sepacardfreq = sepafreq * conshdlrdata->sepacardfreq;
12469sepacardinality = (conshdlrdata->sepacardfreq >= 0)
12470&& ((sepacardfreq == 0 && depth == 0) || (sepacardfreq >= 1 && (depth % sepacardfreq == 0)));
12473maxsepacuts = (depth == 0 ? conshdlrdata->maxsepacutsroot : conshdlrdata->maxsepacuts);
12480 for( i = 0; i < nusefulconss && ncuts < maxsepacuts && !
SCIPisStopped(
scip); i++ )
12488 else if( ncuts > 0 )
12519 for( i = 0; i < nconss; i++ )
12542 for( i = 0; i < nconss && (*result ==
SCIP_FEASIBLE|| completely); i++ )
12567assert(conshdlrdata !=
NULL);
12573 for( i = 0; i < nmarkedconss && !cutoff; i++ )
12594 else if( nfixedvars > 0 )
12624oldnfixedvars = *nfixedvars;
12625oldnchgbds = *nchgbds;
12626oldndelconss = *ndelconss;
12627oldnaddconss = *naddconss;
12628oldnchgcoefs = *nchgcoefs;
12629oldnchgsides = *nchgsides;
12630firstchange = INT_MAX;
12632newchanges = (nrounds == 0 || nnewfixedvars > 0 || nnewaggrvars > 0 || nnewchgbds > 0 || nnewupgdconss > 0);
12635assert(conshdlrdata !=
NULL);
12639 intthisnfixedvars;
12644assert(consdata !=
NULL);
12648 if( newchanges || *nfixedvars > oldnfixedvars || *nchgbds > oldnchgbds )
12656 if( nrounds == 0 )
12657consdata->presolvedtiming = 0;
12658 else if( consdata->presolvedtiming >= presoltiming )
12663consdata->presolvedtiming = presoltiming;
12665thisnfixedvars = *nfixedvars;
12666thisnchgbds = *nchgbds;
12696 if( *nfixedvars > thisnfixedvars || *nchgbds > thisnchgbds )
12702thisnfixedvars = *nfixedvars;
12708 if( consdata->weightsum <= consdata->capacity )
12730 if( *nfixedvars > thisnfixedvars )
12771 if( (*ndelconss != oldndelconss) || (*nchgsides != oldnchgsides) || (*nchgcoefs != oldnchgcoefs) || (*naddconss != oldnaddconss) )
12780npaircomparisons = 0;
12781oldndelconss = *ndelconss;
12782oldnchgsides = *nchgsides;
12783oldnchgcoefs = *nchgcoefs;
12785 for( c = firstchange; c < nconss && !cutoff && !
SCIPisStopped(
scip); ++c )
12797 if( (*ndelconss != oldndelconss) || (*nchgsides != oldnchgsides) || (*nchgcoefs != oldnchgcoefs) )
12799 if( ((
SCIP_Real) (*ndelconss - oldndelconss) + ((
SCIP_Real) (*nchgsides - oldnchgsides))/2.0 +
12802oldndelconss = *ndelconss;
12803oldnchgsides = *nchgsides;
12804oldnchgcoefs = *nchgcoefs;
12805npaircomparisons = 0;
12809#ifdef WITH_CARDINALITY_UPGRADE 12827noldupgdconss = *nupgdconss;
12840 for(makeupgrade = 0; makeupgrade < 2; ++makeupgrade)
12851assert( cons !=
NULL);
12853assert( consdata !=
NULL);
12855 nvars= consdata->nvars;
12856vars = consdata->vars;
12857weights = consdata->weights;
12864 if( consdata->capacity >=
nvars)
12868assert( consdata->sorted );
12869 if( weights[0] != 1 || weights[
nvars-1] != 1 )
12873 for(v = 0; v <
nvars; ++v)
12882var = consdata->vars[v];
12883assert( var !=
NULL);
12899 for(j = 0; j < nimpls; ++j)
12913cardvars[v] = implvars[j];
12930 if( makeupgrade == 0 )
12932 for(v = 0; v <
nvars; ++v)
12956 for(v = 0; v <
nvars; ++v)
12966conshdlrdata->upgradedcard =
TRUE;
12995assert( origcons !=
NULL);
12998 for(v = 0; v <
nvars; ++v)
13014 if( *nupgdconss > noldupgdconss )
13021 else if( success || *nfixedvars > oldnfixedvars || *nchgbds > oldnchgbds )
13037assert(result !=
NULL);
13040assert(consdata !=
NULL);
13045 for( i = 0; i < consdata->nvars; ++i )
13054assert(i < consdata->
nvars);
13062 if( inferinfo < 0 )
13069 if( inferinfo < consdata->
nvars&& consdata->vars[inferinfo] == infervar )
13070capsum = consdata->weights[inferinfo];
13073 for( i = 0; i < consdata->nvars && consdata->vars[i] != infervar; ++i )
13075assert(i < consdata->
nvars);
13076capsum = consdata->weights[i];
13083 if( capsum <= consdata->capacity )
13085 for( i = 0; i < consdata->nvars; i++ )
13090capsum += consdata->weights[i];
13091 if( capsum > consdata->capacity )
13121assert(consdata !=
NULL);
13123 for( i = 0; i < consdata->nvars; i++)
13150assert(cons !=
NULL);
13153assert(consdata !=
NULL);
13171assert(conshdlr !=
NULL);
13172assert(conss !=
NULL|| nconss == 0);
13190assert( conshdlr !=
NULL);
13191assert( cons !=
NULL);
13194assert(consdata !=
NULL);
13196 for( i = 0; i < consdata->nvars; ++i )
13215 const char* consname;
13225 for( v = 0; v <
nvars; ++v )
13228 if( name !=
NULL)
13236initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, global, valid) );
13237assert(cons !=
NULL);
13259assert(success !=
NULL);
13260assert(str !=
NULL);
13261assert(name !=
NULL);
13262assert(cons !=
NULL);
13271 while( *str !=
'\0')
13284endptr = strchr(endptr,
'<');
13286 if( endptr ==
NULL)
13300 if( varssize <=
nvars)
13307vars[
nvars] = var;
13308weights[
nvars] = weight;
13317 if( strncmp(str,
"<=", 2) != 0 )
13342initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
13359assert(consdata !=
NULL);
13361 if( varssize < consdata->
nvars)
13362(*success) =
FALSE;
13365assert(vars !=
NULL);
13368(*success) =
TRUE;
13381assert(consdata !=
NULL);
13383(*nvars) = consdata->nvars;
13384(*success) =
TRUE;
13417assert(eventdata !=
NULL);
13418assert(eventdata->cons !=
NULL);
13421assert(consdata !=
NULL);
13426consdata->onesweightsum += eventdata->weight;
13427consdata->presolvedtiming = 0;
13431consdata->onesweightsum -= eventdata->weight;
13434consdata->presolvedtiming = 0;
13438 if( !consdata->existmultaggr )
13442assert(var !=
NULL);
13447consdata->existmultaggr =
TRUE;
13448consdata->merged =
FALSE;
13452consdata->merged =
FALSE;
13456consdata->presolvedtiming = 0;
13459consdata->varsdeleted =
TRUE;
13487eventhdlrdata =
NULL;
13488conshdlrdata->eventhdlr =
NULL;
13490eventExecKnapsack, eventhdlrdata) );
13493 if( conshdlrdata->eventhdlr ==
NULL)
13495 SCIPerrorMessage(
"event handler for knapsack constraints not found\n");
13502consEnfolpKnapsack, consEnfopsKnapsack, consCheckKnapsack, consLockKnapsack,
13505assert(conshdlr !=
NULL);
13545 "multiplier on separation frequency, how often knapsack cuts are separated (-1: never, 0: only at root)",
13549 "maximal relative distance from current node's dual bound to primal bound compared to best node's dual bound for separating knapsack cuts",
13553 "lower clique size limit for greedy clique extraction algorithm (relative to largest clique)",
13557 "maximal number of separation rounds per node (-1: unlimited)",
13561 "maximal number of separation rounds per node in the root node (-1: unlimited)",
13565 "maximal number of cuts separated per separation round",
13569 "maximal number of cuts separated per separation round in the root node",
13573 "should disaggregation of knapsack constraints be allowed in preprocessing?",
13577 "should presolving try to simplify knapsacks",
13581 "should negated clique information be used in solving process",
13585 "should pairwise constraint comparison be performed in presolving?",
13589 "should hash table be used for detecting redundant constraints in advance",
13593 "should dual presolving steps be performed?",
13597 "should GUB information be used for separation?",
13601 "should presolving try to detect constraints parallel to the objective function defining an upper bound and prevent these constraints from entering the LP?",
13605 "should presolving try to detect constraints parallel to the objective function defining a lower bound and prevent these constraints from entering the LP?",
13609 "should clique partition information be updated when old partition seems outdated?",
13613 "factor on the growth of global cliques to decide when to update a previous " 13614 "(negated) clique partition (used only if updatecliquepartitions is set to TRUE)",
13616#ifdef WITH_CARDINALITY_UPGRADE 13619 "if TRUE then try to update knapsack constraints to cardinality constraints",
13620&conshdlrdata->upgdcardinality,
TRUE, DEFAULT_UPGDCARDINALITY,
NULL,
NULL) );
13670 if( conshdlr ==
NULL)
13678 for( i = 0; i <
nvars; ++i )
13689assert(conshdlrdata !=
NULL);
13690assert(conshdlrdata->eventhdlr !=
NULL);
13696 SCIP_CALL(
SCIPcreateCons(
scip, cons, name, conshdlr, consdata, initial, separate, enforce, check, propagate,
13697local, modifiable, dynamic, removable, stickingatnode) );
13743assert(var !=
NULL);
13775assert(consdata !=
NULL);
13777 returnconsdata->capacity;
13802 SCIPerrorMessage(
"method can only be called during problem creation stage\n");
13807assert(consdata !=
NULL);
13809consdata->capacity = capacity;
13832assert(consdata !=
NULL);
13834 returnconsdata->nvars;
13855assert(consdata !=
NULL);
13857 returnconsdata->vars;
13878assert(consdata !=
NULL);
13880 returnconsdata->weights;
13901assert(consdata !=
NULL);
13903 if( consdata->row !=
NULL)
13927assert(consdata !=
NULL);
13929 if( consdata->row !=
NULL)
13955assert(consdata !=
NULL);
13957 returnconsdata->row;
13973 if( conshdlr ==
NULL)
13976assert(infeasible !=
NULL);
13977*infeasible =
FALSE;
13982 for( i = 0; i < nconss; ++i )
constraint handler for cardinality constraints
static SCIP_Longint safeAddMinweightsGUB(SCIP_Longint val1, SCIP_Longint val2)
static SCIP_RETCODE separateCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool sepacuts, SCIP_Bool usegubs, SCIP_Bool *cutoff, int *ncuts)
static SCIP_DECL_CONSCOPY(consCopyKnapsack)
static SCIP_RETCODE consdataCreate(SCIP *scip, SCIP_CONSDATA **consdata, int nvars, SCIP_VAR **vars, SCIP_Longint *weights, SCIP_Longint capacity)
static SCIP_DECL_CONSHDLRCOPY(conshdlrCopyKnapsack)
static SCIP_RETCODE getLiftingSequenceGUB(SCIP *scip, SCIP_GUBSET *gubset, SCIP_Real *solvals, SCIP_Longint *weights, int *varsC1, int *varsC2, int *varsF, int *varsR, int nvarsC1, int nvarsC2, int nvarsF, int nvarsR, int *gubconsGC1, int *gubconsGC2, int *gubconsGFC1, int *gubconsGR, int *ngubconsGC1, int *ngubconsGC2, int *ngubconsGFC1, int *ngubconsGR, int *ngubconscapexceed, int *maxgubvarssize)
@ GUBCONSSTATUS_BELONGSTOSET_GF
@ GUBCONSSTATUS_UNINITIAL
@ GUBCONSSTATUS_BELONGSTOSET_GR
@ GUBCONSSTATUS_BELONGSTOSET_GOC1
@ GUBCONSSTATUS_BELONGSTOSET_GNC1
@ GUBCONSSTATUS_BELONGSTOSET_GC2
#define DEFAULT_DUALPRESOLVING
static SCIP_RETCODE deleteRedundantVars(SCIP *scip, SCIP_CONS *cons, SCIP_Longint frontsum, int splitpos, int *nchgcoefs, int *nchgsides, int *naddconss)
#define CONSHDLR_NEEDSCONS
#define DEFAULT_SEPACARDFREQ
#define CONSHDLR_SEPAFREQ
static SCIP_RETCODE insertZerolist(SCIP *scip, int **liftcands, int *nliftcands, int **firstidxs, SCIP_Longint **zeroweightsums, int **zeroitems, int **nextidxs, int *zeroitemssize, int *nzeroitems, int probindex, SCIP_Bool value, int knapsackidx, SCIP_Longint knapsackweight, SCIP_Bool *memlimitreached)
static SCIP_RETCODE addRelaxation(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff)
#define KNAPSACKRELAX_MAXDELTA
static SCIP_DECL_CONSENFOPS(consEnfopsKnapsack)
static SCIP_RETCODE eventdataCreate(SCIP *scip, SCIP_EVENTDATA **eventdata, SCIP_CONS *cons, SCIP_Longint weight)
static SCIP_RETCODE prepareCons(SCIP *scip, SCIP_CONS *cons, int *nfixedvars, int *ndelconss, int *nchgcoefs)
static SCIP_DECL_CONSGETPERMSYMGRAPH(consGetPermsymGraphKnapsack)
#define CONSHDLR_CHECKPRIORITY
static SCIP_RETCODE enlargeMinweights(SCIP *scip, SCIP_Longint **minweightsptr, int *minweightslen, int *minweightssize, int newlen)
static SCIP_DECL_CONSGETVARS(consGetVarsKnapsack)
static SCIP_RETCODE separateSequLiftedExtendedWeightInequality(SCIP *scip, SCIP_CONS *cons, SCIP_SEPA *sepa, SCIP_VAR **vars, int nvars, int ntightened, SCIP_Longint *weights, SCIP_Longint capacity, SCIP_Real *solvals, int *feassetvars, int *nonfeassetvars, int nfeassetvars, int nnonfeassetvars, SCIP_SOL *sol, SCIP_Bool *cutoff, int *ncuts)
static SCIP_DECL_CONSEXIT(consExitKnapsack)
static SCIP_RETCODE GUBconsCreate(SCIP *scip, SCIP_GUBCONS **gubcons)
static SCIP_DECL_CONSPRINT(consPrintKnapsack)
#define KNAPSACKRELAX_MAXSCALE
static void normalizeWeights(SCIP_CONS *cons, int *nchgcoefs, int *nchgsides)
static SCIP_RETCODE separateSupLiftedMinimalCoverInequality(SCIP *scip, SCIP_CONS *cons, SCIP_SEPA *sepa, SCIP_VAR **vars, int nvars, int ntightened, SCIP_Longint *weights, SCIP_Longint capacity, SCIP_Real *solvals, int *mincovervars, int *nonmincovervars, int nmincovervars, int nnonmincovervars, SCIP_Longint mincoverweight, SCIP_SOL *sol, SCIP_Bool *cutoff, int *ncuts)
#define DEFAULT_DETECTCUTOFFBOUND
static SCIP_RETCODE addCliques(SCIP *const scip, SCIP_CONS *const cons, SCIP_Real cliqueextractfactor, SCIP_Bool *const cutoff, int *const nbdchgs)
static SCIP_RETCODE upgradeCons(SCIP *scip, SCIP_CONS *cons, int *ndelconss, int *naddconss)
static SCIP_RETCODE createRelaxation(SCIP *scip, SCIP_CONS *cons)
static void updateWeightSums(SCIP_CONSDATA *consdata, SCIP_VAR *var, SCIP_Longint weightdelta)
static void GUBconsFree(SCIP *scip, SCIP_GUBCONS **gubcons)
#define CONSHDLR_PROP_TIMING
static SCIP_DECL_CONSSEPALP(consSepalpKnapsack)
static void getPartitionCovervars(SCIP *scip, SCIP_Real *solvals, int *covervars, int ncovervars, int *varsC1, int *varsC2, int *nvarsC1, int *nvarsC2)
static void GUBsetSwapVars(SCIP *scip, SCIP_GUBSET *gubset, int var1, int var2)
static SCIP_RETCODE unlockRounding(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
static SCIP_DECL_CONSTRANS(consTransKnapsack)
static SCIP_RETCODE getCover(SCIP *scip, SCIP_VAR **vars, int nvars, SCIP_Longint *weights, SCIP_Longint capacity, SCIP_Real *solvals, int *covervars, int *noncovervars, int *ncovervars, int *nnoncovervars, SCIP_Longint *coverweight, SCIP_Bool *found, SCIP_Bool modtransused, int *ntightened, SCIP_Bool *fractional)
static SCIP_DECL_CONSPROP(consPropKnapsack)
static SCIP_RETCODE consdataEnsureVarsSize(SCIP *scip, SCIP_CONSDATA *consdata, int num, SCIP_Bool transformed)
static SCIP_DECL_CONSRESPROP(consRespropKnapsack)
static void GUBsetFree(SCIP *scip, SCIP_GUBSET **gubset)
static SCIP_RETCODE createNormalizedKnapsack(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)
#define CONSHDLR_MAXPREROUNDS
static SCIP_RETCODE calcCliquepartition(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_CONSDATA *consdata, SCIP_Bool normalclique, SCIP_Bool negatedclique)
static SCIP_DECL_CONSEXITPRE(consExitpreKnapsack)
#define DEFAULT_PRESOLPAIRWISE
static SCIP_RETCODE performVarDeletions(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss)
#define CONSHDLR_SEPAPRIORITY
static SCIP_DECL_CONSINITSOL(consInitsolKnapsack)
#define DEFAULT_MAXROUNDSROOT
struct sortkeypair SORTKEYPAIR
#define DEFAULT_NEGATEDCLIQUE
enum GUBVarstatus GUBVARSTATUS
static SCIP_RETCODE changePartitionCovervars(SCIP *scip, SCIP_Longint *weights, int *varsC1, int *varsC2, int *nvarsC1, int *nvarsC2)
#define DEFAULT_MAXCARDBOUNDDIST
static SCIP_DECL_SORTPTRCOMP(compSortkeypairs)
#define MAXCOVERSIZEITERLEWI
static SCIP_RETCODE mergeMultiples(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff)
static SCIP_RETCODE GUBsetCheck(SCIP *scip, SCIP_GUBSET *gubset, SCIP_VAR **vars)
static SCIP_RETCODE GUBsetMoveVar(SCIP *scip, SCIP_GUBSET *gubset, SCIP_VAR **vars, int var, int oldgubcons, int newgubcons)
static SCIP_DECL_CONSCHECK(consCheckKnapsack)
static void sortItems(SCIP_CONSDATA *consdata)
static SCIP_DECL_CONSGETNVARS(consGetNVarsKnapsack)
static SCIP_RETCODE addNegatedCliques(SCIP *const scip, SCIP_CONS *const cons, SCIP_Bool *const cutoff, int *const nbdchgs)
static SCIP_DECL_CONSINIT(consInitKnapsack)
static SCIP_RETCODE detectRedundantVars(SCIP *scip, SCIP_CONS *cons, int *ndelconss, int *nchgcoefs, int *nchgsides, int *naddconss)
static SCIP_RETCODE GUBsetGetCliquePartition(SCIP *scip, SCIP_GUBSET *gubset, SCIP_VAR **vars, SCIP_Real *solvals)
static SCIP_DECL_EVENTEXEC(eventExecKnapsack)
static SCIP_RETCODE addSymmetryInformation(SCIP *scip, SYM_SYMTYPE symtype, SCIP_CONS *cons, SYM_GRAPH *graph, SCIP_Bool *success)
static SCIP_RETCODE applyFixings(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff)
static SCIP_RETCODE lockRounding(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
static void computeMinweightsGUB(SCIP_Longint *minweights, SCIP_Longint *finished, SCIP_Longint *unfinished, int minweightslen)
static SCIP_DECL_CONSINITLP(consInitlpKnapsack)
static SCIP_RETCODE sequentialUpAndDownLiftingGUB(SCIP *scip, SCIP_GUBSET *gubset, SCIP_VAR **vars, int ngubconscapexceed, SCIP_Longint *weights, SCIP_Longint capacity, SCIP_Real *solvals, int *gubconsGC1, int *gubconsGC2, int *gubconsGFC1, int *gubconsGR, int ngubconsGC1, int ngubconsGC2, int ngubconsGFC1, int ngubconsGR, int alpha0, int *liftcoefs, SCIP_Real *cutact, int *liftrhs, int maxgubvarssize)
#define HASHSIZE_KNAPSACKCONS
static SCIP_RETCODE GUBsetCalcCliquePartition(SCIP *const scip, SCIP_VAR **const vars, int const nvars, int *const cliquepartition, int *const ncliques, SCIP_Real *solvals)
#define DEFAULT_MAXSEPACUTSROOT
static SCIP_RETCODE checkCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool checklprows, SCIP_Bool printreason, SCIP_Bool *violated)
static SCIP_DECL_CONSEXITSOL(consExitsolKnapsack)
static SCIP_RETCODE dualWeightsTightening(SCIP *scip, SCIP_CONS *cons, int *ndelconss, int *nchgcoefs, int *nchgsides, int *naddconss)
static SCIP_DECL_CONSPRESOL(consPresolKnapsack)
#define DEFAULT_PRESOLUSEHASHING
static SCIP_DECL_HASHGETKEY(hashGetKeyKnapsackcons)
#define DEFAULT_CLQPARTUPDATEFAC
static SCIP_DECL_CONSDELVARS(consDelvarsKnapsack)
static SCIP_RETCODE addCoef(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Longint weight)
static SCIP_RETCODE dropEvents(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr)
static SCIP_RETCODE consdataFree(SCIP *scip, SCIP_CONSDATA **consdata, SCIP_EVENTHDLR *eventhdlr)
static SCIP_Bool checkMinweightidx(SCIP_Longint *weights, SCIP_Longint capacity, int *covervars, int ncovervars, SCIP_Longint coverweight, int minweightidx, int j)
static SCIP_DECL_CONSDEACTIVE(consDeactiveKnapsack)
static SCIP_RETCODE sequentialUpAndDownLifting(SCIP *scip, SCIP_VAR **vars, int nvars, int ntightened, SCIP_Longint *weights, SCIP_Longint capacity, SCIP_Real *solvals, int *varsM1, int *varsM2, int *varsF, int *varsR, int nvarsM1, int nvarsM2, int nvarsF, int nvarsR, int alpha0, int *liftcoefs, SCIP_Real *cutact, int *liftrhs)
static SCIP_RETCODE separateSequLiftedMinimalCoverInequality(SCIP *scip, SCIP_CONS *cons, SCIP_SEPA *sepa, SCIP_VAR **vars, int nvars, int ntightened, SCIP_Longint *weights, SCIP_Longint capacity, SCIP_Real *solvals, int *mincovervars, int *nonmincovervars, int nmincovervars, int nnonmincovervars, SCIP_SOL *sol, SCIP_GUBSET *gubset, SCIP_Bool *cutoff, int *ncuts)
static SCIP_RETCODE makeCoverMinimal(SCIP *scip, SCIP_Longint *weights, SCIP_Longint capacity, SCIP_Real *solvals, int *covervars, int *noncovervars, int *ncovervars, int *nnoncovervars, SCIP_Longint *coverweight, SCIP_Bool modtransused)
static SCIP_RETCODE delCoefPos(SCIP *scip, SCIP_CONS *cons, int pos)
#define MINGAINPERNMINCOMPARISONS
static SCIP_RETCODE greedyCliqueAlgorithm(SCIP *const scip, SCIP_VAR **items, SCIP_Longint *weights, int nitems, SCIP_Longint capacity, SCIP_Bool sorteditems, SCIP_Real cliqueextractfactor, SCIP_Bool *const cutoff, int *const nbdchgs)
#define DEFAULT_CLIQUEEXTRACTFACTOR
#define DEFAULT_SIMPLIFYINEQUALITIES
static SCIP_RETCODE eventdataFree(SCIP *scip, SCIP_EVENTDATA **eventdata)
static SCIP_RETCODE detectRedundantConstraints(SCIP *scip, BMS_BLKMEM *blkmem, SCIP_CONS **conss, int nconss, SCIP_Bool *cutoff, int *ndelconss)
static SCIP_RETCODE GUBsetCreate(SCIP *scip, SCIP_GUBSET **gubset, int nvars, SCIP_Longint *weights, SCIP_Longint capacity)
static SCIP_RETCODE getLiftingSequence(SCIP *scip, SCIP_Real *solvals, SCIP_Longint *weights, int *varsF, int *varsC2, int *varsR, int nvarsF, int nvarsC2, int nvarsR)
#define CONSHDLR_PROPFREQ
#define MAXNCLIQUEVARSCOMP
static SCIP_RETCODE tightenWeightsLift(SCIP *scip, SCIP_CONS *cons, int *nchgcoefs, SCIP_Bool *cutoff)
static SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(consGetSignedPermsymGraphKnapsack)
static SCIP_RETCODE getFeasibleSet(SCIP *scip, SCIP_CONS *cons, SCIP_SEPA *sepa, SCIP_VAR **vars, int nvars, int ntightened, SCIP_Longint *weights, SCIP_Longint capacity, SCIP_Real *solvals, int *covervars, int *noncovervars, int *ncovervars, int *nnoncovervars, SCIP_Longint *coverweight, SCIP_Bool modtransused, SCIP_SOL *sol, SCIP_Bool *cutoff, int *ncuts)
static SCIP_DECL_CONSACTIVE(consActiveKnapsack)
static SCIP_RETCODE simplifyInequalities(SCIP *scip, SCIP_CONS *cons, int *nfixedvars, int *ndelconss, int *nchgcoefs, int *nchgsides, int *naddconss, SCIP_Bool *cutoff)
enum GUBConsstatus GUBCONSSTATUS
static SCIP_RETCODE removeZeroWeights(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE catchEvents(SCIP *scip, SCIP_CONS *cons, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr)
#define CONSHDLR_PRESOLTIMING
static SCIP_RETCODE enforceConstraint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, int nusefulconss, SCIP_SOL *sol, SCIP_RESULT *result)
#define DEFAULT_MAXSEPACUTS
static SCIP_RETCODE superadditiveUpLifting(SCIP *scip, SCIP_VAR **vars, int nvars, int ntightened, SCIP_Longint *weights, SCIP_Longint capacity, SCIP_Real *solvals, int *covervars, int *noncovervars, int ncovervars, int nnoncovervars, SCIP_Longint coverweight, SCIP_Real *liftcoefs, SCIP_Real *cutact)
static SCIP_DECL_CONSSEPASOL(consSepasolKnapsack)
static SCIP_RETCODE addNlrow(SCIP *scip, SCIP_CONS *cons)
static void getPartitionNoncovervars(SCIP *scip, SCIP_Real *solvals, int *noncovervars, int nnoncovervars, int *varsF, int *varsR, int *nvarsF, int *nvarsR)
static SCIP_DECL_CONSFREE(consFreeKnapsack)
static SCIP_RETCODE stableSort(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR **vars, SCIP_Longint *weights, int *cliquestartposs, SCIP_Bool usenegatedclique)
static SCIP_RETCODE tightenWeights(SCIP *scip, SCIP_CONS *cons, SCIP_PRESOLTIMING presoltiming, int *nchgcoefs, int *nchgsides, int *naddconss, int *ndelconss, SCIP_Bool *cutoff)
#define CONSHDLR_EAGERFREQ
static void consdataChgWeight(SCIP_CONSDATA *consdata, int item, SCIP_Longint newweight)
static SCIP_RETCODE propagateCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff, SCIP_Bool *redundant, int *nfixedvars, SCIP_Bool usenegatedclique)
#define KNAPSACKRELAX_MAXDNOM
#define DEFAULT_MAXROUNDS
static SCIP_DECL_CONSENFOLP(consEnfolpKnapsack)
static SCIP_DECL_CONSLOCK(consLockKnapsack)
#define CONSHDLR_ENFOPRIORITY
static SCIP_DECL_CONSPARSE(consParseKnapsack)
#define LINCONSUPGD_PRIORITY
#define CONSHDLR_DELAYSEPA
#define MAX_USECLIQUES_SIZE
#define DEFAULT_UPDATECLIQUEPARTITIONS
@ GUBVARSTATUS_BELONGSTOSET_F
@ GUBVARSTATUS_BELONGSTOSET_C1
@ GUBVARSTATUS_BELONGSTOSET_R
@ GUBVARSTATUS_BELONGSTOSET_C2
@ GUBVARSTATUS_CAPACITYEXCEEDED
static SCIP_DECL_CONSINITPRE(consInitpreKnapsack)
static SCIP_DECL_CONSDELETE(consDeleteKnapsack)
static SCIP_DECL_LINCONSUPGD(linconsUpgdKnapsack)
static SCIP_DECL_CONSENFORELAX(consEnforelaxKnapsack)
static SCIP_RETCODE checkParallelObjective(SCIP *scip, SCIP_CONS *cons, SCIP_CONSHDLRDATA *conshdlrdata)
static SCIP_RETCODE GUBconsAddVar(SCIP *scip, SCIP_GUBCONS *gubcons, int var)
static SCIP_RETCODE changePartitionFeasiblesetvars(SCIP *scip, SCIP_Longint *weights, int *varsC1, int *varsC2, int *nvarsC1, int *nvarsC2)
#define DEFAULT_DISAGGREGATION
static SCIP_RETCODE preprocessConstraintPairs(SCIP *scip, SCIP_CONS **conss, int firstchange, int chkind, int *ndelconss)
static SCIP_RETCODE GUBconsDelVar(SCIP *scip, SCIP_GUBCONS *gubcons, int var, int gubvarsidx)
#define DEFAULT_DETECTLOWERBOUND
static SCIP_RETCODE dualPresolving(SCIP *scip, SCIP_CONS *cons, int *nfixedvars, int *ndelconss, SCIP_Bool *deleted)
static SCIP_DECL_HASHKEYEQ(hashKeyEqKnapsackcons)
#define CONSHDLR_DELAYPROP
static SCIP_DECL_HASHKEYVAL(hashKeyValKnapsackcons)
#define EVENTTYPE_KNAPSACK
#define MAX_ZEROITEMS_SIZE
Constraint handler for knapsack constraints of the form , x binary and .
Constraint handler for linear constraints in their most general form, .
Constraint handler for logicor constraints (equivalent to set covering, but algorithms are suited fo...
Constraint handler for the set partitioning / packing / covering constraints .
#define SCIP_MAXTREEDEPTH
#define SCIP_LONGINT_FORMAT
SCIP_RETCODE SCIPincludeLinconsUpgrade(SCIP *scip, SCIP_DECL_LINCONSUPGD((*linconsupgd)), int priority, const char *conshdlrname)
int SCIPgetNVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsCardinality(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, int cardval, SCIP_VAR **indvars, SCIP_Real *weights, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_RETCODE SCIPaddCoefKnapsack(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Longint weight)
SCIP_RETCODE SCIPsolveKnapsackApproximately(SCIP *scip, int nitems, SCIP_Longint *weights, SCIP_Real *profits, SCIP_Longint capacity, int *items, int *solitems, int *nonsolitems, int *nsolitems, int *nnonsolitems, SCIP_Real *solval)
SCIP_RETCODE SCIPcleanupConssKnapsack(SCIP *scip, SCIP_Bool onlychecked, SCIP_Bool *infeasible)
SCIP_RETCODE SCIPseparateKnapsackCuts(SCIP *scip, SCIP_CONS *cons, SCIP_SEPA *sepa, SCIP_VAR **vars, int nvars, SCIP_Longint *weights, SCIP_Longint capacity, SCIP_SOL *sol, SCIP_Bool usegubs, SCIP_Bool *cutoff, int *ncuts)
SCIP_RETCODE SCIPcreateConsSetpack(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, 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 SCIPcreateConsBasicKnapsack(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Longint *weights, SCIP_Longint capacity)
SCIP_RETCODE SCIPchgCapacityKnapsack(SCIP *scip, SCIP_CONS *cons, SCIP_Longint capacity)
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 SCIPsolveKnapsackExactly(SCIP *scip, int nitems, SCIP_Longint *weights, SCIP_Real *profits, SCIP_Longint capacity, int *items, int *solitems, int *nonsolitems, int *nsolitems, int *nnonsolitems, SCIP_Real *solval, SCIP_Bool *success)
SCIP_RETCODE SCIPcreateConsKnapsack(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Longint *weights, SCIP_Longint capacity, 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 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)
SCIP_Longint * SCIPgetWeightsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Longint SCIPgetCapacityKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsLogicor(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, 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 SCIPgetDualfarkasKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_ROW * SCIPgetRowKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetDualsolKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPincludeConshdlrKnapsack(SCIP *scip)
SCIP_Bool SCIPisConsCompressionEnabled(SCIP *scip)
SCIP_Bool SCIPisTransformed(SCIP *scip)
SCIP_Bool SCIPisPresolveFinished(SCIP *scip)
SCIP_Bool SCIPisStopped(SCIP *scip)
SCIP_STAGE SCIPgetStage(SCIP *scip)
int SCIPgetNObjVars(SCIP *scip)
int SCIPgetNContVars(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
SCIP_CONS * SCIPfindOrigCons(SCIP *scip, const char *name)
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
int SCIPhashmapGetImageInt(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapInsertInt(SCIP_HASHMAP *hashmap, void *origin, int image)
SCIP_RETCODE SCIPhashmapSetImageInt(SCIP_HASHMAP *hashmap, void *origin, int image)
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
#define SCIPhashSix(a, b, c, d, e, f)
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)
void * SCIPhashtableRetrieve(SCIP_HASHTABLE *hashtable, void *key)
SCIP_RETCODE SCIPhashtableRemove(SCIP_HASHTABLE *hashtable, void *element)
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
SCIP_RETCODE SCIPupdateLocalLowerbound(SCIP *scip, SCIP_Real newbound)
SCIP_RETCODE SCIPdelConsLocal(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLocalLowerbound(SCIP *scip)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
#define SCIPdebugMsgPrint
SCIP_Longint SCIPcalcGreComDiv(SCIP_Longint val1, SCIP_Longint val2)
SCIP_RETCODE SCIPcalcIntegralScalar(SCIP_Real *vals, int nvals, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Real maxscale, SCIP_Real *intscalar, SCIP_Bool *success)
SCIP_Real SCIPrelDiff(SCIP_Real val1, SCIP_Real val2)
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)
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)
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 SCIPgetNLPBranchCands(SCIP *scip)
SCIP_RETCODE SCIPinitConflictAnalysis(SCIP *scip, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
SCIP_Bool SCIPisConflictAnalysisApplicable(SCIP *scip)
SCIP_RETCODE SCIPaddConflictBinvar(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPanalyzeConflictCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
int SCIPconshdlrGetNCheckConss(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPARSE((*consparse)))
void SCIPconshdlrSetData(SCIP_CONSHDLR *conshdlr, SCIP_CONSHDLRDATA *conshdlrdata)
SCIP_CONS ** SCIPconshdlrGetCheckConss(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
SCIP_RETCODE SCIPsetConshdlrInit(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINIT((*consinit)))
SCIP_RETCODE SCIPsetConshdlrGetVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETVARS((*consgetvars)))
SCIP_RETCODE SCIPsetConshdlrInitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITPRE((*consinitpre)))
SCIP_RETCODE SCIPsetConshdlrSepa(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), int sepafreq, int sepapriority, SCIP_Bool delaysepa)
SCIP_RETCODE SCIPsetConshdlrProp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING proptiming)
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_RETCODE SCIPsetConshdlrDeactive(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDEACTIVE((*consdeactive)))
SCIP_Longint SCIPconshdlrGetNCutsFound(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPsetConshdlrGetPermsymGraph(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETPERMSYMGRAPH((*consgetpermsymgraph)))
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSFREE((*consfree)))
SCIP_RETCODE SCIPsetConshdlrEnforelax(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENFORELAX((*consenforelax)))
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPsetConshdlrExit(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXIT((*consexit)))
SCIP_RETCODE SCIPsetConshdlrExitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITPRE((*consexitpre)))
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
SCIP_RETCODE SCIPsetConshdlrGetSignedPermsymGraph(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH((*consgetsignedpermsymgraph)))
SCIP_RETCODE SCIPsetConshdlrExitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITSOL((*consexitsol)))
SCIP_RETCODE SCIPsetConshdlrDelvars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELVARS((*consdelvars)))
SCIP_RETCODE SCIPsetConshdlrInitlp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITLP((*consinitlp)))
SCIP_RETCODE SCIPsetConshdlrInitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITSOL((*consinitsol)))
SCIP_CONSHDLRDATA * SCIPconshdlrGetData(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSTRANS((*constrans)))
SCIP_RETCODE SCIPsetConshdlrResprop(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSRESPROP((*consresprop)))
int SCIPconshdlrGetNActiveConss(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPsetConshdlrGetNVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETNVARS((*consgetnvars)))
int SCIPconshdlrGetSepaFreq(SCIP_CONSHDLR *conshdlr)
SCIP_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPsetConshdlrActive(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSACTIVE((*consactive)))
SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRINT((*consprint)))
SCIP_CONSDATA * SCIPconsGetData(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
SCIP_RETCODE SCIPsetConsSeparated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool separate)
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsDeleted(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConsInitial(SCIP *scip, SCIP_CONS *cons, SCIP_Bool initial)
SCIP_RETCODE SCIPsetConsEnforced(SCIP *scip, SCIP_CONS *cons, SCIP_Bool enforce)
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
SCIP_RETCODE SCIPunmarkConsPropagate(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
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_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_RETCODE SCIPresetConsAge(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPmarkConsPropagate(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
SCIP_RETCODE SCIPupdateConsFlags(SCIP *scip, SCIP_CONS *cons0, SCIP_CONS *cons1)
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
SCIP_RETCODE SCIPsetConsPropagated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool propagate)
SCIP_RETCODE SCIPsetConsChecked(SCIP *scip, SCIP_CONS *cons, SCIP_Bool check)
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
SCIP_RETCODE SCIPincConsAge(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
SCIP_Bool SCIPisCutEfficacious(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut)
SCIP_Bool SCIPisEfficacious(SCIP *scip, SCIP_Real efficacy)
SCIP_RETCODE SCIPaddRow(SCIP *scip, SCIP_ROW *row, SCIP_Bool forcecut, SCIP_Bool *infeasible)
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
SCIP_RETCODE SCIPcatchVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
SCIP_VAR * SCIPeventGetVar(SCIP_EVENT *event)
#define SCIPfreeBuffer(scip, ptr)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
#define SCIPallocClearBlockMemoryArray(scip, ptr, num)
#define SCIPallocClearBufferArray(scip, ptr, num)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPreallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPallocBuffer(scip, ptr)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
#define SCIPallocBlockMemory(scip, ptr)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
SCIP_RETCODE SCIPdelNlRow(SCIP *scip, SCIP_NLROW *nlrow)
SCIP_RETCODE SCIPaddNlRow(SCIP *scip, SCIP_NLROW *nlrow)
SCIP_Bool SCIPisNLPConstructed(SCIP *scip)
SCIP_RETCODE SCIPreleaseNlRow(SCIP *scip, SCIP_NLROW **nlrow)
SCIP_Bool SCIPnlrowIsInNLP(SCIP_NLROW *nlrow)
SCIP_RETCODE SCIPcreateNlRow(SCIP *scip, SCIP_NLROW **nlrow, const char *name, SCIP_Real constant, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, SCIP_EXPR *expr, SCIP_Real lhs, SCIP_Real rhs, SCIP_EXPRCURV curvature)
SCIP_Bool SCIPinProbing(SCIP *scip)
SCIP_RETCODE SCIPcacheRowExtensions(SCIP *scip, SCIP_ROW *row)
SCIP_RETCODE SCIPcreateEmptyRowCons(SCIP *scip, SCIP_ROW **row, SCIP_CONS *cons, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
SCIP_RETCODE SCIPflushRowExtensions(SCIP *scip, SCIP_ROW *row)
SCIP_RETCODE SCIPcreateEmptyRowConshdlr(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_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
SCIP_RETCODE SCIPcreateEmptyRowSepa(SCIP *scip, SCIP_ROW **row, SCIP_SEPA *sepa, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
SCIP_RETCODE SCIPcreateEmptyRowUnspec(SCIP *scip, SCIP_ROW **row, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
SCIP_Real SCIProwGetDualfarkas(SCIP_ROW *row)
SCIP_Bool SCIProwIsInLP(SCIP_ROW *row)
SCIP_Real SCIProwGetDualsol(SCIP_ROW *row)
const char * SCIPsepaGetName(SCIP_SEPA *sepa)
SCIP_Longint SCIPsepaGetNCutsFound(SCIP_SEPA *sepa)
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
void SCIPupdateSolLPConsViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
SCIP_RETCODE SCIPupdateCutoffbound(SCIP *scip, SCIP_Real cutoffbound)
int SCIPgetNSepaRounds(SCIP *scip)
SCIP_Real SCIPgetLowerbound(SCIP *scip)
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisHugeValue(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPcutoffbounddelta(SCIP *scip)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPepsilon(SCIP *scip)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasPositive(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPinRepropagation(SCIP *scip)
int SCIPgetDepth(SCIP *scip)
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
int SCIPvarGetNVlbs(SCIP_VAR *var)
SCIP_Bool SCIPvarIsDeleted(SCIP_VAR *var)
SCIP_RETCODE SCIPlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
SCIP_Real SCIPvarGetMultaggrConstant(SCIP_VAR *var)
SCIP_VAR * SCIPvarGetNegatedVar(SCIP_VAR *var)
SCIP_Real * SCIPvarGetVlbCoefs(SCIP_VAR *var)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
SCIP_RETCODE SCIPaddClique(SCIP *scip, SCIP_VAR **vars, SCIP_Bool *values, int nvars, SCIP_Bool isequation, SCIP_Bool *infeasible, int *nbdchgs)
SCIP_RETCODE SCIPcalcCliquePartition(SCIP *const scip, SCIP_VAR **const vars, int const nvars, int *const cliquepartition, int *const ncliques)
SCIP_RETCODE SCIPgetTransformedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
int SCIPvarGetNImpls(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
int SCIPvarGetNLocksUpType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
SCIP_RETCODE SCIPcalcNegatedCliquePartition(SCIP *const scip, SCIP_VAR **const vars, int const nvars, int *const cliquepartition, int *const ncliques)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_Bool SCIPvarIsTransformed(SCIP_VAR *var)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_VAR * SCIPvarGetProbvar(SCIP_VAR *var)
SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_RETCODE SCIPparseVarName(SCIP *scip, const char *str, SCIP_VAR **var, char **endptr)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
SCIP_VAR ** SCIPvarGetImplVars(SCIP_VAR *var, SCIP_Bool varfixing)
int SCIPvarGetIndex(SCIP_VAR *var)
SCIP_RETCODE SCIPaddVarLocksType(SCIP *scip, SCIP_VAR *var, SCIP_LOCKTYPE locktype, int nlocksdown, int nlocksup)
SCIP_RETCODE SCIPunlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
SCIP_Real SCIPgetVarUbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
int SCIPvarGetProbindex(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
SCIP_Real * SCIPvarGetVlbConstants(SCIP_VAR *var)
int SCIPvarGetNVubs(SCIP_VAR *var)
SCIP_Bool SCIPvarIsIntegral(SCIP_VAR *var)
SCIP_Real * SCIPvarGetImplBounds(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_RETCODE SCIPflattenVarAggregationGraph(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPgetNegatedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **negvar)
SCIP_VAR ** SCIPvarGetMultaggrVars(SCIP_VAR *var)
int SCIPvarGetMultaggrNVars(SCIP_VAR *var)
int SCIPvarGetNCliques(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_Bool SCIPvarIsNegated(SCIP_VAR *var)
int SCIPgetNCliques(SCIP *scip)
SCIP_VAR ** SCIPvarGetVlbVars(SCIP_VAR *var)
SCIP_CLIQUE ** SCIPvarGetCliques(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
SCIP_Real SCIPgetVarLbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
int SCIPvarCompare(SCIP_VAR *var1, SCIP_VAR *var2)
SCIP_RETCODE SCIPvarGetProbvarBinary(SCIP_VAR **var, SCIP_Bool *negated)
SCIP_RETCODE SCIPinferBinvarCons(SCIP *scip, SCIP_VAR *var, SCIP_Bool fixedval, SCIP_CONS *infercons, int inferinfo, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_Real * SCIPvarGetVubConstants(SCIP_VAR *var)
SCIP_RETCODE SCIPwriteVarName(SCIP *scip, FILE *file, SCIP_VAR *var, SCIP_Bool type)
SCIP_RETCODE SCIPgetBinvarRepresentative(SCIP *scip, SCIP_VAR *var, SCIP_VAR **repvar, SCIP_Bool *negated)
SCIP_VAR ** SCIPvarGetVubVars(SCIP_VAR *var)
SCIP_Bool SCIPvarsHaveCommonClique(SCIP_VAR *var1, SCIP_Bool value1, SCIP_VAR *var2, SCIP_Bool value2, SCIP_Bool regardimplics)
SCIP_Real * SCIPvarGetVubCoefs(SCIP_VAR *var)
int SCIPvarGetNLocksDownType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
SCIP_RETCODE SCIPgetNegatedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **negvars)
SCIP_BOUNDTYPE * SCIPvarGetImplTypes(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_RETCODE SCIPcaptureVar(SCIP *scip, SCIP_VAR *var)
SCIP_Bool SCIPallowStrongDualReds(SCIP *scip)
SCIP_RETCODE SCIPvarsGetProbvarBinary(SCIP_VAR ***vars, SCIP_Bool **negatedarr, int nvars)
SCIP_Real * SCIPvarGetMultaggrScalars(SCIP_VAR *var)
void SCIPselectWeightedDownRealLongRealInt(SCIP_Real *realarray1, SCIP_Longint *longarray, SCIP_Real *realarray3, int *intarray, SCIP_Real *weights, SCIP_Real capacity, int len, int *medianpos)
void SCIPsortDownLongPtr(SCIP_Longint *longarray, void **ptrarray, int len)
void SCIPsortIntInt(int *intarray1, int *intarray2, int len)
void SCIPsortPtrPtrIntInt(void **ptrarray1, void **ptrarray2, int *intarray1, int *intarray2, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
void SCIPsortPtrPtrLongIntInt(void **ptrarray1, void **ptrarray2, SCIP_Longint *longarray, int *intarray1, int *intarray2, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
void SCIPsortDownPtrInt(void **ptrarray, int *intarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
void SCIPsortDownLongPtrPtrIntInt(SCIP_Longint *longarray, void **ptrarray1, void **ptrarray2, int *intarray1, int *intarray2, int len)
void SCIPsortRealInt(SCIP_Real *realarray, int *intarray, int len)
void SCIPsortDownRealIntLong(SCIP_Real *realarray, int *intarray, SCIP_Longint *longarray, int len)
void SCIPsortPtrInt(void **ptrarray, int *intarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
void SCIPsortDownRealInt(SCIP_Real *realarray, int *intarray, int len)
void SCIPsortDownLongPtrInt(SCIP_Longint *longarray, void **ptrarray, int *intarray, int len)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIP_RETCODE SCIPskipSpace(char **s)
SCIP_RETCODE SCIPgetSymActiveVariables(SCIP *scip, SYM_SYMTYPE symtype, SCIP_VAR ***vars, SCIP_Real **scalars, int *nvars, SCIP_Real *constant, SCIP_Bool transformed)
SCIP_RETCODE SCIPextendPermsymDetectionGraphLinear(SCIP *scip, SYM_GRAPH *graph, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SCIP_CONS *cons, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool *success)
SCIP_VAR ** SCIPcliqueGetVars(SCIP_CLIQUE *clique)
int SCIPcliqueGetNVars(SCIP_CLIQUE *clique)
SCIP_Bool * SCIPcliqueGetValues(SCIP_CLIQUE *clique)
memory allocation routines
#define BMScopyMemoryArray(ptr, source, num)
#define BMSclearMemoryArray(ptr, num)
struct BMS_BlkMem BMS_BLKMEM
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
public methods for managing constraints
public methods for managing events
public methods for implications, variable bounds, and cliques
public methods for LP management
public methods for message output
#define SCIPdebugPrintCons(x, y, z)
public data structures and miscellaneous methods
methods for selecting (weighted) k-medians
methods for sorting joint arrays of various types
public methods for separators
public methods for problem variables
public methods for branching rule plugins and branching
public methods for conflict handler plugins and conflict analysis
public methods for constraint handler plugins and constraints
public methods for problem copies
public methods for cuts and aggregation rows
public methods for event handler plugins and event handlers
public methods for the LP relaxation, rows and columns
public methods for memory management
public methods for message handling
public methods for nonlinear relaxation
public methods for numerical tolerances
public methods for SCIP parameter handling
public methods for global and local (sub)problems
public methods for the probing mode
public methods for solutions
public methods for querying solving statistics
public methods for the branch-and-bound tree
public methods for SCIP variables
GUBVARSTATUS * gubvarsstatus
GUBCONSSTATUS * gubconsstatus
structs for symmetry computations
methods for dealing with symmetry detection graphs
@ SCIP_CONFTYPE_PROPAGATION
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
struct SCIP_ConsData SCIP_CONSDATA
struct SCIP_EventData SCIP_EVENTDATA
#define SCIP_EVENTTYPE_UBTIGHTENED
#define SCIP_EVENTTYPE_VARFIXED
#define SCIP_EVENTTYPE_VARDELETED
struct SCIP_EventhdlrData SCIP_EVENTHDLRDATA
#define SCIP_EVENTTYPE_LBRELAXED
#define SCIP_EVENTTYPE_FORMAT
#define SCIP_EVENTTYPE_IMPLADDED
#define SCIP_EVENTTYPE_LBTIGHTENED
enum SCIP_BoundType SCIP_BOUNDTYPE
enum SCIP_Result SCIP_RESULT
enum SCIP_Retcode SCIP_RETCODE
@ SCIP_STAGE_TRANSFORMING
enum SYM_Symtype SYM_SYMTYPE
#define SCIP_PRESOLTIMING_MEDIUM
unsigned int SCIP_PRESOLTIMING
#define SCIP_PRESOLTIMING_FAST
#define SCIP_PRESOLTIMING_EXHAUSTIVE
@ SCIP_VARSTATUS_MULTAGGR
@ SCIP_VARSTATUS_AGGREGATED
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4