Scippy

SCIP

Solving Constraint Integer Programs

benderscut.c
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2020 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 benderscut.c
17  * @ingroup OTHER_CFILES
18  * @brief methods for Benders' decomposition cut
19  * @author Stephen J. Maher
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #include <assert.h>
25 #include <string.h>
26 
27 #include "scip/def.h"
28 #include "scip/set.h"
29 #include "scip/clock.h"
30 #include "scip/paramset.h"
31 #include "scip/scip.h"
32 #include "scip/benderscut.h"
33 #include "scip/reopt.h"
34 #include "scip/pub_message.h"
35 #include "scip/pub_misc.h"
36 #include "scip/pub_benders.h"
37 
38 #include "scip/struct_benderscut.h"
39 
40 /* default parameter settings for the Benders' decomposition cuts */
41 #define SCIP_DEFAULT_ENABLED TRUE
42 
43 /** compares two Benders' cuts w. r. to their delay positions and their priority */
44 SCIP_DECL_SORTPTRCOMP(SCIPbenderscutComp)
45 { /*lint --e{715}*/
46  SCIP_BENDERSCUT* benderscut1 = (SCIP_BENDERSCUT*)elem1;
47  SCIP_BENDERSCUT* benderscut2 = (SCIP_BENDERSCUT*)elem2;
48 
49  assert(benderscut1 != NULL);
50  assert(benderscut2 != NULL);
51 
52  return benderscut2->priority - benderscut1->priority; /* prefer higher priorities */
53 }
54 
55 /** comparison method for sorting Benders' cuts w.r.t. to their name */
56 SCIP_DECL_SORTPTRCOMP(SCIPbenderscutCompName)
57 {
59 }
60 
61 /** method to call, when the priority of a compression was changed */
62 static
63 SCIP_DECL_PARAMCHGD(paramChgdBenderscutPriority)
64 { /*lint --e{715}*/
65  SCIP_PARAMDATA* paramdata;
66 
67  paramdata = SCIPparamGetData(param);
68  assert(paramdata != NULL);
69 
70  /* use SCIPsetBenderscutPriority() to mark the compressions unsorted */
71  SCIP_CALL( SCIPsetBenderscutPriority(scip, (SCIP_BENDERSCUT*)paramdata, SCIPparamGetInt(param)) ); /*lint !e740*/
72 
73  return SCIP_OKAY;
74 }
75 
76 /** copies the given Benders' decomposition cut to a new scip */
78  SCIP_BENDERS* benders, /**< the Benders' decomposition that the cuts are copied to */
79  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
80  SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
81  )
82 {
83  assert(benderscut != NULL);
84  assert(set != NULL);
85  assert(set->scip != NULL);
86 
87  if( benderscut->benderscutcopy != NULL )
88  {
89  SCIPsetDebugMsg(set, "including benderscut %s in subscip %p\n", SCIPbenderscutGetName(benderscut), (void*)set->scip);
90  SCIP_CALL( benderscut->benderscutcopy(set->scip, benders, benderscut) );
91  }
92 
93  return SCIP_OKAY;
94 }
95 
96 /** internal method for creating a Benders' decomposition structure */
97 static
99  SCIP_BENDERS* benders, /**< Benders' decomposition */
100  SCIP_BENDERSCUT** benderscut, /**< pointer to the Benders' decomposition cut data structure */
101  SCIP_SET* set, /**< global SCIP settings */
102  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
103  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
104  const char* name, /**< name of the Benders' decomposition cut */
105  const char* desc, /**< description of the Benders' decomposition cut */
106  int priority, /**< priority of the the Benders' decomposition cut */
107  SCIP_Bool islpcut, /**< indicates whether the cut is generated from the LP solution */
108  SCIP_DECL_BENDERSCUTCOPY((*benderscutcopy)),/**< copy method of the Benders' decomposition cut or NULL if you don't want to copy your plugin into sub-SCIPs */
109  SCIP_DECL_BENDERSCUTFREE((*benderscutfree)),/**< destructor of the Benders' decomposition cut */
110  SCIP_DECL_BENDERSCUTINIT((*benderscutinit)),/**< initialize the Benders' decomposition cut */
111  SCIP_DECL_BENDERSCUTEXIT((*benderscutexit)),/**< deinitialize the Benders' decomposition cut */
112  SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol)),/**< solving process initialization method of the Benders' decomposition cut */
113  SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol)),/**< solving process deinitialization method of the Benders' decomposition cut */
114  SCIP_DECL_BENDERSCUTEXEC((*benderscutexec)),/**< execution method of the Benders' decomposition cut */
115  SCIP_BENDERSCUTDATA* benderscutdata /**< Benders' decomposition cut data */
116  )
117 {
119  char paramdesc[SCIP_MAXSTRLEN];
120 
121  assert(benderscut != NULL);
122  assert(name != NULL);
123  assert(desc != NULL);
124  assert(benderscutexec != NULL);
125 
126  SCIP_ALLOC( BMSallocMemory(benderscut) );
127  SCIP_ALLOC( BMSduplicateMemoryArray(&(*benderscut)->name, name, strlen(name)+1) );
128  SCIP_ALLOC( BMSduplicateMemoryArray(&(*benderscut)->desc, desc, strlen(desc)+1) );
129  (*benderscut)->priority = priority;
130  (*benderscut)->islpcut = islpcut;
131  (*benderscut)->benderscutcopy = benderscutcopy;
132  (*benderscut)->benderscutfree = benderscutfree;
133  (*benderscut)->benderscutinit = benderscutinit;
134  (*benderscut)->benderscutexit = benderscutexit;
135  (*benderscut)->benderscutinitsol = benderscutinitsol;
136  (*benderscut)->benderscutexitsol = benderscutexitsol;
137  (*benderscut)->benderscutexec = benderscutexec;
138  (*benderscut)->benderscutdata = benderscutdata;
139  SCIP_CALL( SCIPclockCreate(&(*benderscut)->setuptime, SCIP_CLOCKTYPE_DEFAULT) );
140  SCIP_CALL( SCIPclockCreate(&(*benderscut)->benderscutclock, SCIP_CLOCKTYPE_DEFAULT) );
141  (*benderscut)->ncalls = 0;
142  (*benderscut)->nfound = 0;
143  (*benderscut)->initialized = FALSE;
144 
145  /* add parameters */
146  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "benders/%s/benderscut/%s/priority", SCIPbendersGetName(benders), name);
147  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "priority of Benders' cut <%s>", name);
148  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem, paramname, paramdesc,
149  &(*benderscut)->priority, TRUE, priority, INT_MIN/4, INT_MAX/4,
150  paramChgdBenderscutPriority, (SCIP_PARAMDATA*)(*benderscut)) ); /*lint !e740*/
151 
152  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "benders/%s/benderscut/%s/enabled", SCIPbendersGetName(benders), name);
153  SCIP_CALL( SCIPsetAddBoolParam(set, messagehdlr, blkmem, paramname,
154  "is this Benders' decomposition cut method used to generate cuts?", &(*benderscut)->enabled, FALSE,
155  SCIP_DEFAULT_ENABLED, NULL, NULL) ); /*lint !e740*/
156 
157  return SCIP_OKAY;
158 }
159 
160 /** creates a Benders' decomposition cut */
162  SCIP_BENDERS* benders, /**< Benders' decomposition */
163  SCIP_BENDERSCUT** benderscut, /**< pointer to the Benders' decomposition cut data structure */
164  SCIP_SET* set, /**< global SCIP settings */
165  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
166  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
167  const char* name, /**< name of the Benders' decomposition cut */
168  const char* desc, /**< description of the Benders' decomposition cut */
169  int priority, /**< priority of the the Benders' decomposition cut */
170  SCIP_Bool islpcut, /**< indicates whether the cut is generated from the LP solution */
171  SCIP_DECL_BENDERSCUTCOPY((*benderscutcopy)),/**< copy method of the Benders' decomposition cut or NULL if you don't want to copy your plugin into sub-SCIPs */
172  SCIP_DECL_BENDERSCUTFREE((*benderscutfree)),/**< destructor of the Benders' decomposition cut */
173  SCIP_DECL_BENDERSCUTINIT((*benderscutinit)),/**< initialize the Benders' decomposition cut */
174  SCIP_DECL_BENDERSCUTEXIT((*benderscutexit)),/**< deinitialize the Benders' decomposition cut */
175  SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol)),/**< solving process initialization method of the Benders' decomposition cut */
176  SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol)),/**< solving process deinitialization method of the Benders' decomposition cut */
177  SCIP_DECL_BENDERSCUTEXEC((*benderscutexec)),/**< execution method of the Benders' decomposition cut */
178  SCIP_BENDERSCUTDATA* benderscutdata /**< Benders' decomposition cut data */
179  )
180 {
181  assert(benderscut != NULL);
182  assert(name != NULL);
183  assert(desc != NULL);
184  assert(benderscutexec != NULL);
185 
186  SCIP_CALL_FINALLY( doBenderscutCreate(benders, benderscut, set, messagehdlr, blkmem, name, desc, priority, islpcut,
187  benderscutcopy, benderscutfree, benderscutinit, benderscutexit, benderscutinitsol, benderscutexitsol,
188  benderscutexec, benderscutdata), (void)SCIPbenderscutFree(benderscut, set) );
189 
190  return SCIP_OKAY;
191 }
192 
193 /** calls destructor and frees memory of the Benders' decomposition cut */
195  SCIP_BENDERSCUT** benderscut, /**< pointer to the Benders' decomposition cut data structure */
196  SCIP_SET* set /**< global SCIP settings */
197  )
198 {
199  assert(benderscut != NULL);
200  assert(*benderscut != NULL);
201  assert(!(*benderscut)->initialized);
202  assert(set != NULL);
203 
204  /* call destructor of the Benders' decomposition cut */
205  if( (*benderscut)->benderscutfree != NULL )
206  {
207  SCIP_CALL( (*benderscut)->benderscutfree(set->scip, *benderscut) );
208  }
209 
210  SCIPclockFree(&(*benderscut)->benderscutclock);
211  SCIPclockFree(&(*benderscut)->setuptime);
212  BMSfreeMemoryArray(&(*benderscut)->name);
213  BMSfreeMemoryArray(&(*benderscut)->desc);
214  BMSfreeMemory(benderscut);
215 
216  return SCIP_OKAY;
217 }
218 
219 /** initializes the Benders' decomposition cut */
221  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
222  SCIP_SET* set /**< global SCIP settings */
223  )
224 {
225  assert(benderscut != NULL);
226  assert(set != NULL);
227 
228  if( benderscut->initialized )
229  {
230  SCIPerrorMessage("Benders' decomposition cut <%s> already initialized\n", benderscut->name);
231  return SCIP_INVALIDCALL;
232  }
233 
234  if( set->misc_resetstat )
235  {
236  SCIPclockReset(benderscut->setuptime);
237  SCIPclockReset(benderscut->benderscutclock);
238 
239  benderscut->ncalls = 0;
240  benderscut->nfound = 0;
241  }
242 
243  if( benderscut->benderscutinit != NULL )
244  {
245  /* start timing */
246  SCIPclockStart(benderscut->setuptime, set);
247 
248  SCIP_CALL( benderscut->benderscutinit(set->scip, benderscut) );
249 
250  /* stop timing */
251  SCIPclockStop(benderscut->setuptime, set);
252  }
253  benderscut->initialized = TRUE;
254 
255  return SCIP_OKAY;
256 }
257 
258 /** calls exit method of the Benders' decomposition cut */
260  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
261  SCIP_SET* set /**< global SCIP settings */
262  )
263 {
264  assert(benderscut != NULL);
265  assert(set != NULL);
266 
267  if( !benderscut->initialized )
268  {
269  SCIPerrorMessage("Benders' decomposition cut <%s> not initialized\n", benderscut->name);
270  return SCIP_INVALIDCALL;
271  }
272 
273  if( benderscut->benderscutexit != NULL )
274  {
275  /* start timing */
276  SCIPclockStart(benderscut->setuptime, set);
277 
278  SCIP_CALL( benderscut->benderscutexit(set->scip, benderscut) );
279 
280  /* stop timing */
281  SCIPclockStop(benderscut->setuptime, set);
282  }
283  benderscut->initialized = FALSE;
284 
285  return SCIP_OKAY;
286 }
287 
288 /** informs Benders' cut that the branch and bound process is being started */
290  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
291  SCIP_SET* set /**< global SCIP settings */
292  )
293 {
294  assert(benderscut != NULL);
295  assert(set != NULL);
296 
297  /* call solving process initialization method of the Benders' decomposition cut */
298  if( benderscut->benderscutinitsol != NULL )
299  {
300  /* start timing */
301  SCIPclockStart(benderscut->setuptime, set);
302 
303  SCIP_CALL( benderscut->benderscutinitsol(set->scip, benderscut) );
304 
305  /* stop timing */
306  SCIPclockStop(benderscut->setuptime, set);
307  }
308 
309  return SCIP_OKAY;
310 }
311 
312 /** informs Benders' decomposition that the branch and bound process data is being freed */
314  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition */
315  SCIP_SET* set /**< global SCIP settings */
316  )
317 {
318  assert(benderscut != NULL);
319  assert(set != NULL);
320 
321  /* call solving process deinitialization method of Benders' decomposition cut */
322  if( benderscut->benderscutexitsol != NULL )
323  {
324  /* start timing */
325  SCIPclockStart(benderscut->setuptime, set);
326 
327  SCIP_CALL( benderscut->benderscutexitsol(set->scip, benderscut) );
328 
329  /* stop timing */
330  SCIPclockStop(benderscut->setuptime, set);
331  }
332 
333  return SCIP_OKAY;
334 }
335 
336 /** calls execution method of the Benders' decomposition cut */
338  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
339  SCIP_SET* set, /**< global SCIP settings */
340  SCIP_BENDERS* benders, /**< Benders' decomposition */
341  SCIP_SOL* sol, /**< primal CIP solution */
342  int probnumber, /**< the number of the subproblem for which the cut is generated */
343  SCIP_BENDERSENFOTYPE type, /**< the enforcement type calling this function */
344  SCIP_RESULT* result /**< pointer to store the result of the callback method */
345  )
346 {
347  SCIP_RESULT cutresult;
348 
349  assert(benderscut != NULL);
350  assert(benderscut->benderscutexec != NULL);
351  assert(set != NULL);
352  assert(set->scip != NULL);
353  assert(result != NULL);
354 
355  cutresult = SCIP_DIDNOTRUN;
356 
357  SCIPsetDebugMsg(set, "executing Benders' decomposition cut <%s>\n", benderscut->name);
358 
359  /* start timing */
360  SCIPclockStart(benderscut->benderscutclock, set);
361 
362  /* call the Benders' decomposition cut if it is enabled */
363  if( benderscut->enabled )
364  {
365  SCIP_CALL( benderscut->benderscutexec(set->scip, benders, benderscut, sol, probnumber, type, &cutresult) );
366  }
367 
368  /* stop timing */
369  SCIPclockStop(benderscut->benderscutclock, set);
370 
371  /* evaluate result */
372  if( cutresult != SCIP_DIDNOTRUN
373  && cutresult != SCIP_DIDNOTFIND
374  && cutresult != SCIP_CONSADDED
375  && cutresult != SCIP_FEASIBLE
376  && cutresult != SCIP_SEPARATED )
377  {
378  SCIPerrorMessage("execution method of Benders' decomposition cut <%s> returned invalid result <%d>\n",
379  benderscut->name, cutresult);
380  return SCIP_INVALIDRESULT;
381  }
382 
383  benderscut->ncalls++;
384 
385  if( cutresult == SCIP_CONSADDED || cutresult == SCIP_SEPARATED )
386  benderscut->nfound++;
387 
388  (*result) = cutresult;
389 
390  return SCIP_OKAY;
391 }
392 
393 /** gets user data of the Benders' decomposition cut */
395  SCIP_BENDERSCUT* benderscut /**< Benders' decomposition cut */
396  )
397 {
398  assert(benderscut != NULL);
399 
400  return benderscut->benderscutdata;
401 }
402 
403 /** sets user data of the Benders' decomposition cut; user has to free old data in advance! */
405  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
406  SCIP_BENDERSCUTDATA* benderscutdata /**< new Benders' decomposition cut user data */
407  )
408 {
409  assert(benderscut != NULL);
410 
411  benderscut->benderscutdata = benderscutdata;
412 }
413 
414 /* new callback setter methods */
415 
416 /** sets copy callback of the Benders' decomposition cut */
418  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
419  SCIP_DECL_BENDERSCUTCOPY((*benderscutcopy))/**< copy callback of the Benders' decomposition cut or NULL if you don't want to copy your plugin into sub-SCIPs */
420  )
421 {
422  assert(benderscut != NULL);
423 
424  benderscut->benderscutcopy = benderscutcopy;
425 }
426 
427 /** sets destructor callback of the Benders' decomposition cut */
429  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
430  SCIP_DECL_BENDERSCUTFREE((*benderscutfree))/**< destructor of the Benders' decomposition cut */
431  )
432 {
433  assert(benderscut != NULL);
434 
435  benderscut->benderscutfree = benderscutfree;
436 }
437 
438 /** sets initialization callback of the Benders' decomposition cut */
440  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
441  SCIP_DECL_BENDERSCUTINIT((*benderscutinit))/**< initialize the Benders' decomposition cut */
442  )
443 {
444  assert(benderscut != NULL);
445 
446  benderscut->benderscutinit = benderscutinit;
447 }
448 
449 /** sets deinitialization callback of the Benders' decomposition cut */
451  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
452  SCIP_DECL_BENDERSCUTEXIT((*benderscutexit))/**< deinitialize the Benders' decomposition cut */
453  )
454 {
455  assert(benderscut != NULL);
456 
457  benderscut->benderscutexit = benderscutexit;
458 }
459 
460 /** sets solving process initialization callback of the Benders' decomposition cut */
462  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
463  SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol))/**< solving process initialization callback of the Benders' decomposition cut */
464  )
465 {
466  assert(benderscut != NULL);
467 
468  benderscut->benderscutinitsol = benderscutinitsol;
469 }
470 
471 /** sets solving process deinitialization callback of Benders' decomposition cut */
473  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
474  SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol))/**< solving process deinitialization callback of the Benders' decomposition cut */
475  )
476 {
477  assert(benderscut != NULL);
478 
479  benderscut->benderscutexitsol = benderscutexitsol;
480 }
481 
482 /** gets name of the Benders' decomposition cut */
484  SCIP_BENDERSCUT* benderscut /**< Benders' decomposition cut */
485  )
486 {
487  assert(benderscut != NULL);
488 
489  return benderscut->name;
490 }
491 
492 /** gets description of the Benders' decomposition cut */
494  SCIP_BENDERSCUT* benderscut /**< Benders' decomposition cut */
495  )
496 {
497  assert(benderscut != NULL);
498 
499  return benderscut->desc;
500 }
501 
502 /** gets priority of the Benders' decomposition cut */
504  SCIP_BENDERSCUT* benderscut /**< Benders' decomposition cut */
505  )
506 {
507  assert(benderscut != NULL);
508 
509  return benderscut->priority;
510 }
511 
512 /** sets priority of the Benders' decomposition cut */
514  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
515  int priority /**< new priority of the Benders' decomposition cut */
516  )
517 {
518  assert(benderscut != NULL);
519 
520  benderscut->priority = priority;
521 }
522 
523 /** gets the number of times, the heuristic was called and tried to find a solution */
525  SCIP_BENDERSCUT* benderscut /**< Benders' decomposition cut */
526  )
527 {
528  assert(benderscut != NULL);
529 
530  return benderscut->ncalls;
531 }
532 
533 /** gets the number of Benders' cuts found by this Benders' decomposition cut */
535  SCIP_BENDERSCUT* benderscut /**< Benders' decomposition cut */
536  )
537 {
538  assert(benderscut != NULL);
539 
540  return benderscut->nfound;
541 }
542 
543 /** is the Benders' decomposition cut initialized? */
545  SCIP_BENDERSCUT* benderscut /**< Benders' decomposition cut */
546  )
547 {
548  assert(benderscut != NULL);
549 
550  return benderscut->initialized;
551 }
552 
553 /** gets time in seconds used by this Benders' decomposition cut for setting up */
555  SCIP_BENDERSCUT* benderscut /**< Benders' decomposition cut */
556  )
557 {
558  assert(benderscut != NULL);
559 
560  return SCIPclockGetTime(benderscut->setuptime);
561 }
562 
563 /** gets time in seconds used in this Benders' decomposition cut */
565  SCIP_BENDERSCUT* benderscut /**< Benders' decomposition cut */
566  )
567 {
568  assert(benderscut != NULL);
569 
570  return SCIPclockGetTime(benderscut->benderscutclock);
571 }
572 
573 /** returns whether the Benders' cut uses the LP information */
575  SCIP_BENDERSCUT* benderscut /**< Benders' decomposition cut */
576  )
577 {
578  assert(benderscut != NULL);
579 
580  return benderscut->islpcut;
581 }
582 
583 /** sets the enabled flag of the Benders' decomposition cut method */
585  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
586  SCIP_Bool enabled /**< flag to indicate whether the Benders' decomposition cut is enabled */
587  )
588 {
589  assert(benderscut != NULL);
590 
591  benderscut->enabled = enabled;
592 }
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
SCIP_RETCODE SCIPbenderscutExec(SCIP_BENDERSCUT *benderscut, SCIP_SET *set, SCIP_BENDERS *benders, SCIP_SOL *sol, int probnumber, SCIP_BENDERSENFOTYPE type, SCIP_RESULT *result)
Definition: benderscut.c:337
void SCIPbenderscutSetEnabled(SCIP_BENDERSCUT *benderscut, SCIP_Bool enabled)
Definition: benderscut.c:584
SCIP_Longint SCIPbenderscutGetNCalls(SCIP_BENDERSCUT *benderscut)
Definition: benderscut.c:524
struct SCIP_BenderscutData SCIP_BENDERSCUTDATA
SCIP_PARAMDATA * SCIPparamGetData(SCIP_PARAM *param)
Definition: paramset.c:670
#define SCIP_MAXSTRLEN
Definition: def.h:273
SCIP_Real SCIPbenderscutGetSetupTime(SCIP_BENDERSCUT *benderscut)
Definition: benderscut.c:554
void SCIPbenderscutSetPriority(SCIP_BENDERSCUT *benderscut, int priority)
Definition: benderscut.c:513
internal methods for clocks and timing issues
#define SCIP_DECL_BENDERSCUTFREE(x)
struct SCIP_ParamData SCIP_PARAMDATA
Definition: type_paramset.h:77
#define SCIP_CALL_FINALLY(x, y)
Definition: def.h:406
void SCIPbenderscutSetInitsol(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol)))
Definition: benderscut.c:461
void SCIPclockStop(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:351
#define FALSE
Definition: def.h:73
SCIP_Longint SCIPbenderscutGetNFound(SCIP_BENDERSCUT *benderscut)
Definition: benderscut.c:534
public methods for Benders&#39; decomposition
void SCIPclockStart(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:281
#define TRUE
Definition: def.h:72
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
enum SCIP_BendersEnfoType SCIP_BENDERSENFOTYPE
Definition: type_benders.h:42
SCIP_Longint ncalls
#define SCIP_DECL_BENDERSCUTEXEC(x)
SCIP_RETCODE SCIPbenderscutCopyInclude(SCIP_BENDERS *benders, SCIP_BENDERSCUT *benderscut, SCIP_SET *set)
Definition: benderscut.c:77
internal methods for handling parameter settings
#define BMSfreeMemory(ptr)
Definition: memory.h:137
#define SCIP_DECL_BENDERSCUTCOPY(x)
Definition: heur_padm.c:125
#define SCIP_DEFAULT_ENABLED
Definition: benderscut.c:41
datastructures for Benders&#39; decomposition cuts techniques
#define SCIP_DECL_BENDERSCUTINIT(x)
static SCIP_DECL_PARAMCHGD(paramChgdBenderscutPriority)
Definition: benderscut.c:63
const char * SCIPbenderscutGetName(SCIP_BENDERSCUT *benderscut)
Definition: benderscut.c:483
void SCIPbenderscutSetExit(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTEXIT((*benderscutexit)))
Definition: benderscut.c:450
static SCIP_RETCODE doBenderscutCreate(SCIP_BENDERS *benders, SCIP_BENDERSCUT **benderscut, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, SCIP_Bool islpcut, SCIP_DECL_BENDERSCUTCOPY((*benderscutcopy)), SCIP_DECL_BENDERSCUTFREE((*benderscutfree)), SCIP_DECL_BENDERSCUTINIT((*benderscutinit)), SCIP_DECL_BENDERSCUTEXIT((*benderscutexit)), SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol)), SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol)), SCIP_DECL_BENDERSCUTEXEC((*benderscutexec)), SCIP_BENDERSCUTDATA *benderscutdata)
Definition: benderscut.c:98
SCIP_CLOCK * setuptime
#define BMSfreeMemoryArray(ptr)
Definition: memory.h:139
#define SCIPerrorMessage
Definition: pub_message.h:55
void SCIPclockReset(SCIP_CLOCK *clck)
Definition: clock.c:200
SCIP_RETCODE SCIPbenderscutFree(SCIP_BENDERSCUT **benderscut, SCIP_SET *set)
Definition: benderscut.c:194
SCIP_Real SCIPclockGetTime(SCIP_CLOCK *clck)
Definition: clock.c:429
void SCIPbenderscutSetData(SCIP_BENDERSCUT *benderscut, SCIP_BENDERSCUTDATA *benderscutdata)
Definition: benderscut.c:404
#define NULL
Definition: lpi_spx1.cpp:155
#define SCIP_DECL_BENDERSCUTEXIT(x)
internal methods for global SCIP settings
#define SCIP_CALL(x)
Definition: def.h:364
void SCIPbenderscutSetExitsol(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol)))
Definition: benderscut.c:472
int SCIPbenderscutGetPriority(SCIP_BENDERSCUT *benderscut)
Definition: benderscut.c:503
SCIP_RETCODE SCIPsetAddIntParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: set.c:2956
#define BMSduplicateMemoryArray(ptr, source, num)
Definition: memory.h:135
SCIP_RETCODE SCIPclockCreate(SCIP_CLOCK **clck, SCIP_CLOCKTYPE clocktype)
Definition: clock.c:161
data structures and methods for collecting reoptimization information
SCIP_RETCODE SCIPsetBenderscutPriority(SCIP *scip, SCIP_BENDERSCUT *benderscut, int priority)
public data structures and miscellaneous methods
#define SCIP_Bool
Definition: def.h:70
void SCIPbenderscutSetFree(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTFREE((*benderscutfree)))
Definition: benderscut.c:428
static const char * paramname[]
Definition: lpi_msk.c:4958
void SCIPclockFree(SCIP_CLOCK **clck)
Definition: clock.c:176
SCIP_Bool SCIPbenderscutIsLPCut(SCIP_BENDERSCUT *benderscut)
Definition: benderscut.c:574
#define SCIPsetDebugMsg
Definition: set.h:1721
SCIP_CLOCK * benderscutclock
SCIP_RETCODE SCIPbenderscutInitsol(SCIP_BENDERSCUT *benderscut, SCIP_SET *set)
Definition: benderscut.c:289
void SCIPbenderscutSetInit(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTINIT((*benderscutinit)))
Definition: benderscut.c:439
int SCIPparamGetInt(SCIP_PARAM *param)
Definition: paramset.c:725
SCIP_Real SCIPbenderscutGetTime(SCIP_BENDERSCUT *benderscut)
Definition: benderscut.c:564
SCIP_DECL_SORTPTRCOMP(SCIPbenderscutComp)
Definition: benderscut.c:44
SCIP_Longint nfound
SCIP_RETCODE SCIPbenderscutExit(SCIP_BENDERSCUT *benderscut, SCIP_SET *set)
Definition: benderscut.c:259
public methods for message output
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:10604
#define SCIP_Real
Definition: def.h:163
SCIP_BENDERSCUTDATA * SCIPbenderscutGetData(SCIP_BENDERSCUT *benderscut)
Definition: benderscut.c:394
#define SCIP_DECL_BENDERSCUTEXITSOL(x)
#define BMSallocMemory(ptr)
Definition: memory.h:111
#define SCIP_Longint
Definition: def.h:148
SCIP_BENDERSCUTDATA * benderscutdata
const char * SCIPbenderscutGetDesc(SCIP_BENDERSCUT *benderscut)
Definition: benderscut.c:493
SCIP_RETCODE SCIPbenderscutExitsol(SCIP_BENDERSCUT *benderscut, SCIP_SET *set)
Definition: benderscut.c:313
const char * SCIPbendersGetName(SCIP_BENDERS *benders)
Definition: benders.c:5905
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:429
SCIP_RETCODE SCIPbenderscutCreate(SCIP_BENDERS *benders, SCIP_BENDERSCUT **benderscut, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, SCIP_Bool islpcut, SCIP_DECL_BENDERSCUTCOPY((*benderscutcopy)), SCIP_DECL_BENDERSCUTFREE((*benderscutfree)), SCIP_DECL_BENDERSCUTINIT((*benderscutinit)), SCIP_DECL_BENDERSCUTEXIT((*benderscutexit)), SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol)), SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol)), SCIP_DECL_BENDERSCUTEXEC((*benderscutexec)), SCIP_BENDERSCUTDATA *benderscutdata)
Definition: benderscut.c:161
void SCIPbenderscutSetCopy(SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTCOPY((*benderscutcopy)))
Definition: benderscut.c:417
#define SCIP_ALLOC(x)
Definition: def.h:375
SCIP_RETCODE SCIPsetAddBoolParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: set.c:2934
SCIP_Bool SCIPbenderscutIsInitialized(SCIP_BENDERSCUT *benderscut)
Definition: benderscut.c:544
internal methods for Benders&#39; decomposition cuts
SCIP_RETCODE SCIPbenderscutInit(SCIP_BENDERSCUT *benderscut, SCIP_SET *set)
Definition: benderscut.c:220
#define SCIP_DECL_BENDERSCUTINITSOL(x)
SCIP callable library.