73#define PRESOL_NAME "tworowbnd"
74#define PRESOL_DESC "do bound tigthening by using two rows"
75#define PRESOL_PRIORITY -2000
76#define PRESOL_MAXROUNDS 0
77#define PRESOL_TIMING SCIP_PRESOLTIMING_EXHAUSTIVE
79#define DEFAULT_ENABLECOPY TRUE
80#define DEFAULT_MAXCONSIDEREDNONZEROS 100
81#define DEFAULT_MAXRETRIEVEFAILS 1000
82#define DEFAULT_MAXCOMBINEFAILS 1000
83#define DEFAULT_MAXHASHFAC 10
84#define DEFAULT_MAXPAIRFAC 1
97 int maxconsiderednonzeros;
100 SCIP_Bool enablecopy;
123 uint64_t
a = (uint64_t)(
long)
rowpair->row1idx;
124 uint64_t
b = (uint64_t)(
long)
rowpair->row2idx;
125 return (
void*)((
a << 32) |
b);
136 return (
int)(
hash >> 1);
159 (*hashlist)[(*pos)] =
hash;
160 (*rowidxlist)[(*pos)] = rowidx;
220#ifdef SCIP_DEBUG_SINGLEROWLP
229 for(
i = 0;
i < len;
i++)
380#ifdef SCIP_DEBUG_SINGLEROWLP
381 SCIPdebugMsg(
scip,
"After preprocessing: obj = %g, b = %g, nvars = %d, mincost = %g, maxgain = %g\n", (*
obj),
b,
nvars,
mincost,
maxgain);
404 (*obj) +=
c[
i] *
a[
i];
441 (*obj) +=
c[
i] *
a[
i];
459#ifdef SCIP_DEBUG_SINGLEROWLP
481#ifdef SCIP_DEBUG_SINGLEROWLP
488#ifdef SCIP_DEBUG_SINGLEROWLP
495 for(
i = 0;
i <
k;
i++ )
497 (*obj) +=
c[
i] *
a[
i];
501#ifdef SCIP_DEBUG_SINGLEROWLP
517#ifdef SCIP_DEBUG_SINGLEROWLP
565 SCIP_Bool* infeasible
675 SCIPdebugMsg(
scip,
"%g <= (%s) <= %g has coefs %g and 0.0, minact = %g, maxact = %g\n",
725 SCIPdebugMsg(
scip,
"%g <= (%s) <= %g has coefs %g and 0.0, minact = %g, maxact = %g\n",
846 (*infeasible) =
TRUE;
869#ifdef SCIP_DEBUG_BOUNDS
889#ifdef SCIP_DEBUG_BOUNDS
920#ifdef SCIP_DEBUG_BOUNDS
940#ifdef SCIP_DEBUG_BOUNDS
972 (*infeasible) =
TRUE;
995#ifdef SCIP_DEBUG_BOUNDS
1016#ifdef SCIP_DEBUG_BOUNDS
1048#ifdef SCIP_DEBUG_BOUNDS
1068#ifdef SCIP_DEBUG_BOUNDS
1108 SCIP_Bool infeasible;
1110#ifdef SCIP_DEBUG_2RB
1300 if( presoldata->enablecopy )
1331 presoldata->nchgbnds = 0;
1332 presoldata->nuselessruns = 0;
1342 SCIP_Bool initialized;
1344 SCIP_Bool infeasible;
1396 if( presoldata->nuselessruns >= 5 )
1403 naddconss, ndelconss, nchgcoefs, nchgbds, nfixedvars) );
1448 for(
i = 0;
i < nrows;
i++)
1503#ifdef SCIP_DEBUG_HASHING
1524#ifdef SCIP_DEBUG_HASHING
1638 presoldata->nuselessruns = 0;
1640 else if( infeasible )
1646 presoldata->nuselessruns++;
1698 "presolving/tworowbnd/enablecopy",
1699 "should tworowbnd presolver be copied to sub-SCIPs?",
1702 "presolving/tworowbnd/maxconsiderednonzeros",
1703 "maximal number of considered non-zeros within one row (-1: no limit)",
1706 "presolving/tworowbnd/maxretrievefails",
1707 "maximal number of consecutive useless hashtable retrieves",
1710 "presolving/tworowbnd/maxcombinefails",
1711 "maximal number of consecutive useless row combines",
1714 "presolving/tworowbnd/maxhashfac",
1715 "Maximum number of hashlist entries as multiple of number of rows in the problem (-1: no limit)",
1718 "presolving/tworowbnd/maxpairfac",
1719 "Maximum number of processed row pairs as multiple of the number of rows in the problem (-1: no limit)",
Constraint handler for linear constraints in their most general form, .
SCIP_Bool SCIPisStopped(SCIP *scip)
void SCIPhashsetFree(SCIP_HASHSET **hashset, BMS_BLKMEM *blkmem)
SCIP_Bool SCIPhashsetExists(SCIP_HASHSET *hashset, void *element)
SCIP_RETCODE SCIPhashsetInsert(SCIP_HASHSET *hashset, BMS_BLKMEM *blkmem, void *element)
SCIP_RETCODE SCIPhashsetCreate(SCIP_HASHSET **hashset, BMS_BLKMEM *blkmem, int size)
#define SCIPhashTwo(a, b)
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE 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_RETCODE SCIPincludePresolTworowbnd(SCIP *scip)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_RETCODE SCIPsetPresolFree(SCIP *scip, SCIP_PRESOL *presol,)
void SCIPpresolSetData(SCIP_PRESOL *presol, SCIP_PRESOLDATA *presoldata)
SCIP_PRESOLDATA * SCIPpresolGetData(SCIP_PRESOL *presol)
SCIP_RETCODE SCIPsetPresolCopy(SCIP *scip, SCIP_PRESOL *presol,)
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)
SCIP_RETCODE SCIPsetPresolInit(SCIP *scip, SCIP_PRESOL *presol,)
const char * SCIPpresolGetName(SCIP_PRESOL *presol)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisEQ(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)
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
void SCIPselectWeightedReal(SCIP_Real *realarray, SCIP_Real *weights, SCIP_Real capacity, int len, int *medianpos)
void SCIPsortIntInt(int *intarray1, int *intarray2, int len)
void SCIPsortIntReal(int *intarray, SCIP_Real *realarray, int len)
assert(minobj< SCIPgetCutoffbound(scip))
int SCIPmatrixGetRowNNonzs(SCIP_MATRIX *matrix, int row)
const char * SCIPmatrixGetRowName(SCIP_MATRIX *matrix, int row)
SCIP_Real SCIPmatrixGetRowLhs(SCIP_MATRIX *matrix, int row)
const char * SCIPmatrixGetColName(SCIP_MATRIX *matrix, int col)
SCIP_Real * SCIPmatrixGetRowValPtr(SCIP_MATRIX *matrix, int row)
SCIP_Real SCIPmatrixGetRowRhs(SCIP_MATRIX *matrix, int row)
SCIP_RETCODE SCIPmatrixCreate(SCIP *scip, SCIP_MATRIX **matrixptr, SCIP_Bool onlyifcomplete, SCIP_Bool *initialized, SCIP_Bool *complete, SCIP_Bool *infeasible, int *naddconss, int *ndelconss, int *nchgcoefs, int *nchgbds, int *nfixedvars)
int SCIPmatrixGetNColumns(SCIP_MATRIX *matrix)
void SCIPmatrixFree(SCIP *scip, SCIP_MATRIX **matrix)
SCIP_VAR * SCIPmatrixGetVar(SCIP_MATRIX *matrix, int col)
int * SCIPmatrixGetRowIdxPtr(SCIP_MATRIX *matrix, int row)
int SCIPmatrixGetNRows(SCIP_MATRIX *matrix)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
static SCIP_RETCODE addEntry(SCIP *scip, int *pos, int *listsize, int **hashlist, int **rowidxlist, int hash, int rowidx)
static SCIP_RETCODE transformAndSolve(SCIP *scip, SCIP_MATRIX *matrix, int row1idx, int row2idx, SCIP_Bool swaprow1, SCIP_Bool swaprow2, SCIP_Real *aoriginal, SCIP_Real *acopy, SCIP_Real *coriginal, SCIP_Real *ccopy, SCIP_Bool *cangetbnd, SCIP_Real *lbs, SCIP_Real *ubs, SCIP_Real *newlbsoriginal, SCIP_Real *newlbscopy, SCIP_Real *newubsoriginal, SCIP_Real *newubscopy, SCIP_Bool *success, SCIP_Bool *infeasible)
#define DEFAULT_MAXCONSIDEREDNONZEROS
static int hashIndexPair(int idx1, int idx2)
static SCIP_RETCODE solveSingleRowLP(SCIP *scip, SCIP_Real *a, SCIP_Real b, SCIP_Real *c, SCIP_Real *lbs, SCIP_Real *ubs, int len, SCIP_Real *obj, SCIP_Bool *solvable)
static SCIP_RETCODE processHashlists(SCIP *scip, SCIP_PRESOLDATA *presoldata, SCIP_MATRIX *matrix, int *hashlist1, int *hashlist2, int lenhashlist1, int lenhashlist2, int *rowidxlist1, int *rowidxlist2, SCIP_Real *newlbs, SCIP_Real *newubs)
static void * encodeRowPair(ROWPAIR *rowpair)
static void findNextBlock(int *list, int len, int *start, int *end)
static SCIP_RETCODE applyLPboundTightening(SCIP *scip, SCIP_MATRIX *matrix, int row1, int row2, SCIP_Bool swaprow1, SCIP_Bool swaprow2, SCIP_Real *lbs, SCIP_Real *ubs, SCIP_Bool *success)
#define DEFAULT_ENABLECOPY
#define DEFAULT_MAXHASHFAC
#define DEFAULT_MAXCOMBINEFAILS
#define DEFAULT_MAXRETRIEVEFAILS
#define DEFAULT_MAXPAIRFAC
do bound tightening by using two rows
public methods for matrix
#define SCIP_DECL_PRESOLCOPY(x)
struct SCIP_PresolData SCIP_PRESOLDATA
#define SCIP_DECL_PRESOLFREE(x)
#define SCIP_DECL_PRESOLINIT(x)
#define SCIP_DECL_PRESOLEXEC(x)
enum SCIP_Retcode SCIP_RETCODE
@ SCIP_VARTYPE_CONTINUOUS