linear inequalities in preparation
Definition in file misc_rowprep.c.
#include "scip/pub_misc_rowprep.h"
#include "scip/pub_misc_sort.h"
#include "scip/pub_var.h"
#include "scip/pub_message.h"
#include "scip/scip_lp.h"
#include "scip/scip_mem.h"
#include "scip/scip_message.h"
#include "scip/scip_numerics.h"
#include "scip/scip_sepa.h"
#include "scip/scip_sol.h"
#include "scip/scip_tree.h"
#include "scip/struct_misc.h"
#include "scip/struct_scip.h"
#include "scip/set.h"
Go to the source code of this file.
Macros | |
#define | ROWPREP_SCALEUP_VIOLNONZERO (10.0*SCIPepsilon(scip)) |
#define | ROWPREP_SCALEUP_MINVIOLFACTOR 2.0 |
#define | ROWPREP_SCALEUP_MAXMINCOEF (1.0 / SCIPfeastol(scip)) |
#define | ROWPREP_SCALEUP_MAXMAXCOEF SCIPgetHugeValue(scip) |
#define | ROWPREP_SCALEUP_MAXSIDE SCIPgetHugeValue(scip) |
#define | ROWPREP_SCALEDOWN_MINMAXCOEF (1.0 / SCIPfeastol(scip)) |
#define | ROWPREP_SCALEDOWN_MINCOEF SCIPfeastol(scip) |
#define | M_SQRT2 sqrt(2.0) |
#define ROWPREP_SCALEUP_VIOLNONZERO (10.0*SCIPepsilon(scip)) |
minimal violation for considering up-scaling of rowprep (we want to avoid upscaling very small violations)
Definition at line 50 of file misc_rowprep.c.
Referenced by rowprepCleanupScaleup().
#define ROWPREP_SCALEUP_MINVIOLFACTOR 2.0 |
scale up will target a violation of ~MINVIOLFACTOR*minviol, where minviol is given by caller
Definition at line 51 of file misc_rowprep.c.
Referenced by rowprepCleanupScaledown(), and rowprepCleanupScaleup().
#define ROWPREP_SCALEUP_MAXMINCOEF (1.0 / SCIPfeastol(scip)) |
scale up only if min. coef is below this number (before scaling)
Definition at line 52 of file misc_rowprep.c.
Referenced by rowprepCleanupScaleup().
#define ROWPREP_SCALEUP_MAXMAXCOEF SCIPgetHugeValue(scip) |
scale up only if max. coef will not exceed this number by scaling
Definition at line 53 of file misc_rowprep.c.
Referenced by rowprepCleanupScaleup().
#define ROWPREP_SCALEUP_MAXSIDE SCIPgetHugeValue(scip) |
scale up only if side will not exceed this number by scaling
Definition at line 54 of file misc_rowprep.c.
Referenced by rowprepCleanupIntegralCoefs(), and rowprepCleanupScaleup().
#define ROWPREP_SCALEDOWN_MINMAXCOEF (1.0 / SCIPfeastol(scip)) |
scale down if max. coef is at least this number (before scaling)
Definition at line 55 of file misc_rowprep.c.
Referenced by rowprepCleanupScaledown().
#define ROWPREP_SCALEDOWN_MINCOEF SCIPfeastol(scip) |
scale down only if min. coef does not drop below this number by scaling
Definition at line 56 of file misc_rowprep.c.
Referenced by rowprepCleanupScaledown().
#define M_SQRT2 sqrt(2.0) |
Definition at line 59 of file misc_rowprep.c.
Referenced by SCIPcalcCumulativeDistribution(), SCIPnormalCDF(), and SCIPscaleupRowprep().
|
static |
adds a variable to the rowprep->modifiedvars array, if recording of modification has been enabled and the variable is not fixed
scip | SCIP data structure |
rowprep | rowprep |
var | variable to add |
Definition at line 64 of file misc_rowprep.c.
References SCIP_RowPrep::modifiedvars, SCIP_RowPrep::modifiedvarssize, SCIP_RowPrep::nmodifiedvars, SCIP_RowPrep::recordmodifications, SCIP_CALL, SCIP_OKAY, SCIPcalcMemGrowSize(), SCIPdebugMsg, SCIPisRelEQ(), SCIPreallocBlockMemoryArray, SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), and var.
Referenced by rowprepCleanupImproveCoefrange(), and rowprepCleanupIntegralCoefs().
|
static |
sort terms by absolute value of coefficients, from largest to smallest
scip | SCIP data structure |
rowprep | rowprep to be sorted |
Definition at line 99 of file misc_rowprep.c.
References assert(), SCIP_RowPrep::coefs, i, NULL, SCIP_RowPrep::nvars, REALABS, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPsortDownRealRealPtr(), and SCIP_RowPrep::vars.
Referenced by SCIPcleanupRowprep(), and SCIPcleanupRowprep2().
|
static |
try to improve coef range by aggregating row with variable bounds
Assumes terms have been sorted by rowprepCleanupSortTerms().
scip | SCIP data structure |
rowprep | rowprep to be improve |
sol | solution that we try to cut off, or NULL for LP solution |
maxcoefrange | maximal allowed coefficients range |
Definition at line 158 of file misc_rowprep.c.
References assert(), SCIP_RowPrep::coefs, i, SCIP_RowPrep::local, MAX, MIN, SCIP_RowPrep::nvars, REALABS, rowprepRecordModifiedVar(), SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIPdebugMsg, SCIPgetSolVal(), SCIPisGT(), SCIPisInfinity(), SCIPisLT(), SCIProwprepAddConstant(), SCIPvarGetLbGlobal(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), SCIPvarGetUbLocal(), SCIP_RowPrep::sidetype, sol, var, and SCIP_RowPrep::vars.
Referenced by SCIPcleanupRowprep(), and SCIPcleanupRowprep2().
|
static |
scales up rowprep if it seems useful
scip | SCIP data structure |
rowprep | rowprep to be improve |
viol | violation of cut in sol (input and output) |
minviol | minimal violation we try to achieve |
Definition at line 326 of file misc_rowprep.c.
References assert(), SCIP_RowPrep::coefs, NULL, SCIP_RowPrep::nvars, REALABS, ROWPREP_SCALEUP_MAXMAXCOEF, ROWPREP_SCALEUP_MAXMINCOEF, ROWPREP_SCALEUP_MAXSIDE, ROWPREP_SCALEUP_MINVIOLFACTOR, ROWPREP_SCALEUP_VIOLNONZERO, SCIP_Real, SCIPisInfinity(), SCIPscaleRowprep(), and SCIP_RowPrep::side.
Referenced by SCIPcleanupRowprep().
|
static |
scales down rowprep if it improves coefs and keeps rowprep violated
scip | SCIP data structure |
rowprep | rowprep to be improve |
viol | violation of cut in sol (input and output) |
minviol | minimal violation we try to keep |
Definition at line 376 of file misc_rowprep.c.
References assert(), SCIP_RowPrep::coefs, SCIP_RowPrep::nvars, REALABS, ROWPREP_SCALEDOWN_MINCOEF, ROWPREP_SCALEDOWN_MINMAXCOEF, ROWPREP_SCALEUP_MINVIOLFACTOR, SCIP_Real, SCIPisInfinity(), and SCIPscaleRowprep().
Referenced by SCIPcleanupRowprep().
|
static |
rounds almost integral coefs to integrals, thereby trying to relax the cut
scip | SCIP data structure |
rowprep | rowprep to be improve |
viol | NULL or violation of cut in sol (input), set to SCIP_INVALID if some coef changed |
Definition at line 421 of file misc_rowprep.c.
References assert(), SCIP_RowPrep::coefs, i, SCIP_RowPrep::local, NULL, SCIP_RowPrep::nvars, REALABS, ROWPREP_SCALEUP_MAXSIDE, rowprepRecordModifiedVar(), SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIP_SIDETYPE_RIGHT, SCIPdebugMsg, SCIPisEQ(), SCIPisInfinity(), SCIPisZero(), SCIPround(), SCIProwprepAddConstant(), SCIPscaleRowprep(), SCIPvarGetLbGlobal(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), SCIPvarGetUbLocal(), SCIP_RowPrep::side, SCIP_RowPrep::sidetype, var, and SCIP_RowPrep::vars.
Referenced by SCIPcleanupRowprep(), and SCIPcleanupRowprep2().
|
static |
relaxes almost zero side
scip | SCIP data structure |
rowprep | rowprep to be improve |
viol | NULL or violation of cut in sol (input), set to SCIP_INVALID if some coef changed |
Definition at line 514 of file misc_rowprep.c.
References SCIP_RowPrep::modifiedside, NULL, SCIP_RowPrep::recordmodifications, SCIP_INVALID, SCIP_Real, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIPepsilon(), SCIPisZero(), SCIP_RowPrep::side, SCIP_RowPrep::sidetype, and TRUE.
Referenced by SCIPcleanupRowprep(), and SCIPcleanupRowprep2().