methods for nonlinear data
Functions | |
void | SCIPaddSquareLinearization (SCIP *scip, SCIP_Real sqrcoef, SCIP_Real refpoint, SCIP_Bool isint, SCIP_Real *lincoef, SCIP_Real *linconstant, SCIP_Bool *success) |
void | SCIPaddSquareSecant (SCIP *scip, SCIP_Real sqrcoef, SCIP_Real lb, SCIP_Real ub, SCIP_Real refpoint, SCIP_Real *lincoef, SCIP_Real *linconstant, SCIP_Bool *success) |
void | SCIPaddBilinLinearization (SCIP *scip, SCIP_Real bilincoef, SCIP_Real refpointx, SCIP_Real refpointy, SCIP_Real *lincoefx, SCIP_Real *lincoefy, SCIP_Real *linconstant, SCIP_Bool *success) |
void | SCIPaddBilinMcCormick (SCIP *scip, SCIP_Real bilincoef, SCIP_Real lbx, SCIP_Real ubx, SCIP_Real refpointx, SCIP_Real lby, SCIP_Real uby, SCIP_Real refpointy, SCIP_Bool overestimate, SCIP_Real *lincoefx, SCIP_Real *lincoefy, SCIP_Real *linconstant, SCIP_Bool *success) |
void | SCIPcomputeBilinEnvelope1 (SCIP *scip, SCIP_Real bilincoef, SCIP_Real lbx, SCIP_Real ubx, SCIP_Real refpointx, SCIP_Real lby, SCIP_Real uby, SCIP_Real refpointy, SCIP_Bool overestimate, SCIP_Real xcoef, SCIP_Real ycoef, SCIP_Real constant, SCIP_Real *RESTRICT lincoefx, SCIP_Real *RESTRICT lincoefy, SCIP_Real *RESTRICT linconstant, SCIP_Bool *RESTRICT success) |
void | SCIPcomputeBilinEnvelope2 (SCIP *scip, SCIP_Real bilincoef, SCIP_Real lbx, SCIP_Real ubx, SCIP_Real refpointx, SCIP_Real lby, SCIP_Real uby, SCIP_Real refpointy, SCIP_Bool overestimate, SCIP_Real alpha1, SCIP_Real beta1, SCIP_Real gamma1, SCIP_Real alpha2, SCIP_Real beta2, SCIP_Real gamma2, SCIP_Real *RESTRICT lincoefx, SCIP_Real *RESTRICT lincoefy, SCIP_Real *RESTRICT linconstant, SCIP_Bool *RESTRICT success) |
SCIP_RETCODE | SCIPcreateNlpiProb (SCIP *scip, SCIP_NLPI *nlpi, SCIP_NLROW **nlrows, int nnlrows, SCIP_NLPIPROBLEM *nlpiprob, SCIP_HASHMAP *var2idx, SCIP_Real *nlscore, SCIP_Real cutoffbound, SCIP_Bool setobj, SCIP_Bool onlyconvex) |
SCIP_RETCODE | SCIPupdateNlpiProb (SCIP *scip, SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *nlpiprob, SCIP_HASHMAP *var2nlpiidx, SCIP_VAR **nlpivars, int nlpinvars, SCIP_Real cutoffbound) |
SCIP_RETCODE | SCIPaddNlpiProbRows (SCIP *scip, SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *nlpiprob, SCIP_HASHMAP *var2idx, SCIP_ROW **rows, int nrows) |
Nonlinear Methods | |
static void | computeBilinEnvelope2 (SCIP *scip, SCIP_Real x, SCIP_Real y, SCIP_Real mi, SCIP_Real qi, SCIP_Real mj, SCIP_Real qj, SCIP_Real *RESTRICT xi, SCIP_Real *RESTRICT yi, SCIP_Real *RESTRICT xj, SCIP_Real *RESTRICT yj, SCIP_Real *RESTRICT xcoef, SCIP_Real *RESTRICT ycoef, SCIP_Real *RESTRICT constant) |
void SCIPaddSquareLinearization | ( | SCIP * | scip, |
SCIP_Real | sqrcoef, | ||
SCIP_Real | refpoint, | ||
SCIP_Bool | isint, | ||
SCIP_Real * | lincoef, | ||
SCIP_Real * | linconstant, | ||
SCIP_Bool * | success | ||
) |
computes coefficients of linearization of a square term in a reference point
scip | SCIP data structure |
sqrcoef | coefficient of square term |
refpoint | point where to linearize |
isint | whether corresponding variable is a discrete variable, and thus linearization could be moved |
lincoef | buffer to add coefficient of linearization |
linconstant | buffer to add constant of linearization |
success | buffer to set to FALSE if linearization has failed due to large numbers |
Definition at line 33285 of file scip.c.
References FALSE, REALABS, SCIP_Real, SCIPfloor(), SCIPisInfinity(), and SCIPisIntegral().
Referenced by addBilinearTermToCut(), generateCutConvex(), and generateCutNonConvex().
void SCIPaddSquareSecant | ( | SCIP * | scip, |
SCIP_Real | sqrcoef, | ||
SCIP_Real | lb, | ||
SCIP_Real | ub, | ||
SCIP_Real | refpoint, | ||
SCIP_Real * | lincoef, | ||
SCIP_Real * | linconstant, | ||
SCIP_Bool * | success | ||
) |
computes coefficients of secant of a square term
scip | SCIP data structure |
sqrcoef | coefficient of square term |
lb | lower bound on variable |
ub | upper bound on variable |
refpoint | point for which to compute value of linearization |
lincoef | buffer to add coefficient of secant |
linconstant | buffer to add constant of secant |
success | buffer to set to FALSE if secant has failed due to large numbers or unboundedness |
Definition at line 33353 of file scip.c.
References FALSE, REALABS, SCIP_Real, SCIPisGE(), SCIPisInfinity(), and SCIPisLE().
Referenced by addBilinearTermToCut(), and generateCutNonConvex().
void SCIPaddBilinLinearization | ( | SCIP * | scip, |
SCIP_Real | bilincoef, | ||
SCIP_Real | refpointx, | ||
SCIP_Real | refpointy, | ||
SCIP_Real * | lincoefx, | ||
SCIP_Real * | lincoefy, | ||
SCIP_Real * | linconstant, | ||
SCIP_Bool * | success | ||
) |
computes coefficients of linearization of a bilinear term in a reference point
scip | SCIP data structure |
bilincoef | coefficient of bilinear term |
refpointx | point where to linearize first variable |
refpointy | point where to linearize second variable |
lincoefx | buffer to add coefficient of first variable in linearization |
lincoefy | buffer to add coefficient of second variable in linearization |
linconstant | buffer to add constant of linearization |
success | buffer to set to FALSE if linearization has failed due to large numbers |
Definition at line 33403 of file scip.c.
References FALSE, REALABS, SCIP_Real, and SCIPisInfinity().
Referenced by generateCutConvex().
void SCIPaddBilinMcCormick | ( | SCIP * | scip, |
SCIP_Real | bilincoef, | ||
SCIP_Real | lbx, | ||
SCIP_Real | ubx, | ||
SCIP_Real | refpointx, | ||
SCIP_Real | lby, | ||
SCIP_Real | uby, | ||
SCIP_Real | refpointy, | ||
SCIP_Bool | overestimate, | ||
SCIP_Real * | lincoefx, | ||
SCIP_Real * | lincoefy, | ||
SCIP_Real * | linconstant, | ||
SCIP_Bool * | success | ||
) |
computes coefficients of McCormick under- or overestimation of a bilinear term
scip | SCIP data structure |
bilincoef | coefficient of bilinear term |
lbx | lower bound on first variable |
ubx | upper bound on first variable |
refpointx | reference point for first variable |
lby | lower bound on second variable |
uby | upper bound on second variable |
refpointy | reference point for second variable |
overestimate | whether to compute an overestimator instead of an underestimator |
lincoefx | buffer to add coefficient of first variable in linearization |
lincoefy | buffer to add coefficient of second variable in linearization |
linconstant | buffer to add constant of linearization |
success | buffer to set to FALSE if linearization has failed due to large numbers |
Definition at line 33450 of file scip.c.
References FALSE, MAX, REALABS, SCIP_Real, SCIPdebugMsg, SCIPisGE(), SCIPisInfinity(), SCIPisLE(), and SCIPisRelEQ().
Referenced by addBilinearTermToCut(), and generateCutNonConvex().
void SCIPcomputeBilinEnvelope1 | ( | SCIP * | scip, |
SCIP_Real | bilincoef, | ||
SCIP_Real | lbx, | ||
SCIP_Real | ubx, | ||
SCIP_Real | refpointx, | ||
SCIP_Real | lby, | ||
SCIP_Real | uby, | ||
SCIP_Real | refpointy, | ||
SCIP_Bool | overestimate, | ||
SCIP_Real | xcoef, | ||
SCIP_Real | ycoef, | ||
SCIP_Real | constant, | ||
SCIP_Real *RESTRICT | lincoefx, | ||
SCIP_Real *RESTRICT | lincoefy, | ||
SCIP_Real *RESTRICT | linconstant, | ||
SCIP_Bool *RESTRICT | success | ||
) |
computes coefficients of linearization of a bilinear term in a reference point when given a linear inequality involving only the variables of the bilinear term
scip | SCIP data structure |
bilincoef | coefficient of bilinear term |
lbx | lower bound on first variable |
ubx | upper bound on first variable |
refpointx | reference point for first variable |
lby | lower bound on second variable |
uby | upper bound on second variable |
refpointy | reference point for second variable |
overestimate | whether to compute an overestimator instead of an underestimator |
xcoef | x coefficient of linear inequality; must be in {-1,0,1} |
ycoef | y coefficient of linear inequality |
constant | constant of linear inequality |
lincoefx | buffer to store coefficient of first variable in linearization |
lincoefy | buffer to store coefficient of second variable in linearization |
linconstant | buffer to store constant of linearization |
success | buffer to store whether linearization was successful |
Definition at line 33659 of file scip.c.
References FALSE, SCIP_INVALID, SCIP_Real, SCIPisFeasEQ(), SCIPisFeasGE(), SCIPisFeasGT(), SCIPisFeasLE(), SCIPisGE(), SCIPisInfinity(), SCIPisLE(), SCIPisNegative(), and SCIPisZero().
Referenced by updateBilinearRelaxation().
void SCIPcomputeBilinEnvelope2 | ( | SCIP * | scip, |
SCIP_Real | bilincoef, | ||
SCIP_Real | lbx, | ||
SCIP_Real | ubx, | ||
SCIP_Real | refpointx, | ||
SCIP_Real | lby, | ||
SCIP_Real | uby, | ||
SCIP_Real | refpointy, | ||
SCIP_Bool | overestimate, | ||
SCIP_Real | xcoef1, | ||
SCIP_Real | ycoef1, | ||
SCIP_Real | constant1, | ||
SCIP_Real | xcoef2, | ||
SCIP_Real | ycoef2, | ||
SCIP_Real | constant2, | ||
SCIP_Real *RESTRICT | lincoefx, | ||
SCIP_Real *RESTRICT | lincoefy, | ||
SCIP_Real *RESTRICT | linconstant, | ||
SCIP_Bool *RESTRICT | success | ||
) |
computes coefficients of linearization of a bilinear term in a reference point when given two linear inequality involving only the variables of the bilinear term
scip | SCIP data structure |
bilincoef | coefficient of bilinear term |
lbx | lower bound on first variable |
ubx | upper bound on first variable |
refpointx | reference point for first variable |
lby | lower bound on second variable |
uby | upper bound on second variable |
refpointy | reference point for second variable |
overestimate | whether to compute an overestimator instead of an underestimator |
xcoef1 | x coefficient of linear inequality; must be in {-1,0,1} |
ycoef1 | y coefficient of linear inequality |
constant1 | constant of linear inequality |
xcoef2 | x coefficient of linear inequality; must be in {-1,0,1} |
ycoef2 | y coefficient of linear inequality |
constant2 | constant of linear inequality |
lincoefx | buffer to store coefficient of first variable in linearization |
lincoefy | buffer to store coefficient of second variable in linearization |
linconstant | buffer to store constant of linearization |
success | buffer to store whether linearization was successful |
Definition at line 33893 of file scip.c.
References computeBilinEnvelope2(), FALSE, SCIP_INVALID, SCIP_Real, SCIPisEQ(), SCIPisFeasEQ(), SCIPisFeasGE(), SCIPisFeasGT(), SCIPisFeasLE(), SCIPisGE(), SCIPisInfinity(), SCIPisLE(), and SCIPisNegative().
Referenced by updateBilinearRelaxation().
SCIP_RETCODE SCIPcreateNlpiProb | ( | SCIP * | scip, |
SCIP_NLPI * | nlpi, | ||
SCIP_NLROW ** | nlrows, | ||
int | nnlrows, | ||
SCIP_NLPIPROBLEM * | nlpiprob, | ||
SCIP_HASHMAP * | var2idx, | ||
SCIP_Real * | nlscore, | ||
SCIP_Real | cutoffbound, | ||
SCIP_Bool | setobj, | ||
SCIP_Bool | onlyconvex | ||
) |
creates an NLP relaxation and stores it in a given NLPI problem; the function computes for each variable which the number of non-linearly occurrences and stores it in the nlscore array
scip | SCIP data structure |
nlpi | interface to NLP solver |
nlrows | nonlinear rows |
nnlrows | total number of nonlinear rows |
nlpiprob | empty nlpi problem |
var2idx | empty hash map to store mapping between variables and indices in nlpi problem |
nlscore | array to store the score of each nonlinear variable (NULL if not needed) |
cutoffbound | cutoff bound |
setobj | should the objective function be set? |
onlyconvex | filter only for convex constraints |
Definition at line 34026 of file scip.c.
References BMSclearMemoryArray, SCIP_QuadElement::coef, FALSE, SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, SCIP_Bool, SCIP_CALL, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPdebugMsg, SCIPexprtreeGetNVars(), SCIPexprtreeGetVars(), SCIPfreeBufferArray, SCIPgetNVars(), SCIPgetVars(), SCIPhashmapExists(), SCIPhashmapGetImage(), SCIPhashmapInsert(), SCIPinfinity(), SCIPisInfinity(), SCIPisZero(), SCIPnlpiAddConstraints(), SCIPnlpiAddVars(), SCIPnlpiSetObjective(), SCIPnlrowGetConstant(), SCIPnlrowGetCurvature(), SCIPnlrowGetExprtree(), SCIPnlrowGetLhs(), SCIPnlrowGetLinearCoefs(), SCIPnlrowGetLinearVars(), SCIPnlrowGetName(), SCIPnlrowGetNLinearVars(), SCIPnlrowGetNQuadElems(), SCIPnlrowGetQuadElems(), SCIPnlrowGetQuadVars(), SCIPnlrowGetRhs(), SCIPswapInts(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetObj(), SCIPvarGetUbLocal(), and TRUE.
Referenced by applyNlobbt(), computeInteriorPoint(), createNLP(), SCIP_DECL_RELAXEXEC(), and SCIP_DECL_SEPAEXECLP().
SCIP_RETCODE SCIPupdateNlpiProb | ( | SCIP * | scip, |
SCIP_NLPI * | nlpi, | ||
SCIP_NLPIPROBLEM * | nlpiprob, | ||
SCIP_HASHMAP * | var2nlpiidx, | ||
SCIP_VAR ** | nlpivars, | ||
int | nlpinvars, | ||
SCIP_Real | cutoffbound | ||
) |
updates bounds of each variable and the cutoff row in the nlpiproblem
scip | SCIP data structure |
nlpi | interface to NLP solver |
nlpiprob | nlpi problem representing the convex NLP relaxation |
var2nlpiidx | mapping between variables and nlpi indices |
nlpivars | array containing all variables of the nlpi |
nlpinvars | total number of nlpi variables |
cutoffbound | new cutoff bound |
Definition at line 34349 of file scip.c.
References SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPdebugMsg, SCIPfreeBufferArray, SCIPhashmapExists(), SCIPhashmapGetImage(), SCIPinfinity(), SCIPnlpiChgConsSides(), SCIPnlpiChgVarBounds(), SCIPvarGetLbLocal(), and SCIPvarGetUbLocal().
Referenced by applyNlobbt(), and SCIP_DECL_SEPAEXECLP().
SCIP_RETCODE SCIPaddNlpiProbRows | ( | SCIP * | scip, |
SCIP_NLPI * | nlpi, | ||
SCIP_NLPIPROBLEM * | nlpiprob, | ||
SCIP_HASHMAP * | var2idx, | ||
SCIP_ROW ** | rows, | ||
int | nrows | ||
) |
adds linear rows to the NLP relaxation
scip | SCIP data structure |
nlpi | interface to NLP solver |
nlpiprob | nlpi problem |
var2idx | empty hash map to store mapping between variables and indices in nlpi problem |
rows | rows to add |
nrows | total number of rows to add |
Definition at line 34401 of file scip.c.
References SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPcolGetVar(), SCIPdebugMsg, SCIPfreeBufferArray, SCIPgetNVars(), SCIPhashmapExists(), SCIPhashmapGetImage(), SCIPnlpiAddConstraints(), SCIProwGetCols(), SCIProwGetConstant(), SCIProwGetLhs(), SCIProwGetName(), SCIProwGetNNonz(), SCIProwGetRhs(), and SCIProwGetVals().
Referenced by applyNlobbt(), computeInteriorPoint(), SCIP_DECL_RELAXEXEC(), and SCIP_DECL_SEPAEXECLP().
|
static |
helper function to compute the convex envelope of a bilinear term when two linear inequalities are given; we use the same notation and formulas as in Locatelli 2016
scip | SCIP data structure |
x | reference point for x |
y | reference point for y |
mi | coefficient of x in the first linear inequality |
qi | constant in the first linear inequality |
mj | coefficient of x in the second linear inequality |
qj | constant in the second linear inequality |
xi | buffer to store x coordinate of the first point |
yi | buffer to store y coordinate of the first point |
xj | buffer to store x coordinate of the second point |
yj | buffer to store y coordinate of the second point |
xcoef | buffer to store the x coefficient of the envelope |
ycoef | buffer to store the y coefficient of the envelope |
constant | buffer to store the constant of the envelope |
Definition at line 33824 of file scip.c.
References REALABS, and SCIPisEQ().
Referenced by SCIPcomputeBilinEnvelope2().