1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /*                                                                           */
3 /*                  This file is part of the program and library             */
4 /*         SCIP --- Solving Constraint Integer Programs                      */
5 /*                                                                           */
6 /*    Copyright (C) 2002-2021 Konrad-Zuse-Zentrum                            */
7 /*                            fuer Informationstechnik Berlin                */
8 /*                                                                           */
9 /*  SCIP is distributed under the terms of the ZIB Academic License.         */
10 /*                                                                           */
11 /*  You should have received a copy of the ZIB Academic License              */
12 /*  along with SCIP; see the file COPYING. If not visit scipopt.org.         */
13 /*                                                                           */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file   sepa_xyz.c
17  * @ingroup DEFPLUGINS_SEPA
18  * @brief  xyz separator
19  * @author Tobias Achterberg
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #include <assert.h>
25 
26 #include "scip/sepa_xyz.h"
27 
28 
29 #define SEPA_NAME              "xyz"
30 #define SEPA_DESC              "separator template"
31 #define SEPA_PRIORITY                 0
32 #define SEPA_FREQ                    10
33 #define SEPA_MAXBOUNDDIST           1.0
34 #define SEPA_USESSUBSCIP          FALSE /**< does the separator use a secondary SCIP instance? */
35 #define SEPA_DELAY                FALSE /**< should separation method be delayed, if other separators found cuts? */
36 
37 
38 /*
39  * Data structures
40  */
41 
42 /* TODO: fill in the necessary separator data */
43 
44 /** separator data */
45 struct SCIP_SepaData
46 {
47 };
48 
49 
50 /*
51  * Local methods
52  */
53 
54 /* put your local methods here, and declare them static */
55 
56 
57 /*
58  * Callback methods of separator
59  */
60 
61 /* TODO: Implement all necessary separator methods. The methods with an #if 0 ... #else #define ... are optional */
62 
63 
64 /** copy method for separator plugins (called when SCIP copies plugins) */
65 #if 0
66 static
67 SCIP_DECL_SEPACOPY(sepaCopyXyz)
68 {  /*lint --e{715}*/
69    SCIPerrorMessage("method of xyz separator not implemented yet\n");
70    SCIPABORT(); /*lint --e{527}*/
71 
72    return SCIP_OKAY;
73 }
74 #else
75 #define sepaCopyXyz NULL
76 #endif
77 
78 /** destructor of separator to free user data (called when SCIP is exiting) */
79 #if 0
80 static
81 SCIP_DECL_SEPAFREE(sepaFreeXyz)
82 {  /*lint --e{715}*/
83    SCIPerrorMessage("method of xyz separator not implemented yet\n");
84    SCIPABORT(); /*lint --e{527}*/
85 
86    return SCIP_OKAY;
87 }
88 #else
89 #define sepaFreeXyz NULL
90 #endif
91 
92 
93 /** initialization method of separator (called after problem was transformed) */
94 #if 0
95 static
96 SCIP_DECL_SEPAINIT(sepaInitXyz)
97 {  /*lint --e{715}*/
98    SCIPerrorMessage("method of xyz separator not implemented yet\n");
99    SCIPABORT(); /*lint --e{527}*/
100 
101    return SCIP_OKAY;
102 }
103 #else
104 #define sepaInitXyz NULL
105 #endif
106 
107 
108 /** deinitialization method of separator (called before transformed problem is freed) */
109 #if 0
110 static
111 SCIP_DECL_SEPAEXIT(sepaExitXyz)
112 {  /*lint --e{715}*/
113    SCIPerrorMessage("method of xyz separator not implemented yet\n");
114    SCIPABORT(); /*lint --e{527}*/
115 
116    return SCIP_OKAY;
117 }
118 #else
119 #define sepaExitXyz NULL
120 #endif
121 
122 
123 /** solving process initialization method of separator (called when branch and bound process is about to begin) */
124 #if 0
125 static
126 SCIP_DECL_SEPAINITSOL(sepaInitsolXyz)
127 {  /*lint --e{715}*/
128    SCIPerrorMessage("method of xyz separator not implemented yet\n");
129    SCIPABORT(); /*lint --e{527}*/
130 
131    return SCIP_OKAY;
132 }
133 #else
134 #define sepaInitsolXyz NULL
135 #endif
136 
137 
138 /** solving process deinitialization method of separator (called before branch and bound process data is freed) */
139 #if 0
140 static
141 SCIP_DECL_SEPAEXITSOL(sepaExitsolXyz)
142 {  /*lint --e{715}*/
143    SCIPerrorMessage("method of xyz separator not implemented yet\n");
144    SCIPABORT(); /*lint --e{527}*/
145 
146    return SCIP_OKAY;
147 }
148 #else
149 #define sepaExitsolXyz NULL
150 #endif
151 
152 
153 /** LP solution separation method of separator */
154 #if 0
155 static
156 SCIP_DECL_SEPAEXECLP(sepaExeclpXyz)
157 {  /*lint --e{715}*/
158    SCIPerrorMessage("method of xyz separator not implemented yet\n");
159    SCIPABORT(); /*lint --e{527}*/
160 
161    return SCIP_OKAY;
162 }
163 #else
164 #define sepaExeclpXyz NULL
165 #endif
166 
167 
168 /** arbitrary primal solution separation method of separator */
169 #if 0
170 static
171 SCIP_DECL_SEPAEXECSOL(sepaExecsolXyz)
172 {  /*lint --e{715}*/
173    SCIPerrorMessage("method of xyz separator not implemented yet\n");
174    SCIPABORT(); /*lint --e{527}*/
175 
176    return SCIP_OKAY;
177 }
178 #else
179 #define sepaExecsolXyz NULL
180 #endif
181 
182 
183 /*
184  * separator specific interface methods
185  */
186 
187 /** creates the xyz separator and includes it in SCIP */
SCIPincludeSepaXyz(SCIP * scip)188 SCIP_RETCODE SCIPincludeSepaXyz(
189    SCIP*                 scip                /**< SCIP data structure */
190    )
191 {
192    SCIP_SEPADATA* sepadata;
193    SCIP_SEPA* sepa;
194 
195    /* create xyz separator data */
196    sepadata = NULL;
197    /* TODO: (optional) create separator specific data here */
198 
199    sepa = NULL;
200 
201    /* include separator */
202 #if 0
203    /* use SCIPincludeSepa() if you want to set all callbacks explicitly and realize (by getting compiler errors) when
204     * new callbacks are added in future SCIP versions
205     */
206    SCIP_CALL( SCIPincludeSepa(scip, SEPA_NAME, SEPA_DESC, SEPA_PRIORITY, SEPA_FREQ, SEPA_MAXBOUNDDIST,
207          SEPA_USESSUBSCIP, SEPA_DELAY,
208          sepaCopyXyz, sepaFreeXyz, sepaInitXyz, sepaExitXyz, sepaInitsolXyz, sepaExitsolXyz, sepaExeclpXyz, sepaExecsolXyz,
209          sepadata) );
210 #else
211    /* use SCIPincludeSepaBasic() plus setter functions if you want to set callbacks one-by-one and your code should
212     * compile independent of new callbacks being added in future SCIP versions
213     */
214    SCIP_CALL( SCIPincludeSepaBasic(scip, &sepa, SEPA_NAME, SEPA_DESC, SEPA_PRIORITY, SEPA_FREQ, SEPA_MAXBOUNDDIST,
215          SEPA_USESSUBSCIP, SEPA_DELAY,
216          sepaExeclpXyz, sepaExecsolXyz,
217          sepadata) );
218 
219    assert(sepa != NULL);
220 
221    /* set non fundamental callbacks via setter functions */
222    SCIP_CALL( SCIPsetSepaCopy(scip, sepa, sepaCopyXyz) );
223    SCIP_CALL( SCIPsetSepaFree(scip, sepa, sepaFreeXyz) );
224    SCIP_CALL( SCIPsetSepaInit(scip, sepa, sepaInitXyz) );
225    SCIP_CALL( SCIPsetSepaExit(scip, sepa, sepaExitXyz) );
226    SCIP_CALL( SCIPsetSepaInitsol(scip, sepa, sepaInitsolXyz) );
227    SCIP_CALL( SCIPsetSepaExitsol(scip, sepa, sepaExitsolXyz) );
228 #endif
229 
230    /* add xyz separator parameters */
231    /* TODO: (optional) add separator specific parameters with SCIPaddTypeParam() here */
232 
233    return SCIP_OKAY;
234 }
235