SCIP_ConshdlrData
147 int** cycledecomposition;
167assert( consdata !=
NULL);
168assert( *consdata !=
NULL);
170nvars = (*consdata)->nvars;
174assert( (*consdata)->vars ==
NULL);
175assert( (*consdata)->perm ==
NULL);
176assert( (*consdata)->invperm ==
NULL);
177assert( (*consdata)->ncycles == 0 );
178assert( (*consdata)->cycledecomposition ==
NULL);
185 if( (*consdata)->ndescentpoints > 0 )
187assert( (*consdata)->descentpoints !=
NULL);
192 if( (*consdata)->ppupgrade )
194 for(i = 0; i < (*consdata)->ncycles; ++i)
204 for(i = 0; i < nvars; ++i)
234 int** cycledecomposition;
235 int* indicesincycle;
243 intndescentpoints = 0;
247assert( perm !=
NULL);
248assert( vars !=
NULL);
250assert( upgrade !=
NULL);
256 for(i = 0; i < nvars; ++i)
260 for(i = 0; i < nvars; ++i)
280 else if( checkmonotonicity )
291assert( checkmonotonicity );
297assert( ncycles <= nvars / 2 );
300 for(i = 0; i < nvars; ++i)
308 for(i = 0; i < ncycles; ++i)
316 for(i = 0; i < nvars; ++i)
328descentpoints[c++] = j;
331cycledecomposition[curcycle][++cyclelength] = j;
336cycledecomposition[curcycle][0] = cyclelength;
339 if( maxcyclelength < cyclelength )
340maxcyclelength = cyclelength;
342assert( c == ndescentpoints );
346 if( setppcconshdlr ==
NULL)
361 for(i = 0; i < ncycles && *upgrade && ! terminated; ++i)
366 for(j = 0; j < cycledecomposition[i][0]; ++ j)
368var = vars[cycledecomposition[i][j + 1]];
379cyclelength = cycledecomposition[i][0];
385 for(c = 0; c < nsetppcconss; ++c)
402 if( nsetppcvars == 0 )
404assert( nsetppcvars > 0 );
407assert( setppcvars !=
NULL);
410 for(j = 0; j < nsetppcvars && nfound < cyclelength; ++j)
419 for(k = 0; k < cyclelength; ++k)
421 if( varidx == indicesincycle[k] )
428assert( nfound <= cyclelength );
430 if( nfound == cyclelength )
435 if( c >= nsetppcconss )
441(*consdata)->ncycles = ncycles;
442(*consdata)->cycledecomposition = cycledecomposition;
443(*consdata)->ndescentpoints = ndescentpoints;
444(*consdata)->descentpoints = descentpoints;
455 for(i = 0; i < ncycles; ++i)
485 int* indexcorrection;
488 intnaffectedvariables;
492assert( consdata !=
NULL);
493assert( conshdlr !=
NULL);
499(*consdata)->debugcnt = 0;
502(*consdata)->ndescentpoints = 0;
503(*consdata)->descentpoints =
NULL;
504(*consdata)->ismodelcons = ismodelcons;
508indexcorrection[0] = -1;
509 for(i = 0; i < inputnvars; ++i)
514indexcorrection[i] = 0;
516indexcorrection[i] = indexcorrection[i - 1] + 1;
521indexcorrection[i] = indexcorrection[i - 1];
524naffectedvariables = indexcorrection[inputnvars - 1] + 1;
526(*consdata)->nvars = naffectedvariables;
529 if( naffectedvariables == 0 )
533(*consdata)->vars =
NULL;
534(*consdata)->perm =
NULL;
535(*consdata)->invperm =
NULL;
536(*consdata)->ppupgrade =
FALSE;
537(*consdata)->ncycles = 0;
538(*consdata)->cycledecomposition =
NULL;
545 for(i = 0; i < inputnvars; ++i)
549 if( indexcorrection[i] > -1 )
551vars[j] = inputvars[i];
552perm[j++] = indexcorrection[inputperm[i]];
557 if( indexcorrection[i] > indexcorrection[i - 1] )
559vars[j] = inputvars[i];
560perm[j++] = indexcorrection[inputperm[i]];
566(*consdata)->vars = vars;
567(*consdata)->perm = perm;
570 for(i = 0; i < naffectedvariables; ++i)
573invperm[perm[i]] = i;
575(*consdata)->invperm = invperm;
580 if( conshdlrdata->checkppsymresack )
585(*consdata)->ppupgrade = upgrade;
592 for(i = 0; i < naffectedvariables; ++i)
632assert( cons !=
NULL);
633assert( infeasible !=
NULL);
635*infeasible =
FALSE;
638assert( consdata !=
NULL);
640nvars = consdata->nvars;
646assert( consdata->vars !=
NULL);
647vars = consdata->vars;
650assert( consdata->invperm[0] != 0 );
667 if( consdata->ppupgrade && ! *infeasible )
669 if( checkmonotonicity )
673 int** cycledecomposition;
677 intfirstelemincycle;
679ncycles = consdata->ncycles;
680cycledecomposition = consdata->cycledecomposition;
688 for(i = 0; i < ncycles; ++i)
690assert( cycledecomposition[i][0] > 0 );
692nvarsincycle = cycledecomposition[i][0];
693varsincons[0] = vars[cycledecomposition[i][nvarsincycle]];
694firstelemincycle = cycledecomposition[i][1];
696assert( firstelemincycle == consdata->perm[cycledecomposition[i][nvarsincycle]] );
701 for(j = 0; j < i; ++j)
703nvarsincycle = cycledecomposition[j][0];
704 for(k = 1; k <= nvarsincycle; ++k)
706 if( cycledecomposition[j][k] < firstelemincycle )
708varsincons[nvarsincons] = vars[cycledecomposition[j][k]];
709coeffs[nvarsincons++] = -1.0;
738 int* imgdescentpoints;
743 intnewlastascent = 0;
746descentpoints = consdata->descentpoints;
747ndescentpoints = consdata->ndescentpoints;
748perm = consdata->perm;
750assert( descentpoints !=
NULL);
751assert( ndescentpoints > 0 );
752assert( perm !=
NULL);
753assert( vars !=
NULL);
759 for(j = 0; j < ndescentpoints; ++j)
760imgdescentpoints[j] = perm[descentpoints[j]];
771 for(j = 0; j < ndescentpoints; ++j)
773varsincons[0] = vars[descentpoints[j]];
774 for(i = lastascent; i < imgdescentpoints[j]; ++i)
778coeffs[nvarsincons] = -1.0;
779varsincons[nvarsincons++] = vars[i];
783lastascent = newlastascent;
824 int* tempfixentries,
825 intnumfixentriesinit,
827 int* infeasibleentry
843assert( vars !=
NULL);
844assert( invperm !=
NULL);
845assert( tempfixings !=
NULL);
846assert( tempfixentries !=
NULL);
847assert( infeasible !=
NULL);
850numfixentries = numfixentriesinit;
852*infeasible =
FALSE;
854 for(i = start; i < nvars; ++i)
857assert( invperm[i] != i );
861var2 = vars[invperm[i]];
863assert( var1 !=
NULL);
864assert( var2 !=
NULL);
867var1fix = tempfixings[i];
880assert( var1fix !=
NOINIT);
883var2fix = tempfixings[invperm[i]];
896assert( var2fix !=
NOINIT);
905*infeasibleentry = i;
911tempfixings[invperm[i]] =
FIXED0;
913tempfixentries[numfixentries++] = invperm[i];
920tempfixentries[numfixentries++] = i;
926 for(i = numfixentriesinit; i < numfixentries; ++i)
928tempfixings[tempfixentries[i]] =
NOINIT;
929tempfixentries[i] = 0;
957 intpeekinfeasibleentry;
959 int* tempfixentries;
962assert( cons !=
NULL);
963assert( infeasible !=
NULL);
964assert( ngen !=
NULL);
969*infeasible =
FALSE;
973assert( consdata !=
NULL);
974nvars = consdata->nvars;
980assert( consdata->vars !=
NULL);
981assert( consdata->invperm !=
NULL);
982vars = consdata->vars;
983invperm = consdata->invperm;
986 for(i = 0; i < nvars; ++i)
989assert( invperm[i] != i );
993var2 = vars[invperm[i]];
994assert( var1 !=
NULL);
995assert( var2 !=
NULL);
1026 SCIPdebugMsg(
scip,
" -> node is feasible (could set pair to (1,0) and every earlier pair is constant).\n");
1039 SCIPdebugMsg(
scip,
" -> First entry is not fixed. Check if 0 is feasible.\n");
1040tempfixings[i] =
FIXED0;
1041tempfixentries[0] = i;
1043&peekinfeasible, &peekinfeasibleentry) );
1045 if( peekinfeasible )
1048 SCIPdebugMsg(
scip,
" -> First entry is not fixed. 0 is not feasible. Fixing to 1.\n");
1050 FALSE, infeasible, &tightened) );
1051assert( ! *infeasible );
1057tempfixings[i] =
NOINIT;
1058tempfixentries[0] = 0;
1066 SCIPdebugMsg(
scip,
" -> Second entry is not fixed. Check if 1 is feasible.\n");
1067tempfixings[invperm[i]] =
FIXED1;
1068tempfixentries[0] = invperm[i];
1070&peekinfeasible, &peekinfeasibleentry) );
1072 if( peekinfeasible )
1075 SCIPdebugMsg(
scip,
" -> Second entry is not fixed. 1 is not feasible. Fixing to 0.\n");
1077 FALSE, infeasible, &tightened) );
1078assert( ! *infeasible );
1084tempfixings[invperm[i]] =
NOINIT;
1085tempfixentries[0] = 0;
1100 SCIPdebugMsg(
scip,
" -> node infeasible (pair was fixed to (0,1) but there was no pair of type (1,0) before) ---> lexicographical order violated, infeasible.\n");
1107 for(
r= 0;
r<= i; ++
r)
1110assert( invperm[
r] !=
r);
1119*infeasible =
TRUE;
1133assert( ! *infeasible );
1149assert( ! *infeasible );
1181assert( cons !=
NULL);
1182assert( nvars > 0 );
1183assert( vars !=
NULL);
1184assert( coeffs !=
NULL);
1185assert( infeasible !=
NULL);
1187*infeasible =
FALSE;
1193++consdata->debugcnt;
1199 for(i = 0; i < nvars; ++i)
1201 if( coeffs[i] == 1 || coeffs[i] == -1 )
1240 int* componentends;
1244assert( nvars > 0 );
1245assert( objective !=
NULL);
1246assert( perm !=
NULL);
1247assert( invperm !=
NULL);
1248assert( maxcrit !=
NULL);
1249assert( maxsoluval !=
NULL);
1261 for(i = 0; i < nvars; ++i)
1263componentends[i] = i;
1264componentobj[i] = objective[i];
1266helperobj += objective[i];
1270 for(crit = 0; crit < nvars; ++crit)
1272critinv = invperm[crit];
1275assert( crit != critinv );
1278 if( componentends[crit] == critinv )
1284tmpobj += componentobj[crit];
1286tmpobj -= componentobj[critinv];
1289*maxsoluval = tmpobj;
1294tmpnewcompobj = componentobj[crit] + componentobj[critinv];
1296helperobj -= componentobj[crit];
1298helperobj -= componentobj[critinv];
1300helperobj += tmpnewcompobj;
1303componentobj[componentends[crit]] = tmpnewcompobj;
1304componentobj[componentends[critinv]] = tmpnewcompobj;
1307 if( componentends[crit] == crit )
1309componentends[crit] = componentends[critinv];
1310componentends[componentends[critinv]] = crit;
1314componentends[componentends[crit]] = componentends[critinv];
1315componentends[componentends[critinv]] = componentends[crit];
1326assert( *maxcrit >= 0 );
1350 int* entrycomponent;
1357assert( nvars > 0 );
1358assert( objective !=
NULL);
1359assert( perm !=
NULL);
1360assert( invperm !=
NULL);
1361assert( maxsolu !=
NULL);
1362assert( crit >= 0 );
1363assert( crit <= nvars );
1369 for(i = 0; i < nvars; ++i)
1371entrycomponent[i] = i;
1372componentobjective[i] = objective[i];
1374 for(i = 0; i < crit; ++i)
1380 if( entrycomponent[i] < i )
1394 if( entrycomponent[c] != c )
1397entrycomponent[c] = i;
1398componentobjective[i] += objective[c];
1408 if( entrycomponent[c] != c )
1411entrycomponent[c] = i;
1412componentobjective[i] += objective[c];
1424 for(i = 0; i < nvars; ++i)
1426 if( entrycomponent[i] == entrycomponent[crit] )
1428 else if( entrycomponent[i] == entrycomponent[invperm[crit]] )
1430 else if(
SCIPisGT(
scip, componentobjective[entrycomponent[i]], 0.0) )
1467*infeasible =
FALSE;
1471assert( consdata !=
NULL);
1474 if( consdata->nvars < 2 )
1477assert( consdata->vars !=
NULL);
1478assert( consdata->perm !=
NULL);
1479assert( consdata->invperm !=
NULL);
1480assert( infeasible !=
NULL);
1481assert( ngen !=
NULL);
1483nvars = consdata->nvars;
1484perm = consdata->perm;
1485invperm = consdata->invperm;
1490constobjective = 1.0;
1491 for(i = 0; i < nvars; ++i)
1494sepaobjective[i] = - vals[i];
1497sepaobjective[i] = 1.0 - vals[i];
1498constobjective += vals[i] - 1.0;
1507assert( maxcrit >= 0 );
1508 SCIPdebugMsg(
scip,
"Critical row %d found; Computing maximally violated cover.\n", maxcrit);
1512maxsoluobj += constobjective;
1519 for(i = 0; i < nvars; ++i)
1522maxsolu[i] = -maxsolu[i];
1525 if( maxsolu[i] == 0 )
1527maxsolu[i] = 1 - maxsolu[i];
1534 if( ! *infeasible )
1561assert( cons !=
NULL);
1563assert( consdata !=
NULL);
1566 if( consdata->nvars < 2 )
1569assert( consdata->vars !=
NULL);
1570assert( consdata->invperm !=
NULL);
1574nvars = consdata->nvars;
1575vars = consdata->vars;
1576invperm = consdata->invperm;
1579 for(i = 0; i < nvars; ++i)
1586assert( invperm[i] != i );
1607 else if( val1 > val2 )
1611assert( val2 > val1 );
1616 SCIPinfoMessage(
scip,
NULL,
"First non-constant pair (%d, %d) of variables has pattern (0,1).\n", i, invperm[i]);
1668assert( perm !=
NULL);
1669assert( nvars > 0 );
1670assert( inputvars !=
NULL);
1671assert( upgrade !=
NULL);
1677 if( conshdlr ==
NULL)
1680 SCIPdebugMsg(
scip,
"Cannot check whether symresack constraint can be upgraded to orbisack constraint. ");
1690 for(i = 0; i < nvars; ++i)
1696 if( perm[perm[i]] != i )
1704vars1[nrows] = inputvars[i];
1705vars2[nrows++] = inputvars[perm[i]];
1707assert( nrows <= nvars );
1714 else if( *upgrade )
1717initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
1768assert( cons !=
NULL);
1769assert( perm !=
NULL);
1770assert( vars !=
NULL);
1771assert( nvars > 0 );
1774initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
1779initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
1795assert(conshdlr !=
NULL);
1812assert( conshdlr !=
NULL);
1813assert( consdata !=
NULL);
1829assert( conshdlr !=
NULL);
1833assert( conshdlrdata !=
NULL);
1851assert( conshdlr !=
NULL);
1853assert( sourcecons !=
NULL);
1854assert( targetcons !=
NULL);
1860assert( sourcedata !=
NULL);
1863assert( sourcedata->nvars == 0 || sourcedata->vars !=
NULL);
1864assert( sourcedata->nvars == 0 || sourcedata->perm !=
NULL);
1865assert( sourcedata->nvars == 0 || sourcedata->invperm !=
NULL);
1867 if( sourcedata->ppupgrade )
1869assert( sourcedata->nvars > 0 );
1870assert( sourcedata->ncycles != 0 );
1871assert( sourcedata->cycledecomposition !=
NULL);
1872 for(i = 0; i < sourcedata->ncycles; ++i)
1874assert( sourcedata->cycledecomposition[i] !=
NULL);
1875assert( sourcedata->cycledecomposition[i][0] != 0 );
1884nvars = sourcedata->nvars;
1888consdata->vars =
NULL;
1889consdata->nvars = nvars;
1890consdata->perm =
NULL;
1891consdata->invperm =
NULL;
1892consdata->ppupgrade = sourcedata->ppupgrade;
1893consdata->ismodelcons = sourcedata->ismodelcons;
1895consdata->debugcnt = 0;
1897consdata->ncycles = 0;
1898consdata->cycledecomposition =
NULL;
1899consdata->ndescentpoints = 0;
1900consdata->descentpoints =
NULL;
1906 for(i = 0; i < nvars; ++i)
1914 if( sourcedata->ppupgrade )
1916consdata->ncycles = sourcedata->ncycles;
1918 for(i = 0; i < sourcedata->ncycles; ++i)
1923consdata->ndescentpoints = sourcedata->ndescentpoints;
1933 for(i = 0; i < sourcedata->nvars; ++i)
1959assert( infeasible !=
NULL);
1960*infeasible =
FALSE;
1963assert( conshdlr !=
NULL);
1967assert( conshdlrdata !=
NULL);
1970 for(c = 0; c < nconss; ++c)
1972assert( conss[c] !=
NULL);
1994assert( conshdlr !=
NULL);
1999assert( conshdlrdata !=
NULL);
2001conshdlrdata->maxnvars = 0;
2004 for(c = 0; c < nconss; ++c)
2008assert( conss[c] !=
NULL);
2011assert( consdata !=
NULL);
2014 if( consdata->nvars > conshdlrdata->maxnvars )
2015conshdlrdata->maxnvars = consdata->nvars;
2033assert( conshdlr !=
NULL);
2035assert( result !=
NULL);
2049assert( conshdlrdata !=
NULL);
2051maxnvars = conshdlrdata->maxnvars;
2052assert( maxnvars > 0 );
2057 for(c = 0; c < nconss; ++c)
2065assert( conss[c] !=
NULL);
2068 if( consdata->nvars == 0 )
2072assert( consdata->nvars <= maxnvars );
2107assert( conshdlr !=
NULL);
2109assert( result !=
NULL);
2119assert( conshdlrdata !=
NULL);
2121maxnvars = conshdlrdata->maxnvars;
2122assert( maxnvars > 0 );
2127 for(c = 0; c < nconss; ++c)
2135assert( conss[c] !=
NULL);
2138 if( consdata->nvars == 0 )
2142assert( consdata->nvars <= maxnvars );
2179assert( conshdlr !=
NULL);
2181assert( result !=
NULL);
2183 SCIPdebugMsg(
scip,
"Enforcing method for symresack constraints (lp solutions) ...\n");
2197assert( conshdlrdata !=
NULL);
2199maxnvars = conshdlrdata->maxnvars;
2200assert( maxnvars > 0 );
2205 for(c = 0; c < nconss; ++c)
2213assert( conss[c] !=
NULL);
2215assert( consdata !=
NULL);
2218 if( !consdata->ismodelcons )
2221 if( consdata->nvars == 0 )
2225assert( consdata->nvars <= maxnvars );
2257assert( conshdlr !=
NULL);
2259assert( result !=
NULL);
2261 SCIPdebugMsg(
scip,
"Enforcing method for symresack constraints (pseudo solutions) ...\n");
2265 if( objinfeasible || solinfeasible )
2269 for(c = 0; c < nconss; ++c)
2272assert( consdata !=
NULL);
2275 if( !consdata->ismodelcons )
2300assert( conshdlr !=
NULL);
2302assert( result !=
NULL);
2304 SCIPdebugMsg(
scip,
"Enforcing method for symresack constraints (relaxation solutions) ...\n");
2318assert( conshdlrdata !=
NULL);
2320maxnvars = conshdlrdata->maxnvars;
2321assert( maxnvars > 0 );
2326 for(c = 0; c < nconss; ++c)
2334assert( conss[c] !=
NULL);
2336assert( consdata !=
NULL);
2339 if( !consdata->ismodelcons )
2342 if( consdata->nvars == 0 )
2346assert( consdata->nvars <= maxnvars );
2376assert( conshdlr !=
NULL);
2378assert( result !=
NULL);
2383 for(c = 0; c < nconss; ++c)
2386assert( consdata !=
NULL);
2389 if( !consdata->ismodelcons )
2413assert( conshdlr !=
NULL);
2415assert( result !=
NULL);
2419 SCIPdebugMsg(
scip,
"Propagation method of symresack constraint handler.\n");
2422 for(c = 0; c < nconss; ++c)
2427assert( conss[c] !=
NULL);
2437success = success || ( ngen > 0 );
2461assert( conshdlr !=
NULL);
2463assert( result !=
NULL);
2465oldndelconss = *ndelconss;
2467 SCIPdebugMsg(
scip,
"Presolving method of symresack constraint handler. Propagating symresack inequalities.\n");
2471 for(c = 0; c < nconss; ++c)
2477assert( conss[c] !=
NULL);
2480assert( consdata !=
NULL);
2483 if( consdata->nvars == 0 )
2501*nfixedvars += ngen;
2508 if( *ndelconss > oldndelconss || success )
2529assert( conshdlr !=
NULL);
2531assert( cons !=
NULL);
2532assert( infervar !=
NULL);
2533assert( bdchgidx !=
NULL);
2534assert( result !=
NULL);
2536 SCIPdebugMsg(
scip,
"Propagation resolution method of symresack constraint handler.\n");
2541assert( consdata !=
NULL);
2544 if( consdata->nvars < 2 )
2547assert( consdata->vars !=
NULL);
2548assert( consdata->invperm !=
NULL);
2550vars = consdata->vars;
2551nvars = consdata->nvars;
2552perm = consdata->perm;
2553invperm = consdata->invperm;
2558varrow = inferinfo % nvars;
2559infrow = inferinfo / nvars;
2561assert( varrow >= 0 );
2562assert( varrow < nvars );
2563assert( infrow >= 0 );
2564assert( infrow < nvars );
2565assert( vars[varrow] == infervar || vars[invperm[varrow]] == infervar );
2568 for(i = 0; i < varrow; ++i)
2573assert( i != invperm[i] );
2576assert(
ISFIXED(vars[i], bdchgidx) );
2577assert(
ISFIXED(vars[invperm[i]], bdchgidx) );
2589assert( vars[i] != infervar );
2593 if( invperm[i] > i )
2595assert( vars[invperm[i]] != infervar );
2611 for(i = varrow + 1; i <= infrow; ++i)
2616assert( i != invperm[i] );
2622 if( ( i < perm[i] || i == invperm[varrow] ) &&
ISFIXED(vars[i], bdchgidx) )
2624assert( vars[i] != infervar );
2628 if( ( invperm[i] > i || invperm[i] == varrow ) &&
ISFIXED(vars[invperm[i]], bdchgidx) )
2630assert( vars[invperm[i]] != infervar );
2644assert( infervar == vars[varrow] );
2645assert(
ISFIXED(vars[invperm[varrow]], bdchgidx) );
2647 if( invperm[varrow] > varrow )
2656assert( infervar == vars[invperm[varrow]] );
2657assert(
ISFIXED(vars[varrow], bdchgidx) );
2659 if( varrow < perm[varrow] )
2695assert( conshdlr !=
NULL);
2697assert( cons !=
NULL);
2699 SCIPdebugMsg(
scip,
"Locking method for symresack constraint handler.\n");
2703assert( consdata !=
NULL);
2706 if( consdata->nvars < 2 )
2709assert( consdata->vars !=
NULL);
2710assert( consdata->perm !=
NULL);
2712nvars = consdata->nvars;
2713vars = consdata->vars;
2714perm = consdata->perm;
2716 for(i = 0; i < nvars; ++i)
2719assert( perm[i] != i );
2747assert( cons !=
NULL);
2748assert( sourcescip !=
NULL);
2749assert( sourceconshdlr !=
NULL);
2751assert( sourcecons !=
NULL);
2752assert( varmap !=
NULL);
2753assert( valid !=
NULL);
2757 SCIPdebugMsg(
scip,
"Copying method for symresack constraint handler.\n");
2760assert( sourcedata !=
NULL);
2761assert( sourcedata->vars !=
NULL);
2762assert( sourcedata->perm !=
NULL);
2763assert( sourcedata->nvars > 0 );
2766assert( conshdlrdata !=
NULL);
2769 if( !sourcedata->ismodelcons && !conshdlrdata->forceconscopy )
2776sourcevars = sourcedata->vars;
2777nvars = sourcedata->nvars;
2781 for(i = 0; i < nvars && *valid; ++i)
2784assert( !(*valid) || vars[i] !=
NULL);
2795initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
2816 intnfoundpermidx = 0;
2819assert( success !=
NULL);
2827 if( strncmp(s,
"symresack(", 10) != 0 )
2829 SCIPerrorMessage(
"Syntax error - expected \"symresack(\", but got '%s'", s);
2877endptr = strchr(endptr,
']');
2879 if( endptr ==
NULL)
2891assert( s !=
NULL);
2894 if( nvars > maxnvars )
2899assert( nvars <= maxnvars );
2902vars[nvars-1] = var;
2911 while( *s !=
']');
2929assert( s !=
NULL);
2932 if( nfoundpermidx > nvars )
2939perm[nfoundpermidx-1] = val;
2948 while( *s !=
']');
2950 if( nfoundpermidx != nvars )
2952 SCIPerrorMessage(
"length of permutation is not equal to number of given variables.\n");
2964 while( *s !=
')');
2966 if( *success && cnt < 2 )
2996assert( conshdlr !=
NULL);
2998assert( cons !=
NULL);
3001assert( consdata !=
NULL);
3003 SCIPdebugMsg(
scip,
"Printing method for symresack constraint handler\n");
3006 if( consdata->nvars < 2 )
3009assert( consdata->vars !=
NULL);
3010assert( consdata->perm !=
NULL);
3012vars = consdata->vars;
3013nvars = consdata->nvars;
3014perm = consdata->perm;
3019 for(i = 1; i < nvars; ++i)
3025 for(i = 1; i < nvars; ++i)
3039assert( cons !=
NULL);
3040assert( success !=
NULL);
3041assert( vars !=
NULL);
3044assert( consdata !=
NULL);
3046 if( varssize < consdata->nvars )
3047(*success) =
FALSE;
3053 for(i = 0; i < consdata->nvars; ++i)
3054vars[cnt++] = consdata->vars[i];
3068assert( cons !=
NULL);
3069assert( success !=
NULL);
3070assert( nvars !=
NULL);
3073assert( consdata !=
NULL);
3075(*nvars) = consdata->nvars;
3095consEnfolpSymresack, consEnfopsSymresack, consCheckSymresack, consLockSymresack,
3097assert( conshdlr !=
NULL);
3118 "Upgrade symresack constraints to packing/partioning symresacks?",
3123 "Check whether permutation is monotone when upgrading to packing/partioning symresacks?",
3127 "Whether symresack constraints should be forced to be copied to sub SCIPs.",
3181assert( cons !=
NULL);
3182assert( nvars > 0 );
3186 if( conshdlr ==
NULL)
3196 SCIP_CALL(
SCIPcreateCons(
scip, cons, name, conshdlr, consdata, initial, separate && (! consdata->ppupgrade), enforce, check, propagate,
3197local, modifiable, dynamic, removable, stickingatnode) );
constraint handler for orbisack constraints
Constraint handler for the set partitioning / packing / covering constraints .
#define CONSHDLR_NEEDSCONS
#define CONSHDLR_SEPAFREQ
static SCIP_DECL_CONSTRANS(consTransSymresack)
#define CONSHDLR_CHECKPRIORITY
static SCIP_DECL_CONSDELETE(consDeleteSymresack)
static SCIP_DECL_CONSINITSOL(consInitsolSymresack)
static SCIP_DECL_CONSPROP(consPropSymresack)
static SCIP_DECL_CONSGETVARS(consGetVarsSymresack)
#define CONSHDLR_PROP_TIMING
static SCIP_DECL_CONSHDLRCOPY(conshdlrCopySymresack)
static SCIP_DECL_CONSLOCK(consLockSymresack)
#define DEFAULT_FORCECONSCOPY
#define CONSHDLR_MAXPREROUNDS
#define DEFAULT_CHECKMONOTONICITY
#define ISFIXED(x, bdchgidx)
static SCIP_RETCODE consdataCreate(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONSDATA **consdata, SCIP_VAR *const *inputvars, int inputnvars, int *inputperm, SCIP_Bool ismodelcons)
static SCIP_DECL_CONSENFOPS(consEnfopsSymresack)
static SCIP_RETCODE propVariables(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *infeasible, int *ngen)
static SCIP_RETCODE initLP(SCIP *scip, SCIP_CONS *cons, SCIP_Bool checkmonotonicity, SCIP_Bool *infeasible)
#define CONSHDLR_SEPAPRIORITY
static SCIP_DECL_CONSENFOLP(consEnfolpSymresack)
static SCIP_RETCODE checkSymresackSolution(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_RESULT *result, SCIP_Bool printreason)
static SCIP_DECL_CONSCHECK(consCheckSymresack)
static SCIP_DECL_CONSENFORELAX(consEnforelaxSymresack)
static SCIP_RETCODE checkFeasible(SCIP *scip, SCIP_VAR **vars, int *invperm, int nvars, int start, int *tempfixings, int *tempfixentries, int numfixentriesinit, SCIP_Bool *infeasible, int *infeasibleentry)
static SCIP_DECL_CONSPRINT(consPrintSymresack)
static SCIP_RETCODE maximizeObjectiveSymresackCriticalEntry(SCIP *scip, int nvars, SCIP_Real *objective, int *perm, int *invperm, int crit, int *maxsolu)
static SCIP_RETCODE separateSymresackCovers(SCIP *scip, SCIP_CONS *cons, const SCIP_CONSDATA *consdata, SCIP_Real *vals, int *ngen, SCIP_Bool *infeasible)
#define CONSHDLR_PROPFREQ
static SCIP_DECL_CONSPRESOL(consPresolSymresack)
static SCIP_DECL_CONSINITLP(consInitlpSymresack)
static SCIP_RETCODE addSymresackInequality(SCIP *scip, SCIP_CONS *cons, int nvars, SCIP_VAR **vars, int *coeffs, SCIP_Real rhs, SCIP_Bool *infeasible)
#define CONSHDLR_PRESOLTIMING
static SCIP_RETCODE packingUpgrade(SCIP *scip, SCIP_CONSDATA **consdata, int *perm, SCIP_VAR **vars, int nvars, SCIP_Bool checkmonotonicity, SCIP_Bool *upgrade)
static SCIP_RETCODE consdataFree(SCIP *scip, SCIP_CONSDATA **consdata)
static SCIP_DECL_CONSSEPALP(consSepalpSymresack)
static SCIP_DECL_CONSPARSE(consParseSymresack)
#define CONSHDLR_EAGERFREQ
static SCIP_DECL_CONSGETNVARS(consGetNVarsSymresack)
#define DEFAULT_PPSYMRESACK
static SCIP_RETCODE maximizeObjectiveSymresackStrict(SCIP *scip, int nvars, SCIP_Real *objective, int *perm, int *invperm, int *maxcrit, SCIP_Real *maxsoluval)
#define CONSHDLR_ENFOPRIORITY
static SCIP_DECL_CONSCOPY(consCopySymresack)
#define CONSHDLR_DELAYSEPA
static SCIP_DECL_CONSSEPASOL(consSepasolSymresack)
static SCIP_DECL_CONSFREE(consFreeSymresack)
static SCIP_DECL_CONSRESPROP(consRespropSymresack)
static SCIP_RETCODE orbisackUpgrade(SCIP *scip, SCIP_CONS **cons, const char *name, int *perm, SCIP_VAR **inputvars, int nvars, SCIP_Bool *upgrade, SCIP_Bool ismodelcons, 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_DELAYPROP
constraint handler for symresack constraints
#define SCIP_DEFAULT_INFINITY
SCIP_RETCODE SCIPcreateSymbreakCons(SCIP *scip, SCIP_CONS **cons, const char *name, int *perm, SCIP_VAR **vars, int nvars, SCIP_Bool ismodelcons, 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)
int SCIPgetNVarsSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_SETPPCTYPE SCIPgetTypeSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsOrbisack(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *const *vars1, SCIP_VAR *const *vars2, int nrows, SCIP_Bool ispporbisack, SCIP_Bool isparttype, SCIP_Bool ismodelcons, 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 SCIPcreateConsBasicSymresack(SCIP *scip, SCIP_CONS **cons, const char *name, int *perm, SCIP_VAR **vars, int nvars, SCIP_Bool ismodelcons)
SCIP_RETCODE SCIPcreateConsSymresack(SCIP *scip, SCIP_CONS **cons, const char *name, int *perm, SCIP_VAR **vars, int nvars, SCIP_Bool ismodelcons, 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_SETPPCTYPE_PARTITIONING
@ SCIP_SETPPCTYPE_COVERING
@ SCIP_SETPPCTYPE_PACKING
SCIP_RETCODE SCIPincludeConshdlrSymresack(SCIP *scip)
SCIP_RETCODE SCIPgetVarCopy(SCIP *sourcescip, SCIP *targetscip, SCIP_VAR *sourcevar, SCIP_VAR **targetvar, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, SCIP_Bool *success)
SCIP_Bool SCIPisTransformed(SCIP *scip)
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
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 SCIPaddConflictLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
SCIP_RETCODE SCIPinitConflictAnalysis(SCIP *scip, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
SCIP_RETCODE SCIPaddConflictUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
SCIP_Bool SCIPisConflictAnalysisApplicable(SCIP *scip)
SCIP_RETCODE SCIPaddConflictBinvar(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPanalyzeConflictCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
SCIP_RETCODE SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPARSE((*consparse)))
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
SCIP_RETCODE SCIPsetConshdlrGetVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETVARS((*consgetvars)))
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 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)))
int SCIPconshdlrGetNConss(SCIP_CONSHDLR *conshdlr)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
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 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)))
SCIP_RETCODE SCIPsetConshdlrGetNVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETNVARS((*consgetnvars)))
SCIP_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
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_Bool SCIPconsIsInitial(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsEnforced(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_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
SCIP_Bool SCIPisEfficacious(SCIP *scip, SCIP_Real efficacy)
SCIP_RETCODE SCIPaddRow(SCIP *scip, SCIP_ROW *row, SCIP_Bool forcecut, SCIP_Bool *infeasible)
#define SCIPfreeCleanBufferArray(scip, ptr)
#define SCIPallocCleanBufferArray(scip, ptr, num)
#define SCIPfreeBlockMemoryArray(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 SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
#define SCIPfreeBufferArrayNull(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
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 SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
SCIP_RETCODE SCIPaddVarsToRow(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
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)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisGE(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 SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
SCIP_RETCODE SCIPgetTransformedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_RETCODE SCIPinferVarUbCons(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_CONS *infercons, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_RETCODE SCIPparseVarName(SCIP *scip, const char *str, SCIP_VAR **var, char **endptr)
SCIP_RETCODE SCIPaddVarLocksType(SCIP *scip, SCIP_VAR *var, SCIP_LOCKTYPE locktype, int nlocksdown, int nlocksup)
int SCIPvarGetProbindex(SCIP_VAR *var)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_Bool SCIPvarIsNegated(SCIP_VAR *var)
SCIP_RETCODE SCIPmarkDoNotMultaggrVar(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPinferVarLbCons(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_CONS *infercons, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_Real SCIPvarGetLbAtIndex(SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
SCIP_RETCODE SCIPwriteVarName(SCIP *scip, FILE *file, SCIP_VAR *var, SCIP_Bool type)
SCIP_RETCODE SCIPgetTransformedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **transvar)
SCIP_Real SCIPvarGetUbAtIndex(SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
SCIP_RETCODE SCIPcaptureVar(SCIP *scip, SCIP_VAR *var)
void SCIPsortIntInt(int *intarray1, int *intarray2, int len)
SCIP_Bool SCIPstrToIntValue(const char *str, int *value, char **endptr)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIP_RETCODE SCIPskipSpace(char **s)
memory allocation routines
public methods for managing constraints
public methods for message output
public data structures and miscellaneous methods
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 cuts and aggregation rows
public methods for the LP relaxation, rows and columns
public methods for memory management
public methods for message handling
public methods for numerical tolerances
public methods for SCIP parameter handling
public methods for global and local (sub)problems
public methods for solutions
public methods for SCIP variables
@ SCIP_CONFTYPE_PROPAGATION
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
struct SCIP_ConsData SCIP_CONSDATA
enum SCIP_Result SCIP_RESULT
enum SCIP_Retcode SCIP_RETCODE
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