32 #define PRESOL_NAME "gateextraction" 33 #define PRESOL_DESC "presolver extracting gate(and)-constraints" 34 #define PRESOL_PRIORITY 1000000 35 #define PRESOL_MAXROUNDS -1 36 #define PRESOL_TIMING SCIP_PRESOLTIMING_EXHAUSTIVE 38 #define HASHSIZE_LOGICORCONS 500 39 #define HASHSIZE_SETPPCCONS 500 41 #define DEFAULT_ONLYSETPART FALSE 42 #define DEFAULT_SEARCHEQUATIONS TRUE 45 #define DEFAULT_SORTING 1 93 struct SCIP_PresolData
102 int nsetppchashdatas;
103 int ssetppchashdatas;
105 int firstchangedlogicor;
142 scip = (
SCIP*)userptr;
143 assert(scip != NULL);
147 assert(hashdata1->
nvars == 2);
148 assert(hashdata2->
nvars == 2);
154 for( v = 1; v >= 0; --v )
157 if( hashdata1->
vars[v] != hashdata2->
vars[v] )
166 if( hashdata1->
cons == NULL || hashdata2->
cons == NULL || hashdata1->
cons == hashdata2->
cons )
177 unsigned int hashval;
180 assert(hashdata != NULL);
181 assert(hashdata->
vars != NULL);
182 assert(hashdata->
nvars == 2);
205 scip = (
SCIP*)userptr;
206 assert(scip != NULL);
210 assert(hashdata1->
nvars >= 2);
211 assert(hashdata2->
nvars >= 2);
213 assert(hashdata1->
cons != NULL || hashdata2->
cons != NULL);
218 for( v = hashdata1->
nvars - 1; v >= 0; --v )
221 if( hashdata1->
vars[v] != hashdata2->
vars[v] )
230 if( hashdata1->
cons == NULL || hashdata2->
cons == NULL || hashdata1->
cons == hashdata2->
cons )
243 assert(hashdata != NULL);
244 assert(hashdata->
vars != NULL);
245 assert(hashdata->
nvars >= 2);
258 assert(presoldata != NULL);
260 presoldata->usefullogicor = NULL;
261 presoldata->nusefullogicor = 0;
262 presoldata->susefullogicor = 0;
263 presoldata->firstchangedlogicor = -1;
264 presoldata->maxnvarslogicor = 0;;
265 presoldata->nsetppchashdatas = 0;
266 presoldata->ssetppchashdatas = 0;
267 presoldata->ngates = 0;
268 presoldata->usefulsetppcexist =
FALSE;
269 presoldata->usefullogicorexist =
FALSE;
270 presoldata->newsetppchashdatas =
FALSE;
271 presoldata->initialized =
FALSE;
273 presoldata->hashdatatable = NULL;
274 presoldata->setppchashtable = NULL;
275 presoldata->logicorhashtable = NULL;
285 assert(scip != NULL);
286 assert(presoldata != NULL);
288 assert(presoldata->nusefullogicor == 0);
289 assert(presoldata->susefullogicor == 0);
290 assert(presoldata->nsetppchashdatas == 0);
291 assert(presoldata->ssetppchashdatas == 0);
292 assert(presoldata->firstchangedlogicor == -1);
293 assert(presoldata->ngates == 0);
294 assert(presoldata->usefullogicorexist ==
FALSE);
295 assert(presoldata->usefulsetppcexist ==
FALSE);
296 assert(presoldata->newsetppchashdatas ==
FALSE);
297 assert(presoldata->initialized ==
FALSE);
299 assert(presoldata->hashdatatable == NULL);
300 assert(presoldata->setppchashtable == NULL);
301 assert(presoldata->logicorhashtable == NULL);
305 SCIPhashGetKeyStandard, hashdataKeyEqCons, hashdataKeyValCons, (
void*) scip) );
307 SCIPhashGetKeyStandard, SCIPhashKeyEqPtr, SCIPhashKeyValPtr, (
void*) scip) );
309 SCIPhashGetKeyStandard, SCIPhashKeyEqPtr, SCIPhashKeyValPtr, (
void*) scip) );
327 int nusefulconss = 0;
331 assert(scip != NULL);
332 assert(presoldata != NULL);
333 assert(setppcs != NULL);
334 assert(nsetppcs > 0);
335 assert(logicors != NULL);
336 assert(nlogicors > 0);
337 assert(presoldata->setppchashtable != NULL);
338 assert(presoldata->logicorhashtable != NULL);
340 presoldata->initialized =
TRUE;
342 size =
MAX(nsetppcs, nlogicors);
347 if( !presoldata->usefulsetppcexist )
350 for( c = 0; c < nsetppcs; ++c )
359 usefulconss[nusefulconss] = setppcs[c];
365 if( nusefulconss > 0 )
370 presoldata->usefulsetppcexist =
TRUE;
371 presoldata->ssetppchashdatas = nusefulconss;
376 for( c = 0; c < nusefulconss; ++c )
394 presoldata->setppchashdatas[h].nvars = 2;
403 SCIP_VAR* tmp = presoldata->setppchashdatas[h].vars[0];
404 presoldata->setppchashdatas[h].vars[0] = presoldata->setppchashdatas[h].vars[1];
405 presoldata->setppchashdatas[h].vars[1] = tmp;
408 presoldata->setppchashdatas[h].cons = usefulconss[c];
415 presoldata->nsetppchashdatas = h;
417 if( presoldata->nsetppchashdatas > 0 )
418 presoldata->newsetppchashdatas =
TRUE;
424 if( !presoldata->usefullogicorexist )
427 for( c = 0; c < nlogicors; ++c )
437 usefulconss[nusefulconss] = logicors[c];
447 if( nusefulconss > 0 )
449 presoldata->firstchangedlogicor = 0;
450 presoldata->usefullogicorexist =
TRUE;
451 presoldata->susefullogicor = nusefulconss;
452 presoldata->nusefullogicor = nusefulconss;
471 assert(scip != NULL);
472 assert(presoldata != NULL);
474 if( presoldata->usefulsetppcexist )
478 assert(presoldata->setppchashdatas != NULL || presoldata->nsetppchashdatas == 0);
480 for( c = presoldata->nsetppchashdatas - 1; c >= 0; --c )
484 assert(presoldata->setppchashdatas[c].cons != NULL);
501 || presoldata->setppchashdatas[c].vars[0] != vars[0] || presoldata->setppchashdatas[c].vars[1] != vars[1] )
510 assert(
SCIPhashtableExists(presoldata->setppchashtable, (
void*) presoldata->setppchashdatas[c].cons));
526 if( c < presoldata->nsetppchashdatas - 1 )
533 presoldata->setppchashdatas[c].cons = presoldata->setppchashdatas[presoldata->nsetppchashdatas - 1].cons;
534 presoldata->setppchashdatas[c].vars = presoldata->setppchashdatas[presoldata->nsetppchashdatas - 1].vars;
535 presoldata->setppchashdatas[c].nvars = presoldata->setppchashdatas[presoldata->nsetppchashdatas - 1].nvars;
537 if( c < presoldata->nsetppchashdatas - 1 )
542 --(presoldata->nsetppchashdatas);
547 for( c = presoldata->nsetppchashdatas - 1; c >= 0; --c )
549 assert(presoldata->setppchashdatas[c].nvars == 2);
550 assert(presoldata->setppchashdatas[c].vars != NULL);
551 assert(presoldata->setppchashdatas[c].vars[0] != NULL);
552 assert(presoldata->setppchashdatas[c].vars[1] != NULL);
553 assert(presoldata->setppchashdatas[c].cons != NULL);
555 assert(
SCIPhashtableExists(presoldata->hashdatatable, (
void*) &presoldata->setppchashdatas[c]));
556 assert(
SCIPhashtableExists(presoldata->setppchashtable, (
void*) presoldata->setppchashdatas[c].cons));
575 int oldnsetppchashdatas;
578 assert(scip != NULL);
579 assert(presoldata != NULL);
580 assert(setppcs != NULL);
581 assert(nsetppcs > 0);
582 assert(logicors != NULL);
583 assert(nlogicors > 0);
584 assert(presoldata->initialized);
585 assert(presoldata->setppchashtable != NULL);
586 assert(presoldata->logicorhashtable != NULL);
589 if( !presoldata->usefulsetppcexist || !presoldata->usefullogicorexist )
591 SCIP_Bool usefullogicorexisted = presoldata->usefullogicorexist;
598 if( usefullogicorexisted && !presoldata->usefulsetppcexist )
601 for( c = nlogicors - 1; c >= 0; --c )
612 if( !presoldata->usefulsetppcexist || !presoldata->usefullogicorexist )
619 oldnsetppchashdatas = presoldata->nsetppchashdatas;
623 for( c = nsetppcs - 1; c >= 0; --c )
636 if( presoldata->nsetppchashdatas == presoldata->ssetppchashdatas )
644 if( newsize <= presoldata->ssetppchashdatas )
651 presoldata->ssetppchashdatas = newsize;
654 for( d = presoldata->nsetppchashdatas - 1; d >= 0; --d )
667 SCIP_CALL(
SCIPgetBinvarRepresentative(scip, presoldata->setppchashdatas[presoldata->nsetppchashdatas].vars[0], &(presoldata->setppchashdatas[presoldata->nsetppchashdatas].vars[0]), &(negated[0])) );
668 SCIP_CALL(
SCIPgetBinvarRepresentative(scip, presoldata->setppchashdatas[presoldata->nsetppchashdatas].vars[1], &(presoldata->setppchashdatas[presoldata->nsetppchashdatas].vars[1]), &(negated[1])) );
677 presoldata->setppchashdatas[presoldata->nsetppchashdatas].nvars = 2;
684 if(
SCIPvarGetIndex(presoldata->setppchashdatas[presoldata->nsetppchashdatas].vars[0]) >
SCIPvarGetIndex(presoldata->setppchashdatas[presoldata->nsetppchashdatas].vars[1]) )
686 SCIP_VAR* tmp = presoldata->setppchashdatas[presoldata->nsetppchashdatas].vars[0];
687 presoldata->setppchashdatas[presoldata->nsetppchashdatas].vars[0] = presoldata->setppchashdatas[presoldata->nsetppchashdatas].vars[1];
688 presoldata->setppchashdatas[presoldata->nsetppchashdatas].vars[1] = tmp;
691 presoldata->setppchashdatas[presoldata->nsetppchashdatas].cons = setppcs[c];
696 ++(presoldata->nsetppchashdatas);
702 if( oldnsetppchashdatas < presoldata->nsetppchashdatas )
703 presoldata->newsetppchashdatas =
TRUE;
707 while( presoldata->nusefullogicor > 0 && !
SCIPconsIsActive(presoldata->usefullogicor[presoldata->nusefullogicor - 1]) )
712 --(presoldata->nusefullogicor);
716 for( c = presoldata->nusefullogicor - 1; c >= 0; --c )
719 if( presoldata->maxnvarslogicor <
SCIPgetNVarsLogicor(scip, presoldata->usefullogicor[c]) )
727 presoldata->usefullogicor[c] = presoldata->usefullogicor[presoldata->nusefullogicor - 1];
728 --(presoldata->nusefullogicor);
732 presoldata->firstchangedlogicor = presoldata->nusefullogicor;
733 assert(presoldata->firstchangedlogicor >= 0);
736 for( c = nlogicors - 1; c >= 0; --c )
746 if( presoldata->nusefullogicor == presoldata->susefullogicor )
753 if( newsize <= presoldata->susefullogicor )
757 presoldata->susefullogicor = newsize;
764 presoldata->usefullogicor[presoldata->nusefullogicor] = logicors[c];
765 ++(presoldata->nusefullogicor);
803 assert(scip != NULL);
804 assert(presoldata != NULL);
805 assert(0 <= pos && pos < presoldata->nusefullogicor);
806 assert(gateconss != NULL);
807 assert(activevars != NULL);
808 assert(posresultants != NULL);
809 assert(hashdata != NULL);
810 assert(hashdata->
vars != NULL);
811 assert(hashdata->
nvars == 2);
812 assert(hashdata->
cons == NULL);
813 assert(ndelconss != NULL);
814 assert(naddconss != NULL);
816 assert(presoldata->usefullogicor != NULL);
817 logicor = presoldata->usefullogicor[pos];
818 assert(logicor != NULL);
826 assert(nlogicorvars >= 3 && nlogicorvars <= presoldata->maxnvarslogicor);
829 assert(logicorvars != NULL);
834 for( d = nlogicorvars - 1; d >= 0; --d )
842 if( activevars[d] == NULL )
855 posresultants[nposresultants] = activevars[d];
867 posresultants[nposresultants] = activevars[d];
875 if( nposresultants == 0 )
879 SCIPsortPtr((
void**)activevars, SCIPvarComp, nlogicorvars);
884 for( d = nlogicorvars - 1; d > 0; --d )
888 assert(presoldata->usefullogicor[pos] == logicor);
893 presoldata->usefullogicor[pos] = presoldata->usefullogicor[presoldata->nusefullogicor - 1];
894 --(presoldata->nusefullogicor);
902 for( d = nposresultants - 1; d >= 0; --d )
906 for( v = nlogicorvars - 1; v >= 0; --v )
908 if( activevars[v] == posresultants[d] )
914 hashdata->
vars[0] = activevars[v];
915 hashdata->
vars[1] = posresultants[d];
919 hashdata->
vars[0] = posresultants[d];
920 hashdata->
vars[1] = activevars[v];
927 gateconss[ngateconss] = hashmaphashdata->
cons;
933 if( ngateconss == nlogicorvars - 1 )
939 if( ngateconss == nlogicorvars - 1 && nlogicorvars == 3 )
941 assert(d >= 0 && d < nposresultants);
942 assert(ngateconss >= 2);
944 if( activevars[0] == posresultants[d] )
946 hashdata->
vars[0] = activevars[1];
947 hashdata->
vars[1] = activevars[2];
949 else if( activevars[1] == posresultants[d] )
951 hashdata->
vars[0] = activevars[0];
952 hashdata->
vars[1] = activevars[2];
956 assert(activevars[2] == posresultants[d]);
957 hashdata->
vars[0] = activevars[0];
958 hashdata->
vars[1] = activevars[1];
962 assert(hashmaphashdata == NULL || hashmaphashdata->
cons != NULL);
966 gateconss[ngateconss] = hashmaphashdata->
cons;
974 if( ngateconss == nlogicorvars || (ngateconss >= nlogicorvars - 1 && !presoldata->onlysetpart))
990 assert(ngateconss <= nlogicorvars);
991 assert(d >= 0 && d < nposresultants);
1005 if( ngateconss == nlogicorvars )
1007 SCIPdebugMsg(scip,
"Following constraints form a set-partitioning constraint.\n");
1011 SCIPdebugMsg(scip,
"Following constraints form an and-constraint.\n");
1015 for( v = ngateconss - 1; v >= 0; --v )
1017 assert(gateconss[v] != NULL);
1038 if( ngateconss == nlogicorvars - 1 )
1042 assert(!presoldata->onlysetpart);
1048 for( v = nlogicorvars - 1; v >= 0; --v )
1050 if( activevars[v] == posresultants[d] )
1056 assert(i == ngateconss);
1061 initial, separate, enforce, check, propagate,
1062 local, modifiable, dynamic, removable, stickingatnode) );
1069 ++(presoldata->ngates);
1080 assert(ngateconss == nlogicorvars);
1085 initial, separate, enforce, check, propagate,
1086 local, modifiable, dynamic, removable, stickingatnode) );
1093 ++(presoldata->ngates);
1115 assert(scip != NULL);
1116 assert(presol != NULL);
1134 assert(presoldata != NULL);
1136 if( presoldata->hashdatatable != NULL )
1138 assert(presoldata->setppchashtable != NULL);
1139 assert(presoldata->logicorhashtable != NULL);
1162 assert(presoldata != NULL);
1165 for( c = presoldata->nusefullogicor - 1; c >= 0; --c )
1170 if( presoldata->usefullogicorexist )
1175 if( presoldata->usefulsetppcexist )
1177 assert(presoldata->setppchashdatas != NULL || presoldata->nsetppchashdatas == 0);
1178 for( c = presoldata->nsetppchashdatas - 1; c >= 0; --c )
1180 assert(presoldata->setppchashdatas[c].cons != NULL);
1181 assert(presoldata->setppchashdatas[c].vars != NULL);
1184 assert(
SCIPhashtableExists(presoldata->setppchashtable, (
void*) presoldata->setppchashdatas[c].cons));
1205 if( presoldata->hashdatatable != NULL )
1207 assert(presoldata->setppchashtable != NULL);
1208 assert(presoldata->logicorhashtable != NULL);
1216 presoldata->nusefullogicor = 0;
1217 presoldata->susefullogicor = 0;
1218 presoldata->nsetppchashdatas = 0;
1219 presoldata->ssetppchashdatas = 0;
1220 presoldata->firstchangedlogicor = -1;
1221 presoldata->ngates = 0;
1222 presoldata->usefullogicorexist =
FALSE;
1223 presoldata->usefulsetppcexist =
FALSE;
1224 presoldata->newsetppchashdatas =
FALSE;
1225 presoldata->initialized =
FALSE;
1266 assert(scip != NULL);
1267 assert(presol != NULL);
1269 assert(result != NULL);
1298 assert(nknapsackconss >= 0);
1299 assert(knapsackconss != NULL || nknapsackconss == 0);
1301 for( c = nknapsackconss - 1; c >= 0; --c )
1311 if( nvars > 1 && capacity == nvars - 1 && vals[0] == capacity && vals[1] == 1 )
1313 printf(
"possible knapsack for gate extraction\n");
1323 if( conshdlrsetppc == NULL || conshdlrlogicor == NULL )
1328 assert(nsetppcconss >= 0);
1330 assert(nlogicorconss >= 0);
1332 if( nsetppcconss == 0 || nlogicorconss == 0 )
1337 assert(presoldata != NULL);
1342 if( conshdlrand == NULL )
1345 if( !presoldata->searchequations )
1356 assert(presoldata->onlysetpart);
1365 SCIPwarningMessage(scip,
"Gate-presolving is the 'counterpart' of linearizing all and-constraints, so enabling both presolving steps at ones does not make sense.\n");
1373 assert(setppcconss != NULL);
1375 assert(logicorconss != NULL);
1378 if( presoldata->hashdatatable == NULL )
1382 assert(presoldata->hashdatatable != NULL);
1383 assert(presoldata->setppchashtable != NULL);
1384 assert(presoldata->logicorhashtable != NULL);
1386 presoldata->newsetppchashdatas =
FALSE;
1388 if( !presoldata->initialized )
1390 assert(presoldata->usefullogicor == NULL);
1400 assert(presoldata->initialized);
1402 if( presoldata->nusefullogicor == 0 )
1407 if( presoldata->sorting != 0 )
1413 for( c = presoldata->nusefullogicor - 1; c >= 0; --c )
1418 if( presoldata->sorting == -1 )
1419 SCIPsortDownIntPtr(lengths, (
void**)presoldata->usefullogicor, presoldata->nusefullogicor);
1421 SCIPsortIntPtr(lengths, (
void**)presoldata->usefullogicor, presoldata->nusefullogicor);
1446 int nsetppchashdatas;
1452 assert(nsetppcconss > 0);
1458 size = presoldata->maxnvarslogicor;
1467 hashdata.
cons = NULL;
1469 nsetppchashdatas = 0;
1472 for( d = nsetppcconss - 1; d >= 0; --d )
1474 setppc = setppcconss[d];
1475 assert(setppc != NULL);
1488 if( nsetppcvars < 2 )
1495 if( nsetppcvars > size )
1499 assert(setppcvars != NULL);
1502 for( v = nsetppcvars - 1; v >= 0; --v )
1510 if( activevarssetppc[v] == NULL )
1522 SCIPsortPtr((
void**)activevarssetppc, SCIPvarComp, nsetppcvars);
1524 setppchashdatas[nsetppchashdatas] = &(setppchashdatastore[nsetppchashdatas]);
1529 setppchashdatas[nsetppchashdatas]->
nvars = nsetppcvars;
1530 setppchashdatas[nsetppchashdatas]->
cons = setppc;
1540 for( c = nlogicorconss - 1; c >= 0 && !
SCIPisStopped(scip); --c )
1542 logicor = logicorconss[c];
1543 assert(logicor != NULL);
1550 if( nlogicorvars < 2 )
1556 assert(nlogicorvars <= size);
1559 assert(logicorvars != NULL);
1562 for( v = nlogicorvars - 1; v >= 0; --v )
1571 if( activevarslogicor[v] == NULL )
1578 SCIPsortPtr((
void**)activevarslogicor, SCIPvarComp, nlogicorvars);
1580 hashdata.
nvars = nlogicorvars;
1581 hashdata.
vars = activevarslogicor;
1584 assert(hashmaphashdata == NULL || hashmaphashdata->
cons != NULL);
1599 setppc = hashmaphashdata->
cons;
1627 SCIPdebugMsg(scip,
"Following logicor is redundant to the set-partitioning constraint.\n");
1638 SCIPdebugMsg(scip,
"Following logicor and set-packing constraints form a set-partitioning constraint.\n");
1645 initial, separate, enforce, check, propagate,
1646 local, modifiable, dynamic, removable, stickingatnode) );
1653 ++(presoldata->ngates);
1670 for( d = nsetppchashdatas - 1; d >= 0; --d )
1689 if( presoldata->nsetppchashdatas == 0 || (presoldata->firstchangedlogicor == presoldata->nusefullogicor && !presoldata->newsetppchashdatas) )
1695 assert(presoldata->usefullogicor != NULL);
1696 assert(presoldata->nusefullogicor > 0);
1697 assert(presoldata->firstchangedlogicor >= 0);
1698 assert(presoldata->nsetppchashdatas > 0);
1701 if( presoldata->nsetppchashdatas > 0 && !
SCIPisStopped(scip) )
1709 if( presoldata->newsetppchashdatas )
1712 endloop =
MAX(presoldata->firstchangedlogicor, 0);
1714 assert(presoldata->maxnvarslogicor >= 3);
1720 hashdata.
cons = NULL;
1722 hashdata.
vars = tmpvars;
1727 for( c = presoldata->nusefullogicor - 1; c >= endloop && !
SCIPisStopped(scip); --c )
1729 assert(presoldata->usefullogicor[c] != NULL);
1741 SCIP_CALL(
extractGates(scip, presoldata, c, varmap, gateconss, activevars, posresultants, &hashdata, ndelconss, naddconss) );
1792 "should we only try to extract set-partitioning constraints and no and-constraints",
1798 "should we try to extract set-partitioning constraint out of one logicor and one corresponding set-packing constraint",
1804 "order logicor contraints to extract big-gates before smaller ones (-1), do not order them (0) or order them to extract smaller gates at first (1)",
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
SCIP_RETCODE SCIPincludePresolBasic(SCIP *scip, SCIP_PRESOL **presolptr, const char *name, const char *desc, int priority, int maxrounds, SCIP_PRESOLTIMING timing, SCIP_DECL_PRESOLEXEC((*presolexec)), SCIP_PRESOLDATA *presoldata)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
struct SCIP_PresolData SCIP_PRESOLDATA
#define SCIPallocBlockMemoryArray(scip, ptr, num)
SCIP_RETCODE SCIPsetPresolFree(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLFREE((*presolfree)))
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
SCIP_RETCODE SCIPgetBinvarRepresentative(SCIP *scip, SCIP_VAR *var, SCIP_VAR **repvar, SCIP_Bool *negated)
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
SCIP_RETCODE SCIPsetPresolExit(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXIT((*presolexit)))
int SCIPgetNVarsSetppc(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
SCIP_RETCODE SCIPsetConsPropagated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool propagate)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
SCIP_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
int SCIPsnprintf(char *t, int len, const char *s,...)
enum SCIP_Retcode SCIP_RETCODE
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
SCIP_PRESOLDATA * SCIPpresolGetData(SCIP_PRESOL *presol)
SCIP_VAR ** SCIPgetVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
#define SCIPfreeBlockMemory(scip, ptr)
void SCIPsortDownIntPtr(int *intarray, void **ptrarray, int len)
Constraint handler for AND constraints, .
#define SCIPduplicateBufferArray(scip, ptr, source, num)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
#define SCIPfreeBufferArray(scip, ptr)
Constraint handler for the set partitioning / packing / covering constraints .
#define SCIPallocBlockMemory(scip, ptr)
#define SCIPdebugPrintCons(x, y, z)
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
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_Bool SCIPconsIsActive(SCIP_CONS *cons)
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)
SCIP_VAR * SCIPvarGetNegatedVar(SCIP_VAR *var)
void SCIPsortIntPtr(int *intarray, void **ptrarray, int len)
SCIP_RETCODE SCIPsetConsSeparated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool separate)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
SCIP_RETCODE SCIPsetConsRemovable(SCIP *scip, SCIP_CONS *cons, SCIP_Bool removable)
SCIP_RETCODE SCIPcreateConsAnd(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *resvar, 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_Bool SCIPisParamFixed(SCIP *scip, const char *name)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
Constraint handler for logicor constraints (equivalent to set covering, but algorithms are suited fo...
void SCIPpresolSetData(SCIP_PRESOL *presol, SCIP_PRESOLDATA *presoldata)
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
SCIP_RETCODE SCIPsetConsChecked(SCIP *scip, SCIP_CONS *cons, SCIP_Bool check)
SCIP_RETCODE SCIPsetConsDynamic(SCIP *scip, SCIP_CONS *cons, SCIP_Bool dynamic)
SCIP_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsSetpart(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)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
SCIP_RETCODE SCIPunfixParam(SCIP *scip, const char *name)
void SCIPsortPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
#define SCIPhashTwo(a, b)
void SCIPhashtableRemoveAll(SCIP_HASHTABLE *hashtable)
SCIP_RETCODE SCIPhashtableRemove(SCIP_HASHTABLE *hashtable, void *element)
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
SCIP_RETCODE SCIPcaptureCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPsetPresolInitpre(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLINITPRE((*presolinitpre)))
SCIP_Longint SCIPgetCapacityKnapsack(SCIP *scip, SCIP_CONS *cons)
#define SCIPallocBufferArray(scip, ptr, num)
SCIP_RETCODE SCIPsetConsLocal(SCIP *scip, SCIP_CONS *cons, SCIP_Bool local)
int SCIPgetNImplVars(SCIP *scip)
SCIP_SETPPCTYPE SCIPgetTypeSetppc(SCIP *scip, SCIP_CONS *cons)
int SCIPvarGetNLocksUp(SCIP_VAR *var)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
int SCIPvarCompare(SCIP_VAR *var1, SCIP_VAR *var2)
SCIP_Bool SCIPconsIsDeleted(SCIP_CONS *cons)
const char * SCIPpresolGetName(SCIP_PRESOL *presol)
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
void * SCIPhashtableRetrieve(SCIP_HASHTABLE *hashtable, void *key)
int SCIPgetNBinVars(SCIP *scip)
int SCIPconshdlrGetNActiveConss(SCIP_CONSHDLR *conshdlr)
SCIP_VAR ** SCIPgetVarsSetppc(SCIP *scip, SCIP_CONS *cons)
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
SCIP_RETCODE SCIPsetConsStickingAtNode(SCIP *scip, SCIP_CONS *cons, SCIP_Bool stickingatnode)
int SCIPvarGetNLocksDown(SCIP_VAR *var)
SCIP_RETCODE SCIPsetConsEnforced(SCIP *scip, SCIP_CONS *cons, SCIP_Bool enforce)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
SCIP_RETCODE SCIPsetPresolCopy(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLCOPY((*presolcopy)))
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
SCIP_RETCODE SCIPcaptureVar(SCIP *scip, SCIP_VAR *var)
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
SCIP_Bool SCIPisStopped(SCIP *scip)
int SCIPgetNVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConsModifiable(SCIP *scip, SCIP_CONS *cons, SCIP_Bool modifiable)
int SCIPvarGetIndex(SCIP_VAR *var)
SCIP_Bool SCIPhashtableExists(SCIP_HASHTABLE *hashtable, void *element)
SCIP_RETCODE SCIPincludePresolGateextraction(SCIP *scip)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
SCIP_Longint * SCIPgetWeightsKnapsack(SCIP *scip, SCIP_CONS *cons)
#define SCIPcombineTwoInt(a, b)
SCIP_RETCODE SCIPsetPresolExitpre(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXITPRE((*presolexitpre)))
SCIP_RETCODE SCIPgetNegatedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **negvar)
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)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
SCIP_Bool SCIPvarIsNegated(SCIP_VAR *var)
SCIP_RETCODE SCIPsetConsInitial(SCIP *scip, SCIP_CONS *cons, SCIP_Bool initial)