constraint handler for quadratic constraints \(\textrm{lhs} \leq \sum_{i,j=1}^n a_{i,j} x_i x_j + \sum_{i=1}^n b_i x_i \leq \textrm{rhs}\)
Definition in file cons_quadratic.c.
#include <assert.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include "scip/cons_nonlinear.h"
#include "scip/cons_quadratic.h"
#include "scip/cons_linear.h"
#include "scip/cons_and.h"
#include "scip/cons_varbound.h"
#include "scip/cons_bounddisjunction.h"
#include "scip/intervalarith.h"
#include "scip/heur_subnlp.h"
#include "scip/heur_trysol.h"
#include "scip/debug.h"
#include "nlpi/nlpi.h"
#include "nlpi/nlpi_ipopt.h"
Go to the source code of this file.
Typedefs | |
typedef struct SCIP_QuadConsUpgrade | SCIP_QUADCONSUPGRADE |
typedef struct BilinearEstimator | BILINESTIMATOR |
#define SCIP_PRIVATE_ROWPREP |
Definition at line 39 of file cons_quadratic.c.
#define CONSHDLR_NAME "quadratic" |
Definition at line 55 of file cons_quadratic.c.
Referenced by SCIP_DECL_CONSEXITSOL(), SCIP_DECL_CONSHDLRCOPY(), SCIP_DECL_CONSINITSOL(), SCIPaddBilinearIneqQuadratic(), SCIPchgBilinCoefQuadratic(), SCIPchgLhsQuadratic(), SCIPchgLinearCoefQuadratic(), SCIPchgRhsQuadratic(), SCIPchgSquareCoefQuadratic(), SCIPcreateConsQuadratic(), SCIPcreateConsQuadratic2(), SCIPgetActivityQuadratic(), SCIPgetAllBilinearTermsQuadratic(), SCIPgetFeasibilityQuadratic(), SCIPgetNAllBilinearTermsQuadratic(), SCIPincludeConshdlrQuadratic(), and SCIPincludeQuadconsUpgrade().
#define CONSHDLR_DESC "quadratic constraints of the form lhs <= b' x + x' A x <= rhs" |
Definition at line 56 of file cons_quadratic.c.
Referenced by SCIPincludeConshdlrQuadratic().
#define CONSHDLR_SEPAPRIORITY 10 |
priority of the constraint handler for separation
Definition at line 57 of file cons_quadratic.c.
Referenced by SCIPincludeConshdlrQuadratic().
#define CONSHDLR_ENFOPRIORITY -50 |
priority of the constraint handler for constraint enforcing
Definition at line 58 of file cons_quadratic.c.
Referenced by SCIPincludeConshdlrQuadratic().
#define CONSHDLR_CHECKPRIORITY -4000000 |
priority of the constraint handler for checking feasibility
Definition at line 59 of file cons_quadratic.c.
Referenced by SCIPincludeConshdlrQuadratic().
#define CONSHDLR_SEPAFREQ 1 |
frequency for separating cuts; zero means to separate only in the root node
Definition at line 60 of file cons_quadratic.c.
Referenced by SCIPincludeConshdlrQuadratic().
#define CONSHDLR_PROPFREQ 1 |
frequency for propagating domains; zero means only preprocessing propagation
Definition at line 61 of file cons_quadratic.c.
Referenced by SCIPincludeConshdlrQuadratic().
#define CONSHDLR_EAGERFREQ 100 |
frequency for using all instead of only the useful constraints in separation, propagation and enforcement, -1 for no eager evaluations, 0 for first only
Definition at line 62 of file cons_quadratic.c.
Referenced by SCIPincludeConshdlrQuadratic().
#define CONSHDLR_MAXPREROUNDS -1 |
maximal number of presolving rounds the constraint handler participates in (-1: no limit)
Definition at line 65 of file cons_quadratic.c.
Referenced by SCIPincludeConshdlrQuadratic().
#define CONSHDLR_DELAYSEPA FALSE |
should separation method be delayed, if other separators found cuts?
Definition at line 66 of file cons_quadratic.c.
Referenced by SCIPincludeConshdlrQuadratic().
#define CONSHDLR_DELAYPROP FALSE |
should propagation method be delayed, if other propagators found reductions?
Definition at line 67 of file cons_quadratic.c.
Referenced by SCIPincludeConshdlrQuadratic().
#define CONSHDLR_NEEDSCONS TRUE |
should the constraint handler be skipped, if no constraints are available?
Definition at line 68 of file cons_quadratic.c.
Referenced by SCIPincludeConshdlrQuadratic().
#define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP |
propagation timing mask of the constraint handler
Definition at line 70 of file cons_quadratic.c.
Referenced by SCIPincludeConshdlrQuadratic().
#define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_ALWAYS |
presolving timing of the constraint handler (fast, medium, or exhaustive)
Definition at line 71 of file cons_quadratic.c.
Referenced by SCIPincludeConshdlrQuadratic().
#define MAXDNOM 10000LL |
maximal denominator for simple rational fixed values
Definition at line 73 of file cons_quadratic.c.
Referenced by presolveTryAddLinearReform().
#define NONLINCONSUPGD_PRIORITY 40000 |
priority of upgrading nonlinear constraints
Definition at line 74 of file cons_quadratic.c.
Referenced by SCIPincludeConshdlrQuadratic().
#define INITLPMAXVARVAL 1000.0 |
maximal absolute value of variable for still generating a linearization cut at that point in initlp
Definition at line 75 of file cons_quadratic.c.
Referenced by SCIP_DECL_CONSINITLP().
#define PROPBILINNEW |
Definition at line 85 of file cons_quadratic.c.
#define INTERIOR_EPS 1e-1 |
Definition at line 88 of file cons_quadratic.c.
Referenced by computeInteriorPoint().
#define GAUGESCALE 0.99999 |
Definition at line 91 of file cons_quadratic.c.
Referenced by computeReferencePointGauge().
#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 93 of file cons_quadratic.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 94 of file cons_quadratic.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 95 of file cons_quadratic.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 96 of file cons_quadratic.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 97 of file cons_quadratic.c.
Referenced by rowprepCleanupScaleup().
#define ROWPREP_SCALEDOWN_MINMAXCOEF (1.0 / SCIPfeastol(scip)) |
scale down if max. coef is at least this number (before scaling)
Definition at line 98 of file cons_quadratic.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 99 of file cons_quadratic.c.
Referenced by rowprepCleanupScaledown().
#define infty2infty | ( | infty1, | |
infty2, | |||
val | |||
) | ((val) >= (infty1) ? (infty2) : (val)) |
translate from one value of infinity to another
if val is >= infty1, then give infty2, else give val
Definition at line 309 of file cons_quadratic.c.
Referenced by propagateBoundsBilinearTerm(), propagateBoundsCons(), and propagateBoundsGetQuadActivity().
typedef struct SCIP_QuadConsUpgrade SCIP_QUADCONSUPGRADE |
quadratic constraint update method
Definition at line 197 of file cons_quadratic.c.
typedef struct BilinearEstimator BILINESTIMATOR |
Definition at line 214 of file cons_quadratic.c.
|
static |
checks whether a quadratic constraint upgrade method has already be registered
scip | SCIP data structure |
conshdlrdata | constraint handler data |
conshdlrname | name of the constraint handler |
Definition at line 275 of file cons_quadratic.c.
References FALSE, SCIPwarningMessage(), and TRUE.
Referenced by SCIPincludeQuadconsUpgrade().
|
static |
catches variable bound change events on a linear variable in a quadratic constraint
scip | SCIP data structure |
eventhdlr | event handler |
cons | constraint for which to catch bound change events |
linvarpos | position of variable in linear variables array |
Definition at line 313 of file cons_quadratic.c.
References dropLinearVarEvents(), SCIP_CALL, SCIP_EVENTTYPE_GBDCHANGED, SCIP_EVENTTYPE_LBCHANGED, SCIP_EVENTTYPE_UBCHANGED, SCIP_EVENTTYPE_VARFIXED, SCIP_INVALID, SCIP_OKAY, SCIPallocBlockMemory, SCIPcatchVarEvent(), SCIPconsGetData(), and SCIPisInfinity().
Referenced by addLinearCoef(), catchVarEvents(), and chgLinearCoefPos().
|
static |
drops variable bound change events on a linear variable in a quadratic constraint
scip | SCIP data structure |
eventhdlr | event handler |
cons | constraint for which to catch bound change events |
linvarpos | position of variable in linear variables array |
Definition at line 378 of file cons_quadratic.c.
References catchQuadVarEvents(), SCIP_CALL, SCIP_EVENTTYPE_GBDCHANGED, SCIP_EVENTTYPE_LBCHANGED, SCIP_EVENTTYPE_UBCHANGED, SCIP_EVENTTYPE_VARFIXED, SCIP_OKAY, SCIPconsGetData(), SCIPdropVarEvent(), SCIPfreeBlockMemory, and SCIPisInfinity().
Referenced by catchLinearVarEvents(), chgLinearCoefPos(), delLinearCoefPos(), and dropVarEvents().
|
static |
catches variable bound change events on a quadratic variable in a quadratic constraint
scip | SCIP data structure |
eventhdlr | event handler |
cons | constraint for which to catch bound change events |
quadvarpos | position of variable in quadratic variables array |
Definition at line 432 of file cons_quadratic.c.
References dropQuadVarEvents(), SCIP_CALL, SCIP_EVENTTYPE_BOUNDCHANGED, SCIP_EVENTTYPE_GBDCHANGED, SCIP_EVENTTYPE_IMPLADDED, SCIP_EVENTTYPE_VARFIXED, SCIP_OKAY, SCIPallocBlockMemory, SCIPcatchVarEvent(), SCIPconsGetData(), and SCIPintervalSetEmpty().
Referenced by addQuadVarTerm(), catchVarEvents(), dropLinearVarEvents(), and replaceQuadVarTermPos().
|
static |
catches variable bound change events on a quadratic variable in a quadratic constraint
scip | SCIP data structure |
eventhdlr | event handler |
cons | constraint for which to catch bound change events |
quadvarpos | position of variable in quadratic variables array |
Definition at line 477 of file cons_quadratic.c.
References catchVarEvents(), SCIP_CALL, SCIP_EVENTTYPE_BOUNDCHANGED, SCIP_EVENTTYPE_GBDCHANGED, SCIP_EVENTTYPE_IMPLADDED, SCIP_EVENTTYPE_VARFIXED, SCIP_OKAY, SCIPconsGetData(), SCIPdropVarEvent(), and SCIPfreeBlockMemory.
Referenced by catchQuadVarEvents(), delQuadVarTermPos(), dropVarEvents(), and replaceQuadVarTermPos().
|
static |
catch variable events
scip | SCIP data structure |
eventhdlr | event handler |
cons | constraint for which to catch bound change events |
Definition at line 515 of file cons_quadratic.c.
References catchLinearVarEvents(), catchQuadVarEvents(), dropVarEvents(), FALSE, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemoryArray, SCIPconsGetData(), SCIPisEQ(), SCIPvarGetLbGlobal(), SCIPvarGetUbGlobal(), SCIPvarIsActive(), and TRUE.
Referenced by dropQuadVarEvents(), and SCIP_DECL_CONSENABLE().
|
static |
drop variable events
scip | SCIP data structure |
eventhdlr | event handler |
cons | constraint for which to drop bound change events |
Definition at line 564 of file cons_quadratic.c.
References dropLinearVarEvents(), dropQuadVarEvents(), lockLinearVariable(), SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), and SCIPfreeBlockMemoryArray.
Referenced by catchVarEvents(), and SCIP_DECL_CONSDISABLE().
|
static |
locks a linear variable in a constraint
scip | SCIP data structure |
cons | constraint where to lock a variable |
var | variable to lock |
coef | coefficient of variable in constraint |
Definition at line 605 of file cons_quadratic.c.
References SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPisInfinity(), SCIPlockVarCons(), and unlockLinearVariable().
Referenced by addLinearCoef(), chgLinearCoefPos(), and dropVarEvents().
|
static |
unlocks a linear variable in a constraint
scip | SCIP data structure |
cons | constraint where to unlock a variable |
var | variable to unlock |
coef | coefficient of variable in constraint |
Definition at line 636 of file cons_quadratic.c.
References lockQuadraticVariable(), SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPisInfinity(), and SCIPunlockVarCons().
Referenced by chgLinearCoefPos(), delLinearCoefPos(), and lockLinearVariable().
|
static |
locks a quadratic variable in a constraint
scip | SCIP data structure |
cons | constraint where to lock a variable |
var | variable to lock |
Definition at line 667 of file cons_quadratic.c.
References SCIP_CALL, SCIP_OKAY, SCIPlockVarCons(), TRUE, and unlockQuadraticVariable().
Referenced by addQuadVarTerm(), replaceQuadVarTermPos(), and unlockLinearVariable().
|
static |
unlocks a quadratic variable in a constraint
scip | SCIP data structure |
cons | constraint where to unlock a variable |
var | variable to unlock |
Definition at line 680 of file cons_quadratic.c.
References consdataUpdateLinearActivity(), SCIP_CALL, SCIP_OKAY, SCIPunlockVarCons(), and TRUE.
Referenced by delQuadVarTermPos(), lockQuadraticVariable(), and replaceQuadVarTermPos().
|
static |
computes the minimal and maximal activity for the linear part in a constraint data
Only sums up terms that contribute finite values. Gives the number of terms that contribute infinite values. Only computes those activities where the corresponding side of the constraint is finite.
scip | SCIP data structure |
consdata | constraint data |
intervalinfty | infinity value used in interval operations |
Definition at line 698 of file cons_quadratic.c.
References consdataUpdateLinearActivityLbChange(), MAX, SCIP_INVALID, SCIP_Real, SCIPintervalGetRoundingMode(), SCIPintervalSetRoundingMode(), SCIPintervalSetRoundingModeDownwards(), SCIPintervalSetRoundingModeUpwards(), SCIPisInfinity(), SCIPvarGetLbLocal(), and SCIPvarGetUbLocal().
Referenced by propagateBoundsCons(), and unlockQuadraticVariable().
|
static |
update the linear activities after a change in the lower bound of a variable
scip | SCIP data structure |
consdata | constraint data |
coef | coefficient of variable in constraint |
oldbnd | previous lower bound of variable |
newbnd | new lower bound of variable |
Definition at line 812 of file cons_quadratic.c.
References consdataUpdateLinearActivityUbChange(), SCIP_INVALID, SCIP_Real, SCIPintervalGetRoundingMode(), SCIPintervalSetRoundingMode(), SCIPintervalSetRoundingModeDownwards(), SCIPintervalSetRoundingModeUpwards(), and SCIPisInfinity().
Referenced by consdataUpdateLinearActivity(), and SCIP_DECL_EVENTEXEC().
|
static |
update the linear activities after a change in the upper bound of a variable
scip | SCIP data structure |
consdata | constraint data |
coef | coefficient of variable in constraint |
oldbnd | previous lower bound of variable |
newbnd | new lower bound of variable |
Definition at line 911 of file cons_quadratic.c.
References hasQuadvarHpProperty(), SCIP_Bool, SCIP_INVALID, SCIP_Real, SCIPintervalGetRoundingMode(), SCIPintervalSetRoundingMode(), SCIPintervalSetRoundingModeDownwards(), SCIPintervalSetRoundingModeUpwards(), and SCIPisInfinity().
Referenced by consdataUpdateLinearActivityLbChange(), and SCIP_DECL_EVENTEXEC().
|
static |
returns whether a quadratic variable domain can be reduced to its lower or upper bound; this is the case if the quadratic variable is in just one single quadratic constraint and (sqrcoef > 0 and LHS = -infinity), or (sqrcoef < 0 and RHS = +infinity) hold
scip | SCIP data structure |
consdata | constraint data |
idx | index of quadratic variable |
Definition at line 1013 of file cons_quadratic.c.
References SCIP_Bool, SCIP_DECL_EVENTEXEC(), SCIP_Real, SCIP_VARTYPE_BINARY, SCIPisInfinity(), SCIPisZero(), SCIPvarGetNLocksDown(), SCIPvarGetNLocksUp(), SCIPvarGetObj(), and SCIPvarGetType().
Referenced by consdataUpdateLinearActivityUbChange(), and SCIP_DECL_CONSPRESOL().
|
static |
processes variable fixing or bound change event
Definition at line 1041 of file cons_quadratic.c.
References consdataEnsureLinearVarsSize(), consdataUpdateLinearActivityLbChange(), consdataUpdateLinearActivityUbChange(), FALSE, SCIP_QuadVarTerm::nadjbilin, SCIP_CALL, SCIP_EVENTTYPE_BOUNDCHANGED, SCIP_EVENTTYPE_BOUNDTIGHTENED, SCIP_EVENTTYPE_GBDCHANGED, SCIP_EVENTTYPE_IMPLADDED, SCIP_EVENTTYPE_LBCHANGED, SCIP_EVENTTYPE_VARFIXED, SCIP_OKAY, SCIP_STAGE_SOLVING, SCIP_VARTYPE_INTEGER, SCIPconsGetData(), SCIPeventGetNewbound(), SCIPeventGetOldbound(), SCIPeventGetType(), SCIPeventGetVar(), SCIPgetStage(), SCIPintervalSetEmpty(), SCIPisEQ(), SCIPmarkConsPropagate(), SCIPvarGetLbGlobal(), SCIPvarGetType(), SCIPvarGetUbGlobal(), SCIPvarIsBinary(), SCIP_QuadVarTerm::sqrcoef, and TRUE.
Referenced by addLinearizationCuts(), and hasQuadvarHpProperty().
|
static |
ensures, that linear vars and coefs arrays can store at least num entries
scip | SCIP data structure |
consdata | quadratic constraint data |
num | minimum number of entries to store |
Definition at line 1138 of file cons_quadratic.c.
References consdataEnsureQuadVarTermsSize(), SCIP_CALL, SCIP_OKAY, SCIPcalcMemGrowSize(), and SCIPreallocBlockMemoryArray.
Referenced by addLinearCoef(), presolveDisaggregate(), removeFixedVariables(), SCIP_DECL_EVENTEXEC(), and SCIPcreateConsQuadratic().
|
static |
ensures, that quadratic variable terms array can store at least num entries
scip | SCIP data structure |
consdata | quadratic constraint data |
num | minimum number of entries to store |
Definition at line 1168 of file cons_quadratic.c.
References consdataEnsureAdjBilinSize(), SCIP_CALL, SCIP_OKAY, SCIPcalcMemGrowSize(), and SCIPreallocBlockMemoryArray.
Referenced by addQuadVarTerm(), consdataEnsureLinearVarsSize(), and removeFixedVariables().
|
static |
ensures, that adjacency array can store at least num entries
scip | SCIP data structure |
quadvarterm | quadratic variable term |
num | minimum number of entries to store |
Definition at line 1193 of file cons_quadratic.c.
References SCIP_QuadVarTerm::adjbilin, SCIP_QuadVarTerm::adjbilinsize, consdataEnsureBilinSize(), SCIP_QuadVarTerm::nadjbilin, SCIP_CALL, SCIP_OKAY, SCIPcalcMemGrowSize(), and SCIPreallocBlockMemoryArray.
Referenced by addBilinearTerm(), consdataEnsureQuadVarTermsSize(), and mergeAndCleanQuadVarTerms().
|
static |
ensures, that bilinear term arrays can store at least num entries
scip | SCIP data structure |
consdata | quadratic constraint data |
num | minimum number of entries to store |
Definition at line 1218 of file cons_quadratic.c.
References consdataCreateEmpty(), SCIP_CALL, SCIP_OKAY, SCIPcalcMemGrowSize(), and SCIPreallocBlockMemoryArray.
Referenced by addBilinearTerm(), consdataEnsureAdjBilinSize(), removeFixedVariables(), and SCIPcreateConsQuadratic().
|
static |
creates empty constraint data structure
scip | SCIP data structure |
consdata | a buffer to store pointer to new constraint data |
Definition at line 1243 of file cons_quadratic.c.
References BMSclearMemory, consdataCreate(), FALSE, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIPallocBlockMemory, SCIPinfinity(), and TRUE.
Referenced by consdataEnsureBilinSize(), and SCIPcreateConsQuadratic().
|
static |
creates constraint data structure
scip | SCIP data structure |
consdata | a buffer to store pointer to new constraint data |
lhs | left hand side of constraint |
rhs | right hand side of constraint |
nlinvars | number of linear variables |
linvars | array of linear variables |
lincoefs | array of coefficients of linear variables |
nquadvars | number of quadratic variables |
quadvarterms | array of quadratic variable terms |
nbilinterms | number of bilinear terms |
bilinterms | array of bilinear terms |
capturevars | whether we should capture variables |
Definition at line 1284 of file cons_quadratic.c.
References SCIP_QuadVarTerm::adjbilin, BMSclearMemory, consdataFree(), FALSE, SCIP_QuadVarTerm::nadjbilin, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIPallocBlockMemory, SCIPcaptureVar(), SCIPduplicateBlockMemoryArray, SCIPintervalSet(), SCIPintervalSetEmpty(), SCIPisInfinity(), and TRUE.
Referenced by consdataCreateEmpty(), SCIP_DECL_CONSTRANS(), and SCIPcreateConsQuadratic2().
|
static |
frees constraint data structure
scip | SCIP data structure |
consdata | pointer to constraint data to free |
Definition at line 1404 of file cons_quadratic.c.
References consdataSortLinearVars(), SCIP_CALL, SCIP_OKAY, SCIPfreeBlockMemory, SCIPfreeBlockMemoryArray, SCIPfreeBlockMemoryArrayNull, SCIPreleaseNlRow(), and SCIPreleaseVar().
Referenced by consdataCreate(), and SCIP_DECL_CONSDELETE().
|
static |
sorts linear part of constraint data
consdata | quadratic constraint data |
Definition at line 1473 of file cons_quadratic.c.
References SCIP_DECL_SORTINDCOMP(), SCIPsortedvecFindPtr(), SCIPsortPtrPtrReal(), SCIPsortPtrReal(), and TRUE.
Referenced by consdataFree(), and mergeAndCleanLinearVars().
|
static |
index comparison method for quadratic variable terms: compares two indices of the quadratic variable set in the quadratic constraint
Definition at line 1534 of file cons_quadratic.c.
References consdataSortQuadVarTerms(), and SCIPvarCompare().
Referenced by computeViolations(), consdataFindQuadVarTerm(), consdataSortLinearVars(), and SCIP_DECL_SORTINDCOMP().
|
static |
sorting of quadratic variable terms
scip | SCIP data structure |
consdata | quadratic constraint data |
Definition at line 1547 of file cons_quadratic.c.
References consdataFindQuadVarTerm(), SCIP_QuadVarTerm::eventdata, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPsort(), and TRUE.
Referenced by checkFactorable(), consdataFindQuadVarTerm(), mergeAndCleanQuadVarTerms(), presolveDisaggregate(), propagateBoundsCons(), SCIP_DECL_CONSINITSOL(), SCIP_DECL_SORTINDCOMP(), SCIPaddBilinTermQuadratic(), and SCIPsortQuadVarTermsQuadratic().
|
static |
returns the position of variable in the quadratic variable terms array of a constraint, or -1 if not found
scip | SCIP data structure |
consdata | quadratic constraint data |
var | variable to search for |
pos | buffer where to store position of var in quadvarterms array, or -1 if not found |
Definition at line 1616 of file cons_quadratic.c.
References consdataSortQuadVarTerms(), SCIP_CALL, SCIP_DECL_SORTINDCOMP(), SCIP_OKAY, and SCIPvarCompare().
Referenced by checkFactorable(), consdataSortQuadVarTerms(), createNlRow(), mergeAndCleanLinearVars(), presolveDisaggregateMarkComponent(), propagateBoundsCons(), SCIP_DECL_CONSINITSOL(), SCIPaddBilinTermQuadratic(), SCIPaddQuadVarLinearCoefQuadratic(), SCIPaddSquareCoefQuadratic(), and SCIPfindQuadVarTermQuadratic().
|
static |
index comparison method for bilinear terms: compares two index pairs of the bilinear term set in the quadratic constraint
Definition at line 1669 of file cons_quadratic.c.
References consdataCheckBilinTermsSort(), SCIP_Bool, and SCIPvarCompare().
|
static |
checks if all bilinear terms are sorted correctly
Definition at line 1688 of file cons_quadratic.c.
References consdataSortBilinTerms(), FALSE, and TRUE.
Referenced by addBilinearTerm(), consdataSortBilinTerms(), mergeAndCleanBilinearTerms(), and SCIP_DECL_SORTINDCOMP().
|
static |
sorting of bilinear terms
scip | SCIP data structure |
consdata | quadratic constraint data |
Definition at line 1711 of file cons_quadratic.c.
References consdataCheckBilinTermsSort(), consdataMoveLinearVar(), SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPsort(), and TRUE.
Referenced by consdataCheckBilinTermsSort(), and mergeAndCleanBilinearTerms().
|
static |
moves a linear variable from one position to another
consdata | constraint data |
oldpos | position of variable that shall be moved |
newpos | new position of variable |
Definition at line 1789 of file cons_quadratic.c.
References consdataMoveQuadVarTerm(), and FALSE.
Referenced by consdataSortBilinTerms(), and delLinearCoefPos().
|
static |
moves a quadratic variable from one position to another
consdata | constraint data |
oldpos | position of variable that shall be moved |
newpos | new position of variable |
Definition at line 1822 of file cons_quadratic.c.
References addLinearCoef(), and FALSE.
Referenced by consdataMoveLinearVar(), and delQuadVarTermPos().
|
static |
adds linear coefficient in quadratic constraint
scip | SCIP data structure |
cons | quadratic constraint |
var | variable of constraint entry |
coef | coefficient of constraint entry |
Definition at line 1852 of file cons_quadratic.c.
References catchLinearVarEvents(), consdataEnsureLinearVarsSize(), delLinearCoefPos(), FALSE, lockLinearVariable(), SCIP_Bool, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIPcaptureVar(), SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetData(), SCIPconsIsEnabled(), SCIPconsIsTransformed(), SCIPgetTransformedVar(), SCIPisEQ(), SCIPisZero(), SCIPreleaseNlRow(), SCIPvarCompare(), SCIPvarGetLbGlobal(), SCIPvarGetUbGlobal(), SCIPvarIsActive(), SCIPvarIsTransformed(), and TRUE.
Referenced by consdataMoveQuadVarTerm(), mergeAndCleanQuadVarTerms(), presolveDisaggregate(), presolveTryAddAND(), presolveTryAddLinearReform(), removeFixedVariables(), SCIPaddLinearVarQuadratic(), SCIPchgLinearCoefQuadratic(), and SCIPcreateConsQuadratic().
|
static |
deletes linear coefficient at given position from quadratic constraint data
scip | SCIP data structure |
cons | quadratic constraint |
pos | position of coefficient to delete |
Definition at line 1944 of file cons_quadratic.c.
References chgLinearCoefPos(), consdataMoveLinearVar(), dropLinearVarEvents(), FALSE, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetData(), SCIPreleaseNlRow(), SCIPreleaseVar(), and unlockLinearVariable().
Referenced by addLinearCoef(), mergeAndCleanLinearVars(), removeFixedVariables(), and SCIPchgLinearCoefQuadratic().
|
static |
changes linear coefficient value at given position of quadratic constraint
scip | SCIP data structure |
cons | quadratic constraint |
pos | position of linear coefficient to change |
newcoef | new value of linear coefficient |
Definition at line 2013 of file cons_quadratic.c.
References addQuadVarTerm(), catchLinearVarEvents(), dropLinearVarEvents(), FALSE, lockLinearVariable(), SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetData(), SCIPconsIsEnabled(), SCIPconsIsLocked(), SCIPconsIsTransformed(), SCIPisZero(), SCIPreleaseNlRow(), SCIPvarIsTransformed(), and unlockLinearVariable().
Referenced by delLinearCoefPos(), mergeAndCleanLinearVars(), presolveDisaggregate(), and SCIPchgLinearCoefQuadratic().
|
static |
adds quadratic variable term to quadratic constraint
scip | SCIP data structure |
cons | quadratic constraint |
var | variable to add |
lincoef | linear coefficient of variable |
sqrcoef | square coefficient of variable |
Definition at line 2109 of file cons_quadratic.c.
References SCIP_QuadVarTerm::adjbilin, SCIP_QuadVarTerm::adjbilinsize, catchQuadVarEvents(), consdataEnsureQuadVarTermsSize(), delQuadVarTermPos(), SCIP_QuadVarTerm::eventdata, FALSE, SCIP_QuadVarTerm::lincoef, lockQuadraticVariable(), SCIP_QuadVarTerm::nadjbilin, SCIP_Bool, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIPcaptureVar(), SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetData(), SCIPconsIsEnabled(), SCIPconsIsTransformed(), SCIPgetTransformedVar(), SCIPintervalSetEmpty(), SCIPisEQ(), SCIPreleaseNlRow(), SCIPvarCompare(), SCIPvarGetLbGlobal(), SCIPvarGetUbGlobal(), SCIPvarIsActive(), SCIPvarIsTransformed(), SCIP_QuadVarTerm::sqrcoef, TRUE, and SCIP_QuadVarTerm::var.
Referenced by chgLinearCoefPos(), removeFixedVariables(), SCIPaddBilinTermQuadratic(), SCIPaddQuadVarLinearCoefQuadratic(), SCIPaddQuadVarQuadratic(), SCIPaddSquareCoefQuadratic(), SCIPchgSquareCoefQuadratic(), and SCIPcreateConsQuadratic().
|
static |
deletes quadratic variable term at given position from quadratic constraint data
scip | SCIP data structure |
cons | quadratic constraint |
pos | position of term to delete |
Definition at line 2203 of file cons_quadratic.c.
References consdataMoveQuadVarTerm(), dropQuadVarEvents(), FALSE, replaceQuadVarTermPos(), SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetData(), SCIPfreeBlockMemoryArrayNull, SCIPintervalSetEmpty(), SCIPreleaseNlRow(), SCIPreleaseVar(), and unlockQuadraticVariable().
Referenced by addQuadVarTerm(), mergeAndCleanQuadVarTerms(), presolveDisaggregate(), and removeFixedVariables().
|
static |
replace variable in quadratic variable term at given position of quadratic constraint data
Allows to replace x by coef*y+offset, thereby maintaining linear and square coefficients and bilinear terms.
scip | SCIP data structure |
cons | quadratic constraint |
pos | position of term to replace |
var | new variable |
coef | linear coefficient of new variable |
offset | offset of new variable |
Definition at line 2275 of file cons_quadratic.c.
References addBilinearTerm(), SCIP_QuadVarTerm::adjbilin, catchQuadVarEvents(), SCIP_BilinTerm::coef, dropQuadVarEvents(), SCIP_QuadVarTerm::eventdata, FALSE, SCIP_QuadVarTerm::lincoef, lockQuadraticVariable(), SCIP_QuadVarTerm::nadjbilin, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPcaptureVar(), SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetData(), SCIPconsIsEnabled(), SCIPintervalSetEmpty(), SCIPisEQ(), SCIPisInfinity(), SCIPreleaseNlRow(), SCIPreleaseVar(), SCIPvarCompare(), SCIPvarGetLbGlobal(), SCIPvarGetUbGlobal(), SCIPvarIsActive(), SCIP_QuadVarTerm::sqrcoef, unlockQuadraticVariable(), SCIP_QuadVarTerm::var, SCIP_BilinTerm::var1, and SCIP_BilinTerm::var2.
Referenced by delQuadVarTermPos(), and removeFixedVariables().
|
static |
adds a bilinear term to quadratic constraint
scip | SCIP data structure |
cons | quadratic constraint |
var1pos | position of first variable in quadratic variables array |
var2pos | position of second variable in quadratic variables array |
coef | coefficient of bilinear term |
Definition at line 2444 of file cons_quadratic.c.
References SCIP_BilinTerm::coef, consdataCheckBilinTermsSort(), consdataEnsureAdjBilinSize(), consdataEnsureBilinSize(), FALSE, removeBilinearTermsPos(), SCIP_CALL, SCIP_INVALID, SCIP_INVALIDDATA, SCIP_OKAY, SCIPconsGetData(), SCIPerrorMessage, SCIPintervalSetEmpty(), SCIPisZero(), SCIPreleaseNlRow(), SCIPvarCompare(), TRUE, SCIP_BilinTerm::var1, and SCIP_BilinTerm::var2.
Referenced by removeFixedVariables(), replaceQuadVarTermPos(), SCIPaddBilinTermQuadratic(), and SCIPcreateConsQuadratic().
|
static |
removes a set of bilinear terms and updates adjacency information in quad var terms
Note: this function sorts the given array termposs.
scip | SCIP data structure |
cons | quadratic constraint |
nterms | number of terms to delete |
termposs | indices of terms to delete |
Definition at line 2546 of file cons_quadratic.c.
References FALSE, mergeAndCleanQuadVarTerms(), SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIPallocBufferArray, SCIPconsGetData(), SCIPfreeBufferArray, SCIPintervalSetEmpty(), SCIPreleaseNlRow(), and SCIPsortInt().
Referenced by addBilinearTerm(), mergeAndCleanBilinearTerms(), presolveTryAddAND(), presolveTryAddLinearReform(), and removeFixedVariables().
|
static |
merges quad var terms that correspond to the same variable and does additional cleanup
If a quadratic variable terms is actually linear, makes a linear term out of it also replaces squares of binary variables by the binary variables, i.e., adds sqrcoef to lincoef.
scip | SCIP data structure |
cons | quadratic constraint |
Definition at line 2645 of file cons_quadratic.c.
References addLinearCoef(), SCIP_QuadVarTerm::adjbilin, BMScopyMemoryArray, consdataEnsureAdjBilinSize(), consdataSortQuadVarTerms(), delQuadVarTermPos(), SCIP_QuadVarTerm::lincoef, mergeAndCleanLinearVars(), SCIP_QuadVarTerm::nadjbilin, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPdebugMsg, SCIPintervalSetEmpty(), SCIPisZero(), SCIPreleaseNlRow(), SCIPvarGetName(), SCIPvarIsBinary(), SCIP_QuadVarTerm::sqrcoef, TRUE, and SCIP_QuadVarTerm::var.
Referenced by presolveDisaggregate(), removeBilinearTermsPos(), removeFixedVariables(), SCIP_DECL_CONSENABLE(), SCIP_DECL_CONSEXITPRE(), and SCIP_DECL_CONSPRESOL().
|
static |
merges entries with same linear variable into one entry and cleans up entries with coefficient 0.0
scip | SCIP data structure |
cons | quadratic constraint |
Definition at line 2742 of file cons_quadratic.c.
References chgLinearCoefPos(), consdataFindQuadVarTerm(), consdataSortLinearVars(), delLinearCoefPos(), mergeAndCleanBilinearTerms(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPconsGetData(), SCIPintervalSetEmpty(), SCIPisZero(), and TRUE.
Referenced by mergeAndCleanQuadVarTerms(), removeFixedVariables(), SCIP_DECL_CONSENABLE(), SCIP_DECL_CONSEXITPRE(), and SCIP_DECL_CONSPRESOL().
|
static |
merges bilinear terms with same variables into a single term, removes bilinear terms with coefficient 0.0
scip | SCIP data structure |
cons | quadratic constraint |
Definition at line 2814 of file cons_quadratic.c.
References SCIP_BilinTerm::coef, consdataCheckBilinTermsSort(), consdataSortBilinTerms(), removeBilinearTermsPos(), removeFixedVariables(), SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPconsGetData(), SCIPfreeBufferArray, SCIPisZero(), TRUE, SCIP_BilinTerm::var1, and SCIP_BilinTerm::var2.
Referenced by mergeAndCleanLinearVars(), presolveDisaggregate(), removeFixedVariables(), SCIP_DECL_CONSENABLE(), SCIP_DECL_CONSEXITPRE(), and SCIP_DECL_CONSPRESOL().
|
static |
removes fixes (or aggregated) variables from a quadratic constraint
scip | SCIP data structure |
cons | quadratic constraint |
Definition at line 2887 of file cons_quadratic.c.
References addBilinearTerm(), addLinearCoef(), addQuadVarTerm(), SCIP_BilinTerm::coef, consdataEnsureBilinSize(), consdataEnsureLinearVarsSize(), consdataEnsureQuadVarTermsSize(), createNlRow(), delLinearCoefPos(), delQuadVarTermPos(), FALSE, mergeAndCleanBilinearTerms(), mergeAndCleanLinearVars(), mergeAndCleanQuadVarTerms(), removeBilinearTermsPos(), replaceQuadVarTermPos(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_VARSTATUS_MULTAGGR, SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, SCIPdebugPrintCons, SCIPgetProbvarSum(), SCIPisEQ(), SCIPisInfinity(), SCIPvarCompare(), SCIPvarGetLbGlobal(), SCIPvarGetMultaggrConstant(), SCIPvarGetMultaggrNVars(), SCIPvarGetMultaggrScalars(), SCIPvarGetMultaggrVars(), SCIPvarGetName(), SCIPvarGetStatus(), SCIPvarGetUbGlobal(), SCIPvarIsActive(), TRUE, SCIP_BilinTerm::var1, and SCIP_BilinTerm::var2.
Referenced by mergeAndCleanBilinearTerms(), SCIP_DECL_CONSEXITPRE(), and SCIP_DECL_CONSPRESOL().
|
static |
create a nonlinear row representation of the constraint and stores them in consdata
scip | SCIP data structure |
cons | quadratic constraint |
Definition at line 3217 of file cons_quadratic.c.
References SCIP_QuadElement::coef, consdataFindQuadVarTerm(), SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, MAX, presolveSolve(), SCIP_CALL, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_EXPRCURV_LINEAR, SCIP_EXPRCURV_UNKNOWN, SCIP_OKAY, SCIP_Real, SCIPaddLinearCoefsToNlRow(), SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPcreateNlRow(), SCIPfreeBufferArray, SCIPisZero(), and SCIPreleaseNlRow().
Referenced by computeInteriorPoint(), removeFixedVariables(), SCIP_DECL_CONSINITSOL(), and SCIPgetNlRowQuadratic().
|
static |
solve constraint as presolving
scip | SCIP data structure |
cons | constraint |
result | to store result of solve: cutoff, success, or do-not-find |
redundant | to store whether constraint is redundant now (should be deleted) |
naggrvars | counter on number of variable aggregations |
Definition at line 3350 of file cons_quadratic.c.
References FALSE, presolveTryAddAND(), SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_Real, SCIP_SUCCESS, SCIPaggregateVars(), SCIPconsGetData(), SCIPdebugMsg, SCIPisEQ(), SCIPisZero(), SCIPvarGetName(), SCIPvarIsBinary(), and TRUE.
Referenced by createNlRow(), and SCIP_DECL_CONSPRESOL().
|
static |
reformulates products of binary variables as AND constraint
For a product x*y, with x and y binary variables, the product is replaced by a new auxiliary variable z and the constraint z = {x and y} is added.
scip | SCIP data structure |
conshdlr | constraint handler |
cons | constraint |
naddconss | buffer where to add the number of AND constraints added |
Definition at line 3437 of file cons_quadratic.c.
References addLinearCoef(), getImpliedBounds(), removeBilinearTermsPos(), SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_BINARY, SCIPaddCons(), SCIPaddVar(), SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsDynamic(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateConsAnd(), SCIPcreateVar(), SCIPdebugAddSolVal, SCIPdebugGetSolVal, SCIPdebugMsg, SCIPdebugPrintCons, SCIPfreeBufferArray, SCIPgetNBinVars(), SCIPreleaseCons(), SCIPreleaseVar(), SCIPsnprintf(), SCIPvarGetName(), SCIPvarIsBinary(), SCIPvarIsInitial(), SCIPvarIsRemovable(), and TRUE.
Referenced by presolveSolve(), and SCIP_DECL_CONSPRESOL().
|
static |
gets bounds of variable y if x takes a certain value; checks whether x = xval has implications on y
scip | SCIP data structure |
x | variable which implications to check |
xval | value of x to check for (TRUE for 1, FALSE for 0) |
y | variable to check if bounds can be reduced |
resultant | buffer to store bounds on y |
Definition at line 3539 of file cons_quadratic.c.
References FALSE, SCIP_Interval::inf, MAX, presolveTryAddLinearReform(), SCIP_BOUNDTYPE_LOWER, SCIP_OKAY, SCIP_Real, SCIPhaveVarsCommonClique(), SCIPintervalSetBounds(), SCIPsortedvecFindPtr(), SCIPvarGetImplBounds(), SCIPvarGetImplTypes(), SCIPvarGetImplVars(), SCIPvarGetLbGlobal(), SCIPvarGetNImpls(), SCIPvarGetUbGlobal(), SCIPvarIsActive(), SCIPvarIsBinary(), SCIP_Interval::sup, and TRUE.
Referenced by presolveDisaggregate(), presolveTryAddAND(), and presolveTryAddLinearReform().
|
static |
Reformulates products of binary times bounded continuous variables as system of linear inequalities (plus auxiliary variable).
For a product x*y, with y a binary variable and x a continous variable with finite bounds, an auxiliary variable z and the inequalities \( x^L y \leq z \leq x^U y \) and \( x - (1-y) x^U \leq z \leq x - (1-y) x^L \) are added.
If x is a linear term consisting of more than one variable, it is split up in groups of linear terms of length at most maxnrvar. For each product of linear term of length at most maxnrvar with y, an auxiliary z and linear inequalities are added.
If y is a binary variable, the AND constraint \( z = x \wedge y \) may be added instead of linear constraints.
scip | SCIP data structure |
conshdlr | constraint handler |
cons | constraint |
naddconss | buffer where to add the number of auxiliary constraints added |
Definition at line 3630 of file cons_quadratic.c.
References addLinearCoef(), FALSE, getImpliedBounds(), SCIP_Interval::inf, MAX, MAXDNOM, presolveUpgrade(), REALABS, removeBilinearTermsPos(), SCIP_Bool, SCIP_CALL, SCIP_Longint, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_CONTINUOUS, SCIP_VARTYPE_IMPLINT, SCIPaddCons(), SCIPaddVar(), SCIPcalcGreComDiv(), SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsDynamic(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateConsAnd(), SCIPcreateConsLinear(), SCIPcreateConsVarbound(), SCIPcreateVar(), SCIPdebugAddSolVal, SCIPdebugGetSolVal, SCIPdebugMsg, SCIPdebugPrintCons, SCIPfeastol(), SCIPfreeBufferArrayNull, SCIPgetNBinVars(), SCIPinfinity(), SCIPintervalAdd(), SCIPintervalDivScalar(), SCIPintervalGetInf(), SCIPintervalGetSup(), SCIPintervalMulScalar(), SCIPintervalSet(), SCIPisEQ(), SCIPisInfinity(), SCIPisIntegral(), SCIPisNegative(), SCIPisPositive(), SCIPisZero(), SCIPreallocBufferArray, SCIPreleaseCons(), SCIPreleaseVar(), SCIPround(), SCIPselectSimpleValue(), SCIPsnprintf(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetType(), SCIPvarGetUbGlobal(), SCIPvarIsBinary(), SCIPvarIsInitial(), SCIPvarIsRemovable(), SCIP_Interval::sup, and TRUE.
Referenced by getImpliedBounds(), and SCIP_DECL_CONSPRESOL().
|
static |
tries to automatically convert a quadratic constraint (or a part of it) into a more specific and more specialized constraint
scip | SCIP data structure |
conshdlr | constraint handler data structure |
cons | source constraint to try to convert |
upgraded | buffer to store whether constraint was upgraded |
nupgdconss | buffer to increase if constraint was upgraded |
naddconss | buffer to increase with number of additional constraints created during upgrade |
presoltiming | current presolving timing |
Definition at line 4076 of file cons_quadratic.c.
References FALSE, presolveDisaggregateMarkComponent(), SCIP_Bool, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_BINARY, SCIP_VARTYPE_CONTINUOUS, SCIP_VARTYPE_IMPLINT, SCIP_VARTYPE_INTEGER, SCIPaddCons(), SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsModifiable(), SCIPdebugMsg, SCIPdebugMsgPrint, SCIPdebugPrintCons, SCIPdelCons(), SCIPerrorMessage, SCIPfreeBufferArray, SCIPisIntegral(), SCIPisRelEQ(), SCIPisZero(), SCIPreallocBufferArray, SCIPreleaseCons(), SCIPvarGetLbLocal(), SCIPvarGetType(), SCIPvarGetUbLocal(), and TRUE.
Referenced by presolveTryAddLinearReform(), and SCIP_DECL_CONSPRESOL().
|
static |
helper function for presolveDisaggregate
scip | SCIP data structure |
consdata | constraint data |
quadvaridx | index of quadratic variable to mark |
var2component | variables to components mapping |
componentnr | the component number to mark to |
componentsize | buffer to store size of component (incremented by 1) |
Definition at line 4292 of file cons_quadratic.c.
References SCIP_QuadVarTerm::adjbilin, consdataFindQuadVarTerm(), SCIP_QuadVarTerm::nadjbilin, presolveDisaggregateMergeComponents(), SCIP_CALL, SCIP_OKAY, SCIPhashmapExists(), SCIPhashmapGetImage(), SCIPhashmapInsert(), and SCIP_QuadVarTerm::var.
Referenced by presolveDisaggregate(), and presolveUpgrade().
|
static |
merges components in variables connectivity graph
scip | SCIP data structure |
conshdlr | constraint handler data structure |
var2component | variables to component mapping |
nvars | number of variables |
ncomponents | number of components |
componentssize | size of components |
Definition at line 4340 of file cons_quadratic.c.
References nextPowerOf2(), SCIP_CALL, SCIP_OKAY, SCIP_PARAMETERWRONGVAL, SCIP_Real, SCIPallocBufferArray, SCIPconshdlrGetData(), SCIPdebugMsg, SCIPerrorMessage, SCIPfreeBufferArray, SCIPgetProbName(), SCIPhashmapEntryGetImage(), SCIPhashmapEntrySetImage(), SCIPhashmapGetEntry(), SCIPhashmapGetNEntries(), SCIPsortDownIntInt(), and SCIPsortIntInt().
Referenced by presolveDisaggregate(), and presolveDisaggregateMarkComponent().
|
static |
compute the next highest power of 2 for a 32-bit argument
Source: https://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
v | input |
Definition at line 4488 of file cons_quadratic.c.
References presolveDisaggregate().
Referenced by presolveDisaggregate(), and presolveDisaggregateMergeComponents().
|
static |
for quadratic constraints that consists of a sum of quadratic terms, disaggregates the sum into a set of constraints by introducing auxiliary variables
Assume the quadratic constraint can be written in the form lhs <= b'x + sum_{k=1..p} q_k(x_k) <= rhs where x_k denotes a subset of the variables in x and these subsets are pairwise disjunct and q_k(.) is a quadratic form. p is selected as large as possible, but to be <= conshdlrdata->maxdisaggrsize.
Without additional scaling, the constraint is disaggregated into lhs <= b'x + sum_k c_k z_k <= rhs c_k z_k ~ q_k(x) where "~" is either "<=", "==", or ">=", depending on whether lhs or rhs are infinite. Further, c_k is chosen to be the maximal absolute value of the coefficients of the quadratic terms in q_k(x). This is done to ensure that z_k takes values with a similar magnitute as the variables in x_k (better for separation).
However, a solution of this disaggregated system can violate the original constraint by (p+1)*epsilon (assuming unscaled violations are used, which is the default). Therefore, all constraints are scaled by p+1: (p+1)*lhs <= (p+1)*b'x + (p+1) * sum_k c_k z_k <= (p+1) * rhs (p+1)*c_k z_k ~ (p+1)*q_k(x)
scip | SCIP data structure |
conshdlr | constraint handler data structure |
cons | source constraint to try to convert |
naddconss | pointer to counter of added constraints |
Definition at line 4526 of file cons_quadratic.c.
References addLinearCoef(), checkCurvatureEasy(), chgLinearCoefPos(), consdataEnsureLinearVarsSize(), consdataSortQuadVarTerms(), delQuadVarTermPos(), FALSE, getImpliedBounds(), SCIP_Interval::inf, mergeAndCleanBilinearTerms(), mergeAndCleanQuadVarTerms(), nextPowerOf2(), presolveDisaggregateMarkComponent(), presolveDisaggregateMergeComponents(), REALABS, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_CONTINUOUS, SCIPaddBilinTermQuadratic(), SCIPaddCons(), SCIPaddLinearVarQuadratic(), SCIPaddQuadVarLinearCoefQuadratic(), SCIPaddQuadVarQuadratic(), SCIPaddVar(), SCIPallocBufferArray, SCIPallocClearBufferArray, SCIPblkmem(), SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsDynamic(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPcreateConsQuadratic2(), SCIPcreateVar(), SCIPdebugAddSolVal, SCIPdebugGetSolVal, SCIPdebugMsg, SCIPdebugPrintCons, SCIPfreeBlockMemoryArray, SCIPfreeBufferArray, SCIPhashmapCreate(), SCIPhashmapExists(), SCIPhashmapFree(), SCIPhashmapGetImage(), SCIPinfinity(), SCIPisInfinity(), SCIPisZero(), SCIPreleaseCons(), SCIPreleaseNlRow(), SCIPreleaseVar(), SCIPsnprintf(), SCIPvarGetName(), SCIPvarGetNImpls(), SCIPvarIsActive(), SCIPvarIsBinary(), SCIP_Interval::sup, and TRUE.
Referenced by nextPowerOf2(), and SCIP_DECL_CONSPRESOL().
|
static |
checks a quadratic constraint for convexity and/or concavity without checking multivariate functions
scip | SCIP data structure |
cons | quadratic constraint |
determined | pointer to store whether the curvature could be determined |
checkmultivariate | whether curvature will be checked later on for multivariate functions |
Definition at line 4890 of file cons_quadratic.c.
References checkCurvature(), FALSE, SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, SCIPinfinity(), SCIPisInfinity(), SCIPisNegative(), SCIPisPositive(), and TRUE.
Referenced by checkCurvature(), presolveDisaggregate(), SCIPisConcaveQuadratic(), and SCIPisConvexQuadratic().
|
static |
checks a quadratic constraint for convexity and/or concavity
scip | SCIP data structure |
cons | quadratic constraint |
checkmultivariate | whether curvature should also be checked for multivariate functions |
Definition at line 4967 of file cons_quadratic.c.
References BMSclearMemoryArray, checkCurvatureEasy(), checkFactorable(), FALSE, LapackDsyev(), MAX, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_VERBLEVEL_FULL, SCIPallocBufferArray, SCIPblkmem(), SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, SCIPfreeBufferArray, SCIPhashmapCreate(), SCIPhashmapExists(), SCIPhashmapFree(), SCIPhashmapGetImage(), SCIPhashmapInsert(), SCIPinfinity(), SCIPisInfinity(), SCIPisIpoptAvailableIpopt(), SCIPisNegative(), SCIPisPositive(), SCIPvarIsBinary(), SCIPverbMessage(), SCIPwarningMessage(), and TRUE.
Referenced by addLinearizationCuts(), checkCurvatureEasy(), generateCut(), generateCutUnboundedLP(), SCIP_DECL_CONSINITLP(), SCIP_DECL_CONSINITSOL(), SCIP_DECL_CONSSEPALP(), and SCIPcheckCurvatureQuadratic().
|
static |
check whether indefinite constraint function is factorable and store corresponding coefficients
scip | SCIP data structure |
cons | constraint |
Definition at line 5187 of file cons_quadratic.c.
References BMSclearMemoryArray, SCIP_BilinTerm::coef, computeViolation(), consdataFindQuadVarTerm(), consdataSortQuadVarTerms(), FALSE, LapackDsyev(), MAX, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBlockMemoryArray, SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, SCIPdebugMsgPrint, SCIPfreeBlockMemoryArray, SCIPfreeBufferArray, SCIPisIpoptAvailableIpopt(), SCIPisNegative(), SCIPisPositive(), SCIPisRelEQ(), SCIPisZero(), SCIPvarGetName(), sqrt(), TRUE, SCIP_BilinTerm::var1, and SCIP_BilinTerm::var2.
Referenced by checkCurvature(), and SCIP_DECL_CONSINITSOL().
|
static |
computes activity and violation of a constraint
If solution violates bounds by more than feastol, the violation is still computed, but *solviolbounds is set to TRUE
scip | SCIP data structure |
cons | constraint |
sol | solution or NULL if LP solution should be used |
solviolbounds | buffer to store whether quadratic variables in solution are outside their bounds by more than feastol |
Definition at line 5396 of file cons_quadratic.c.
References computeViolations(), FALSE, MAX, REALABS, SCIP_OKAY, SCIP_Real, SCIPconsGetData(), SCIPgetSolVal(), SCIPinfinity(), SCIPisFeasGE(), SCIPisFeasLE(), SCIPisInfinity(), SCIPrelDiff(), SCIPupdateSolConsViolation(), SCIPvarGetLbLocal(), SCIPvarGetUbLocal(), and TRUE.
Referenced by checkFactorable(), computeViolations(), proposeFeasibleSolution(), SCIP_DECL_CONSCHECK(), SCIPgetActivityQuadratic(), SCIPgetFeasibilityQuadratic(), and SCIPgetViolationQuadratic().
|
static |
computes violation of a set of constraints
scip | SCIP data structure |
conss | constraints |
nconss | number of constraints |
sol | solution or NULL if LP solution should be used |
solviolbounds | buffer to store whether quadratic variables in solution are outside their bounds by more than feastol in some constraint |
maxviolcon | buffer to store constraint with largest violation, or NULL if solution is feasible |
Definition at line 5582 of file cons_quadratic.c.
References computeViolation(), FALSE, MAX, SCIP_Bool, SCIP_CALL, SCIP_DECL_SORTINDCOMP(), SCIP_OKAY, SCIP_Real, SCIPconsGetData(), SCIPfeastol(), and SCIPisGT().
Referenced by computeViolation(), enforceConstraint(), SCIP_DECL_CONSENFOPS(), SCIP_DECL_CONSSEPALP(), and SCIP_DECL_CONSSEPASOL().
|
static |
index comparison method for bilinear terms
Definition at line 5632 of file cons_quadratic.c.
References SCIP_DECL_SORTINDCOMP(), and SCIPvarCompare().
|
static |
volume comparison method for bilinear terms; prioritizes bilinear products with a larger volume
Definition at line 5648 of file cons_quadratic.c.
References SCIP_Real, SCIPvarGetLbLocal(), SCIPvarGetUbLocal(), and sortAllBilinTerms().
|
static |
helper function to sort all bilinear terms in the constraint handler data
scip | SCIP data structure |
bilinterms | array containing all bilinear terms |
nbilinterms | total number of bilinear terms |
bilinconss | array for mapping each term to its constraint |
bilinposs | array for mapping each term to its position in the corresponding bilinconss constraint |
Definition at line 5670 of file cons_quadratic.c.
References SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPsort(), and storeAllBilinearTerms().
Referenced by SCIP_DECL_SORTINDCOMP(), and storeAllBilinearTerms().
|
static |
stores all bilinear terms in the quadratic constraint handler data; in addition, for each bilinear term we store the number of nonconvex constraints that require to over- or underestimate this term, which only depends on the lhs, rhs, and the bilinear coefficient
scip | SCIP data structure |
conshdlrdata | constraint handler data |
conss | constraints to process |
nconss | number of constraints |
Definition at line 5741 of file cons_quadratic.c.
References freeAllBilinearTerms(), MAX, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemoryArray, SCIPallocBufferArray, SCIPallocClearBlockMemoryArray, SCIPconsGetData(), SCIPfreeBufferArray, SCIPgetDepth(), SCIPgetSubscipDepth(), SCIPinDive(), SCIPinProbing(), SCIPisInfinity(), SCIPisNegative(), SCIPisPositive(), sortAllBilinTerms(), and TRUE.
Referenced by SCIP_DECL_CONSINITLP(), and sortAllBilinTerms().
|
static |
frees memory allocated in storeAllBilinearTerms()
scip | SCIP data structure |
conshdlrdata | constraint handler data |
conss | constraints to process |
nconss | number of constraints |
Definition at line 5928 of file cons_quadratic.c.
References FALSE, generateCutFactorableDo(), SCIP_OKAY, SCIPconsGetData(), and SCIPfreeBlockMemoryArrayNull.
Referenced by SCIP_DECL_CONSEXITSOL(), and storeAllBilinearTerms().
|
static |
tries to compute cut for multleft * <coefleft, x'> * multright <= rhs / (multright * <coefright, x'>) where x'=(x,1)
scip | SCIP data structure |
cons | constraint |
ref | reference solution where to generate the cut |
multleft | multiplicator on lhs |
coefleft | coefficient for factor on lhs |
multright | multiplicator on both sides |
coefright | coefficient for factor that goes to rhs |
rightminactivity | minimal activity of <coefright, x> |
rightmaxactivity | maximal activity of <coefright, x> |
rhs | denominator on rhs |
rowprep | rowprep to store cut coefs and constant |
success | buffer to indicate whether a cut was successfully computed |
Definition at line 5958 of file cons_quadratic.c.
References FALSE, generateCutFactorable(), SCIP_RowPrep::local, SCIP_RowPrep::name, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_SIDETYPE_RIGHT, SCIPaddRowprepConstant(), SCIPaddRowprepTerm(), SCIPconsGetData(), SCIPconsGetName(), SCIPgetNLPs(), SCIPisFeasLE(), SCIPisInfinity(), SCIPisZero(), SCIPsnprintf(), SCIP_RowPrep::sidetype, and TRUE.
Referenced by freeAllBilinearTerms(), and generateCutFactorable().
|
static |
tries to generate a cut if constraint quadratic function is factorable and there are no linear variables (ax+b)(cx+d) <= rhs and cx+d >= 0 -> (ax+b) <= rhs / (cx+d), where the right hand side is concave and can be linearized
scip | SCIP data structure |
cons | constraint |
violside | for which side a cut should be generated |
ref | reference solution where to generate the cut |
rowprep | data structure to store cut coefficients |
success | buffer to indicate whether a cut was successfully computed |
Definition at line 6072 of file cons_quadratic.c.
References FALSE, generateCutFactorableDo(), generateCutLTIfindIntersection(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_SIDETYPE_RIGHT, SCIPconsGetData(), SCIPinfinity(), SCIPisFeasNegative(), SCIPisFeasPositive(), SCIPisInfinity(), SCIPisZero(), SCIPvarGetLbLocal(), and SCIPvarGetUbLocal().
Referenced by generateCut(), and generateCutFactorableDo().
|
static |
Definition at line 6279 of file cons_quadratic.c.
References FALSE, generateCutLTIgenMulCoeff(), SCIP_Bool, SCIP_INVALID, SCIP_Real, SCIPdebugMsg, SCIPisInfinity(), SCIPisRelEQ(), SCIPisZero(), sqrt(), and TRUE.
Referenced by generateCutFactorable(), and generateCutLTIcomputeCoefs().
|
static |
generate coefficients for a plane through points (x1, y1_, x1*y1) and (x2, y2, x2*y2) such that intersecting it with one of them (the first if whichuse is FALSE, the second otherwise) gives a tangent to the curve x*y = k
Returns TRUE on error and FALSE on success.
Definition at line 6427 of file cons_quadratic.c.
References FALSE, generateCutLTIcomputeCoefs(), SCIP_Real, SCIPisZero(), and TRUE.
Referenced by generateCutLTIcomputeCoefs(), and generateCutLTIfindIntersection().
|
static |
computes coefficients of a lifted-tangent inequality for x*y = w
The code is an adaptation of the methods in exprMul-upperHull.cpp in Couenne/stable/0.4 rev773, written by P. Belotti and licensed under Eclipse Public License.
scip | SCIP data structure |
xl | lower bound on x |
xu | upper bound on x |
x0 | reference point for x |
yl | lower bound on y |
yu | upper bound on y |
y0_ | reference point for y |
wl | lower bound on w |
wu | upper bound on w |
w0 | reference point for w |
cx | buffer where to store cut coefficient for x |
cy | buffer where to store cut coefficient for y |
cw | buffer where to store cut coefficient for w |
c0 | buffer where to store cut left-hand-side |
success | buffer where to indicate whether cut coefficients were computed |
Definition at line 6485 of file cons_quadratic.c.
References FALSE, generateCutLTI(), generateCutLTIfindIntersection(), generateCutLTIgenMulCoeff(), MAX, SCIP_Bool, SCIP_INVALID, SCIP_Real, SCIPdebugMsg, SCIPisFeasGE(), SCIPisFeasLE(), SCIPisGE(), SCIPisGT(), SCIPisInfinity(), SCIPisLE(), SCIPisLT(), SCIPisZero(), and TRUE.
Referenced by generateCutLTI(), and generateCutLTIgenMulCoeff().
|
static |
tries to generate a cut if constraint quadratic function is factorable and there are linear variables
Computes what is called a lifted tangent inequality described in
Belotti, Miller, Namazifar, Lifted inequalities for bounded products of variables, SIAG/OPT Views-and-News 22:1, 2011
scip | SCIP data structure |
cons | constraint |
violside | for which side a cut should be generated |
ref | reference solution where to generate the cut |
sol | solution that shall be cutoff, NULL for LP solution |
rowprep | rowprep to store cut data |
success | buffer to indicate whether a cut was successfully computed |
Definition at line 6844 of file cons_quadratic.c.
References FALSE, generateCutConvex(), generateCutLTIcomputeCoefs(), SCIP_RowPrep::local, SCIP_RowPrep::name, SCIP_CALL, SCIP_LPSOLSTAT_OPTIMAL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_SIDETYPE_LEFT, SCIPaddRowprepConstant(), SCIPaddRowprepSide(), SCIPaddRowprepTerm(), SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, SCIPgetLPSolstat(), SCIPgetNLPs(), SCIPgetSolVal(), SCIPinfinity(), SCIPisFeasNegative(), SCIPisFeasPositive(), SCIPisInfinity(), SCIPisRelEQ(), SCIPsnprintf(), SCIPvarGetLbLocal(), SCIPvarGetUbLocal(), SCIP_RowPrep::sidetype, and TRUE.
Referenced by generateCut(), and generateCutLTIcomputeCoefs().
|
static |
computes cut coefficients by linearizing a quadratic function
scip | SCIP data structure |
cons | constraint |
violside | side for which to generate cut |
ref | reference solution where to generate the cut |
rowprep | rowprep to store cut data |
success | buffer to indicate whether a cut was successfully computed |
Definition at line 7104 of file cons_quadratic.c.
References SCIP_BilinTerm::coef, SCIP_RowPrep::name, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_SIDETYPE_LEFT, SCIP_VARTYPE_CONTINUOUS, SCIPaddBilinLinearization(), SCIPaddRowprepConstant(), SCIPaddRowprepSide(), SCIPaddRowprepTerm(), SCIPaddSquareLinearization(), SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, SCIPgetNLPs(), SCIPsnprintf(), SCIPvarGetType(), SCIP_RowPrep::sidetype, TRUE, updateBilinearRelaxation(), SCIP_BilinTerm::var1, and SCIP_BilinTerm::var2.
Referenced by generateCut(), and generateCutLTI().
|
static |
helper function to update the best relaxation for a bilinear term when using valid linear inequalities
scip | SCIP data structure |
x | first variable |
y | second variable |
bilincoef | coefficient of the bilinear term |
violside | side of quadratic constraint that is violated |
refx | reference point for the x variable |
refy | reference point for the y variable |
ineqs | coefficients of each linear inequality; stored as triple (xcoef,ycoef,constant) |
nineqs | total number of inequalities |
mccormickval | value of the McCormick relaxation at the reference point |
bestcoefx | pointer to update the x coefficient |
bestcoefy | pointer to update the y coefficient |
bestconst | pointer to update the constant |
bestval | value of the best relaxation that have been found so far |
success | buffer to store whether we found a better relaxation |
Definition at line 7189 of file cons_quadratic.c.
References getInteriority(), MAX, REALABS, SCIP_Bool, SCIP_Real, SCIP_SIDETYPE_LEFT, SCIPcomputeBilinEnvelope1(), SCIPcomputeBilinEnvelope2(), SCIPdebugMsg, SCIPisFeasGE(), SCIPisFeasLE(), SCIPisRelGT(), SCIPisRelLT(), SCIPisZero(), SCIPvarGetLbLocal(), SCIPvarGetUbLocal(), and TRUE.
Referenced by generateCutConvex(), and generateCutNonConvex().
|
static |
scip | SCIP data structure |
lbx | lower bound of the first variable |
ubx | upper bound of the first variable |
refx | reference point of the first variable |
lby | lower bound of the second variable |
uby | upper bound of the second variable |
refy | reference point of the second variable |
Definition at line 7304 of file cons_quadratic.c.
References generateCutNonConvex(), MAX, SCIP_Real, and SCIPepsilon().
Referenced by generateCutNonConvex(), and updateBilinearRelaxation().
|
static |
computes cut coefficients for a nonconvex quadratic function
scip | SCIP data structure |
conshdlrdata | constraint handler data |
cons | constraint |
violside | side for which to generate cut |
ref | reference solution where to generate the cut |
rowprep | rowprep to store cut data |
success | buffer to indicate whether a cut was successfully computed |
Definition at line 7325 of file cons_quadratic.c.
References SCIP_BilinTerm::coef, FALSE, generateCut(), getInteriority(), BilinearEstimator::ineqoverest, BilinearEstimator::inequnderest, BilinearEstimator::lastimprfac, SCIP_RowPrep::local, SCIP_RowPrep::name, BilinearEstimator::nineqoverest, BilinearEstimator::ninequnderest, REALABS, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIP_VARTYPE_CONTINUOUS, SCIPaddBilinMcCormick(), SCIPaddRowprepConstant(), SCIPaddRowprepSide(), SCIPaddRowprepTerm(), SCIPaddSquareLinearization(), SCIPaddSquareSecant(), SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, SCIPgetDepth(), SCIPgetNLPs(), SCIPgetNSepaRounds(), SCIPisEQ(), SCIPisGE(), SCIPisRelGE(), SCIPisRelLE(), SCIPsnprintf(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetType(), SCIPvarGetUbLocal(), SCIP_RowPrep::sidetype, TRUE, updateBilinearRelaxation(), SCIP_BilinTerm::var1, SCIP_BilinTerm::var2, BilinearEstimator::x, and BilinearEstimator::y.
Referenced by generateCut(), and getInteriority().
|
static |
generates a cut based on linearization (if convex) or McCormick (if nonconvex) in a given reference point
scip | SCIP data structure |
conshdlr | constraint handler |
cons | constraint |
ref | reference solution where to generate the cut |
sol | point that we aim to separate, or NULL for LP solution |
violside | for which side a cut should be generated |
row | storage for cut |
efficacy | buffer to store efficacy of row in reference solution, or NULL if not of interest |
checkcurvmultivar | are we allowed to check the curvature of a multivariate quadratic function, if not done yet |
minefficacy | minimal required efficacy |
Definition at line 7521 of file cons_quadratic.c.
References checkCurvature(), SCIP_RowPrep::coefs, computeED(), FALSE, generateCutConvex(), generateCutFactorable(), generateCutLTI(), generateCutNonConvex(), SCIP_RowPrep::nvars, REALABS, SCIP_Bool, SCIP_CALL, SCIP_LPSOLSTAT_OPTIMAL, SCIP_OKAY, SCIP_Real, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIPaddRowprepTerms(), SCIPcleanupRowprep(), SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsLocal(), SCIPcreateRowprep(), SCIPdebugMsg, SCIPfreeRowprep(), SCIPgetLPSolstat(), SCIPgetRowprepRowCons(), SCIPgetRowprepViolation(), SCIPisInfinity(), SCIPmergeRowprepTerms(), SCIProwGetLhs(), SCIProwGetName(), SCIProwGetNNonz(), SCIProwGetRhs(), and SCIP_RowPrep::side.
Referenced by generateCutNonConvex(), generateCutSol(), generateCutUnboundedLP(), and SCIP_DECL_CONSINITLP().
|
static |
computes eigen decomposition of A, where \( f(x) = x^T A x + b^T x \).
The eigen decomposition is given by A = P D P^T, where D is diagonal formed by the eigenvalues and P is orthonormal whose columns are the eigenvectors; we also compute b^T * P, in case one needs the change of variables P^T x = y <=> x = P y We store P^T in an array, specifically, in consdata->eigenvectors we store P^T row-wise, i.e., the first row of P^T is stored in eigenvector[0..n-1], the second row is stored in eigenvectors[n..2n-1], etc; equivalently, the first eigenvector is eigenvector[0..n-1], the second one is eigenvectors[n..2n-1], etc.
scip | SCIP data structure |
conshdlr | constraint handler |
cons | constraint |
Definition at line 7664 of file cons_quadratic.c.
References BMSclearMemoryArray, computeInteriorPoint(), FALSE, LapackDsyev(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBlockMemoryArray, SCIPallocClearBlockMemoryArray, SCIPblkmem(), SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, SCIPhashmapCreate(), SCIPhashmapExists(), SCIPhashmapFree(), SCIPhashmapGetImage(), SCIPhashmapInsert(), SCIPisInfinity(), SCIPisIpoptAvailableIpopt(), and TRUE.
Referenced by generateCut(), and SCIP_DECL_CONSINITSOL().
|
static |
computes an interior point for the quadratic part of the convex constraint
There are different methods for computing the interior point
scip | SCIP data structure |
cons | constraint |
method | method for computing interior point ('a' any point, 'm'ost interior) |
success | buffer to store if an interior point was found |
Definition at line 7816 of file cons_quadratic.c.
References SCIP_QuadElement::coef, computeGauge(), createNlRow(), FALSE, SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, INTERIOR_EPS, MAX, SCIP_CALL, SCIP_INVALIDDATA, SCIP_MAXSTRLEN, SCIP_NLPPAR_FEASTOL, SCIP_NLPPAR_RELOBJTOL, SCIP_NLPPAR_VERBLEVEL, SCIP_NLPSOLSTAT_FEASIBLE, SCIP_NLPSOLSTAT_GLOBINFEASIBLE, SCIP_NLPSOLSTAT_GLOBOPT, SCIP_NLPSOLSTAT_LOCINFEASIBLE, SCIP_NLPSOLSTAT_LOCOPT, SCIP_NLPSOLSTAT_UNBOUNDED, SCIP_NLPSOLSTAT_UNKNOWN, SCIP_NLPTERMSTAT_OKAY, SCIP_OKAY, SCIP_Real, SCIPABORT, SCIPallocBlockMemoryArray, SCIPallocBufferArray, SCIPallocClearBlockMemoryArray, SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, SCIPdualfeastol(), SCIPerrorMessage, SCIPfeastol(), SCIPfreeBufferArrayNull, SCIPgetNlpis(), SCIPgetNNlpis(), SCIPgetProbName(), SCIPinfinity(), SCIPinfoMessage(), SCIPisFeasZero(), SCIPisGE(), SCIPisInfinity(), SCIPisLE(), SCIPnlpiAddConstraints(), SCIPnlpiAddVars(), SCIPnlpiCreateProblem(), SCIPnlpiFreeProblem(), SCIPnlpiGetSolstat(), SCIPnlpiGetSolution(), SCIPnlpiGetTermstat(), SCIPnlpiSetIntPar(), SCIPnlpiSetObjective(), SCIPnlpiSetRealPar(), SCIPnlpiSolve(), SCIPnlrowGetNQuadElems(), SCIPnlrowGetQuadElems(), SCIPnlrowGetQuadVars(), SCIPprintCons(), SCIPsnprintf(), SCIPvarGetLbGlobal(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), SCIPvarGetUbLocal(), and TRUE.
Referenced by computeED(), and computeGauge().
|
static |
compute gauge function of the set \(S - s_0\) where \( S = \{ x : f(x) \le c \}\) and \( s_0 \in \mathring S\).
Here, \( f(x) \) is a purely quadratic (i.e, all \(x\) variables appear in a bilinear or quadratic term). Explicitly, \( f(x) = \pm x^T A x \pm b^T x \) depending whether \(A\) is positive semidefinite (+) or negative semidefinite (-). The constant \(c\) is rhs - maximum activity of the purely linear part of the constraint if \(A \succeq 0\) and minimum activity - lhs if \(A \preceq 0\). This is computed only at INITSOL.
The method does:
scip | SCIP data structure |
conshdlr | constraint handler |
cons | constraint |
Definition at line 8195 of file cons_quadratic.c.
References SCIP_QuadVarTerm::adjbilin, SCIP_BilinTerm::coef, computeInteriorPoint(), evaluateGauge(), FALSE, SCIP_QuadVarTerm::lincoef, SCIP_QuadVarTerm::nadjbilin, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocClearBlockMemoryArray, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPdebugMsg, SCIPisInfinity(), SCIPvarGetName(), SCIP_QuadVarTerm::sqrcoef, TRUE, SCIP_QuadVarTerm::var, SCIP_BilinTerm::var1, and SCIP_BilinTerm::var2.
Referenced by computeInteriorPoint(), and SCIP_DECL_CONSINITSOL().
|
static |
evaluates gauge function of the set \(S - s_0\) where \( S = \{ x : f(x) \le c \}\) and \( s_0 \in \mathring S\).
\( S = \{ x : f(x) \le c \}\) at \(sol - s_0\); see computeGauge() for more details
scip | SCIP data structure |
conshdlr | constraint handler |
cons | constraint |
refsol | reference point where to generate cut, or NULL if sol should be used |
gaugeval | buffer to store the value of the gauge function |
success | buffer to store if evaluation was successful |
Definition at line 8332 of file cons_quadratic.c.
References computeReferencePointProjection(), FALSE, SCIP_Bool, SCIP_OKAY, SCIP_Real, SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, SCIPgetSolVal(), SCIPisGE(), SCIPisInfinity(), SCIPisLE(), SCIPisNegative(), SCIPisPositive(), SCIPisZero(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), sqrt(), and TRUE.
Referenced by computeGauge(), and computeReferencePointGauge().
|
static |
compute projection of refsol onto feasible region of cons; stores the projection in ref
This method solves
\[ \min \{ ||x - \bar x||^2 : x^T A x + 2 b^T x \le c \} \]
where \( \bar x \) is refsol. Note that \( \bar x \) is not feasible, so the optimal solution actually satisfies
\[ \min \{ ||x - \bar x||^2 : x^T A x + 2 b^T x = c \} \]
Using the eigendecomposition \( A = P D P^T \), the change of variables \( y = P^T x \) and the optimality conditions, this reduces to finding \( \rho \) such that
\[ y(\rho) = (I + \rho D)^{-1} (\bar y - \rho \bar b) \]
makes the constraint active. In the previous formula, \( \bar y = P^T \bar x\) and \( \bar b = P^T b \). If \( D \neq 0 \), the function
\[ \varphi(\rho) := y(\rho)^T D y(\rho) + 2 \bar b^T y(\rho) - c \]
is strictly convex. So this method actually computes the unique 0 of this function using Newton's method.
scip | SCIP data structure |
conshdlr | constraint handler |
cons | constraint |
refsol | the given point to project, or NULL if LP solution should be used |
ref | array to store reference point |
Definition at line 8524 of file cons_quadratic.c.
References computeReferencePointGauge(), MAX, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPallocClearBufferArray, SCIPconsGetData(), SCIPdebugMessage, SCIPfreeBufferArray, SCIPgetSolVal(), SCIPisInfinity(), SCIPvarGetLbLocal(), SCIPvarGetName(), and SCIPvarGetUbLocal().
Referenced by evaluateGauge(), and generateCutSol().
|
static |
compute reference point suggested by gauge function
scip | SCIP data structure |
conshdlr | constraint handler |
cons | constraint |
refsol | reference point where to compute gauge, or NULL if LP solution should be used |
ref | array to store reference point |
success | buffer to store whether we succeeded computing reference point |
Definition at line 8716 of file cons_quadratic.c.
References evaluateGauge(), FALSE, GAUGESCALE, generateCutSol(), MAX, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, SCIPgetSolVal(), SCIPisFeasLE(), SCIPisInfinity(), SCIPvarGetLbLocal(), SCIPvarGetName(), and SCIPvarGetUbLocal().
Referenced by computeReferencePointProjection(), and generateCutSol().
|
static |
generates a cut based on linearization (if convex) or McCormick (if nonconvex) in a solution
scip | SCIP data structure |
conshdlr | constraint handler |
cons | constraint |
sol | solution where to generate cut, or NULL if LP solution should be used |
refsol | reference point where to generate cut, or NULL if sol should be used |
violside | for which side a cut should be generated |
row | storage for cut |
efficacy | buffer to store efficacy of row in reference solution, or NULL if not of interest |
checkcurvmultivar | are we allowed to check the curvature of a multivariate quadratic function, if not done yet |
minefficacy | minimal required efficacy |
mode | mode of execution 'g'auge, 'p'rojection, 'l'inearization gradient, 'd'efault |
Definition at line 8822 of file cons_quadratic.c.
References computeReferencePointGauge(), computeReferencePointProjection(), FALSE, generateCut(), generateCutUnboundedLP(), MAX, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIPallocBufferArray, SCIPconsGetData(), SCIPconshdlrGetData(), SCIPdebugMessage, SCIPdebugMsg, SCIPfreeBufferArray, SCIPgetSolVal(), SCIPisCutApplicable(), SCIPisGT(), SCIPisInfinity(), SCIPvarGetLbLocal(), SCIPvarGetUbLocal(), and TRUE.
Referenced by addLinearizationCuts(), computeReferencePointGauge(), generateCutUnboundedLP(), and separatePoint().
|
static |
tries to find a cut that intersects with an unbounded ray of the LP
For convex functions, we do this by linearizing in the feasible solution of the LPI. For nonconvex functions, we just call generateCutSol with the unbounded solution as reference point.
scip | SCIP data structure |
conshdlr | constraint handler |
cons | constraint |
violside | for which side a cut should be generated |
row | storage for cut |
rowrayprod | buffer to store product of ray with row coefficients, or NULL if not of interest |
checkcurvmultivar | are we allowed to check the curvature of a multivariate quadratic function, if not done yet |
Definition at line 8963 of file cons_quadratic.c.
References checkCurvature(), SCIP_BilinTerm::coef, FALSE, generateCut(), generateCutSol(), processCut(), REALABS, SCIP_CALL, SCIP_LPSOLSTAT_UNBOUNDEDRAY, SCIP_OKAY, SCIP_Real, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIPallocBufferArray, SCIPcolGetVar(), SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, SCIPfreeBufferArray, SCIPgetLPSolstat(), SCIPgetPrimalRayVal(), SCIPhasPrimalRay(), SCIPinfinity(), SCIPisNegative(), SCIPisPositive(), SCIPisZero(), SCIProwGetCols(), SCIProwGetNNonz(), SCIProwGetVals(), SCIP_BilinTerm::var1, and SCIP_BilinTerm::var2.
Referenced by generateCutSol(), and separatePoint().
|
static |
processes a cut for constraint cons, i.e., checks numerics and possibly adds cut to sepastore
scip | SCIP data structure |
row | cut to process |
conshdlr | quadratic constraints handler |
cons | constraint |
efficacy | efficacy of row in reference solution |
minefficacy | minimal efficacy |
inenforcement | whether we are in constraint enforcement |
bestefficacy | buffer to store best efficacy of a cut that was added to the LP, if found; or NULL if not of interest |
result | result of separation |
Definition at line 9107 of file cons_quadratic.c.
References FALSE, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_OKAY, SCIP_SEPARATED, SCIPaddRow(), SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPdebugMessage, SCIPisCutApplicable(), SCIPisGT(), SCIPmarkRowNotRemovableLocal(), SCIPreleaseRow(), SCIPresetConsAge(), and separatePoint().
Referenced by generateCutUnboundedLP(), and separatePoint().
|
static |
tries to separate solution or LP solution by a linear cut
assumes that constraint violations have been computed
scip | SCIP data structure |
conshdlr | quadratic constraints handler |
conss | constraints |
nconss | number of constraints |
nusefulconss | number of constraints that seem to be useful |
sol | solution to separate, or NULL if LP solution should be used |
minefficacy | minimal efficacy of a cut if it should be added to the LP |
inenforcement | whether we are in constraint enforcement |
result | result of separation |
bestefficacy | buffer to store best efficacy of a cut that was added to the LP, if found; or NULL if not of interest |
Definition at line 9173 of file cons_quadratic.c.
References addLinearizationCuts(), generateCutSol(), generateCutUnboundedLP(), processCut(), SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_FEASIBLE, SCIP_LPSOLSTAT_UNBOUNDEDRAY, SCIP_OKAY, SCIP_Real, SCIP_SEPARATED, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIPconsGetData(), SCIPconshdlrGetData(), SCIPfeastol(), SCIPgetLPSolstat(), SCIPisGT(), SCIPisInfinity(), SCIPisNegative(), SCIPisPositive(), SCIProwGetLhs(), and SCIProwGetRhs().
Referenced by enforceConstraint(), processCut(), SCIP_DECL_CONSSEPALP(), and SCIP_DECL_CONSSEPASOL().
|
static |
adds linearizations cuts for convex constraints w.r.t. a given reference point to cutpool and sepastore
scip | SCIP data structure |
conshdlr | quadratic constraints handler |
conss | constraints |
nconss | number of constraints |
ref | reference point where to linearize, or NULL for LP solution |
separatedlpsol | buffer to store whether a cut that separates the current LP solution was found and added to LP, or NULL if adding to cutpool only |
minefficacy | minimal efficacy of a cut when checking for separation of LP solution |
Definition at line 9278 of file cons_quadratic.c.
References checkCurvature(), FALSE, generateCutSol(), SCIP_Bool, SCIP_CALL, SCIP_DECL_EVENTEXEC(), SCIP_OKAY, SCIP_Real, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIPaddPoolCut(), SCIPaddRow(), SCIPconsGetData(), SCIPconshdlrGetData(), SCIPconsIsEnabled(), SCIPconsIsLocal(), SCIPdebugMsg, SCIPgetRowLPFeasibility(), SCIPinfinity(), SCIPisInfinity(), SCIPreleaseRow(), SCIProwGetName(), SCIProwIsLocal(), and TRUE.
Referenced by SCIP_DECL_CONSSEPALP(), SCIP_DECL_EVENTEXEC(), and separatePoint().
|
static |
processes the event that a new primal solution has been found
Definition at line 9367 of file cons_quadratic.c.
References addLinearizationCuts(), registerBranchingCandidatesGap(), SCIP_CALL, SCIP_EVENTTYPE_FORMAT, SCIP_EVENTTYPE_SOLFOUND, SCIP_OKAY, SCIPconshdlrGetConss(), SCIPconshdlrGetData(), SCIPconshdlrGetNConss(), SCIPdebugMsg, SCIPeventGetSol(), SCIPeventGetType(), SCIPheurGetName(), and SCIPsolGetHeur().
|
static |
registers branching candidates according to convexification gap rule
That is, computes for every nonconvex term the gap between the terms value in the LP solution and the value of the underestimator as it would be (and maybe has been) constructed by the separation routines of this constraint handler. Then it registers all variables occurring in each term with the computed gap. If variables appear in more than one term, they are registered several times.
scip | SCIP data structure |
conshdlr | constraint handler |
conss | constraints to check |
nconss | number of constraints to check |
sol | solution to enforce (NULL for the LP solution) |
nnotify | counter for number of notifications performed |
Definition at line 9419 of file cons_quadratic.c.
References BilinearEstimator::lastimprfac, MAX, REALABS, registerBranchingCandidatesViolation(), SCIP_Bool, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPaddExternBranchCand(), SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPdebugMsg, SCIPfeastol(), SCIPgetSolVal(), SCIPinfinity(), SCIPisFeasNegative(), SCIPisGE(), SCIPisGT(), SCIPisInfinity(), SCIPisLE(), SCIPisLT(), SCIPisNegative(), SCIPisRelEQ(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), SCIPvarIsBinary(), SCIPvarIsIntegral(), sqrt(), BilinearEstimator::x, and BilinearEstimator::y.
Referenced by registerBranchingCandidates(), and SCIP_DECL_EVENTEXEC().
|
static |
registers branching candidates according to constraint violation rule
That is, registers all variables appearing in nonconvex terms^1 with a score that is the violation of the constraint. This is the same rule as is applied in cons_nonlinear and other nonlinear constraint handlers.
1) We mean all quadratic variables that appear either in a nonconvex square term or in a bilinear term, if the constraint itself is nonconvex. (and this under the assumption that the rhs is violated; for violated lhs, swap terms)
scip | SCIP data structure |
conshdlr | constraint handler |
conss | constraints to check |
nconss | number of constraints to check |
sol | solution to enforce (NULL for the LP solution) |
nnotify | counter for number of notifications performed |
Definition at line 9658 of file cons_quadratic.c.
References MAX, SCIP_QuadVarTerm::nadjbilin, registerBranchingCandidatesCentrality(), SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPaddExternBranchCand(), SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, SCIPfeastol(), SCIPgetSolVal(), SCIPisGE(), SCIPisGT(), SCIPisLE(), SCIPisRelEQ(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), SCIP_QuadVarTerm::sqrcoef, and SCIP_QuadVarTerm::var.
Referenced by registerBranchingCandidates(), and registerBranchingCandidatesGap().
|
static |
registers branching candidates according to centrality rule
That is, registers all variables appearing in nonconvex terms^1 with a score that is given by the distance of the variable value from its bounds. This rule should not make sense, as the distance to the bounds is also (often) considered by the branching rule later on.
1) We mean all quadratic variables that appear either in a nonconvex square term or in a bilinear term, if the constraint itself is nonconvex. (and this under the assumption that the rhs is violated; for violated lhs, swap terms)
scip | SCIP data structure |
conshdlr | constraint handler |
conss | constraints to check |
nconss | number of constraints to check |
sol | solution to enforce (NULL for the LP solution) |
nnotify | counter for number of notifications performed |
Definition at line 9743 of file cons_quadratic.c.
References MAX, SCIP_QuadVarTerm::nadjbilin, registerBranchingCandidates(), SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPaddExternBranchCand(), SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, SCIPfeastol(), SCIPgetSolVal(), SCIPisEQ(), SCIPisGT(), SCIPisInfinity(), SCIPisRelEQ(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), SCIP_QuadVarTerm::sqrcoef, and SCIP_QuadVarTerm::var.
Referenced by registerBranchingCandidates(), and registerBranchingCandidatesViolation().
|
static |
registers branching candidates
scip | SCIP data structure |
conshdlr | constraint handler |
conss | constraints to check |
nconss | number of constraints to check |
sol | solution to enforce (NULL for the LP solution) |
nnotify | counter for number of notifications performed |
Definition at line 9831 of file cons_quadratic.c.
References registerBranchingCandidatesCentrality(), registerBranchingCandidatesGap(), registerBranchingCandidatesViolation(), registerLargeRelaxValueVariableForBranching(), SCIP_CALL, SCIP_ERROR, SCIP_OKAY, SCIPABORT, SCIPconshdlrGetData(), and SCIPerrorMessage.
Referenced by enforceConstraint(), and registerBranchingCandidatesCentrality().
|
static |
registers a quadratic variable from a violated constraint as branching candidate that has a large absolute value in the (LP) relaxation
scip | SCIP data structure |
conss | constraints |
nconss | number of constraints |
sol | solution to enforce (NULL for the LP solution) |
brvar | buffer to store branching variable |
Definition at line 9871 of file cons_quadratic.c.
References replaceByLinearConstraints(), SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPaddExternBranchCand(), SCIPconsGetData(), SCIPfeastol(), SCIPgetSolVal(), SCIPisGT(), SCIPisRelEQ(), SCIPvarGetLbLocal(), and SCIPvarGetUbLocal().
Referenced by enforceConstraint(), and registerBranchingCandidates().
|
static |
replaces violated quadratic constraints where all quadratic variables are fixed by linear constraints
scip | SCIP data structure |
conss | constraints |
nconss | number of constraints |
addedcons | buffer to store whether a linear constraint was added |
reduceddom | whether a domain has been reduced |
infeasible | whether we detected infeasibility |
Definition at line 9924 of file cons_quadratic.c.
References FALSE, propagateBoundsTightenVarLb(), REALABS, SCIP_Bool, SCIP_CALL, SCIP_INFEASIBLE, SCIP_LPSOLSTAT_OPTIMAL, SCIP_OKAY, SCIP_Real, SCIPaddConsLocal(), SCIPcheckCons(), SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateConsLinear(), SCIPdebugMessage, SCIPdebugMsg, SCIPdebugPrintCons, SCIPdelConsLocal(), SCIPfeastol(), SCIPgetLPSolstat(), SCIPinfinity(), SCIPisEQ(), SCIPisGT(), SCIPisInfinity(), SCIPisRelEQ(), SCIPisZero(), SCIPreleaseCons(), SCIPtightenVarLb(), SCIPtightenVarUb(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), and TRUE.
Referenced by enforceConstraint(), registerLargeRelaxValueVariableForBranching(), and SCIP_DECL_CONSENFOPS().
|
static |
tightens a lower bound on a variable and checks the result
scip | SCIP data structure |
cons | constraint where we currently propagate |
intervalinfty | infinity value used in interval operations |
var | variable which domain we might reduce |
bnd | new lower bound for variable |
result | result to update if there was a tightening or cutoff |
nchgbds | counter to increase if a bound was tightened |
Definition at line 10132 of file cons_quadratic.c.
References FALSE, propagateBoundsTightenVarUb(), SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_REDUCEDDOM, SCIPadjustedVarLb(), SCIPconsGetName(), SCIPdebugMsg, SCIPinProbing(), SCIPisHugeValue(), SCIPisInfinity(), SCIPisLE(), SCIPresetConsAge(), SCIPtightenVarLb(), SCIPvarGetLbLocal(), and SCIPvarGetName().
Referenced by propagateBoundsBilinearTerm(), propagateBoundsCons(), propagateBoundsQuadVar(), and replaceByLinearConstraints().
|
static |
tightens an upper bound on a variable and checks the result
scip | SCIP data structure |
cons | constraint where we currently propagate |
intervalinfty | infinity value used in interval operations |
var | variable which domain we might reduce |
bnd | new upper bound for variable |
result | result to update if there was a tightening or cutoff |
nchgbds | counter to increase if a bound was tightened |
Definition at line 10193 of file cons_quadratic.c.
References FALSE, propagateBoundsQuadVar(), SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_REDUCEDDOM, SCIPadjustedVarUb(), SCIPconsGetName(), SCIPdebugMsg, SCIPinProbing(), SCIPisGE(), SCIPisHugeValue(), SCIPisInfinity(), SCIPresetConsAge(), SCIPtightenVarUb(), SCIPvarGetName(), and SCIPvarGetUbLocal().
Referenced by propagateBoundsBilinearTerm(), propagateBoundsCons(), propagateBoundsQuadVar(), and propagateBoundsTightenVarLb().
|
static |
solves a quadratic equation \( a x^2 + b x \in rhs \) (with b an interval) and reduces bounds on x or deduces infeasibility if possible
scip | SCIP data structure |
cons | constraint where we currently propagate |
intervalinfty | infinity value used in interval operations |
var | variable which bounds with might tighten |
a | coefficient in square term |
b | coefficient in linear term |
rhs | right hand side of quadratic equation |
result | result of propagation |
nchgbds | buffer where to add number of tightened bounds |
Definition at line 10254 of file cons_quadratic.c.
References MAX, propagateBoundsBilinearTerm(), propagateBoundsTightenVarLb(), propagateBoundsTightenVarUb(), SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_Real, SCIP_REDUCEDDOM, SCIPconsGetName(), SCIPdebugMsg, SCIPintervalAddScalar(), SCIPintervalGetInf(), SCIPintervalGetRoundingMode(), SCIPintervalGetSup(), SCIPintervalIsEmpty(), SCIPintervalIsEntire(), SCIPintervalMulScalar(), SCIPintervalQuad(), SCIPintervalQuadUpperBound(), SCIPintervalSet(), SCIPintervalSetBounds(), SCIPintervalSetRoundingMode(), SCIPintervalSetRoundingModeDownwards(), SCIPintervalSetRoundingModeUpwards(), SCIPintervalSolveUnivariateQuadExpression(), SCIPintervalSolveUnivariateQuadExpressionPositive(), SCIPintervalSub(), SCIPisInfinity(), SCIPresetConsAge(), SCIPvarGetLbLocal(), SCIPvarGetName(), and SCIPvarGetUbLocal().
Referenced by propagateBoundsCons(), and propagateBoundsTightenVarUb().
|
static |
tries to deduce domain reductions for x in xsqrcoef x^2 + xlincoef x + ysqrcoef y^2 + ylincoef y + bilincoef x y \in rhs
scip | SCIP data structure |
cons | the constraint, where the bilinear term belongs to |
intervalinfty | infinity value used in interval operations |
x | first variable |
xsqrcoef | square coefficient of x |
xlincoef | linear coefficient of x |
y | second variable |
ysqrcoef | square coefficient of y |
ylincoef | linear coefficient of y |
bilincoef | bilinear coefficient of x*y |
rhs | right hand side of quadratic equation |
result | pointer to store result of domain propagation |
nchgbds | counter to increment if domain reductions are found |
Definition at line 10453 of file cons_quadratic.c.
References infty2infty, MAX, propagateBoundsGetQuadActivity(), propagateBoundsTightenVarLb(), propagateBoundsTightenVarUb(), SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_REDUCEDDOM, SCIPconsGetName(), SCIPdebugMsg, SCIPinfinity(), SCIPintervalGetInf(), SCIPintervalGetSup(), SCIPintervalIsEmpty(), SCIPintervalIsEntire(), SCIPintervalSetBounds(), SCIPintervalSolveBivariateQuadExpressionAllScalar(), SCIPisInfinity(), SCIPvarGetLbLocal(), SCIPvarGetName(), and SCIPvarGetUbLocal().
Referenced by propagateBoundsCons(), and propagateBoundsQuadVar().
|
static |
computes the minimal and maximal activity for the quadratic part in a constraint data
Only sums up terms that contribute finite values. Gives the number of terms that contribute infinite values. Only computes those activities where the corresponding side of the constraint is finite.
scip | SCIP data structure |
consdata | constraint data |
intervalinfty | infinity value used in interval operations |
minquadactivity | minimal activity of quadratic variable terms where only terms with finite minimal activity contribute |
maxquadactivity | maximal activity of quadratic variable terms where only terms with finite maximal activity contribute |
minactivityinf | number of quadratic variables that contribute -infinity to minimal activity |
maxactivityinf | number of quadratic variables that contribute +infinity to maximal activity |
quadactcontr | contribution of each quadratic variables to quadactivity |
Definition at line 10527 of file cons_quadratic.c.
References SCIP_Interval::inf, infty2infty, MAX, propagateBoundsCons(), SCIP_Real, SCIPinfinity(), SCIPintervalAdd(), SCIPintervalGetInf(), SCIPintervalGetRoundingMode(), SCIPintervalGetSup(), SCIPintervalIsEmpty(), SCIPintervalMulScalar(), SCIPintervalQuadUpperBound(), SCIPintervalSet(), SCIPintervalSetBounds(), SCIPintervalSetRoundingMode(), SCIPintervalSetRoundingModeDownwards(), SCIPintervalSetRoundingModeUpwards(), SCIPisInfinity(), SCIPvarGetLbLocal(), SCIPvarGetUbLocal(), sqrt(), and SCIP_Interval::sup.
Referenced by propagateBoundsBilinearTerm(), and propagateBoundsCons().
|
static |
propagates bounds on a quadratic constraint
scip | SCIP data structure |
conshdlr | constraint handler |
cons | constraint to process |
result | pointer to store the result of the propagation call |
nchgbds | buffer where to add the the number of changed bounds |
redundant | buffer where to store whether constraint has been found to be redundant |
Definition at line 10662 of file cons_quadratic.c.
References consdataFindQuadVarTerm(), consdataSortQuadVarTerms(), consdataUpdateLinearActivity(), FALSE, SCIP_Interval::inf, infty2infty, MAX, propagateBounds(), propagateBoundsBilinearTerm(), propagateBoundsGetQuadActivity(), propagateBoundsQuadVar(), propagateBoundsTightenVarLb(), propagateBoundsTightenVarUb(), SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, SCIPepsilon(), SCIPfeastol(), SCIPfreeBufferArrayNull, SCIPinfinity(), SCIPintervalAdd(), SCIPintervalGetInf(), SCIPintervalGetRoundingMode(), SCIPintervalGetSup(), SCIPintervalIsEmpty(), SCIPintervalIsEntire(), SCIPintervalIsSubsetEQ(), SCIPintervalMulInf(), SCIPintervalMulScalar(), SCIPintervalMulSup(), SCIPintervalNegateReal(), SCIPintervalSet(), SCIPintervalSetBounds(), SCIPintervalSetRoundingMode(), SCIPintervalSetRoundingModeDownwards(), SCIPintervalSetRoundingModeUpwards(), SCIPintervalSub(), SCIPisEQ(), SCIPisGT(), SCIPisInfinity(), SCIPisLT(), SCIPvarGetLbLocal(), SCIPvarGetUbLocal(), SCIP_Interval::sup, and TRUE.
Referenced by propagateBounds(), propagateBoundsGetQuadActivity(), and SCIP_DECL_CONSPRESOL().
|
static |
calls domain propagation for a set of constraints
scip | SCIP data structure |
conshdlr | constraint handler |
conss | constraints to process |
nconss | number of constraints |
result | pointer to store the result of the propagation calls |
nchgbds | buffer where to add the the number of changed bounds |
Definition at line 11197 of file cons_quadratic.c.
References consdataFindUnlockedLinearVar(), FALSE, propagateBoundsCons(), SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_OKAY, SCIP_STAGE_PRESOLVING, SCIP_STAGE_SOLVING, SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsEnabled(), SCIPconsIsMarkedPropagate(), SCIPdebugMsg, SCIPdelConsLocal(), SCIPgetStage(), SCIPunmarkConsPropagate(), and TRUE.
Referenced by enforceConstraint(), propagateBoundsCons(), SCIP_DECL_CONSENFOPS(), and SCIP_DECL_CONSPROP().
|
static |
checks for a linear variable that can be increase or decreased without harming feasibility
scip | SCIP data structure |
consdata | constraint data |
Definition at line 11272 of file cons_quadratic.c.
References proposeFeasibleSolution(), SCIPdebugMsg, SCIPisInfinity(), SCIPvarGetName(), SCIPvarGetNLocksDown(), and SCIPvarGetObj().
Referenced by propagateBounds(), SCIP_DECL_CONSCHECK(), SCIP_DECL_CONSINITSOL(), SCIPgetLinvarMayDecreaseQuadratic(), and SCIPgetLinvarMayIncreaseQuadratic().
|
static |
Given a solution where every quadratic constraint is either feasible or can be made feasible by moving a linear variable, construct the corresponding feasible solution and pass it to the trysol heuristic.
The method assumes that this is always possible and that not all constraints are feasible already.
scip | SCIP data structure |
conshdlr | constraint handler |
conss | constraints to process |
nconss | number of constraints |
sol | solution to process |
success | buffer to store whether we succeeded to construct a solution that satisfies all provided constraints |
Definition at line 11337 of file cons_quadratic.c.
References computeViolation(), enforceConstraint(), FALSE, MAX, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_STAGE_INITPRESOLVE, SCIP_STAGE_SOLVED, SCIPceil(), SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPcreateLPSol(), SCIPcreateSolCopy(), SCIPdebugMsg, SCIPfeastol(), SCIPfloor(), SCIPfreeSol(), SCIPgetSolTransObj(), SCIPgetSolVal(), SCIPgetStage(), SCIPgetUpperbound(), SCIPheurGetName(), SCIPheurPassSolTrySol(), SCIPincSolVal(), SCIPisGT(), SCIPisInfinity(), SCIPisNegative(), SCIPisPositive(), SCIPisSumLT(), SCIPisZero(), SCIPsolGetHeur(), SCIPunlinkSol(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), SCIPvarIsIntegral(), and TRUE.
Referenced by consdataFindUnlockedLinearVar(), and SCIP_DECL_CONSCHECK().
|
static |
helper function to enforce constraints
scip | SCIP data structure |
conshdlr | constraint handler |
conss | constraints to process |
nconss | number of constraints |
nusefulconss | number of useful (non-obsolete) constraints to process |
sol | solution to enforce (NULL for the LP solution) |
solinfeasible | was the solution already declared infeasible by a constraint handler? |
result | pointer to store the result of the enforcing call |
Definition at line 11493 of file cons_quadratic.c.
References computeViolations(), propagateBounds(), registerBranchingCandidates(), registerLargeRelaxValueVariableForBranching(), replaceByLinearConstraints(), SCIP_Bool, SCIP_BRANCHED, SCIP_CALL, SCIP_CONSADDED, SCIP_CUTOFF, SCIP_DECL_NONLINCONSUPGD(), SCIP_FEASIBLE, SCIP_INFEASIBLE, SCIP_OKAY, SCIP_Real, SCIP_REDUCEDDOM, SCIP_SEPARATED, SCIP_VERBLEVEL_HIGH, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPcreateChild(), SCIPdebugMsg, SCIPfeastol(), SCIPgetCurrentNode(), SCIPgetSolVal(), SCIPisGT(), SCIPisInfinity(), SCIPisStopped(), SCIPlpfeastol(), SCIPnodeGetEstimate(), SCIPvarGetName(), SCIPverbMessage(), SCIPwarningMessage(), separatePoint(), and TRUE.
Referenced by proposeFeasibleSolution(), SCIP_DECL_CONSENFOLP(), and SCIP_DECL_CONSENFORELAX().
|
static |
tries to upgrade a nonlinear constraint into a quadratic constraint
Definition at line 11702 of file cons_quadratic.c.
References SCIP_CALL, SCIP_DECL_CONSHDLRCOPY(), SCIP_ERROR, SCIP_EXPR_ABS, SCIP_EXPR_CONST, SCIP_EXPR_COS, SCIP_EXPR_DIV, SCIP_EXPR_EXP, SCIP_EXPR_INTPOWER, SCIP_EXPR_LAST, SCIP_EXPR_LINEAR, SCIP_EXPR_LOG, SCIP_EXPR_MAX, SCIP_EXPR_MIN, SCIP_EXPR_MINUS, SCIP_EXPR_MUL, SCIP_EXPR_PARAM, SCIP_EXPR_PLUS, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_PRODUCT, SCIP_EXPR_QUADRATIC, SCIP_EXPR_REALPOWER, SCIP_EXPR_SIGN, SCIP_EXPR_SIGNPOWER, SCIP_EXPR_SIN, SCIP_EXPR_SQRT, SCIP_EXPR_SQUARE, SCIP_EXPR_SUM, SCIP_EXPR_TAN, SCIP_EXPR_USER, SCIP_EXPR_VARIDX, SCIP_OKAY, SCIP_Real, SCIPaddBilinTermQuadratic(), SCIPaddConstantQuadratic(), SCIPaddQuadVarLinearCoefQuadratic(), SCIPaddQuadVarQuadratic(), SCIPaddSquareCoefQuadratic(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateConsQuadratic(), SCIPerrorMessage, SCIPexprgraphAreAllNodeChildrenVars(), SCIPexprgraphGetNodeChildren(), SCIPexprgraphGetNodeNChildren(), SCIPexprgraphGetNodeOperator(), SCIPexprgraphGetNodeQuadraticConstant(), SCIPexprgraphGetNodeQuadraticLinearCoefs(), SCIPexprgraphGetNodeQuadraticNQuadElements(), SCIPexprgraphGetNodeQuadraticQuadElements(), SCIPexprgraphGetNodeVar(), SCIPgetExprgraphNodeNonlinear(), SCIPgetExprgraphNonlinear(), SCIPgetLhsNonlinear(), SCIPgetLinearCoefsNonlinear(), SCIPgetLinearVarsNonlinear(), SCIPgetNLinearVarsNonlinear(), SCIPgetRhsNonlinear(), and SCIPwarningMessage().
Referenced by enforceConstraint().
|
static |
copy method for constraint handler plugins (called when SCIP copies plugins)
Definition at line 11882 of file cons_quadratic.c.
References CONSHDLR_NAME, SCIP_CALL, SCIP_DECL_CONSFREE(), SCIP_OKAY, SCIPconshdlrGetName(), SCIPincludeConshdlrQuadratic(), and TRUE.
Referenced by SCIP_DECL_NONLINCONSUPGD().
|
static |
destructor of constraint handler to free constraint handler data (called when SCIP is exiting)
Definition at line 11898 of file cons_quadratic.c.
References SCIP_DECL_CONSINIT(), SCIP_OKAY, SCIPconshdlrGetData(), SCIPfreeBlockMemory, and SCIPfreeBlockMemoryArrayNull.
Referenced by SCIP_DECL_CONSHDLRCOPY().
|
static |
initialization method of constraint handler (called after problem was transformed)
Definition at line 11922 of file cons_quadratic.c.
References SCIP_DECL_CONSEXIT(), SCIP_OKAY, SCIPconshdlrGetData(), and SCIPfindHeur().
Referenced by SCIP_DECL_CONSFREE().
|
static |
deinitialization method of constraint handler (called before transformed problem is freed)
Definition at line 11941 of file cons_quadratic.c.
References SCIP_DECL_CONSEXITPRE(), SCIP_DECL_CONSINITPRE, SCIP_OKAY, and SCIPconshdlrGetData().
Referenced by SCIP_DECL_CONSINIT().
|
static |
presolving initialization method of constraint handler (called when presolving is about to begin) presolving deinitialization method of constraint handler (called after presolving has been finished)
Definition at line 11979 of file cons_quadratic.c.
References mergeAndCleanBilinearTerms(), mergeAndCleanLinearVars(), mergeAndCleanQuadVarTerms(), removeFixedVariables(), SCIP_CALL, SCIP_DECL_CONSINITSOL(), SCIP_OKAY, SCIPconsGetData(), SCIPconsIsAdded(), SCIPenableNLP(), and SCIPvarIsActive().
Referenced by SCIP_DECL_CONSEXIT().
|
static |
solving process initialization method of constraint handler (called when branch and bound process is about to begin)
Definition at line 12033 of file cons_quadratic.c.
References checkCurvature(), checkFactorable(), computeED(), computeGauge(), consdataFindQuadVarTerm(), consdataFindUnlockedLinearVar(), consdataSortQuadVarTerms(), CONSHDLR_NAME, createNlRow(), FALSE, MAX, REALABS, SCIP_CALL, SCIP_DECL_CONSEXITSOL(), SCIP_EVENTTYPE_SOLFOUND, SCIP_OKAY, SCIP_STAGE_INITSOLVE, SCIP_VERBLEVEL_HIGH, SCIPaddNlRow(), SCIPallocBlockMemoryArray, SCIPcatchEvent(), SCIPconsGetData(), SCIPconshdlrGetData(), SCIPconsIsEnabled(), SCIPfindEventhdlr(), SCIPgetStage(), SCIPgetSubscipDepth(), SCIPinfinity(), SCIPisInfinity(), SCIPisInRestart(), SCIPisIpoptAvailableIpopt(), SCIPisNLPConstructed(), SCIPmarkConsPropagate(), and SCIPverbMessage().
Referenced by SCIP_DECL_CONSEXITPRE().
|
static |
solving process deinitialization method of constraint handler (called before branch and bound process data is freed)
Definition at line 12168 of file cons_quadratic.c.
References CONSHDLR_NAME, freeAllBilinearTerms(), SCIP_CALL, SCIP_DECL_CONSDELETE(), SCIP_EVENTTYPE_SOLFOUND, SCIP_OKAY, SCIP_STAGE_EXITSOLVE, SCIPconsGetData(), SCIPconshdlrGetData(), SCIPconsIsEnabled(), SCIPdropEvent(), SCIPfindEventhdlr(), SCIPfreeBlockMemoryArrayNull, SCIPgetStage(), and SCIPreleaseNlRow().
Referenced by SCIP_DECL_CONSINITSOL().
|
static |
frees specific constraint data
Definition at line 12234 of file cons_quadratic.c.
References consdataFree(), SCIP_CALL, SCIP_DECL_CONSTRANS(), SCIP_OKAY, and SCIPconsGetData().
Referenced by SCIP_DECL_CONSEXITSOL().
|
static |
transforms constraint data into data belonging to the transformed problem
Definition at line 12251 of file cons_quadratic.c.
References consdataCreate(), FALSE, SCIP_CALL, SCIP_DECL_CONSINITLP(), SCIP_OKAY, SCIPcaptureVar(), SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateCons(), SCIPdebugMsg, SCIPdebugPrintCons, SCIPgetTransformedVar(), and SCIPvarCompare().
Referenced by SCIP_DECL_CONSDELETE().
|
static |
LP initialization method of constraint handler (called before the initial LP relaxation at a node is solved)
Definition at line 12308 of file cons_quadratic.c.
References checkCurvature(), FALSE, generateCut(), INITLPMAXVARVAL, MAX, REALABS, SCIP_Bool, SCIP_BOUNDTYPE_LOWER, SCIP_CALL, SCIP_DECL_CONSSEPALP(), SCIP_OKAY, SCIP_Real, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIPaddRow(), SCIPaddVarsToRow(), SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsLocal(), SCIPcreateEmptyRowCons(), SCIPdebug, SCIPdebugMsg, SCIPfreeBufferArray, SCIPinfinity(), SCIPisInfinity(), SCIPprintRow(), SCIPreleaseRow(), SCIProwGetName(), SCIPvarGetBestBoundLocal(), SCIPvarGetBestBoundType(), SCIPvarGetLbGlobal(), SCIPvarGetUbGlobal(), SCIPvarGetWorstBoundLocal(), storeAllBilinearTerms(), and TRUE.
Referenced by SCIP_DECL_CONSTRANS().
|
static |
separation method of constraint handler for LP solutions
Definition at line 12506 of file cons_quadratic.c.
References addLinearizationCuts(), checkCurvature(), computeViolations(), FALSE, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DECL_CONSSEPASOL(), SCIP_DIDNOTFIND, SCIP_LPSOLSTAT_OPTIMAL, SCIP_LPSOLSTAT_UNBOUNDEDRAY, SCIP_NLPSOLSTAT_FEASIBLE, SCIP_NLPSOLSTAT_GLOBINFEASIBLE, SCIP_NLPSOLSTAT_UNKNOWN, SCIP_OKAY, SCIP_SEPARATED, SCIPaddLinearConsToNlpHeurSubNlp(), SCIPconsGetData(), SCIPconshdlrGetData(), SCIPcreateNLPSol(), SCIPdebugMsg, SCIPfeastol(), SCIPfreeSol(), SCIPgetDepth(), SCIPgetLPSolstat(), SCIPgetNBinVars(), SCIPgetNContVars(), SCIPgetNIntVars(), SCIPgetNLPFracVars(), SCIPgetNLPSolstat(), SCIPgetNNlpis(), SCIPgetNVars(), SCIPgetSepaMinEfficacy(), SCIPgetSolOrigObj(), SCIPheurPassSolTrySol(), SCIPisGT(), SCIPisNLPConstructed(), SCIPsetNLPInitialGuessSol(), SCIPsolveNLP(), separatePoint(), and TRUE.
Referenced by SCIP_DECL_CONSINITLP().
|
static |
separation method of constraint handler for arbitrary primal solutions
Definition at line 12658 of file cons_quadratic.c.
References computeViolations(), FALSE, SCIP_Bool, SCIP_CALL, SCIP_DECL_CONSENFOLP(), SCIP_DIDNOTFIND, SCIP_OKAY, SCIPgetSepaMinEfficacy(), and separatePoint().
Referenced by SCIP_DECL_CONSSEPALP().
|
static |
constraint enforcing method of constraint handler for LP solutions
Definition at line 12688 of file cons_quadratic.c.
References enforceConstraint(), SCIP_CALL, SCIP_DECL_CONSENFORELAX(), and SCIP_OKAY.
Referenced by SCIP_DECL_CONSSEPASOL().
|
static |
constraint enforcing method of constraint handler for relaxation solutions
Definition at line 12697 of file cons_quadratic.c.
References enforceConstraint(), SCIP_CALL, SCIP_DECL_CONSENFOPS(), and SCIP_OKAY.
Referenced by SCIP_DECL_CONSENFOLP().
|
static |
constraint enforcing method of constraint handler for pseudo solutions
Definition at line 12706 of file cons_quadratic.c.
References computeViolations(), MAX, propagateBounds(), replaceByLinearConstraints(), SCIP_Bool, SCIP_CALL, SCIP_CONSADDED, SCIP_CUTOFF, SCIP_DECL_CONSPROP(), SCIP_FEASIBLE, SCIP_INFEASIBLE, SCIP_INVALID, SCIP_OKAY, SCIP_REDUCEDDOM, SCIP_SOLVELP, SCIPaddExternBranchCand(), SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, SCIPfeastol(), SCIPisGT(), SCIPisRelEQ(), SCIPvarGetLbLocal(), and SCIPvarGetUbLocal().
Referenced by SCIP_DECL_CONSENFORELAX().
|
static |
domain propagation method of constraint handler
Definition at line 12815 of file cons_quadratic.c.
References propagateBounds(), SCIP_CALL, SCIP_DECL_CONSPRESOL(), and SCIP_OKAY.
Referenced by SCIP_DECL_CONSENFOPS().
|
static |
presolving method of constraint handler
Definition at line 12832 of file cons_quadratic.c.
References FALSE, hasQuadvarHpProperty(), mergeAndCleanBilinearTerms(), mergeAndCleanLinearVars(), mergeAndCleanQuadVarTerms(), presolveDisaggregate(), presolveSolve(), presolveTryAddAND(), presolveTryAddLinearReform(), presolveUpgrade(), propagateBoundsCons(), removeFixedVariables(), SCIP_Bool, SCIP_BOUNDTYPE_LOWER, SCIP_BOUNDTYPE_UPPER, SCIP_CALL, SCIP_CUTOFF, SCIP_DECL_CONSLOCK(), SCIP_DIDNOTFIND, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_PRESOLTIMING_EXHAUSTIVE, SCIP_PRESOLTIMING_FAST, SCIP_Real, SCIP_REDUCEDDOM, SCIP_SUCCESS, SCIP_VARTYPE_BINARY, SCIP_VARTYPE_CONTINUOUS, SCIP_VARTYPE_IMPLINT, SCIPaddCons(), SCIPchgVarType(), SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPcreateConsBounddisjunction(), SCIPdebugMsg, SCIPdebugPrintCons, SCIPdelCons(), SCIPisEQ(), SCIPisFeasNegative(), SCIPisFeasPositive(), SCIPisInfinity(), SCIPisIntegral(), SCIPisPresolveFinished(), SCIPreleaseCons(), SCIPsnprintf(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetType(), SCIPvarGetUbGlobal(), and TRUE.
Referenced by SCIP_DECL_CONSPROP().
|
static |
variable rounding lock method of constraint handler
Definition at line 13186 of file cons_quadratic.c.
References SCIP_Bool, SCIP_CALL, SCIP_DECL_CONSENABLE(), SCIP_OKAY, SCIPaddVarLocks(), SCIPconsGetData(), and SCIPisInfinity().
Referenced by SCIP_DECL_CONSPRESOL().
|
static |
constraint enabling notification method of constraint handler
Definition at line 13239 of file cons_quadratic.c.
References catchVarEvents(), mergeAndCleanBilinearTerms(), mergeAndCleanLinearVars(), mergeAndCleanQuadVarTerms(), SCIP_CALL, SCIP_DECL_CONSDISABLE(), SCIP_OKAY, SCIP_STAGE_EXITPRESOLVE, SCIP_STAGE_SOLVING, SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsActive(), SCIPconsIsTransformed(), SCIPdebugMsg, and SCIPgetStage().
Referenced by SCIP_DECL_CONSLOCK().
|
static |
constraint disabling notification method of constraint handler
Definition at line 13276 of file cons_quadratic.c.
References dropVarEvents(), FALSE, SCIP_CALL, SCIP_DECL_CONSPRINT(), SCIP_OKAY, SCIP_STAGE_SOLVING, SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsTransformed(), SCIPdebugMsg, and SCIPgetStage().
Referenced by SCIP_DECL_CONSENABLE().
|
static |
constraint display method of constraint handler
Definition at line 13304 of file cons_quadratic.c.
References SCIP_CALL, SCIP_DECL_CONSCHECK(), SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPconsGetData(), SCIPfreeBufferArray, SCIPfreeBufferArrayNull, SCIPinfoMessage(), SCIPisEQ(), SCIPisInfinity(), SCIPwriteVarsPolynomial(), and TRUE.
Referenced by SCIP_DECL_CONSDISABLE().
|
static |
feasibility check method of constraint handler for integral solutions
Definition at line 13437 of file cons_quadratic.c.
References computeViolation(), consdataFindUnlockedLinearVar(), FALSE, proposeFeasibleSolution(), REALABS, SCIP_Bool, SCIP_CALL, SCIP_DECL_CONSCOPY(), SCIP_FEASIBLE, SCIP_INFEASIBLE, SCIP_OKAY, SCIP_Real, SCIP_STAGE_INITSOLVE, SCIP_STAGE_SOLVING, SCIP_STAGE_TRANSFORMED, SCIPconsGetData(), SCIPconshdlrGetData(), SCIPfeastol(), SCIPgetStage(), SCIPinfoMessage(), SCIPisGT(), SCIPisInfinity(), SCIPprintCons(), and SCIPupdateStartpointHeurSubNlp().
Referenced by SCIP_DECL_CONSPRINT().
|
static |
constraint copying method of constraint handler
Definition at line 13540 of file cons_quadratic.c.
References SCIP_QuadVarTerm::adjbilin, SCIP_BilinTerm::coef, SCIP_QuadVarTerm::eventdata, FALSE, SCIP_QuadVarTerm::lincoef, SCIP_QuadVarTerm::nadjbilin, SCIP_CALL, SCIP_DECL_CONSPARSE(), SCIP_OKAY, SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPcreateConsQuadratic2(), SCIPfreeBufferArrayNull, SCIPgetVarCopy(), SCIP_QuadVarTerm::sqrcoef, TRUE, SCIP_QuadVarTerm::var, SCIP_BilinTerm::var1, and SCIP_BilinTerm::var2.
Referenced by SCIP_DECL_CONSCHECK().
|
static |
constraint parsing method of constraint handler
Definition at line 13653 of file cons_quadratic.c.
References FALSE, SCIP_CALL, SCIP_DECL_CONSGETVARS(), SCIP_OKAY, SCIP_Real, SCIPaddBilinTermQuadratic(), SCIPaddConstantQuadratic(), SCIPaddLinearVarQuadratic(), SCIPaddQuadVarQuadratic(), SCIPcreateConsQuadratic(), SCIPerrorMessage, SCIPfindQuadVarTermQuadratic(), SCIPfreeParseVarsPolynomialData(), SCIPinfinity(), SCIPisInfinity(), SCIPparseVarsPolynomial(), SCIPreleaseCons(), and SCIPstrToRealValue().
Referenced by SCIP_DECL_CONSCOPY().
|
static |
constraint method of constraint handler which returns the variables (if possible)
Definition at line 13846 of file cons_quadratic.c.
References BMScopyMemoryArray, FALSE, SCIP_DECL_CONSGETNVARS(), SCIP_OKAY, SCIPconsGetData(), and TRUE.
Referenced by SCIP_DECL_CONSPARSE().
|
static |
constraint method of constraint handler which returns the number of variables (if possible)
Definition at line 13877 of file cons_quadratic.c.
References SCIP_OKAY, SCIPconsGetData(), SCIPincludeConshdlrQuadratic(), and TRUE.
Referenced by SCIP_DECL_CONSGETVARS().
|
static |
helper function to compute the violation of an inequality of the form xcoef * x <= ycoef * y + constant for two corner points of the domain [lbx,ubx]x[lby,uby]
x | first variable |
y | second variable |
xcoef | x-coefficient |
ycoef | y-coefficient |
constant | constant |
viol1 | buffer to store the violation of the first corner point |
viol2 | buffer to store the violation of the second corner point |
Definition at line 15653 of file cons_quadratic.c.
References MAX, SCIP_Real, SCIPaddBilinearIneqQuadratic(), SCIPvarGetLbLocal(), and SCIPvarGetUbLocal().
Referenced by SCIPaddBilinearIneqQuadratic(), and SCIPgetAllBilinearTermsQuadratic().
SCIP_RETCODE SCIPcreateRowprep | ( | SCIP * | scip, |
SCIP_ROWPREP ** | rowprep, | ||
SCIP_SIDETYPE | sidetype, | ||
SCIP_Bool | local | ||
) |
creates a SCIP_ROWPREP datastructure
Initial cut represents 0 <= 0.
scip | SCIP data structure |
rowprep | buffer to store pointer to rowprep |
sidetype | whether cut will be or lower-equal or larger-equal type |
local | whether cut will be valid only locally |
Definition at line 15834 of file cons_quadratic.c.
References BMSclearMemory, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, and SCIPfreeRowprep().
Referenced by generateCut(), generateCutPoint(), generateCutProjectedPoint(), generateCutSol(), generateLinearizationCut(), generateSecantCut(), generateSecantCutNoCheck(), and SCIPaddBilinearIneqQuadratic().
void SCIPfreeRowprep | ( | SCIP * | scip, |
SCIP_ROWPREP ** | rowprep | ||
) |
frees a SCIP_ROWPREP datastructure
scip | SCIP data structure |
rowprep | pointer that stores pointer to rowprep |
Definition at line 15854 of file cons_quadratic.c.
References SCIPcopyRowprep(), SCIPfreeBlockMemory, and SCIPfreeBlockMemoryArrayNull.
Referenced by addLinearizationCuts(), generateCut(), generateSparseCut(), SCIP_DECL_CONSINITLP(), SCIPcreateRowprep(), and separatePoint().
SCIP_RETCODE SCIPcopyRowprep | ( | SCIP * | scip, |
SCIP_ROWPREP ** | target, | ||
SCIP_ROWPREP * | source | ||
) |
creates a copy of a SCIP_ROWPREP datastructure
scip | SCIP data structure |
target | buffer to store pointer of rowprep copy |
source | rowprep to copy |
Definition at line 15869 of file cons_quadratic.c.
References SCIP_RowPrep::coefs, SCIP_CALL, SCIP_OKAY, SCIPduplicateBlockMemory, SCIPduplicateBlockMemoryArray, SCIPensureRowprepSize(), SCIP_RowPrep::vars, and SCIP_RowPrep::varssize.
Referenced by SCIPfreeRowprep().
SCIP_RETCODE SCIPensureRowprepSize | ( | SCIP * | scip, |
SCIP_ROWPREP * | rowprep, | ||
int | size | ||
) |
ensures that rowprep has space for at least given number of additional terms
Useful when knowing in advance how many terms will be added.
scip | SCIP data structure |
rowprep | rowprep |
size | number of additional terms for which to alloc space in rowprep |
Definition at line 15896 of file cons_quadratic.c.
References SCIP_RowPrep::coefs, SCIP_RowPrep::nvars, SCIP_CALL, SCIP_OKAY, SCIPcalcMemGrowSize(), SCIPprintRowprep(), SCIPreallocBlockMemoryArray, SCIP_RowPrep::vars, and SCIP_RowPrep::varssize.
Referenced by generateCutPoint(), generateCutProjectedPoint(), generateCutSol(), SCIPaddRowprepTerm(), SCIPaddRowprepTerms(), and SCIPcopyRowprep().
void SCIPprintRowprep | ( | SCIP * | scip, |
SCIP_ROWPREP * | rowprep, | ||
FILE * | file | ||
) |
prints a rowprep
scip | SCIP data structure |
rowprep | rowprep to be printed |
file | file to print to, or NULL for stdout |
Definition at line 15922 of file cons_quadratic.c.
References SCIP_RowPrep::coefs, SCIP_RowPrep::local, SCIP_RowPrep::name, SCIP_RowPrep::nvars, SCIP_SIDETYPE_LEFT, SCIPaddRowprepTerm(), SCIPinfoMessage(), SCIPvarGetName(), SCIP_RowPrep::side, SCIP_RowPrep::sidetype, and SCIP_RowPrep::vars.
Referenced by addConcaveEstimatorBivariate(), addConcaveEstimatorUnivariate(), addLinearization(), generateCut(), SCIPcleanupRowprep(), and SCIPensureRowprepSize().
SCIP_RETCODE SCIPaddRowprepTerm | ( | SCIP * | scip, |
SCIP_ROWPREP * | rowprep, | ||
SCIP_VAR * | var, | ||
SCIP_Real | coef | ||
) |
adds a term coef*var to a rowprep
scip | SCIP data structure |
rowprep | rowprep |
var | variable to add |
coef | coefficient to add |
Definition at line 15947 of file cons_quadratic.c.
References SCIP_RowPrep::coefs, SCIP_RowPrep::nvars, SCIP_CALL, SCIP_OKAY, SCIPaddRowprepTerms(), SCIPensureRowprepSize(), SCIP_RowPrep::vars, and SCIP_RowPrep::varssize.
Referenced by addConcaveEstimatorBivariate(), addConcaveEstimatorUnivariate(), generateCutConvex(), generateCutFactorableDo(), generateCutLTI(), generateCutNonConvex(), generateCutPoint(), generateCutProjectedPoint(), generateCutSol(), generateLinearizationCut(), generateSecantCut(), generateSecantCutNoCheck(), and SCIPprintRowprep().
SCIP_RETCODE SCIPaddRowprepTerms | ( | SCIP * | scip, |
SCIP_ROWPREP * | rowprep, | ||
int | nvars, | ||
SCIP_VAR ** | vars, | ||
SCIP_Real * | coefs | ||
) |
adds several terms coef*var to a rowprep
scip | SCIP data structure |
rowprep | rowprep |
nvars | number of terms to add |
vars | variables to add |
coefs | coefficients to add |
Definition at line 15972 of file cons_quadratic.c.
References BMScopyMemoryArray, SCIP_RowPrep::coefs, SCIP_RowPrep::nvars, SCIP_CALL, SCIP_OKAY, SCIPaddRowprepSide(), SCIPensureRowprepSize(), SCIP_RowPrep::vars, and SCIP_RowPrep::varssize.
Referenced by addIntervalGradientEstimator(), addLinearization(), addUserEstimator(), generateCut(), and SCIPaddRowprepTerm().
void SCIPaddRowprepSide | ( | SCIP_ROWPREP * | rowprep, |
SCIP_Real | side | ||
) |
adds constant value to side of rowprep
rowprep | rowprep |
side | constant value to be added to side |
Definition at line 16005 of file cons_quadratic.c.
References SCIPaddRowprepConstant(), and SCIP_RowPrep::side.
Referenced by generateCut(), generateCutConvex(), generateCutLTI(), generateCutNonConvex(), generateCutPoint(), generateCutProjectedPoint(), generateCutSol(), generateLinearizationCut(), generateSecantCut(), generateSecantCutNoCheck(), SCIPaddRowprepConstant(), and SCIPaddRowprepTerms().
void SCIPaddRowprepConstant | ( | SCIP_ROWPREP * | rowprep, |
SCIP_Real | constant | ||
) |
adds constant term to rowprep
Substracts constant from side.
rowprep | rowprep |
constant | constant value to be added |
Definition at line 16019 of file cons_quadratic.c.
References SCIP_Real, SCIPaddRowprepSide(), and SCIPgetRowprepViolation().
Referenced by addConcaveEstimatorBivariate(), addConcaveEstimatorUnivariate(), addIntervalGradientEstimator(), addLinearization(), addUserEstimator(), generateCutConvex(), generateCutFactorableDo(), generateCutLTI(), generateCutNonConvex(), rowprepCleanupImproveCoefrange(), rowprepCleanupIntegralCoefs(), and SCIPaddRowprepSide().
SCIP_Real SCIPgetRowprepViolation | ( | SCIP * | scip, |
SCIP_ROWPREP * | rowprep, | ||
SCIP_SOL * | sol | ||
) |
computes violation of cut in a given solution
scip | SCIP data structure |
rowprep | rowprep to be turned into a row |
sol | solution or NULL for LP solution |
Definition at line 16030 of file cons_quadratic.c.
References SCIP_RowPrep::coefs, MAX, SCIP_RowPrep::nvars, SCIP_Real, SCIP_SIDETYPE_RIGHT, SCIP_VARSTATUS_LOOSE, SCIPgetSolVal(), SCIPmergeRowprepTerms(), SCIPvarGetStatus(), SCIP_RowPrep::side, SCIP_RowPrep::sidetype, and SCIP_RowPrep::vars.
Referenced by addLinearizationCuts(), generateCut(), generateSparseCut(), SCIPaddRowprepConstant(), and SCIPcleanupRowprep().
void SCIPmergeRowprepTerms | ( | SCIP * | scip, |
SCIP_ROWPREP * | rowprep | ||
) |
Merge terms that use same variable and eliminate zero coefficients.
Terms are sorted by variable (
scip | SCIP data structure |
rowprep | rowprep to be cleaned up |
Definition at line 16063 of file cons_quadratic.c.
References SCIP_RowPrep::coefs, SCIP_RowPrep::nvars, rowprepCleanupSortTerms(), SCIPsortPtrReal(), and SCIP_RowPrep::vars.
Referenced by generateCut(), and SCIPgetRowprepViolation().
|
static |
sort cut terms by absolute value of coefficients, from largest to smallest
scip | SCIP data structure |
rowprep | rowprep to be sorted |
Definition at line 16122 of file cons_quadratic.c.
References SCIP_RowPrep::coefs, SCIP_RowPrep::nvars, REALABS, rowprepCleanupImproveCoefrange(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPsortDownRealRealPtr(), and SCIP_RowPrep::vars.
Referenced by SCIPcleanupRowprep(), and SCIPmergeRowprepTerms().
|
static |
try to improve coef range by aggregating cut 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 16181 of file cons_quadratic.c.
References SCIP_RowPrep::coefs, SCIP_RowPrep::local, MAX, SCIP_RowPrep::nvars, REALABS, rowprepCleanupScaleup(), SCIP_INVALID, SCIP_Real, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIPaddRowprepConstant(), SCIPdebugMsg, SCIPgetSolVal(), SCIPisGT(), SCIPisInfinity(), SCIPisLT(), SCIPvarGetLbGlobal(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), SCIPvarGetUbLocal(), SCIP_RowPrep::sidetype, and SCIP_RowPrep::vars.
Referenced by rowprepCleanupSortTerms(), and SCIPcleanupRowprep().
|
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 16344 of file cons_quadratic.c.
References SCIP_RowPrep::coefs, SCIP_RowPrep::nvars, REALABS, ROWPREP_SCALEUP_MAXMAXCOEF, ROWPREP_SCALEUP_MAXMINCOEF, ROWPREP_SCALEUP_MAXSIDE, ROWPREP_SCALEUP_MINVIOLFACTOR, ROWPREP_SCALEUP_VIOLNONZERO, rowprepCleanupScaledown(), SCIP_Real, SCIPscaleRowprep(), and SCIP_RowPrep::side.
Referenced by rowprepCleanupImproveCoefrange(), and 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 16393 of file cons_quadratic.c.
References SCIP_RowPrep::coefs, SCIP_RowPrep::nvars, REALABS, ROWPREP_SCALEDOWN_MINCOEF, ROWPREP_SCALEDOWN_MINMAXCOEF, ROWPREP_SCALEUP_MINVIOLFACTOR, rowprepCleanupIntegralCoefs(), SCIP_Real, and SCIPscaleRowprep().
Referenced by rowprepCleanupScaleup(), and SCIPcleanupRowprep().
|
static |
rounds almost integral coefs to integrals, thereby trying to relax the cut
scip | SCIP data structure |
rowprep | rowprep to be improve |
viol | violation of cut in sol (input), set to SCIP_INVALID if some coef changed |
Definition at line 16437 of file cons_quadratic.c.
References SCIP_RowPrep::coefs, SCIP_RowPrep::local, SCIP_RowPrep::nvars, REALABS, rowprepCleanupSide(), SCIP_INVALID, SCIP_Real, SCIP_SIDETYPE_RIGHT, SCIPaddRowprepConstant(), SCIPdebugMsg, SCIPisEQ(), SCIPisInfinity(), SCIPround(), SCIPvarGetLbGlobal(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), SCIPvarGetUbLocal(), SCIP_RowPrep::sidetype, and SCIP_RowPrep::vars.
Referenced by rowprepCleanupScaledown(), and SCIPcleanupRowprep().
|
static |
relaxes almost zero side
scip | SCIP data structure |
rowprep | rowprep to be improve |
viol | violation of cut in sol (input), set to SCIP_INVALID if some coef changed |
Definition at line 16511 of file cons_quadratic.c.
References SCIP_INVALID, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIPcleanupRowprep(), SCIPepsilon(), SCIPisZero(), SCIP_RowPrep::side, and SCIP_RowPrep::sidetype.
Referenced by rowprepCleanupIntegralCoefs(), and SCIPcleanupRowprep().
SCIP_RETCODE SCIPcleanupRowprep | ( | SCIP * | scip, |
SCIP_ROWPREP * | rowprep, | ||
SCIP_SOL * | sol, | ||
SCIP_Real | maxcoefrange, | ||
SCIP_Real | minviol, | ||
SCIP_Real * | coefrange, | ||
SCIP_Real * | viol | ||
) |
scip | SCIP data structure |
rowprep | rowprep to be cleaned |
sol | solution that we try to cut off, or NULL for LP solution |
maxcoefrange | maximal allowed coefficients range |
minviol | minimal absolute violation the row should achieve (w.r.t. sol) |
coefrange | buffer to store coefrange of cleaned up cut, or NULL if not of interest |
viol | buffer to store absolute violation of cleaned up cut in sol, or NULL if not of interest |
Definition at line 16545 of file cons_quadratic.c.
References SCIP_RowPrep::coefs, MAX, SCIP_RowPrep::nvars, REALABS, rowprepCleanupImproveCoefrange(), rowprepCleanupIntegralCoefs(), rowprepCleanupScaledown(), rowprepCleanupScaleup(), rowprepCleanupSide(), rowprepCleanupSortTerms(), SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPgetRowprepViolation(), SCIPgetSepaMinEfficacy(), SCIPinfoMessage(), SCIPprintRowprep(), and SCIPscaleRowprep().
Referenced by generateCut(), rowprepCleanupSide(), SCIP_DECL_CONSINITLP(), and separatePoint().
int SCIPscaleRowprep | ( | SCIP_ROWPREP * | rowprep, |
SCIP_Real | factor | ||
) |
scales a rowprep
rowprep | rowprep to be scaled |
factor | suggested scale factor |
Definition at line 16649 of file cons_quadratic.c.
References SCIP_RowPrep::coefs, SCIP_RowPrep::nvars, SCIPgetRowprepRowCons(), and SCIP_RowPrep::side.
Referenced by rowprepCleanupScaledown(), rowprepCleanupScaleup(), and SCIPcleanupRowprep().
SCIP_RETCODE SCIPgetRowprepRowCons | ( | SCIP * | scip, |
SCIP_ROW ** | row, | ||
SCIP_ROWPREP * | rowprep, | ||
SCIP_CONSHDLR * | conshdlr | ||
) |
generates a SCIP_ROW from a rowprep
scip | SCIP data structure |
row | buffer to store pointer to new row |
rowprep | rowprep to be turned into a row |
conshdlr | constraint handler |
Definition at line 16678 of file cons_quadratic.c.
References SCIP_RowPrep::coefs, FALSE, SCIP_RowPrep::local, SCIP_RowPrep::name, SCIP_RowPrep::nvars, SCIP_CALL, SCIP_OKAY, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIPaddVarsToRow(), SCIPcreateEmptyRowCons(), SCIPgetDepth(), SCIPgetRowprepRowSepa(), SCIPinfinity(), SCIP_RowPrep::side, SCIP_RowPrep::sidetype, TRUE, and SCIP_RowPrep::vars.
Referenced by addLinearizationCuts(), generateCut(), SCIP_DECL_CONSINITLP(), SCIPscaleRowprep(), and separatePoint().
SCIP_RETCODE SCIPgetRowprepRowSepa | ( | SCIP * | scip, |
SCIP_ROW ** | row, | ||
SCIP_ROWPREP * | rowprep, | ||
SCIP_SEPA * | sepa | ||
) |
generates a SCIP_ROW from a rowprep
scip | SCIP data structure |
row | buffer to store pointer to new row |
rowprep | rowprep to be turned into a row |
sepa | separator |
Definition at line 16700 of file cons_quadratic.c.
References SCIP_RowPrep::coefs, FALSE, SCIP_RowPrep::local, SCIP_RowPrep::name, SCIP_RowPrep::nvars, SCIP_CALL, SCIP_OKAY, SCIP_SIDETYPE_LEFT, SCIP_SIDETYPE_RIGHT, SCIPaddVarsToRow(), SCIPcreateEmptyRowSepa(), SCIPgetDepth(), SCIPinfinity(), SCIP_RowPrep::side, SCIP_RowPrep::sidetype, TRUE, and SCIP_RowPrep::vars.
Referenced by SCIPgetRowprepRowCons().