assert(rowprep !=
NULL);
110 switch( rowprep->
nvars)
123tmp1 = rowprep->
coefs[0];
125rowprep->
coefs[1] = tmp1;
127tmp2 = rowprep->
vars[0];
128rowprep->
vars[0] = rowprep->
vars[1];
129rowprep->
vars[1] = tmp2;
139 for( i = 0; i < rowprep->
nvars; ++i )
147 while( rowprep->
nvars> 0 && rowprep->
coefs[rowprep->
nvars-1] == 0.0 )
177 if( rowprep->
nvars> 0 )
183mincoef = maxcoef = 1.0;
189 while( maxcoef / mincoef > maxcoefrange )
191 SCIPdebugMsg(
scip,
"cut coefficients have very large range: mincoef = %g maxcoef = %g\n", mincoef, maxcoef);
196assert(rowprep->
nvars> 1);
212 for( pos = 0; pos < 2; ++pos )
214var = rowprep->
vars[pos ? rowprep->
nvars-1 : maxcoefidx];
215coef = rowprep->
coefs[pos ? rowprep->
nvars-1 : maxcoefidx];
224ref =
MAX(lb,
MIN(ub, ref));
233loss[pos] =
REALABS(coef) * (ref - lb);
242loss[pos] =
REALABS(coef) * (ub - ref);
244assert(loss[pos] >= 0.0);
246 SCIPdebugMsg(
scip,
"aggregating %g*<%s> %c= ... with <%s>[%g] %c= %g looses %g\n",
258pos = (loss[1] ==
SCIP_INVALID|| loss[1] > loss[0]) ? 0 : 1;
261var = rowprep->
vars[pos ? rowprep->
nvars-1 : maxcoefidx];
262coef = rowprep->
coefs[pos ? rowprep->
nvars-1 : maxcoefidx];
285rowprep->
coefs[maxcoefidx] = 0.0;
309 if( maxcoefidx > 0 )
312 for( i = maxcoefidx; i < rowprep->
nvars; ++i )
314rowprep->
vars[i-maxcoefidx] = rowprep->
vars[i];
315rowprep->
coefs[i-maxcoefidx] = rowprep->
coefs[i];
317rowprep->
nvars-= maxcoefidx;
338assert(rowprep !=
NULL);
339assert(viol !=
NULL);
346 if( *viol >= minviol )
367*viol = ldexp(*viol, scaleexp);
393 if( *viol > minviol && !
SCIPisInfinity(
scip, *viol) && scalefactor * *viol < minviol )
395assert(minviol > 0.0);
412*viol = ldexp(*viol, scaleexp);
432assert(rowprep !=
NULL);
453 SCIPdebugMsg(
scip,
"var with almost zero coef in boundchange-row %.15g*<%s> <=/>= %.15g; scaling up\n",
459 for( i = 0; i < rowprep->
nvars; ++i )
461coef = rowprep->
coefs[i];
463 if( coef != roundcoef &&
SCIPisEQ(
scip, coef, roundcoef) )
468var = rowprep->
vars[i];
470 if( rowprep->
local)
475 if( rowprep->
local)
483 SCIPdebugMsg(
scip,
"var <%s> [%g,%g] has almost integral coef %.15g, round coefficient to %g and add constant %g\n",
493 SCIPdebugMsg(
scip,
"var <%s> [%g,%g] has almost integral coef %.15g, round coefficient to %g without relaxing side (!)\n",
496rowprep->
coefs[i] = roundcoef;
506 while( rowprep->
nvars> 0 && rowprep->
coefs[rowprep->
nvars-1] == 0.0 )
531rowprep->
side= 0.0;
542#undef SCIProwprepGetNVars 543#undef SCIProwprepGetVars 544#undef SCIProwprepGetCoefs 545#undef SCIProwprepGetSide 546#undef SCIProwprepGetSidetype 547#undef SCIProwprepIsLocal 548#undef SCIProwprepGetName 549#undef SCIProwprepGetNModifiedVars 550#undef SCIProwprepGetModifiedVars 551#undef SCIProwprepSetCoef 552#undef SCIProwprepAddSide 553#undef SCIProwprepAddConstant 554#undef SCIProwprepSetSidetype 555#undef SCIProwprepSetLocal 556#undef SCIProwprepRecordModifications 571assert(rowprep !=
NULL);
576(*rowprep)->sidetype = sidetype;
577(*rowprep)->local = local;
589assert(rowprep !=
NULL);
590assert(*rowprep !=
NULL);
606assert(target !=
NULL);
607assert(source !=
NULL);
619(*target)->recordmodifications =
FALSE;
620(*target)->modifiedvars =
NULL;
621(*target)->modifiedvarssize = 0;
622(*target)->nmodifiedvars = 0;
623(*target)->modifiedside =
FALSE;
633assert(rowprep !=
NULL);
635 returnrowprep->
nvars;
643assert(rowprep !=
NULL);
645 returnrowprep->
vars;
653assert(rowprep !=
NULL);
655 returnrowprep->
coefs;
663assert(rowprep !=
NULL);
665 returnrowprep->
side;
673assert(rowprep !=
NULL);
683assert(rowprep !=
NULL);
685 returnrowprep->
local;
693assert(rowprep !=
NULL);
695 returnrowprep->
name;
703assert(rowprep !=
NULL);
713assert(rowprep !=
NULL);
723assert(rowprep !=
NULL);
726rowprep->
side= 0.0;
740assert(rowprep !=
NULL);
742rowprep->
coefs[idx] = newcoef;
751assert(rowprep !=
NULL);
753rowprep->
side+= side;
774assert(rowprep !=
NULL);
785assert(rowprep !=
NULL);
787rowprep->
local= islocal;
795assert(rowprep !=
NULL);
810assert(rowprep !=
NULL);
812 if( *rowprep->
name!=
'\0')
817 for( i = 0; i < rowprep->
nvars; ++i )
843assert(rowprep !=
NULL);
845 if( *rowprep->
name!=
'\0')
853 for( i = 0; i < rowprep->
nvars; ++i )
855coef = rowprep->
coefs[i];
856var = rowprep->
vars[i];
860 if(
REALABS(term) > maxterm )
873violation = activity - rowprep->
side;
876violation = rowprep->
side- activity;
896assert(rowprep !=
NULL);
921assert(rowprep !=
NULL);
922assert(var !=
NULL);
947assert(rowprep !=
NULL);
948assert(vars !=
NULL|| nvars == 0);
949assert(coefs !=
NULL|| nvars == 0);
960rowprep->
nvars+= nvars;
988 for( i = 0; i < rowprep->
nvars; ++i )
1005 if( reliable !=
NULL)
1015 if( reliable !=
NULL)
1023term = rowprep->
coefs[i] * val;
1026 if( reliable !=
NULL&&
REALABS(term) > maxterm )
1033violation = activity - rowprep->
side;
1036violation = rowprep->
side- activity;
1045 if( reliable !=
NULL)
1047 if( violation != 0.0 )
1050(void) frexp(maxterm / violation, &exponent);
1051*reliable = exponent <= 50;
1057 return MAX(violation, 0.0);
1073assert(rowprep !=
NULL);
1097assert(rowprep !=
NULL);
1099 if( rowprep->
nvars<= 1 )
1108 while( j < rowprep->nvars )
1110 if( rowprep->
vars[i] == rowprep->
vars[j] )
1125rowprep->
coefs[i] = 0.0;
1133rowprep->
coefs[i] = 0.0;
1136 if( rowprep->
coefs[i] == 0.0 )
1140rowprep->
vars[i] = rowprep->
vars[j];
1148rowprep->
vars[i+1] = rowprep->
vars[j];
1162rowprep->
coefs[i] = 0.0;
1170rowprep->
coefs[i] = 0.0;
1174 if( rowprep->
coefs[i] == 0.0 )
1178rowprep->
nvars= i+1;
1231 if( rowprep->
nvars> 0 )
1246assert(myviol >= 0.0);
1249 if( rowprep->
nvars> 0 )
1261 if( minviol > 0.0 )
1291 if( coefrange !=
NULL)
1293 if( rowprep->
nvars> 0 )
1301 if( success !=
NULL)
1315 SCIPdebugMsg(
scip,
"rowprep coefficient %g is beyond value for infinity\n", rowprep->
coefs[0]);
1327 if( *success && minviol > 0.0 )
1333 if( !violreliable )
1338 else if( myviol < minviol )
1340 SCIPdebugMsg(
scip,
"rowprep violation %g is below minimal violation %g\n", myviol, minviol);
1390assert(maxcoefbound >= 1.0);
1405 if( rowprep->
nvars> 0 )
1419 if( rowprep->
nvars> 0 )
1436 if(
REALABS(rowprep->
coefs[0]) < 1.0/maxcoefbound )
1438 else if(
REALABS(rowprep->
coefs[0]) > maxcoefbound )
1461 if( success !=
NULL)
1475 SCIPdebugMsg(
scip,
"rowprep coefficient %g is beyond value for infinity\n", rowprep->
coefs[0]);
1525 if( frac < minfrac )
1528 else if( frac < minfrac0 )
1533 for( i = 0; i < rowprep->
nvars; ++i )
1540 if( frac < minfrac )
1543 else if( frac < minfrac0 )
1550 SCIPdebugMsg(
scip,
"minimal fractional of rowprep coefs and side is %g, max coef/side is %g\n",
MIN(minfrac, minfrac0), maxval);
1567 if( factor < minscaleup )
1568factor = minscaleup;
1573makeintegral =
FALSE;
1575 else if( minscaleup > 1.0 )
1577factor = minscaleup;
1582 if( success !=
NULL)
1595factor = pow(2.0, factor);
1601 for( i = 0; i < rowprep->
nvars; ++i )
1602rowprep->
coefs[i] *= factor;
1605rowprep->
side*= factor;
1609 SCIPinfoMessage(
scip,
NULL,
"scaled up rowprep by %g (minfrac=%g, minscaleup=%g), maxval is now %g\n", factor, minfrac, minscaleup, maxval);
1613 if( success !=
NULL)
1616 else if( success !=
NULL)
1635assert(rowprep !=
NULL);
1636assert(factor > 0.0);
1639v = frexp(factor, &expon);
1645 for( i = 0; i < rowprep->
nvars; ++i )
1646rowprep->
coefs[i] = ldexp(rowprep->
coefs[i], expon);
1649rowprep->
side= ldexp(rowprep->
side, expon);
1663assert(row !=
NULL);
1664assert(rowprep !=
NULL);
1665assert(conshdlr !=
NULL);
1686assert(row !=
NULL);
1687assert(rowprep !=
NULL);
1688assert(cons !=
NULL);
1709assert(row !=
NULL);
1710assert(rowprep !=
NULL);
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
#define SCIPduplicateBlockMemory(scip, ptr, source)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(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 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 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 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 SCIPaddVarsToRow(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
SCIP_Real SCIPgetSepaMinEfficacy(SCIP *scip)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_Bool SCIPisRelEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisHugeValue(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPround(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPepsilon(SCIP *scip)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int SCIPgetDepth(SCIP *scip)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_VAR ** SCIProwprepGetVars(SCIP_ROWPREP *rowprep)
void SCIProwprepReset(SCIP_ROWPREP *rowprep)
SCIP_RETCODE SCIPcleanupRowprep2(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_SOL *sol, SCIP_Real maxcoefbound, SCIP_Bool *success)
SCIP_Real SCIProwprepGetSide(SCIP_ROWPREP *rowprep)
SCIP_RETCODE SCIPensureRowprepSize(SCIP *scip, SCIP_ROWPREP *rowprep, int size)
void SCIPmergeRowprepTerms(SCIP *scip, SCIP_ROWPREP *rowprep)
int SCIProwprepGetNModifiedVars(SCIP_ROWPREP *rowprep)
SCIP_Real SCIPgetRowprepViolation(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_SOL *sol, SCIP_Bool *reliable)
void SCIProwprepSetCoef(SCIP_ROWPREP *rowprep, int idx, SCIP_Real newcoef)
SCIP_Real SCIPscaleupRowprep(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_Real minscaleup, SCIP_Bool *success)
SCIP_Real * SCIProwprepGetCoefs(SCIP_ROWPREP *rowprep)
SCIP_VAR ** SCIProwprepGetModifiedVars(SCIP_ROWPREP *rowprep)
char * SCIProwprepGetName(SCIP_ROWPREP *rowprep)
void SCIProwprepSetSidetype(SCIP_ROWPREP *rowprep, SCIP_SIDETYPE sidetype)
SCIP_Bool SCIPisRowprepViolationReliable(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_SOL *sol)
SCIP_Bool SCIProwprepIsLocal(SCIP_ROWPREP *rowprep)
void SCIPprintRowprepSol(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_SOL *sol, FILE *file)
void SCIProwprepAddConstant(SCIP_ROWPREP *rowprep, SCIP_Real constant)
SCIP_SIDETYPE SCIProwprepGetSidetype(SCIP_ROWPREP *rowprep)
SCIP_RETCODE SCIPgetRowprepRowSepa(SCIP *scip, SCIP_ROW **row, SCIP_ROWPREP *rowprep, SCIP_SEPA *sepa)
SCIP_RETCODE SCIPaddRowprepTerm(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_VAR *var, SCIP_Real coef)
SCIP_RETCODE SCIPgetRowprepRowCons(SCIP *scip, SCIP_ROW **row, SCIP_ROWPREP *rowprep, SCIP_CONS *cons)
SCIP_RETCODE SCIPgetRowprepRowConshdlr(SCIP *scip, SCIP_ROW **row, SCIP_ROWPREP *rowprep, SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPcreateRowprep(SCIP *scip, SCIP_ROWPREP **rowprep, SCIP_SIDETYPE sidetype, SCIP_Bool local)
int SCIPscaleRowprep(SCIP_ROWPREP *rowprep, SCIP_Real factor)
int SCIProwprepGetNVars(SCIP_ROWPREP *rowprep)
void SCIProwprepRecordModifications(SCIP_ROWPREP *rowprep)
SCIP_RETCODE SCIPaddRowprepTerms(SCIP *scip, SCIP_ROWPREP *rowprep, int nvars, SCIP_VAR **vars, SCIP_Real *coefs)
void SCIProwprepSetLocal(SCIP_ROWPREP *rowprep, SCIP_Bool islocal)
void SCIProwprepAddSide(SCIP_ROWPREP *rowprep, SCIP_Real side)
SCIP_RETCODE SCIPcopyRowprep(SCIP *scip, SCIP_ROWPREP **target, SCIP_ROWPREP *source)
SCIP_RETCODE SCIPcleanupRowprep(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_SOL *sol, SCIP_Real minviol, SCIP_Real *viol, SCIP_Bool *success)
void SCIPfreeRowprep(SCIP *scip, SCIP_ROWPREP **rowprep)
void SCIPprintRowprep(SCIP *scip, SCIP_ROWPREP *rowprep, FILE *file)
void SCIPsortDownRealRealPtr(SCIP_Real *realarray1, SCIP_Real *realarray2, void **ptrarray, int len)
void SCIPsortPtrReal(void **ptrarray, SCIP_Real *realarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
#define BMSclearMemory(ptr)
#define BMScopyMemoryArray(ptr, source, num)
#define ROWPREP_SCALEUP_MAXSIDE
#define ROWPREP_SCALEUP_MAXMAXCOEF
#define ROWPREP_SCALEDOWN_MINMAXCOEF
static SCIP_RETCODE rowprepCleanupIntegralCoefs(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_Real *viol)
#define ROWPREP_SCALEUP_MAXMINCOEF
static SCIP_RETCODE rowprepCleanupImproveCoefrange(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_SOL *sol, SCIP_Real maxcoefrange)
static void rowprepCleanupSide(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_Real *viol)
#define ROWPREP_SCALEUP_VIOLNONZERO
static SCIP_RETCODE rowprepCleanupSortTerms(SCIP *scip, SCIP_ROWPREP *rowprep)
#define ROWPREP_SCALEDOWN_MINCOEF
static SCIP_RETCODE rowprepRecordModifiedVar(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_VAR *var)
static void rowprepCleanupScaleup(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_Real *viol, SCIP_Real minviol)
static void rowprepCleanupScaledown(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_Real *viol, SCIP_Real minviol)
#define ROWPREP_SCALEUP_MINVIOLFACTOR
public methods for message output
preparation of a linear inequality to become a SCIP_ROW
methods for sorting joint arrays of various types
public methods for problem variables
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 separator plugins
public methods for solutions
public methods for the branch-and-bound tree
SCIP_Real SCIPsetGetSepaMaxCoefRatioRowprep(SCIP_SET *set)
internal methods for global SCIP settings
char name[SCIP_MAXSTRLEN]
SCIP_Bool recordmodifications
miscellaneous datastructures
SCIP main data structure.
enum SCIP_SideType SCIP_SIDETYPE
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