cons_quadratic.h
Go to the documentation of this file.
18 * @brief constraint handler for quadratic constraints \f$\textrm{lhs} \leq \sum_{i,j=1}^n a_{i,j} x_ix_j + \sum_{i=1}^n b_i x_i \leq \textrm{rhs}\f$
23 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
70 * For semidefinite matrices \f$A=(a_{i,j})_{i,j}\f$, cuts based on linearization of \f$\langle x, Ax\rangle\f$ are implemented.
71 * For underestimating a non-convex term, McCormick underestimators and secants for univariate concave quadratic terms are implemented.
72 * If \f$\langle x, Ax\rangle\f$ is factorable (i.e., can be written as product of two linear functions),
73 * specialized separation techniques (e.g., lifted tangent inequalities) that take the constraint sides into account are applied.
75 * Branching is performed for variables in nonconvex terms, if the relaxation solution cannot be separated.
78 * During presolve, variable products which contain binary variables may be reformulated into linear constraints, thereby introducing new variables.
83 * <a href="http://dx.doi.org/10.1007/978-1-4614-1927-3">Extending a CIP framework to solve MIQCPs</a>@n
90 * Decomposition of Multistage Stochastic Programs and a Constraint Integer Programming Approach to Mixed-Integer Nonlinear Programming@n
119 * except for temporary reasons, we assume that the index of var1 is smaller than the index of var2
176 int nbinlin, int nbinquad, int nintlin, int nintquad, int nimpllin, int nimplquad, int ncontlin, int ncontquad, \
177 SCIP_Bool integral, int* nupgdconss, SCIP_CONS** upgdconss, int upgdconsssize, SCIP_PRESOLTIMING presoltiming)
183 SCIP_DECL_QUADCONSUPGD((*quadconsupgd)), /**< method to call for upgrading quadratic constraint */
197 * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
206 SCIP_Real* lincoefs, /**< coefficients of variables in linear part (b_i) or NULL if nlinvars == 0 */
208 SCIP_VAR** quadvars1, /**< array with first variables in quadratic terms (y_j) or NULL if nquadterms == 0 */
209 SCIP_VAR** quadvars2, /**< array with second variables in quadratic terms (z_j) or NULL if nquadterms == 0 */
210 SCIP_Real* quadcoeffs, /**< array with coefficients of quadratic terms (a_j) or NULL if nquadterms == 0 */
236 * in its most basic variant, i. e., with all constraint flags set to their default values, which can be set
248 * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
270 * \ell \leq \sum_{i=1}^n b_i x_i + \sum_{j=1}^m (a_j y_j^2 + b_j y_j) + \sum_{k=1}^p c_k v_k w_k \leq u.
273 * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
297 SCIP_Bool removable /**< should the constraint be removed from the LP due to aging or cleanup? */
301 * in its most basic variant, i. e., with all constraint flags set to their default values, which can be set
306 * \ell \leq \sum_{i=1}^n b_i x_i + \sum_{j=1}^m (a_j y_j^2 + b_j y_j) + \sum_{k=1}^p c_kv_kw_k \leq u.
311 * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
329 /** Adds a constant to the constraint function, that is, subtracts a constant from both sides */
457 * @note If the quadratic variable terms have not been sorted before, then a search may reorder the current order of the terms.
500 /** get index of a variable in linvars that may be decreased without making any other constraint infeasible, or -1 if none */
507 /** get index of a variable in linvars that may be increased without making any other constraint infeasible, or -1 if none */
514 /** Check the quadratic function of a quadratic constraint for its semi-definiteness, if not done yet.
530 /** Indicates whether the quadratic function of a quadratic constraint is (known to be) concave.
549 * That is, checks whether each variable with a square term is fixed and for each bilinear term at least one variable is fixed.
570 * @note This method may only be called during problem creation stage for an original constraint.
581 * @note This method may only be called during problem creation stage for an original constraint.
608 /** changes the linear coefficient value for a given quadratic variable in a quadratic constraint data; if not
621 /** changes the square coefficient value for a given quadratic variable in a quadratic constraint data; if not
634 /** changes the bilinear coefficient value for a given quadratic variable in a quadratic constraint data; if not
648 /** returns the total number of bilinear terms that are contained in all quadratic constraints */
660 int* RESTRICT nunderests, /**< array to store the total number of constraints that require to underestimate a bilinear term */
661 int* RESTRICT noverests, /**< array to store the total number of constraints that require to overestimate a bilinear term */
662 SCIP_Real* maxnonconvexity /**< estimate of nonconvex eigenvalues of all quadratic constraints containing a bilinear term */
665 /** adds a globally valid inequality of the form xcoef x <= ycoef y + constant for a bilinear term (x,y)
667 * @note the indices of bilinear terms match with the entries of bilinear terms returned by SCIPgetAllBilinearTermsQuadratic
793 * Drops small or large coefficients if coefrange is too large, if this can be done by relaxing the cut.
797 * Scales coefficients and side down if they are large and if the minimal violation is still reached.
798 * Rounds coefficients close to integral values to integrals, if this can be done by relaxing the cut.
801 * After return, the terms in the rowprep will be sorted by absolute value of coefficient, in decreasing order.
810 SCIP_Real* coefrange, /**< buffer to store coefrange of cleaned up cut, or NULL if not of interest */
811 SCIP_Real* viol /**< buffer to store absolute violation of cleaned up cut in sol, or NULL if not of interest */
SCIP_VAR ** SCIPgetLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons)
Definition: cons_quadratic.c:14868
SCIP_RETCODE SCIPchgSquareCoefQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real coef)
Definition: cons_quadratic.c:15561
SCIP_RETCODE SCIPincludeConshdlrQuadratic(SCIP *scip)
Definition: cons_quadratic.c:14025
SCIP_RETCODE SCIPchgBilinCoefQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var1, SCIP_VAR *var2, SCIP_Real coef)
Definition: cons_quadratic.c:15630
SCIP_RETCODE SCIPaddQuadVarQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real lincoef, SCIP_Real sqrcoef)
Definition: cons_quadratic.c:14623
void SCIPaddConstantQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_Real constant)
Definition: cons_quadratic.c:14562
type definitions for miscellaneous datastructures
timing definitions for SCIP
Definition: struct_scip.h:58
type definitions for NLP management
int SCIPgetNAllBilinearTermsQuadratic(SCIP *scip)
Definition: cons_quadratic.c:15709
SCIP_RETCODE SCIPaddSquareCoefQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real coef)
Definition: cons_quadratic.c:14706
SCIP_RETCODE SCIPchgRhsQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_Real rhs)
Definition: cons_quadratic.c:15349
SCIP_RETCODE SCIPincludeQuadconsUpgrade(SCIP *scip, SCIP_DECL_QUADCONSUPGD((*quadconsupgd)), int priority, SCIP_Bool active, const char *conshdlrname)
Definition: cons_quadratic.c:14187
SCIP_RETCODE SCIPaddRowprepTerms(SCIP *scip, SCIP_ROWPREP *rowprep, int nvars, SCIP_VAR **vars, SCIP_Real *coefs)
Definition: cons_quadratic.c:16100
SCIP_RETCODE SCIPcleanupRowprep(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_SOL *sol, SCIP_Real maxcoefrange, SCIP_Real minviol, SCIP_Real *coefrange, SCIP_Real *viol)
Definition: cons_quadratic.c:16673
SCIP_RETCODE SCIPaddRowprepTerm(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_VAR *var, SCIP_Real coef)
Definition: cons_quadratic.c:16075
Definition: struct_var.h:198
Definition: cons_quadratic.h:104
SCIP_RETCODE SCIPchgLinearCoefQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real coef)
Definition: cons_quadratic.c:15468
SCIP_RETCODE SCIPcreateConsBasicQuadratic2(SCIP *scip, SCIP_CONS **cons, const char *name, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nquadvarterms, SCIP_QUADVARTERM *quadvarterms, int nbilinterms, SCIP_BILINTERM *bilinterms, SCIP_Real lhs, SCIP_Real rhs)
Definition: cons_quadratic.c:14538
type definitions for return codes for SCIP methods
Definition: struct_sepa.h:37
SCIP_RETCODE SCIPcreateConsBasicQuadratic(SCIP *scip, SCIP_CONS **cons, const char *name, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nquadterms, SCIP_VAR **quadvars1, SCIP_VAR **quadvars2, SCIP_Real *quadcoefs, SCIP_Real lhs, SCIP_Real rhs)
Definition: cons_quadratic.c:14445
SCIP_Real SCIPgetLhsQuadratic(SCIP *scip, SCIP_CONS *cons)
Definition: cons_quadratic.c:14982
SCIP_RETCODE SCIPaddLinearVarQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real coef)
Definition: cons_quadratic.c:14598
SCIP_RETCODE SCIPcreateConsQuadratic(SCIP *scip, SCIP_CONS **cons, const char *name, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nquadterms, SCIP_VAR **quadvars1, SCIP_VAR **quadvars2, SCIP_Real *quadcoeffs, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable)
Definition: cons_quadratic.c:14263
int SCIPgetNQuadVarTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
Definition: cons_quadratic.c:14895
type definitions for LP management
Definition: struct_sol.h:63
SCIP_RETCODE SCIPaddBilinearIneqQuadratic(SCIP *scip, SCIP_VAR *x, SCIP_VAR *y, int idx, SCIP_Real xcoef, SCIP_Real ycoef, SCIP_Real constant, SCIP_Bool *success)
Definition: cons_quadratic.c:15819
int SCIPgetNBilinTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
Definition: cons_quadratic.c:14956
Definition: struct_misc.h:127
SCIP_Bool SCIPisConcaveQuadratic(SCIP *scip, SCIP_CONS *cons)
Definition: cons_quadratic.c:15074
void SCIPfreeRowprep(SCIP *scip, SCIP_ROWPREP **rowprep)
Definition: cons_quadratic.c:15982
SCIP_RETCODE SCIPchgLhsQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_Real lhs)
Definition: cons_quadratic.c:15304
struct SCIP_QuadVarEventData SCIP_QUADVAREVENTDATA
Definition: cons_quadratic.h:100
SCIP_RETCODE SCIPfindQuadVarTermQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, int *pos)
Definition: cons_quadratic.c:14938
SCIP_RETCODE SCIPensureRowprepSize(SCIP *scip, SCIP_ROWPREP *rowprep, int size)
Definition: cons_quadratic.c:16024
Definition: struct_cons.h:37
SCIP_RETCODE SCIPgetAllBilinearTermsQuadratic(SCIP *scip, SCIP_VAR **RESTRICT x, SCIP_VAR **RESTRICT y, int *RESTRICT nbilinterms, int *RESTRICT nunderests, int *RESTRICT noverests, SCIP_Real *maxnonconvexity)
Definition: cons_quadratic.c:15730
SCIP_Real SCIPgetRowprepViolation(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_SOL *sol)
Definition: cons_quadratic.c:16158
Definition: struct_cons.h:117
type definitions for SCIP's main datastructure
SCIP_Real * SCIPgetCoefsLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons)
Definition: cons_quadratic.c:14882
int SCIPgetLinvarMayDecreaseQuadratic(SCIP *scip, SCIP_CONS *cons)
Definition: cons_quadratic.c:15006
void SCIPaddRowprepSide(SCIP_ROWPREP *rowprep, SCIP_Real side)
Definition: cons_quadratic.c:16133
SCIP_RETCODE SCIPcreateRowprep(SCIP *scip, SCIP_ROWPREP **rowprep, SCIP_SIDETYPE sidetype, SCIP_Bool local)
Definition: cons_quadratic.c:15962
SCIP_RETCODE SCIPgetNlRowQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_NLROW **nlrow)
Definition: cons_quadratic.c:14829
type definitions for problem variables
SCIP_BILINTERM * SCIPgetBilinTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
Definition: cons_quadratic.c:14970
SCIP_Real SCIPgetRhsQuadratic(SCIP *scip, SCIP_CONS *cons)
Definition: cons_quadratic.c:14994
SCIP_RETCODE SCIPgetViolationQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Real *violation)
Definition: cons_quadratic.c:15091
SCIP_RETCODE SCIPaddBilinTermQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var1, SCIP_VAR *var2, SCIP_Real coef)
Definition: cons_quadratic.c:14763
void SCIPmergeRowprepTerms(SCIP *scip, SCIP_ROWPREP *rowprep)
Definition: cons_quadratic.c:16191
Definition: struct_lp.h:192
Definition: cons_quadratic.h:121
SCIP_RETCODE SCIPgetRowprepRowCons(SCIP *scip, SCIP_ROW **row, SCIP_ROWPREP *rowprep, SCIP_CONSHDLR *conshdlr)
Definition: cons_quadratic.c:16806
type definitions for storing primal CIP solutions
SCIP_Bool SCIPisLinearLocalQuadratic(SCIP *scip, SCIP_CONS *cons)
Definition: cons_quadratic.c:15120
SCIP_RETCODE SCIPcheckCurvatureQuadratic(SCIP *scip, SCIP_CONS *cons)
Definition: cons_quadratic.c:15044
int SCIPgetLinvarMayIncreaseQuadratic(SCIP *scip, SCIP_CONS *cons)
Definition: cons_quadratic.c:15025
int SCIPgetNLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons)
Definition: cons_quadratic.c:14854
SCIP_RETCODE SCIPcopyRowprep(SCIP *scip, SCIP_ROWPREP **target, SCIP_ROWPREP *source)
Definition: cons_quadratic.c:15997
type definitions for separators
SCIP_RETCODE SCIPgetFeasibilityQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Real *feasibility)
Definition: cons_quadratic.c:15391
SCIP_RETCODE SCIPsortQuadVarTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
Definition: cons_quadratic.c:14921
int SCIPscaleRowprep(SCIP_ROWPREP *rowprep, SCIP_Real factor)
Definition: cons_quadratic.c:16777
SCIP_RETCODE SCIPaddToNlpiProblemQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *nlpiprob, SCIP_HASHMAP *scipvar2nlpivar, SCIP_Bool names)
Definition: cons_quadratic.c:15166
Definition: struct_nlp.h:63
SCIP_RETCODE SCIPcreateConsQuadratic2(SCIP *scip, SCIP_CONS **cons, const char *name, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nquadvarterms, SCIP_QUADVARTERM *quadvarterms, int nbilinterms, SCIP_BILINTERM *bilinterms, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable)
Definition: cons_quadratic.c:14476
SCIP_RETCODE SCIPaddQuadVarLinearCoefQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real coef)
Definition: cons_quadratic.c:14653
common defines and data types used in all packages of SCIP
SCIP_QUADVARTERM * SCIPgetQuadVarTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
Definition: cons_quadratic.c:14909
void SCIPprintRowprep(SCIP *scip, SCIP_ROWPREP *rowprep, FILE *file)
Definition: cons_quadratic.c:16050
Definition: objbenders.h:33
SCIP_RETCODE SCIPgetRowprepRowSepa(SCIP *scip, SCIP_ROW **row, SCIP_ROWPREP *rowprep, SCIP_SEPA *sepa)
Definition: cons_quadratic.c:16828
Definition: nlpi_all.c:47
SCIP_Bool SCIPisConvexQuadratic(SCIP *scip, SCIP_CONS *cons)
Definition: cons_quadratic.c:15057
SCIP_RETCODE SCIPgetActivityQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Real *activity)
Definition: cons_quadratic.c:15433
type definitions for constraints and constraint handlers
type definitions for specific NLP solver interfaces
Definition: cons_quadratic.h:134
void SCIPaddRowprepConstant(SCIP_ROWPREP *rowprep, SCIP_Real constant)
Definition: cons_quadratic.c:16147
Definition: struct_nlpi.h:35