assert(var !=
NULL);
113assert(bounds !=
NULL);
114assert(boundtypes !=
NULL);
115assert(newbounds !=
NULL);
116assert(counts !=
NULL);
117assert(issetvar !=
NULL);
118assert(2 * nvars > varidx);
119assert(foundbin !=
NULL);
120assert(foundnonbin !=
NULL);
121assert(implidx !=
NULL);
122assert(nimplidx !=
NULL);
123assert(lastbounds !=
NULL);
126 if( !boundtypes[pos] )
128assert(counts[varidx] <= pos - nredvars + 1);
131 if( counts[varidx] == pos - nredvars )
135 if( counts[varidx] == 1 )
137assert(*ncountnonzeros < 2*nvars);
138countnonzeros[*ncountnonzeros] = varidx;
140newbounds[varidx] = bounds[pos];
143 else if( newbounds[varidx] > bounds[pos] )
145lastbounds[*nimplidx] = newbounds[varidx];
146newbounds[varidx] = bounds[pos];
153*foundnonbin =
MIN(*foundnonbin, varidx);
155implidx[*nimplidx] = varidx;
164 for(
w= nimpls - 1;
w>= 0; --
w)
175 if( implcoefs[
w] < 0.0 )
180 if( counts[idx] == pos - nredvars )
196 if( issetvar[idx] > 0 )
198 SCIPdebugMsg(
scip,
"set variable <%s> %s %g implies other set variable <%s> %s %g\n",
201issetvar[varidx] = -1;
206*foundbin =
MIN(*foundbin, idx);
208 if( counts[idx] == 1 )
210assert(*ncountnonzeros < 2*nvars);
211countnonzeros[*ncountnonzeros] = idx;
215implidx[*nimplidx] = idx;
228newub = (bounds[pos] - implconsts[
w]) / implcoefs[
w];
233 if( issetvar[idx] > 0 && newub <= bounds[issetvar[idx] - 1] )
235 SCIPdebugMsg(
scip,
"set variable <%s> %s %g implies other set variable <%s> %s %g (%g)\n",
238issetvar[varidx] = -1;
244 if( counts[idx] == 1 )
246assert(*ncountnonzeros < 2*nvars);
247countnonzeros[*ncountnonzeros] = idx;
249newbounds[idx] = newub;
252 else if( newbounds[idx] < newub )
254lastbounds[*nimplidx] = newbounds[idx];
255newbounds[idx] = newub;
260*foundnonbin =
MIN(*foundnonbin, idx);
262implidx[*nimplidx] = idx;
269assert(counts[varidx] <= pos - nredvars + 1);
272 if( counts[idx] == pos - nredvars )
288 if( issetvar[idx] > 0 )
290 SCIPdebugMsg(
scip,
"set variable <%s> %s %g implies other set variable <%s> %s %g\n",
293issetvar[varidx] = -1;
298*foundbin =
MIN(*foundbin, idx);
300 if( counts[idx] == 1 )
302assert(*ncountnonzeros < 2*nvars);
303countnonzeros[*ncountnonzeros] = idx;
307implidx[*nimplidx] = idx;
320newlb = (bounds[pos] - implconsts[
w]) / implcoefs[
w];
325 if( issetvar[idx] > 0 && newlb >= bounds[issetvar[idx] - 1] )
327 SCIPdebugMsg(
scip,
"set variable <%s> %s %g implies other set variable <%s> %s %g (%g)\n",
330issetvar[varidx] = -1;
336 if( counts[idx] == 1 )
338assert(*ncountnonzeros < 2*nvars);
339countnonzeros[*ncountnonzeros] = idx;
342newbounds[idx] = newlb;
344 else if( newbounds[idx] > newlb )
346lastbounds[*nimplidx] = newbounds[idx];
347newbounds[idx] = newlb;
352*foundnonbin =
MIN(*foundnonbin, idx);
354implidx[*nimplidx] = idx;
364assert(boundtypes[pos]);
365assert(counts[varidx] <= pos - nredvars + 1);
368 if( counts[varidx] == pos - nredvars )
372 if( counts[varidx] == 1 )
374assert(*ncountnonzeros < 2*nvars);
375countnonzeros[*ncountnonzeros] = varidx;
377newbounds[varidx] = bounds[pos];
380 else if( newbounds[varidx] < bounds[pos] )
382lastbounds[*nimplidx] = newbounds[varidx];
383newbounds[varidx] = bounds[pos];
390*foundnonbin =
MIN(*foundnonbin, varidx);
392implidx[*nimplidx] = varidx;
401 for(
w= nimpls - 1;
w>= 0; --
w)
412 if( implcoefs[
w] < 0.0 )
414assert(counts[idx] <= pos - nredvars + 1);
417 if( counts[idx] == pos - nredvars )
430 if( issetvar[idx] > 0 )
432 SCIPdebugMsg(
scip,
"set variable <%s> %s %g implies other set variable <%s> %s %g\n",
435issetvar[varidx] = -1;
440*foundbin =
MIN(*foundbin, idx);
442 if( counts[idx] == 1 )
444assert(*ncountnonzeros < 2*nvars);
445countnonzeros[*ncountnonzeros] = idx;
449implidx[*nimplidx] = idx;
462newlb = (bounds[pos] - implconsts[
w]) / implcoefs[
w];
464 if( issetvar[idx] > 0 && newlb >= bounds[issetvar[idx] - 1] )
466 SCIPdebugMsg(
scip,
"set variable <%s> %s %g implies other set variable <%s> %s %g (%g)\n",
469issetvar[varidx] = -1;
475 if( counts[idx] == 1 )
477assert(*ncountnonzeros < 2*nvars);
478countnonzeros[*ncountnonzeros] = idx;
481newbounds[idx] = newlb;
483 else if( newbounds[idx] > newlb )
485lastbounds[*nimplidx] = newbounds[idx];
486newbounds[idx] = newlb;
491*foundnonbin =
MIN(*foundnonbin, idx);
493implidx[*nimplidx] = idx;
503assert(counts[idx] <= pos - nredvars + 1);
505 if( counts[idx] == pos - nredvars )
518 if( issetvar[idx] > 0 )
520 SCIPdebugMsg(
scip,
"set variable <%s> %s %g implies other set variable <%s> %s %g\n",
523issetvar[varidx] = -1;
528*foundbin =
MIN(*foundbin, idx);
530 if( counts[idx] == 1 )
532assert(*ncountnonzeros < 2*nvars);
533countnonzeros[*ncountnonzeros] = idx;
537implidx[*nimplidx] = idx;
550newub = (bounds[pos] - implconsts[
w]) / implcoefs[
w];
552 if( issetvar[idx] > 0 && newub <= bounds[issetvar[idx] - 1] )
554 SCIPdebugMsg(
scip,
"set variable <%s> %s %g implies other set variable <%s> %s %g (%g)\n",
557issetvar[varidx] = -1;
563 if( counts[idx] == 1 )
565assert(*ncountnonzeros < 2*nvars);
566countnonzeros[*ncountnonzeros] = idx;
569newbounds[idx] = newub;
571 else if( newbounds[idx] < newub )
573lastbounds[*nimplidx] = newbounds[idx];
574newbounds[idx] = newub;
579*foundnonbin =
MIN(*foundnonbin, idx);
581implidx[*nimplidx] = idx;
614 int* ncountnonzeros,
641assert(var !=
NULL);
645assert(bounds !=
NULL);
646assert(boundtypes !=
NULL);
647assert(newbounds !=
NULL);
648assert(counts !=
NULL);
649assert(issetvar !=
NULL);
650assert(2 * nvars > varidx);
651assert(foundbin !=
NULL);
652assert(foundnonbin !=
NULL);
653assert(implidx !=
NULL);
654assert(nimplidx !=
NULL);
655assert(lastbounds !=
NULL);
657 if( issetvar[varidx] > 0 )
672assert(implvars !=
NULL);
673assert(implboundtypes !=
NULL);
676assert(implvars[
w] != var);
691assert(counts[idx] <= pos - nredvars + 1);
696 if( issetvar[idx] > 0 && bounds[issetvar[idx] - 1] >= implbounds[
w] )
698 SCIPdebugMsg(
scip,
"set variable <%s> %s %g implies other set variable <%s> %s %g (%g)\n",
700 "<=", implbounds[
w], bounds[issetvar[idx] - 1]);
702issetvar[varidx] = -1;
710 if( counts[idx] == pos - nredvars && !redundant )
723*foundbin =
MIN(*foundbin, idx);
725 if( counts[idx] == 1 )
727assert(*ncountnonzeros < 2*nvars);
728countnonzeros[*ncountnonzeros] = idx;
734*foundnonbin =
MIN(*foundnonbin, idx);
736 if( counts[idx] == 1 )
738assert(*ncountnonzeros < 2*nvars);
739countnonzeros[*ncountnonzeros] = idx;
741newbounds[idx] = implbounds[
w];
744 else if( newbounds[idx] < implbounds[
w] )
746lastbounds[*nimplidx] = newbounds[idx];
747newbounds[idx] = implbounds[
w];
753implidx[*nimplidx] = idx;
761assert(counts[idx] <= pos - nredvars + 1);
766 if( issetvar[idx] > 0 && bounds[issetvar[idx] - 1] <= implbounds[
w] )
768 SCIPdebugMsg(
scip,
"set variable <%s> %s %g implies other set variable <%s> %s %g (%g)\n",
770 ">=", implbounds[
w], bounds[issetvar[idx] - 1]);
772issetvar[varidx] = -1;
780 if( counts[idx] == pos - nredvars && !redundant )
793*foundbin =
MIN(*foundbin, idx);
795 if( counts[idx] == 1 )
797assert(*ncountnonzeros < 2*nvars);
798countnonzeros[*ncountnonzeros] = idx;
804*foundnonbin =
MIN(*foundnonbin, idx);
806 if( counts[idx] == 1 )
808assert(*ncountnonzeros < 2*nvars);
809countnonzeros[*ncountnonzeros] = idx;
811newbounds[idx] = implbounds[
w];
814 else if( newbounds[idx] > implbounds[
w] )
816lastbounds[*nimplidx] = newbounds[idx];
817newbounds[idx] = implbounds[
w];
823implidx[*nimplidx] = idx;
851 int* ncountnonzeros,
873assert(var !=
NULL);
877assert(bounds !=
NULL);
878assert(boundtypes !=
NULL);
879assert(newbounds !=
NULL);
880assert(counts !=
NULL);
881assert(issetvar !=
NULL);
882assert(2 * nvars > varidx);
883assert(foundbin !=
NULL);
884assert(implidx !=
NULL);
885assert(nimplidx !=
NULL);
888assert(counts[varidx] <= pos - nredvars);
891 if( issetvar[varidx] > 0 )
894 if( counts[varidx] == pos - nredvars )
897*foundbin =
MIN(*foundbin, varidx);
899 if( counts[varidx] == 1 )
901assert(*ncountnonzeros < 2*nvars);
902countnonzeros[*ncountnonzeros] = varidx;
906implidx[*nimplidx] = varidx;
928 if( clqvalues[
w] )
931assert(counts[idx] <= pos - nredvars + 1);
936 if( issetvar[idx] > 0 )
938 SCIPdebugMessage(
"set variable <%s> %s %g implies other set variable <%s> %s %g\n",
940clqvalues[
w] ?
"<=":
">=", clqvalues[
w] ? 0.0 : 1.0);
942issetvar[varidx] = -1;
947 if( counts[idx] == pos - nredvars )
950*foundbin =
MIN(*foundbin, idx);
952 if( counts[idx] == 1 )
954assert(*ncountnonzeros < 2*nvars);
955countnonzeros[*ncountnonzeros] = idx;
959implidx[*nimplidx] = idx;
972#define CLEARRATIO 0.8 1035 int* countnonzeros;
1044 intstart = INT_MAX;
1051 intmaxcountnonzeros;
1059assert(vars !=
NULL);
1060assert(bounds !=
NULL);
1061assert(boundtypes !=
NULL);
1062assert(redundants !=
NULL);
1063assert(nredvars !=
NULL);
1064assert(nglobalred !=
NULL);
1065assert(setredundant !=
NULL);
1066assert(glbinfeas !=
NULL);
1067assert(
scip->transprob !=
NULL);
1079*glbinfeas =
FALSE;
1082maxcountnonzeros = (int)(2*nprobvars*
CLEARRATIO);
1085 for( v = 0; v < nvars; ++v )
1088assert(varidx >= 0);
1090 if( boundtypes[v] )
1091varidx += nprobvars;
1094issetvar[varidx] = v+1;
1102#ifdef SCIP_DISABLED_CODE 1113 for( v = 0; v < nvars; ++v )
1118foundnonbin = INT_MAX;
1119reducedset =
FALSE;
1122value = (!boundtypes[v]);
1125assert(varidx >= 0);
1128varidx += nprobvars;
1135 collectBinaryCliqueData(var, varidx, v, *nredvars, value, bounds, boundtypes, newbounds, counts, countnonzeros,
1136&ncountnonzeros, issetvar, nprobvars, &foundbin, implidx, &nimplidx);
1148 collectNonBinaryImplicationData(
scip, var, varidx, v, *nredvars, value, bounds, boundtypes, newbounds, counts,
1149countnonzeros, &ncountnonzeros, issetvar, nprobvars, &foundbin, &foundnonbin, implidx, &nimplidx, lastbounds);
1158 collectNonBinaryVBoundData(
scip, var, varidx, v, *nredvars, bounds, boundtypes, newbounds, counts, countnonzeros,
1159&ncountnonzeros, issetvar, nprobvars, &foundbin, &foundnonbin, implidx, &nimplidx, lastbounds);
1163 if( issetvar[varidx] < 0 )
1171assert(probvars !=
NULL);
1176 for(
w= nimplidx - 1;
w>= 0; --
w)
1178assert(implidx[
w] < 2 * nprobvars);
1179assert(counts[implidx[
w]] == v - (*nredvars) + 1);
1181--counts[implidx[
w]];
1183 if( implidx[
w] == countnonzeros[ncountnonzeros-1] && counts[implidx[
w]] == 0 )
1186probidx = implidx[
w] < nprobvars ? implidx[
w] : implidx[
w] - nprobvars;
1189newbounds[implidx[
w]] = lastbounds[
w];
1199 if( !fullshortening )
1202 if( foundbin < INT_MAX && !reducedset )
1205 if( foundnonbin < INT_MAX && !reducedset )
1210globalred = globalred && (foundbin < INT_MAX || foundnonbin < INT_MAX);
1216 if( foundbin < INT_MAX && foundbin >= nprobvars )
1217foundbin -= nprobvars;
1220 if( foundnonbin < INT_MAX && foundnonbin >= nprobvars )
1221foundnonbin -= nprobvars;
1223 if( start > foundbin )
1226 if( start > foundnonbin )
1227start = foundnonbin;
1233 if( !usebin && !usenonbin )
1238 if( *nredvars > 0 )
1244 for( v = nvars - 1; v >= 0; --v )
1249assert(varidx >= 0);
1251 if( boundtypes[v] )
1252varidx += nprobvars;
1255 if( issetvar[varidx] < 0 )
1259redundants[v] =
TRUE;
1265assert((*nredvars) == nreds);
1277assert(probvars !=
NULL);
1279assert(start < nprobvars);
1282 for( v = start; v < nprobvars; ++v )
1284probvar = probvars[v];
1285assert(probvar !=
NULL);
1287assert(counts[v] <= nvars);
1288assert(counts[nprobvars + v] <= nvars);
1290 if( counts[v] + (*nredvars) == nvars )
1307 if( issetvar[v] > 0 )
1308*setredundant =
TRUE;
1333 if( issetvar[v] > 0 && newbounds[v] >= bounds[issetvar[v] - 1] )
1334*setredundant =
TRUE;
1338 else if( counts[nprobvars + v] + (*nredvars) == nvars )
1355 if( issetvar[nprobvars + v] > 0 )
1356*setredundant =
TRUE;
1361 intidx = nprobvars + v;
1383 if( issetvar[idx] > 0 && newbounds[idx] <= bounds[issetvar[idx] - 1] )
1384*setredundant =
TRUE;
1392 for( v = 0; v < nvars; ++v )
1395assert(varidx >= 0);
1397 if( boundtypes[v] )
1398varidx += nprobvars;
1400issetvar[varidx] = 0;
1403 if( ncountnonzeros >= maxcountnonzeros )
1409 while( --ncountnonzeros >= 0 )
1410counts[countnonzeros[ncountnonzeros]] = 0;
#define SCIPfreeCleanBufferArray(scip, ptr)
#define SCIPallocCleanBufferArray(scip, ptr, num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
SCIP_RETCODE SCIPshrinkDisjunctiveVarSet(SCIP *scip, SCIP_VAR **vars, SCIP_Real *bounds, SCIP_Bool *boundtypes, SCIP_Bool *redundants, int nvars, int *nredvars, int *nglobalred, SCIP_Bool *setredundant, SCIP_Bool *glbinfeas, SCIP_Bool fullshortening)
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int SCIPvarGetNVlbs(SCIP_VAR *var)
SCIP_Real * SCIPvarGetVlbCoefs(SCIP_VAR *var)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
int SCIPvarGetNImpls(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
SCIP_VAR ** SCIPvarGetImplVars(SCIP_VAR *var, SCIP_Bool varfixing)
int SCIPvarGetProbindex(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_RETCODE SCIPcleanupCliques(SCIP *scip, SCIP_Bool *infeasible)
SCIP_Real * SCIPvarGetVlbConstants(SCIP_VAR *var)
int SCIPvarGetNVubs(SCIP_VAR *var)
SCIP_Real * SCIPvarGetImplBounds(SCIP_VAR *var, SCIP_Bool varfixing)
int SCIPvarGetNCliques(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_VAR ** SCIPvarGetVlbVars(SCIP_VAR *var)
SCIP_CLIQUE ** SCIPvarGetCliques(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_Real * SCIPvarGetVubConstants(SCIP_VAR *var)
SCIP_VAR ** SCIPvarGetVubVars(SCIP_VAR *var)
SCIP_Real * SCIPvarGetVubCoefs(SCIP_VAR *var)
SCIP_BOUNDTYPE * SCIPvarGetImplTypes(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_VAR ** SCIPcliqueGetVars(SCIP_CLIQUE *clique)
int SCIPcliqueGetNVars(SCIP_CLIQUE *clique)
SCIP_Bool * SCIPcliqueGetValues(SCIP_CLIQUE *clique)
memory allocation routines
#define BMSclearMemoryArray(ptr, num)
static void collectNonBinaryVBoundData(SCIP *scip, SCIP_VAR *var, int varidx, int pos, int nredvars, SCIP_Real *bounds, SCIP_Bool *boundtypes, SCIP_Real *newbounds, int *counts, int *countnonzeros, int *ncountnonzeros, int *issetvar, int nvars, int *foundbin, int *foundnonbin, int *implidx, int *nimplidx, SCIP_Real *lastbounds)
static void collectBinaryCliqueData(SCIP_VAR *var, int varidx, int pos, int nredvars, SCIP_Bool value, SCIP_Real *bounds, SCIP_Bool *boundtypes, SCIP_Real *newbounds, int *counts, int *countnonzeros, int *ncountnonzeros, int *issetvar, int nvars, int *foundbin, int *implidx, int *nimplidx)
static void collectNonBinaryImplicationData(SCIP *scip, SCIP_VAR *var, int varidx, int pos, int nredvars, SCIP_Bool value, SCIP_Real *bounds, SCIP_Bool *boundtypes, SCIP_Real *newbounds, int *counts, int *countnonzeros, int *ncountnonzeros, int *issetvar, int nvars, int *foundbin, int *foundnonbin, int *implidx, int *nimplidx, SCIP_Real *lastbounds)
methods commonly used for presolving
const char * SCIPprobGetName(SCIP_PROB *prob)
int SCIPprobGetNImplBinVars(SCIP_PROB *prob)
int SCIPprobGetNVars(SCIP_PROB *prob)
SCIP_VAR ** SCIPprobGetVars(SCIP_PROB *prob)
internal methods for storing and manipulating the main problem
public methods for implications, variable bounds, and cliques
public methods for message output
public methods for problem variables
public methods for memory management
public methods for message handling
public methods for numerical tolerances
public methods for the branch-and-bound tree
datastructures for block memory pools and memory buffers
SCIP main data structure.
SCIP_RETCODE SCIPnodeAddBoundchg(SCIP_NODE *node, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_VAR *var, SCIP_Real newbound, SCIP_BOUNDTYPE boundtype, SCIP_Bool probingchange)
internal methods for branch and bound tree
enum SCIP_BoundType SCIP_BOUNDTYPE
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