Scippy

SCIP

Solving Constraint Integer Programs

cutsel.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-2022 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 cutsel.c
17  * @ingroup OTHER_CFILES
18  * @brief methods for cut selectors
19  * @author Felipe Serrano
20  * @author Mark Turner
21  */
22 
23 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
24 
25 #include <assert.h>
26 
27 #include "scip/set.h"
28 #include "scip/clock.h"
29 #include "scip/paramset.h"
30 #include "scip/scip.h"
31 #include "scip/cutsel.h"
32 
33 #include "scip/struct_cutsel.h"
34 
35 
36 /** method to call, when the priority of a cut selector was changed */
37 static
38 SCIP_DECL_PARAMCHGD(paramChgdCutselPriority)
39 { /*lint --e{715}*/
40  SCIP_PARAMDATA* paramdata;
41 
42  paramdata = SCIPparamGetData(param);
43  assert(paramdata != NULL);
44 
45  /* use SCIPsetCutselPriority() to mark the cutsels unsorted */
46  SCIP_CALL( SCIPsetCutselPriority(scip, (SCIP_CUTSEL*)paramdata, SCIPparamGetInt(param)) ); /*lint !e740*/
47 
48  return SCIP_OKAY;
49 }
50 
51 /** internal method for creating a cut selector */
52 static
54  SCIP_CUTSEL** cutsel, /**< pointer to store cut selector */
55  SCIP_SET* set, /**< global SCIP settings */
56  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
57  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
58  const char* name, /**< name of cut selector */
59  const char* desc, /**< description of cut selector */
60  int priority, /**< priority of the cut selector */
61  SCIP_DECL_CUTSELCOPY ((*cutselcopy)), /**< copy method of cut selector or NULL if you don't want to copy your plugin into sub-SCIPs */
62  SCIP_DECL_CUTSELFREE ((*cutselfree)), /**< destructor of cut selector */
63  SCIP_DECL_CUTSELINIT ((*cutselinit)), /**< initialize cut selector */
64  SCIP_DECL_CUTSELEXIT ((*cutselexit)), /**< deinitialize cut selector */
65  SCIP_DECL_CUTSELINITSOL((*cutselinitsol)),/**< solving process initialization method of cut selector */
66  SCIP_DECL_CUTSELEXITSOL((*cutselexitsol)),/**< solving process deinitialization method of cut selector */
67  SCIP_DECL_CUTSELSELECT((*cutselselect)), /**< cut selection method */
68  SCIP_CUTSELDATA* cutseldata /**< cut selector data */
69  )
70 {
72  char paramdesc[SCIP_MAXSTRLEN];
73 
74  assert(cutsel != NULL);
75  assert(name != NULL);
76  assert(desc != NULL);
77  assert(cutselselect != NULL);
78 
79  SCIP_ALLOC( BMSallocMemory(cutsel) );
80  BMSclearMemory(*cutsel);
81 
82  SCIP_ALLOC( BMSduplicateMemoryArray(&(*cutsel)->name, name, strlen(name)+1) );
83  SCIP_ALLOC( BMSduplicateMemoryArray(&(*cutsel)->desc, desc, strlen(desc)+1) );
84  (*cutsel)->priority = priority;
85  (*cutsel)->cutselcopy = cutselcopy;
86  (*cutsel)->cutselfree = cutselfree;
87  (*cutsel)->cutselinit = cutselinit;
88  (*cutsel)->cutselexit = cutselexit;
89  (*cutsel)->cutselinitsol = cutselinitsol;
90  (*cutsel)->cutselexitsol = cutselexitsol;
91  (*cutsel)->cutselselect = cutselselect;
92  (*cutsel)->cutseldata = cutseldata;
93  (*cutsel)->ncalls = 0;
94  (*cutsel)->nrootcalls = 0;
95  (*cutsel)->nrootcutsselected = 0;
96  (*cutsel)->nrootcutsforced = 0;
97  (*cutsel)->nrootcutsfiltered = 0;
98  (*cutsel)->nlocalcutsselected = 0;
99  (*cutsel)->nlocalcutsforced = 0;
100  (*cutsel)->nlocalcutsfiltered = 0;
101  (*cutsel)->initialized = FALSE;
102 
103  /* create clocks */
104  SCIP_CALL( SCIPclockCreate(&(*cutsel)->setuptime, SCIP_CLOCKTYPE_DEFAULT) );
105  SCIP_CALL( SCIPclockCreate(&(*cutsel)->cutseltime, SCIP_CLOCKTYPE_DEFAULT) );
106 
107  /* add parameters */
108  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "cutselection/%s/priority", name);
109  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "priority of cut selection rule <%s>", name);
110  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem, paramname, paramdesc,
111  &(*cutsel)->priority, FALSE, priority, INT_MIN/4, INT_MAX/2,
112  paramChgdCutselPriority, (SCIP_PARAMDATA*)(*cutsel)) ); /*lint !e740*/
113 
114  return SCIP_OKAY;
115 }
116 
117 
118 /** creates a cut selector */
120  SCIP_CUTSEL** cutsel, /**< pointer to store cut selector */
121  SCIP_SET* set, /**< global SCIP settings */
122  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
123  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
124  const char* name, /**< name of cut selector */
125  const char* desc, /**< description of cut selector */
126  int priority, /**< priority of the cut selector in standard mode */
127  SCIP_DECL_CUTSELCOPY ((*cutselcopy)), /**< copy method of cut selector or NULL if you don't want to copy your plugin into sub-SCIPs */
128  SCIP_DECL_CUTSELFREE ((*cutselfree)), /**< destructor of cut selector */
129  SCIP_DECL_CUTSELINIT ((*cutselinit)), /**< initialize cut selector */
130  SCIP_DECL_CUTSELEXIT ((*cutselexit)), /**< deinitialize cut selector */
131  SCIP_DECL_CUTSELINITSOL((*cutselinitsol)),/**< solving process initialization method of cut selector */
132  SCIP_DECL_CUTSELEXITSOL((*cutselexitsol)),/**< solving process deinitialization method of cut selector */
133  SCIP_DECL_CUTSELSELECT((*cutselselect)), /**< cut selection method */
134  SCIP_CUTSELDATA* cutseldata /**< cut selector data */
135  )
136 {
137  assert(cutsel != NULL);
138  assert(name != NULL);
139  assert(desc != NULL);
140  assert(cutselselect != NULL);
141 
142  SCIP_CALL_FINALLY( doCutselCreate(cutsel, set, messagehdlr, blkmem, name, desc, priority,
143  cutselcopy, cutselfree, cutselinit, cutselexit, cutselinitsol, cutselexitsol, cutselselect,
144  cutseldata), (void) SCIPcutselFree(cutsel, set) );
145 
146  return SCIP_OKAY;
147 }
148 
149 /** gets name of cut selector */
150 const char* SCIPcutselGetName(
151  SCIP_CUTSEL* cutsel /**< cut selector */
152  )
153 {
154  assert(cutsel != NULL);
155 
156  return cutsel->name;
157 }
158 
159 /** calls cut selectors to select cuts */
161  SCIP_SET* set, /**< global SCIP settings */
162  SCIP_ROW** cuts, /**< array with cuts to select from */
163  int ncuts, /**< length of cuts */
164  int nforcedcuts, /**< number of forced cuts at start of given array */
165  SCIP_Bool root, /**< are we at the root node? */
166  SCIP_Bool initiallp, /**< is the separation storage currently being filled with the initial LP rows? */
167  int maxnselectedcuts, /**< maximum number of cuts to be selected */
168  int* nselectedcuts /**< pointer to return number of selected cuts */
169  )
170 {
171  int i;
172  SCIP_RESULT result = SCIP_DIDNOTFIND;
173 
174  assert(nselectedcuts != NULL);
175 
176  /* sort the cut selectors by priority */
177  SCIPsetSortCutsels(set);
178 
179  /* Redefine maxnselectedcuts to be w.r.t the optional cuts. */
180  maxnselectedcuts -= nforcedcuts;
181 
182  /* try all cut selectors until one succeeds */
183  *nselectedcuts = 0;
184  for( i = 0; i < set->ncutsels && result == SCIP_DIDNOTFIND; ++i )
185  {
186  SCIP_CUTSEL* cutsel;
187 
188  cutsel = set->cutsels[i];
189 
190  assert(cutsel != NULL);
191  assert(ncuts - nforcedcuts > 0);
192  assert(maxnselectedcuts > 0);
193 
194  /* start timing */
195  SCIPclockStart(cutsel->cutseltime, set);
196 
197  SCIP_CALL( cutsel->cutselselect(set->scip, cutsel, &(cuts[nforcedcuts]), ncuts - nforcedcuts, cuts, nforcedcuts,
198  root, maxnselectedcuts, nselectedcuts, &result) );
199 
200  /* stop timing */
201  SCIPclockStop(cutsel->cutseltime, set);
202 
203  assert(*nselectedcuts <= maxnselectedcuts);
204  assert(result == SCIP_SUCCESS || result == SCIP_DIDNOTFIND);
205  assert(result != SCIP_DIDNOTFIND || *nselectedcuts == 0);
206 
207  ++cutsel->ncalls;
208  if( root )
209  ++cutsel->nrootcalls;
210 
211  if( result != SCIP_DIDNOTFIND && !initiallp )
212  {
213  assert(0 <= ncuts);
214  assert(0 <= *nselectedcuts && *nselectedcuts <= ncuts);
215 
216  if( root )
217  {
218  cutsel->nrootcutsselected += *nselectedcuts;
219  cutsel->nrootcutsforced += nforcedcuts;
220  cutsel->nrootcutsfiltered += ncuts - *nselectedcuts; /*lint !e776*/
221  }
222  else
223  {
224  cutsel->nlocalcutsselected += *nselectedcuts;
225  cutsel->nlocalcutsforced += nforcedcuts;
226  cutsel->nlocalcutsfiltered += ncuts - *nselectedcuts; /*lint !e776*/
227  }
228  }
229  }
230 
231  return SCIP_OKAY;
232 }
233 
234 /** gets description of cut selector */
235 const char* SCIPcutselGetDesc(
236  SCIP_CUTSEL* cutsel /**< cut selector */
237  )
238 {
239  assert(cutsel != NULL);
240 
241  return cutsel->desc;
242 }
243 
244 /** copies the given cut selector to a new scip */
246  SCIP_CUTSEL* cutsel, /**< cut selector */
247  SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
248  )
249 {
250  assert(cutsel != NULL);
251  assert(set != NULL);
252  assert(set->scip != NULL);
253 
254  if( cutsel->cutselcopy != NULL )
255  {
256  SCIPsetDebugMsg(set, "including cut selector %s in subscip %p\n", SCIPcutselGetName(cutsel), (void*)set->scip);
257  SCIP_CALL( cutsel->cutselcopy(set->scip, cutsel) );
258  }
259  return SCIP_OKAY;
260 }
261 
262 /** frees memory of cut selector */
264  SCIP_CUTSEL** cutsel, /**< pointer to cut selector data structure */
265  SCIP_SET* set /**< global SCIP settings */
266  )
267 {
268  assert(cutsel != NULL);
269 
270  if( *cutsel == NULL )
271  return SCIP_OKAY;
272 
273  assert(!(*cutsel)->initialized);
274  assert(set != NULL);
275 
276  /* call destructor of cut selector */
277  if( (*cutsel)->cutselfree != NULL )
278  {
279  SCIP_CALL( (*cutsel)->cutselfree(set->scip, *cutsel) );
280  }
281 
282  /* free clocks */
283  SCIPclockFree(&(*cutsel)->cutseltime);
284  SCIPclockFree(&(*cutsel)->setuptime);
285 
286  BMSfreeMemoryArrayNull(&(*cutsel)->name);
287  BMSfreeMemoryArrayNull(&(*cutsel)->desc);
288  BMSfreeMemory(cutsel);
289 
290  return SCIP_OKAY;
291 }
292 
293 /** initializes cut selector */
295  SCIP_CUTSEL* cutsel, /**< cut selector */
296  SCIP_SET* set /**< global SCIP settings */
297  )
298 {
299  assert(cutsel != NULL);
300  assert(set != NULL);
301 
302  if( cutsel->initialized )
303  {
304  SCIPerrorMessage("cut selector <%s> already initialized", cutsel->name);
305  return SCIP_INVALIDCALL;
306  }
307 
308  if( set->misc_resetstat )
309  {
310  SCIPclockReset(cutsel->setuptime);
311  SCIPclockReset(cutsel->cutseltime);
312  }
313 
314  if( cutsel->cutselinit != NULL )
315  {
316  /* start timing */
317  SCIPclockStart(cutsel->setuptime, set);
318 
319  SCIP_CALL( cutsel->cutselinit(set->scip, cutsel) );
320 
321  /* stop timing */
322  SCIPclockStop(cutsel->setuptime, set);
323  }
324 
325  cutsel->initialized = TRUE;
326 
327  return SCIP_OKAY;
328 }
329 
330 /** deinitializes cut selector */
332  SCIP_CUTSEL* cutsel, /**< cut selector */
333  SCIP_SET* set /**< global SCIP settings */
334  )
335 {
336  assert(cutsel != NULL);
337  assert(set != NULL);
338 
339  if( !cutsel->initialized )
340  {
341  SCIPerrorMessage("cut selector <%s> not initialized", cutsel->name);
342  return SCIP_INVALIDCALL;
343  }
344 
345  if( cutsel->cutselexit != NULL )
346  {
347  /* start timing */
348  SCIPclockStart(cutsel->setuptime, set);
349 
350  SCIP_CALL( cutsel->cutselexit(set->scip, cutsel) );
351 
352  /* stop timing */
353  SCIPclockStop(cutsel->setuptime, set);
354  }
355  cutsel->initialized = FALSE;
356 
357  return SCIP_OKAY;
358 }
359 
360 /** informs cut selector that the branch and bound process is being started */
362  SCIP_CUTSEL* cutsel, /**< cut selector */
363  SCIP_SET* set /**< global SCIP settings */
364  )
365 {
366  assert(cutsel != NULL);
367  assert(set != NULL);
368 
369  /* call solving process initialization method of cut selector */
370  if( cutsel->cutselinitsol != NULL )
371  {
372  /* start timing */
373  SCIPclockStart(cutsel->setuptime, set);
374 
375  SCIP_CALL( cutsel->cutselinitsol(set->scip, cutsel) );
376 
377  /* stop timing */
378  SCIPclockStop(cutsel->setuptime, set);
379  }
380 
381  return SCIP_OKAY;
382 }
383 
384 /** informs cut selector that the branch and bound process is being started */
386  SCIP_CUTSEL* cutsel, /**< cut selector */
387  SCIP_SET* set /**< global SCIP settings */
388  )
389 {
390  assert(cutsel != NULL);
391  assert(set != NULL);
392 
393  /* call solving process deinitialization method of cut selector */
394  if( cutsel->cutselexitsol != NULL )
395  {
396  /* start timing */
397  SCIPclockStart(cutsel->setuptime, set);
398 
399  SCIP_CALL( cutsel->cutselexitsol(set->scip, cutsel) );
400 
401  /* stop timing */
402  SCIPclockStop(cutsel->setuptime, set);
403  }
404 
405  return SCIP_OKAY;
406 }
407 
408 /** gets user data of cut selector */
410  SCIP_CUTSEL* cutsel /**< cut selector */
411  )
412 {
413  assert(cutsel != NULL);
414 
415  return cutsel->cutseldata;
416 }
417 
418 /** sets user data of cut selector; user has to free old data in advance! */
420  SCIP_CUTSEL* cutsel, /**< cut selector */
421  SCIP_CUTSELDATA* cutseldata /**< new cut selector user data */
422 )
423 {
424  assert(cutsel != NULL);
425 
426  cutsel->cutseldata = cutseldata;
427 }
428 
429 /** gets priority of cut selector */
431  SCIP_CUTSEL* cutsel /**< cut selector */
432  )
433 {
434  assert(cutsel != NULL);
435 
436  return cutsel->priority;
437 }
438 
439 /** enables or disables all clocks of @p cutsel, depending on the value of the flag */
441  SCIP_CUTSEL* cutsel, /**< the cut selector for which all clocks should be enabled or disabled */
442  SCIP_Bool enable /**< should the clocks of the cut selector be enabled? */
443  )
444 {
445  assert(cutsel != NULL);
446 
447  SCIPclockEnableOrDisable(cutsel->setuptime, enable);
448  SCIPclockEnableOrDisable(cutsel->cutseltime, enable);
449 }
450 
451 
452 /* new callback/method setter methods */
453 
454 /** sets copy method of cut selector */
456  SCIP_CUTSEL* cutsel, /**< cut selector */
457  SCIP_DECL_CUTSELCOPY ((*cutselcopy)) /**< copy method of cut selector or NULL if you don't want to copy your plugin into sub-SCIPs */
458  )
459 {
460  assert(cutsel != NULL);
461 
462  cutsel->cutselcopy = cutselcopy;
463 }
464 
465 /** sets destructor method of cut selector */
467  SCIP_CUTSEL* cutsel, /**< cut selector */
468  SCIP_DECL_CUTSELFREE ((*cutselfree)) /**< destructor of cut selector */
469  )
470 {
471  assert(cutsel != NULL);
472 
473  cutsel->cutselfree = cutselfree;
474 }
475 
476 /** sets initialization method of cut selector */
478  SCIP_CUTSEL* cutsel, /**< cut selector */
479  SCIP_DECL_CUTSELINIT ((*cutselinit)) /**< initialize cut selector */
480  )
481 {
482  assert(cutsel != NULL);
483 
484  cutsel->cutselinit = cutselinit;
485 }
486 
487 /** sets deinitialization method of cut selector */
489  SCIP_CUTSEL* cutsel, /**< cut selector */
490  SCIP_DECL_CUTSELEXIT ((*cutselexit)) /**< deinitialize cut selector */
491  )
492 {
493  assert(cutsel != NULL);
494 
495  cutsel->cutselexit = cutselexit;
496 }
497 
498 /** sets solving process initialization method of cut selector */
500  SCIP_CUTSEL* cutsel, /**< cut selector */
501  SCIP_DECL_CUTSELINITSOL ((*cutselinitsol))/**< solving process initialization method of cut selector */
502  )
503 {
504  assert(cutsel != NULL);
505 
506  cutsel->cutselinitsol = cutselinitsol;
507 }
508 
509 /** sets solving process deinitialization method of cut selector */
511  SCIP_CUTSEL* cutsel, /**< cut selector */
512  SCIP_DECL_CUTSELEXITSOL ((*cutselexitsol))/**< solving process deinitialization method of cut selector */
513  )
514 {
515  assert(cutsel != NULL);
516 
517  cutsel->cutselexitsol = cutselexitsol;
518 }
519 
520 /** sets priority of cut selector */
522  SCIP_CUTSEL* cutsel, /**< cut selector */
523  SCIP_SET* set, /**< global SCIP settings */
524  int priority /**< new priority of the cut selector */
525  )
526 {
527  assert(cutsel != NULL);
528  assert(set != NULL);
529 
530  cutsel->priority = priority;
531  set->cutselssorted = FALSE;
532 }
533 
534 /** is cut selector initialized? */
536  SCIP_CUTSEL* cutsel /**< cut selector */
537  )
538 {
539  assert(cutsel != NULL);
540 
541  return cutsel->initialized;
542 }
543 
544 /** gets time in seconds used in this cut selector for setting up for next stages */
546  SCIP_CUTSEL* cutsel /**< cut selector */
547  )
548 {
549  assert(cutsel != NULL);
550 
551  return SCIPclockGetTime(cutsel->setuptime);
552 }
553 
554 /** gets time in seconds used in this cut selector */
556  SCIP_CUTSEL* cutsel /**< cut selector */
557  )
558 {
559  assert(cutsel != NULL);
560 
561  return SCIPclockGetTime(cutsel->cutseltime);
562 }
563 
564 /** get number of times the cutselector was called */
566  SCIP_CUTSEL* cutsel /**< cut selector */
567  )
568 {
569  assert(cutsel != NULL);
570 
571  return cutsel->ncalls;
572 }
573 
574 /** get number of times the cutselector was called at the root */
576  SCIP_CUTSEL* cutsel /**< cut selector */
577  )
578 {
579  assert(cutsel != NULL);
580 
581  return cutsel->nrootcalls;
582 }
583 
584 /** get total number of cuts that were selected at the root */
586  SCIP_CUTSEL* cutsel /**< cut selector */
587  )
588 {
589  assert(cutsel != NULL);
590 
591  return cutsel->nrootcutsselected;
592 }
593 
594 /** get total number of forced cuts that were selected at the root */
596  SCIP_CUTSEL* cutsel /**< cut selector */
597  )
598 {
599  assert(cutsel != NULL);
600 
601  return cutsel->nrootcutsforced;
602 }
603 
604 /** get total number of root cuts that were filtered */
606  SCIP_CUTSEL* cutsel /**< cut selector */
607  )
608 {
609  assert(cutsel != NULL);
610 
611  return cutsel->nrootcutsfiltered;
612 }
613 
614 /** get total number of local cuts that were selected */
616  SCIP_CUTSEL* cutsel /**< cut selector */
617  )
618 {
619  assert(cutsel != NULL);
620 
621  return cutsel->nlocalcutsselected;
622 }
623 
624 /** get total number of forced local cuts that were selected */
626  SCIP_CUTSEL* cutsel /**< cut selector */
627  )
628 {
629  assert(cutsel != NULL);
630 
631  return cutsel->nlocalcutsforced;
632 }
633 
634 /** get total number of local cuts that were filtered */
636  SCIP_CUTSEL* cutsel /**< cut selector */
637  )
638 {
639  assert(cutsel != NULL);
640 
641  return cutsel->nlocalcutsfiltered;
642 }
643 
644 /** compares two cut selectors w. r. to their priority */
645 SCIP_DECL_SORTPTRCOMP(SCIPcutselComp)
646 { /*lint --e{715}*/
647  return ((SCIP_CUTSEL*)elem2)->priority - ((SCIP_CUTSEL*)elem1)->priority;
648 }
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
const char * SCIPcutselGetName(SCIP_CUTSEL *cutsel)
Definition: cutsel.c:150
SCIP_RETCODE SCIPcutselFree(SCIP_CUTSEL **cutsel, SCIP_SET *set)
Definition: cutsel.c:263
SCIP_RETCODE SCIPcutselExitsol(SCIP_CUTSEL *cutsel, SCIP_SET *set)
Definition: cutsel.c:385
#define BMSfreeMemoryArrayNull(ptr)
Definition: memory.h:141
SCIP_CUTSELDATA * SCIPcutselGetData(SCIP_CUTSEL *cutsel)
Definition: cutsel.c:409
SCIP_PARAMDATA * SCIPparamGetData(SCIP_PARAM *param)
Definition: paramset.c:670
#define SCIP_DECL_CUTSELINITSOL(x)
Definition: type_cutsel.h:88
#define SCIP_MAXSTRLEN
Definition: def.h:293
internal methods for clocks and timing issues
struct SCIP_CutselData SCIP_CUTSELDATA
Definition: type_cutsel.h:44
SCIP_Longint SCIPcutselGetNCalls(SCIP_CUTSEL *cutsel)
Definition: cutsel.c:565
struct SCIP_ParamData SCIP_PARAMDATA
Definition: type_paramset.h:78
#define SCIP_CALL_FINALLY(x, y)
Definition: def.h:426
SCIP_Longint SCIPcutselGetNRootForcedCuts(SCIP_CUTSEL *cutsel)
Definition: cutsel.c:595
SCIP_RETCODE SCIPcutselCreate(SCIP_CUTSEL **cutsel, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, SCIP_DECL_CUTSELCOPY((*cutselcopy)), SCIP_DECL_CUTSELFREE((*cutselfree)), SCIP_DECL_CUTSELINIT((*cutselinit)), SCIP_DECL_CUTSELEXIT((*cutselexit)), SCIP_DECL_CUTSELINITSOL((*cutselinitsol)), SCIP_DECL_CUTSELEXITSOL((*cutselexitsol)), SCIP_DECL_CUTSELSELECT((*cutselselect)), SCIP_CUTSELDATA *cutseldata)
Definition: cutsel.c:119
SCIP_Longint nrootcutsselected
Definition: struct_cutsel.h:55
static SCIP_RETCODE doCutselCreate(SCIP_CUTSEL **cutsel, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, SCIP_DECL_CUTSELCOPY((*cutselcopy)), SCIP_DECL_CUTSELFREE((*cutselfree)), SCIP_DECL_CUTSELINIT((*cutselinit)), SCIP_DECL_CUTSELEXIT((*cutselexit)), SCIP_DECL_CUTSELINITSOL((*cutselinitsol)), SCIP_DECL_CUTSELEXITSOL((*cutselexitsol)), SCIP_DECL_CUTSELSELECT((*cutselselect)), SCIP_CUTSELDATA *cutseldata)
Definition: cutsel.c:53
void SCIPcutselSetPriority(SCIP_CUTSEL *cutsel, SCIP_SET *set, int priority)
Definition: cutsel.c:521
SCIP_Bool initialized
Definition: struct_cutsel.h:52
void SCIPclockStop(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:351
#define FALSE
Definition: def.h:87
internal methods for cut selectors
void SCIPclockStart(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:281
static SCIP_DECL_PARAMCHGD(paramChgdCutselPriority)
Definition: cutsel.c:38
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:10755
#define TRUE
Definition: def.h:86
void SCIPsetSortCutsels(SCIP_SET *set)
Definition: set.c:4365
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
SCIP_Longint nrootcutsfiltered
Definition: struct_cutsel.h:57
#define SCIP_DECL_CUTSELEXIT(x)
Definition: type_cutsel.h:77
void SCIPcutselEnableOrDisableClocks(SCIP_CUTSEL *cutsel, SCIP_Bool enable)
Definition: cutsel.c:440
SCIP_Longint SCIPcutselGetNRootCutsFiltered(SCIP_CUTSEL *cutsel)
Definition: cutsel.c:605
internal methods for handling parameter settings
void SCIPcutselSetData(SCIP_CUTSEL *cutsel, SCIP_CUTSELDATA *cutseldata)
Definition: cutsel.c:419
void SCIPclockEnableOrDisable(SCIP_CLOCK *clck, SCIP_Bool enable)
Definition: clock.c:251
#define BMSfreeMemory(ptr)
Definition: memory.h:138
SCIP_Longint nlocalcutsfiltered
Definition: struct_cutsel.h:60
Definition: heur_padm.c:123
#define SCIP_DECL_CUTSELSELECT(x)
Definition: type_cutsel.h:123
SCIP_CLOCK * setuptime
Definition: struct_cutsel.h:48
void SCIPcutselSetCopy(SCIP_CUTSEL *cutsel, SCIP_DECL_CUTSELCOPY((*cutselcopy)))
Definition: cutsel.c:455
SCIP_DECL_SORTPTRCOMP(SCIPcutselComp)
Definition: cutsel.c:645
SCIP_Longint nrootcalls
Definition: struct_cutsel.h:54
SCIP_RETCODE SCIPcutselCopyInclude(SCIP_CUTSEL *cutsel, SCIP_SET *set)
Definition: cutsel.c:245
SCIP_Longint SCIPcutselGetNRootCalls(SCIP_CUTSEL *cutsel)
Definition: cutsel.c:575
#define SCIPerrorMessage
Definition: pub_message.h:55
void SCIPclockReset(SCIP_CLOCK *clck)
Definition: clock.c:200
SCIP_Real SCIPcutselGetSetupTime(SCIP_CUTSEL *cutsel)
Definition: cutsel.c:545
SCIP_Longint SCIPcutselGetNLocalCutsFiltered(SCIP_CUTSEL *cutsel)
Definition: cutsel.c:635
#define SCIP_DECL_CUTSELINIT(x)
Definition: type_cutsel.h:69
SCIP_Real SCIPclockGetTime(SCIP_CLOCK *clck)
Definition: clock.c:429
SCIP_RETCODE SCIPcutselsSelect(SCIP_SET *set, SCIP_ROW **cuts, int ncuts, int nforcedcuts, SCIP_Bool root, SCIP_Bool initiallp, int maxnselectedcuts, int *nselectedcuts)
Definition: cutsel.c:160
#define NULL
Definition: lpi_spx1.cpp:155
internal methods for global SCIP settings
#define SCIP_CALL(x)
Definition: def.h:384
void SCIPcutselSetExitsol(SCIP_CUTSEL *cutsel, SCIP_DECL_CUTSELEXITSOL((*cutselexitsol)))
Definition: cutsel.c:510
#define SCIP_DECL_CUTSELCOPY(x)
Definition: type_cutsel.h:53
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:3020
#define BMSduplicateMemoryArray(ptr, source, num)
Definition: memory.h:136
SCIP_Longint SCIPcutselGetNRootCuts(SCIP_CUTSEL *cutsel)
Definition: cutsel.c:585
SCIP_RETCODE SCIPcutselInit(SCIP_CUTSEL *cutsel, SCIP_SET *set)
Definition: cutsel.c:294
SCIP_RETCODE SCIPclockCreate(SCIP_CLOCK **clck, SCIP_CLOCKTYPE clocktype)
Definition: clock.c:161
SCIP_Bool SCIPcutselIsInitialized(SCIP_CUTSEL *cutsel)
Definition: cutsel.c:535
#define SCIP_Bool
Definition: def.h:84
static const char * paramname[]
Definition: lpi_msk.c:5031
SCIP_RETCODE SCIPcutselExit(SCIP_CUTSEL *cutsel, SCIP_SET *set)
Definition: cutsel.c:331
void SCIPclockFree(SCIP_CLOCK **clck)
Definition: clock.c:176
const char * SCIPcutselGetDesc(SCIP_CUTSEL *cutsel)
Definition: cutsel.c:235
#define SCIPsetDebugMsg
Definition: set.h:1761
SCIP_RETCODE SCIPsetCutselPriority(SCIP *scip, SCIP_CUTSEL *cutsel, int priority)
Definition: scip_cutsel.c:249
void SCIPcutselSetFree(SCIP_CUTSEL *cutsel, SCIP_DECL_CUTSELFREE((*cutselfree)))
Definition: cutsel.c:466
#define BMSclearMemory(ptr)
Definition: memory.h:122
SCIP_Longint nlocalcutsselected
Definition: struct_cutsel.h:58
int SCIPparamGetInt(SCIP_PARAM *param)
Definition: paramset.c:725
void SCIPcutselSetExit(SCIP_CUTSEL *cutsel, SCIP_DECL_CUTSELEXIT((*cutselexit)))
Definition: cutsel.c:488
SCIP_Longint nrootcutsforced
Definition: struct_cutsel.h:56
SCIP_Longint nlocalcutsforced
Definition: struct_cutsel.h:59
data structures for cut selectors
SCIP_Longint SCIPcutselGetNLocalCuts(SCIP_CUTSEL *cutsel)
Definition: cutsel.c:615
SCIP_Longint ncalls
Definition: struct_cutsel.h:53
int SCIPcutselGetPriority(SCIP_CUTSEL *cutsel)
Definition: cutsel.c:430
#define SCIP_Real
Definition: def.h:177
SCIP_CUTSELDATA * cutseldata
Definition: struct_cutsel.h:50
void SCIPcutselSetInit(SCIP_CUTSEL *cutsel, SCIP_DECL_CUTSELINIT((*cutselinit)))
Definition: cutsel.c:477
#define SCIP_DECL_CUTSELFREE(x)
Definition: type_cutsel.h:61
#define BMSallocMemory(ptr)
Definition: memory.h:111
SCIP_CLOCK * cutseltime
Definition: struct_cutsel.h:49
#define SCIP_Longint
Definition: def.h:162
SCIP_Real SCIPcutselGetTime(SCIP_CUTSEL *cutsel)
Definition: cutsel.c:555
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:430
SCIP_Longint SCIPcutselGetNLocalForcedCuts(SCIP_CUTSEL *cutsel)
Definition: cutsel.c:625
#define SCIP_ALLOC(x)
Definition: def.h:395
#define SCIP_DECL_CUTSELEXITSOL(x)
Definition: type_cutsel.h:99
SCIP callable library.
SCIP_RETCODE SCIPcutselInitsol(SCIP_CUTSEL *cutsel, SCIP_SET *set)
Definition: cutsel.c:361
void SCIPcutselSetInitsol(SCIP_CUTSEL *cutsel, SCIP_DECL_CUTSELINITSOL((*cutselinitsol)))
Definition: cutsel.c:499