6767
6868#include "scip/cons_linear.h" /* for SCIPcreateConsLinear */
6969#include "scip/cons_nonlinear.h" /* for newer SCIP versions */
70- #if SCIP_VERSION < 1000
71- #include "scip/cons_quadratic.h" /* for SCIPcreateConsBasicQuadratic */
72- #include "scip/cons_soc.h" /* for SCIPcreateConsSOC */
73- #endif
7470#include "scip/cons_linear.h" /* for separateSol() */
7571#include "scip/scip_cons.h" /* for SCIPgetConsVars */
7672#include "scip/scip.h" /* for SCIPallocBufferArray, etc */
7773#include "scip/def.h"
78- #if SCIP_VERSION >= 900
7974#include "scip/symmetry_graph.h"
8075#include "symmetry/struct_symmetry.h"
81- #endif
8276
8377#ifdef OMP
8478#include "omp.h" /* for changing the number of threads */
@@ -2986,16 +2980,11 @@ SCIP_RETCODE addTwoMinorSOCConstraints(
29862980 /* add SOC constraint (if not solving LPs only propagate) */
29872981 (void ) SCIPsnprintf (name , SCIP_MAXSTRLEN , "2x2minorSOC#%d#%d#%d" , c , s , t );
29882982
2989- #if ( SCIP_VERSION >= 800 || ( SCIP_VERSION < 800 && SCIP_APIVERSION >= 100 ) )
29902983 consvals [0 ] = 4.0 ; /* correct to 4, because coefficient is outside of square */
29912984 consvars [2 ] = matrixsumvar ;
29922985 consvals [2 ] = -1.0 ;
29932986 SCIP_CALL ( SCIPcreateConsQuadraticNonlinear (scip , & cons , name , 0 , NULL , NULL , 3 , consvars , consvars , consvals ,
29942987 - SCIPinfinity (scip ), 0.0 , TRUE, ! solvesdps , ! solvesdps , ! solvesdps , TRUE, FALSE, FALSE, TRUE, TRUE) );
2995- #else
2996- SCIP_CALL ( SCIPcreateConsSOC (scip , & cons , name , 2 , consvars , consvals , NULL , 0.0 , matrixsumvar , 1.0 , 0.0 ,
2997- TRUE, ! solvesdps , ! solvesdps , ! solvesdps , TRUE, FALSE, FALSE, TRUE, TRUE) );
2998- #endif
29992988 SCIP_CALL ( SCIPaddCons (scip , cons ) );
30002989
30012990#ifdef SCIP_MORE_DEBUG
@@ -3649,7 +3638,7 @@ SCIP_RETCODE addRank1QuadConss(
36493638 (void ) SCIPsnprintf (name , SCIP_MAXSTRLEN , "quadcons#%d#%d#%d" , i , j , c );
36503639
36513640 /* create quadratic constraint */
3652- SCIP_CALL ( SCIPcreateConsQuadraticNonlinear (scip , & quadcons , name , lincnt , linvars , lincoefs , quadcnt , quadvars1 , quadvars2 , quadcoefs , lhs , lhs ,
3641+ SCIP_CALL ( SCIPcreateConsQuadraticNonlinear (scip , & quadcons , name , lincnt , linvars , lincoefs , quadcnt , quadvars1 , quadvars2 , quadcoefs , - SCIPinfinity ( scip ), rhs ,
36533642 TRUE, /* initial */
36543643 TRUE, /* separate */
36553644 TRUE, /* enforce */
@@ -4643,11 +4632,7 @@ SCIP_RETCODE fixAndAggrVars(
46434632 }
46444633
46454634 /* get the variables this var was aggregated to */
4646- #if SCIP_VERSION_MAJOR >= 10
46474635 SCIP_CALL ( SCIPgetProbvarLinearSum (scip , aggrvars , scalars , & naggrvars , globalnvars , & constant , & requiredsize ) );
4648- #else
4649- SCIP_CALL ( SCIPgetProbvarLinearSum (scip , aggrvars , scalars , & naggrvars , globalnvars , & constant , & requiredsize , TRUE) );
4650- #endif
46514636 assert ( requiredsize <= globalnvars ); /* requiredsize is the number of empty spots in aggrvars needed, globalnvars is the number
46524637 * of spots we provided */
46534638
@@ -5625,6 +5610,7 @@ SCIP_RETCODE propagate3Minors(
56255610 return SCIP_OKAY ;
56265611}
56275612
5613+
56285614/** collect all nonlinear quadratic constraints and create variables and SDP constraint */
56295615static
56305616SCIP_RETCODE collectQuadraticVariables (
@@ -5923,6 +5909,7 @@ SCIP_RETCODE collectQuadraticVariables(
59235909}
59245910
59255911
5912+
59265913/** upgrade quadratic constraints to an SDP constraint with rank 1 */
59275914static
59285915SCIP_DECL_NONLINCONSUPGD (consQuadConsUpgdSdp )
@@ -6146,8 +6133,6 @@ SCIP_DECL_NONLINCONSUPGD(consQuadConsUpgdSdp)
61466133}
61476134
61486135
6149- #if SCIP_VERSION >= 900
6150-
61516136/* define indices for operator nodes in symmetry graph */
61526137#define OP_SDP_DIMENSION 1
61536138
@@ -6287,7 +6272,7 @@ SCIP_RETCODE addSymmetryInformation(
62876272
62886273 return SCIP_OKAY ;
62896274}
6290- #endif
6275+
62916276
62926277
62936278/*
@@ -8753,7 +8738,6 @@ SCIP_DECL_CONSGETNVARS(consGetNVarsSdp)
87538738 return SCIP_OKAY ;
87548739}
87558740
8756- #if SCIP_VERSION >= 900
87578741/** constraint handler method which returns the permutation symmetry detection graph of a constraint */
87588742static
87598743SCIP_DECL_CONSGETPERMSYMGRAPH (consGetPermsymGraphSdp )
@@ -8770,7 +8754,6 @@ SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(consGetSignedPermsymGraphSdp)
87708754 * success = FALSE;
87718755 return SCIP_OKAY ;
87728756}
8773- #endif
87748757
87758758/** creates the handler for SDP constraints and includes it in SCIP */
87768759SCIP_RETCODE SCIPincludeConshdlrSdp (
@@ -8848,10 +8831,8 @@ SCIP_RETCODE SCIPincludeConshdlrSdp(
88488831 SCIP_CALL ( SCIPsetConshdlrParse (scip , conshdlr , consParseSdp ) );
88498832 SCIP_CALL ( SCIPsetConshdlrGetVars (scip , conshdlr , consGetVarsSdp ) );
88508833 SCIP_CALL ( SCIPsetConshdlrGetNVars (scip , conshdlr , consGetNVarsSdp ) );
8851- #if SCIP_VERSION >= 900
88528834 SCIP_CALL ( SCIPsetConshdlrGetPermsymGraph (scip , conshdlr , consGetPermsymGraphSdp ) );
88538835 SCIP_CALL ( SCIPsetConshdlrGetSignedPermsymGraph (scip , conshdlr , consGetSignedPermsymGraphSdp ) );
8854- #endif
88558836
88568837 /* add parameter */
88578838#ifdef OMP
@@ -9155,11 +9136,7 @@ SCIP_RETCODE SCIPincludeConshdlrSdpRank1(
91559136 SCIP_CALL ( SCIPsetConshdlrGetNVars (scip , conshdlr , consGetNVarsSdp ) );
91569137
91579138 /* include upgrading function for quadratic constraints */
9158- #if ( SCIP_VERSION >= 800 || ( SCIP_VERSION < 800 && SCIP_APIVERSION >= 100 ) )
91599139 SCIP_CALL ( SCIPincludeConsUpgradeNonlinear (scip , consQuadConsUpgdSdp , 0 , TRUE, CONSHDLRRANK1_NAME ) );
9160- #else
9161- SCIP_CALL ( SCIPincludeQuadconsUpgrade (scip , consQuadConsUpgdSdp , 0 , TRUE, CONSHDLRRANK1_NAME ) );
9162- #endif
91639140
91649141 return SCIP_OKAY ;
91659142}
0 commit comments