Detailed Description
methods for nonlinear data
Function Documentation
◆ SCIPaddSquareLinearization()
SCIP_EXPORT 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
- Parameters
-
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 53 of file scip_nonlinear.c.
References FALSE, NULL, REALABS, SCIP_Real, SCIPfloor(), SCIPisInfinity(), and SCIPisIntegral().
Referenced by addBilinearTermToCut(), generateCutConvex(), and generateCutNonConvex().
◆ SCIPaddSquareSecant()
SCIP_EXPORT 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
- Parameters
-
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 121 of file scip_nonlinear.c.
References FALSE, NULL, REALABS, SCIP_Real, SCIPisGE(), SCIPisInfinity(), and SCIPisLE().
Referenced by addBilinearTermToCut(), and generateCutNonConvex().
◆ SCIPaddBilinLinearization()
SCIP_EXPORT 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
- Parameters
-
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 171 of file scip_nonlinear.c.
References FALSE, NULL, REALABS, SCIP_Real, and SCIPisInfinity().
Referenced by generateCutConvex().
◆ SCIPaddBilinMcCormick()
SCIP_EXPORT 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
- Parameters
-
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 218 of file scip_nonlinear.c.
References FALSE, MAX, NULL, REALABS, SCIP_Real, SCIPdebugMsg, SCIPisGE(), SCIPisInfinity(), SCIPisLE(), and SCIPisRelEQ().
Referenced by addBilinearTermToCut(), and generateCutNonConvex().
◆ SCIPcomputeBilinEnvelope1()
SCIP_EXPORT 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
- Note
- the formulas are extracted from "Convex envelopes of bivariate functions through the solution of KKT systems" by Marco Locatelli
- Parameters
-
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 427 of file scip_nonlinear.c.
References FALSE, NULL, QUAD, QUAD_SCALE, QUAD_TO_DBL, SCIP_INVALID, SCIP_Real, SCIPisFeasEQ(), SCIPisFeasGE(), SCIPisFeasGT(), SCIPisFeasLE(), SCIPisGE(), SCIPisInfinity(), SCIPisLE(), SCIPisNegative(), SCIPisZero(), SCIPquadprecDivDD, SCIPquadprecDivQQ, SCIPquadprecProdDD, SCIPquadprecProdQD, SCIPquadprecProdQQ, SCIPquadprecSquareQ, SCIPquadprecSumDD, SCIPquadprecSumQD, and SCIPquadprecSumQQ.
Referenced by updateBilinearRelaxation().
◆ SCIPcomputeBilinEnvelope2()
SCIP_EXPORT 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
- Note
- the formulas are extracted from "Convex envelopes of bivariate functions through the solution of KKT systems" by Marco Locatelli
- Parameters
-
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 826 of file scip_nonlinear.c.
References computeBilinEnvelope2(), FALSE, NULL, SCIP_INVALID, SCIP_Real, SCIPisEQ(), SCIPisFeasEQ(), SCIPisFeasGE(), SCIPisFeasGT(), SCIPisFeasLE(), SCIPisGE(), SCIPisInfinity(), SCIPisLE(), SCIPisNegative(), and SCIPisRelEQ().
Referenced by updateBilinearRelaxation().
◆ SCIPcreateNlpiProb()
SCIP_EXPORT SCIP_RETCODE SCIPcreateNlpiProb | ( | SCIP * | scip, |
SCIP_NLPI * | nlpi, | ||
SCIP_NLROW ** | nlrows, | ||
int | nnlrows, | ||
SCIP_NLPIPROBLEM * | nlpiprob, | ||
SCIP_HASHMAP * | var2idx, | ||
SCIP_HASHMAP * | nlrow2idx, | ||
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
- Note
- the first row corresponds always to the cutoff row (even if cutoffbound is SCIPinfinity(scip))
- Parameters
-
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 nlrow2idx empty hash map to store mapping between variables and indices in nlpi problem, can be NULL 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 959 of file scip_nonlinear.c.
References BMSclearMemoryArray, SCIP_QuadElement::coef, FALSE, SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, NULL, SCIP_Bool, SCIP_CALL, SCIP_EXPRCURV_CONCAVE, SCIP_EXPRCURV_CONVEX, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPdebugMsg, SCIPexprtreeGetNVars(), SCIPexprtreeGetVars(), SCIPfreeBufferArray, SCIPgetNVars(), SCIPgetVars(), SCIPhashmapExists(), SCIPhashmapGetImageInt(), SCIPhashmapInsertInt(), 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(), createAuxiliaryNonlinearSubproblem(), createNLP(), SCIP_DECL_RELAXEXEC(), and SCIP_DECL_SEPAEXECLP().
◆ SCIPupdateNlpiProb()
SCIP_EXPORT 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
- Parameters
-
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 1292 of file scip_nonlinear.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPdebugMsg, SCIPfreeBufferArray, SCIPhashmapExists(), SCIPhashmapGetImageInt(), SCIPinfinity(), SCIPnlpiChgConsSides(), SCIPnlpiChgVarBounds(), SCIPvarGetLbLocal(), and SCIPvarGetUbLocal().
Referenced by applyNlobbt(), SCIP_DECL_SEPAEXECLP(), and updateAuxiliaryNonlinearSubproblem().
◆ SCIPaddNlpiProbRows()
SCIP_EXPORT 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
- Parameters
-
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 1344 of file scip_nonlinear.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPcolGetVar(), SCIPdebugMsg, SCIPfreeBufferArray, SCIPgetNVars(), SCIPhashmapExists(), SCIPhashmapGetImageInt(), SCIPnlpiAddConstraints(), SCIProwGetCols(), SCIProwGetConstant(), SCIProwGetLhs(), SCIProwGetName(), SCIProwGetNNonz(), SCIProwGetRhs(), and SCIProwGetVals().
Referenced by applyNlobbt(), computeInteriorPoint(), SCIP_DECL_RELAXEXEC(), and SCIP_DECL_SEPAEXECLP().