Scippy

SCIP

Solving Constraint Integer Programs

prop.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-2018 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 email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file prop.c
17  * @brief methods and datastructures for propagators
18  * @author Tobias Achterberg
19  * @author Timo Berthold
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/stat.h"
30 #include "scip/clock.h"
31 #include "scip/paramset.h"
32 #include "scip/var.h"
33 #include "scip/scip.h"
34 #include "scip/prop.h"
35 #include "scip/pub_message.h"
36 #include "scip/pub_misc.h"
37 
38 #include "scip/struct_prop.h"
39 
40 
41 /** compares two propagators w. r. to their priority */
42 SCIP_DECL_SORTPTRCOMP(SCIPpropComp)
43 { /*lint --e{715}*/
44  return ((SCIP_PROP*)elem2)->priority - ((SCIP_PROP*)elem1)->priority;
45 }
46 
47 /** compares two propagators w. r. to their priority */
48 SCIP_DECL_SORTPTRCOMP(SCIPpropCompPresol)
49 { /*lint --e{715}*/
50  return ((SCIP_PROP*)elem2)->presolpriority - ((SCIP_PROP*)elem1)->presolpriority;
51 }
52 
53 /** comparison method for sorting propagators w.r.t. to their name */
54 SCIP_DECL_SORTPTRCOMP(SCIPpropCompName)
55 {
56  return strcmp(SCIPpropGetName((SCIP_PROP*)elem1), SCIPpropGetName((SCIP_PROP*)elem2));
57 }
58 
59 /** method to call, when the priority of a propagator was changed */
60 static
61 SCIP_DECL_PARAMCHGD(paramChgdPropPriority)
62 { /*lint --e{715}*/
63  SCIP_PARAMDATA* paramdata;
64 
65  paramdata = SCIPparamGetData(param);
66  assert(paramdata != NULL);
67 
68  /* use SCIPsetPropPriority() to mark the props unsorted */
69  SCIP_CALL( SCIPsetPropPriority(scip, (SCIP_PROP*)paramdata, SCIPparamGetInt(param)) ); /*lint !e740*/
70 
71  return SCIP_OKAY;
72 }
73 
74 /** method to call, when the presolving priority of a propagator was changed */
75 static
76 SCIP_DECL_PARAMCHGD(paramChgdPropPresolPriority)
77 { /*lint --e{715}*/
78  SCIP_PARAMDATA* paramdata;
79 
80  paramdata = SCIPparamGetData(param);
81  assert(paramdata != NULL);
82 
83  /* use SCIPsetPropPriority() to mark the props unsorted */
84  SCIP_CALL( SCIPsetPropPresolPriority(scip, (SCIP_PROP*)paramdata, SCIPparamGetInt(param)) ); /*lint !e740*/
85 
86  return SCIP_OKAY;
87 }
88 
89 /** copies the given propagator to a new scip */
91  SCIP_PROP* prop, /**< propagator */
92  SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
93  )
94 {
95  assert(prop != NULL);
96  assert(set != NULL);
97  assert(set->scip != NULL);
98 
99  if( prop->propcopy != NULL )
100  {
101  SCIPsetDebugMsg(set, "including propagator %s in subscip %p\n", SCIPpropGetName(prop), (void*)set->scip);
102  SCIP_CALL( prop->propcopy(set->scip, prop) );
103  }
104  return SCIP_OKAY;
105 }
106 
107 /** creates a propagator */
109  SCIP_PROP** prop, /**< pointer to propagator data structure */
110  SCIP_SET* set, /**< global SCIP settings */
111  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
112  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
113  const char* name, /**< name of propagator */
114  const char* desc, /**< description of propagator */
115  int priority, /**< priority of the propagator (>= 0: before, < 0: after constraint handlers) */
116  int freq, /**< frequency for calling propagator */
117  SCIP_Bool delay, /**< should propagator be delayed, if other propagators found reductions? */
118  SCIP_PROPTIMING timingmask, /**< positions in the node solving loop where propagator should be executed */
119  int presolpriority, /**< priority of the propagator (>= 0: before, < 0: after constraint handlers) */
120  int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */
121  SCIP_PRESOLTIMING presoltiming, /**< timing mask of the propagator's presolving method */
122  SCIP_DECL_PROPCOPY ((*propcopy)), /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */
123  SCIP_DECL_PROPFREE ((*propfree)), /**< destructor of propagator */
124  SCIP_DECL_PROPINIT ((*propinit)), /**< initialize propagator */
125  SCIP_DECL_PROPEXIT ((*propexit)), /**< deinitialize propagator */
126  SCIP_DECL_PROPINITPRE ((*propinitpre)), /**< presolving initialization method of propagator */
127  SCIP_DECL_PROPEXITPRE ((*propexitpre)), /**< presolving deinitialization method of propagator */
128  SCIP_DECL_PROPINITSOL ((*propinitsol)), /**< solving process initialization method of propagator */
129  SCIP_DECL_PROPEXITSOL ((*propexitsol)), /**< solving process deinitialization method of propagator */
130  SCIP_DECL_PROPPRESOL ((*proppresol)), /**< presolving method */
131  SCIP_DECL_PROPEXEC ((*propexec)), /**< execution method of propagator */
132  SCIP_DECL_PROPRESPROP ((*propresprop)), /**< propagation conflict resolving method */
133  SCIP_PROPDATA* propdata /**< propagator data */
134  )
135 {
136  char paramname[SCIP_MAXSTRLEN];
137  char paramdesc[SCIP_MAXSTRLEN];
138 
139  assert(prop != NULL);
140  assert(name != NULL);
141  assert(desc != NULL);
142  assert(freq >= -1);
143  assert(propexec != NULL);
144 
145  /* the interface change from delay flags to timings cannot be recognized at compile time: Exit with an appropriate
146  * error message
147  */
148  if( presoltiming < SCIP_PRESOLTIMING_NONE || presoltiming > SCIP_PRESOLTIMING_MAX )
149  {
150  SCIPmessagePrintError("ERROR: 'PRESOLDELAY'-flag no longer available since SCIP 3.2, use an appropriate "
151  "'SCIP_PRESOLTIMING' for <%s> propagator instead.\n", name);
152 
153  return SCIP_PARAMETERWRONGVAL;
154  }
155 
156  SCIP_ALLOC( BMSallocMemory(prop) );
157  SCIP_ALLOC( BMSduplicateMemoryArray(&(*prop)->name, name, strlen(name)+1) );
158  SCIP_ALLOC( BMSduplicateMemoryArray(&(*prop)->desc, desc, strlen(desc)+1) );
159  (*prop)->priority = priority;
160  (*prop)->freq = freq;
161  (*prop)->propcopy = propcopy;
162  (*prop)->propfree = propfree;
163  (*prop)->propinit = propinit;
164  (*prop)->propexit = propexit;
165  (*prop)->propinitpre = propinitpre;
166  (*prop)->propexitpre = propexitpre;
167  (*prop)->propinitsol = propinitsol;
168  (*prop)->propexitsol = propexitsol;
169  (*prop)->proppresol = proppresol;
170  (*prop)->propexec = propexec;
171  (*prop)->propresprop = propresprop;
172  (*prop)->propdata = propdata;
173  SCIP_CALL( SCIPclockCreate(&(*prop)->setuptime, SCIP_CLOCKTYPE_DEFAULT) );
174  SCIP_CALL( SCIPclockCreate(&(*prop)->proptime, SCIP_CLOCKTYPE_DEFAULT) );
175  SCIP_CALL( SCIPclockCreate(&(*prop)->sbproptime, SCIP_CLOCKTYPE_DEFAULT) );
176  SCIP_CALL( SCIPclockCreate(&(*prop)->resproptime, SCIP_CLOCKTYPE_DEFAULT) );
177  SCIP_CALL( SCIPclockCreate(&(*prop)->presoltime, SCIP_CLOCKTYPE_DEFAULT) );
178  (*prop)->ncalls = 0;
179  (*prop)->nrespropcalls = 0;
180  (*prop)->ncutoffs = 0;
181  (*prop)->ndomredsfound = 0;
182  (*prop)->wasdelayed = FALSE;
183  (*prop)->initialized = FALSE;
184 
185  /* add parameters */
186  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/priority", name);
187  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "priority of propagator <%s>", name);
188  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem, paramname, paramdesc,
189  &(*prop)->priority, TRUE, priority, INT_MIN/4, INT_MAX/4,
190  paramChgdPropPriority, (SCIP_PARAMDATA*)(*prop)) ); /*lint !e740*/
191 
192  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/freq", name);
193  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "frequency for calling propagator <%s> (-1: never, 0: only in root node)", name);
194  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem, paramname, paramdesc,
195  &(*prop)->freq, FALSE, freq, -1, SCIP_MAXTREEDEPTH, NULL, NULL) );
196 
197  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/delay", name);
198  SCIP_CALL( SCIPsetAddBoolParam(set, messagehdlr, blkmem, paramname,
199  "should propagator be delayed, if other propagators found reductions?",
200  &(*prop)->delay, TRUE, delay, NULL, NULL) ); /*lint !e740*/
201 
202  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/timingmask", name);
203  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "timing when propagator should be called (%u:BEFORELP, %u:DURINGLPLOOP, %u:AFTERLPLOOP, %u:ALWAYS))",
205  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem, paramname, paramdesc,
206  (int*)(&(*prop)->timingmask), TRUE, timingmask, (int) SCIP_PROPTIMING_BEFORELP, (int) SCIP_PROPTIMING_ALWAYS, NULL, NULL) ); /*lint !e713*/
207 
208  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/presolpriority", name);
209  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "presolving priority of propagator <%s>", name);
210  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem, paramname, paramdesc,
211  &(*prop)->presolpriority, TRUE, presolpriority, INT_MIN/4, INT_MAX/4,
212  paramChgdPropPresolPriority, (SCIP_PARAMDATA*)(*prop)) ); /*lint !e740*/
213 
214  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/maxprerounds", name);
215  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem, paramname,
216  "maximal number of presolving rounds the propagator participates in (-1: no limit)",
217  &(*prop)->maxprerounds, FALSE, presolmaxrounds, -1, INT_MAX, NULL, NULL) ); /*lint !e740*/
218 
219  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/presoltiming", name);
220  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "timing mask of the presolving method of propagator <%s> (%u:FAST, %u:MEDIUM, %u:EXHAUSTIVE, %u:FINAL)",
222  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem, paramname, paramdesc,
223  (int*)&(*prop)->presoltiming, TRUE, (int)presoltiming, (int) SCIP_PRESOLTIMING_NONE, (int) SCIP_PRESOLTIMING_MAX, NULL, NULL) ); /*lint !e740*/
224 
225 
226  return SCIP_OKAY;
227 }
228 
229 /** calls destructor and frees memory of propagator */
231  SCIP_PROP** prop, /**< pointer to propagator data structure */
232  SCIP_SET* set /**< global SCIP settings */
233  )
234 {
235  assert(prop != NULL);
236  assert(*prop != NULL);
237  assert(!(*prop)->initialized);
238  assert(set != NULL);
239 
240  /* call destructor of propagator */
241  if( (*prop)->propfree != NULL )
242  {
243  SCIP_CALL( (*prop)->propfree(set->scip, *prop) );
244  }
245 
246  SCIPclockFree(&(*prop)->presoltime);
247  SCIPclockFree(&(*prop)->resproptime);
248  SCIPclockFree(&(*prop)->sbproptime);
249  SCIPclockFree(&(*prop)->proptime);
250  SCIPclockFree(&(*prop)->setuptime);
251  BMSfreeMemoryArray(&(*prop)->desc);
252  BMSfreeMemoryArray(&(*prop)->name);
253  BMSfreeMemory(prop);
254 
255  return SCIP_OKAY;
256 }
257 
258 /** initializes propagator */
260  SCIP_PROP* prop, /**< propagator */
261  SCIP_SET* set /**< global SCIP settings */
262  )
263 {
264  assert(prop != NULL);
265  assert(set != NULL);
266 
267  if( prop->initialized )
268  {
269  SCIPerrorMessage("propagator <%s> already initialized\n", prop->name);
270  return SCIP_INVALIDCALL;
271  }
272 
273  if( set->misc_resetstat )
274  {
275  SCIPclockReset(prop->proptime);
276  SCIPclockReset(prop->sbproptime);
278  SCIPclockReset(prop->presoltime);
279  SCIPclockReset(prop->setuptime);
280 
281  prop->ncalls = 0;
282  prop->nrespropcalls = 0;
283  prop->ncutoffs = 0;
284  prop->ndomredsfound = 0;
285  prop->lastnfixedvars = 0;
286  prop->lastnaggrvars = 0;
287  prop->lastnchgvartypes = 0;
288  prop->lastnchgbds = 0;
289  prop->lastnaddholes = 0;
290  prop->lastndelconss = 0;
291  prop->lastnaddconss = 0;
292  prop->lastnupgdconss = 0;
293  prop->lastnchgcoefs = 0;
294  prop->lastnchgsides = 0;
295  prop->nfixedvars = 0;
296  prop->naggrvars = 0;
297  prop->nchgvartypes = 0;
298  prop->nchgbds = 0;
299  prop->naddholes = 0;
300  prop->ndelconss = 0;
301  prop->naddconss = 0;
302  prop->nupgdconss = 0;
303  prop->nchgcoefs = 0;
304  prop->nchgsides = 0;
305  prop->npresolcalls = 0;
306  prop->wasdelayed = FALSE;
307  }
308 
309  if( prop->propinit != NULL )
310  {
311  /* start timing */
312  SCIPclockStart(prop->setuptime, set);
313 
314  SCIP_CALL( prop->propinit(set->scip, prop) );
315 
316  /* stop timing */
317  SCIPclockStop(prop->setuptime, set);
318  }
319  prop->initialized = TRUE;
320 
321  return SCIP_OKAY;
322 }
323 
324 /** calls exit method of propagator */
326  SCIP_PROP* prop, /**< propagator */
327  SCIP_SET* set /**< global SCIP settings */
328  )
329 {
330  assert(prop != NULL);
331  assert(set != NULL);
332 
333  if( !prop->initialized )
334  {
335  SCIPerrorMessage("propagator <%s> not initialized\n", prop->name);
336  return SCIP_INVALIDCALL;
337  }
338 
339  if( prop->propexit != NULL )
340  {
341  /* start timing */
342  SCIPclockStart(prop->setuptime, set);
343 
344  SCIP_CALL( prop->propexit(set->scip, prop) );
345 
346  /* stop timing */
347  SCIPclockStop(prop->setuptime, set);
348  }
349  prop->initialized = FALSE;
350 
351  return SCIP_OKAY;
352 }
353 
354 /** informs propagator that the presolving process is being started */
356  SCIP_PROP* prop, /**< propagator */
357  SCIP_SET* set /**< global SCIP settings */
358  )
359 {
360  assert(prop != NULL);
361  assert(set != NULL);
362 
363  prop->lastnfixedvars = 0;
364  prop->lastnaggrvars = 0;
365  prop->lastnchgvartypes = 0;
366  prop->lastnchgbds = 0;
367  prop->lastnaddholes = 0;
368  prop->lastndelconss = 0;
369  prop->lastnaddconss = 0;
370  prop->lastnupgdconss = 0;
371  prop->lastnchgcoefs = 0;
372  prop->lastnchgsides = 0;
373  prop->wasdelayed = FALSE;
374 
375  /* call presolving initialization method of propagator */
376  if( prop->propinitpre != NULL )
377  {
378  /* start timing */
379  SCIPclockStart(prop->setuptime, set);
380 
381  SCIP_CALL( prop->propinitpre(set->scip, prop) );
382 
383  /* stop timing */
384  SCIPclockStop(prop->setuptime, set);
385  }
386 
387  return SCIP_OKAY;
388 }
389 
390 /** informs propagator that the presolving process is finished */
392  SCIP_PROP* prop, /**< propagator */
393  SCIP_SET* set /**< global SCIP settings */
394  )
395 {
396  assert(prop != NULL);
397  assert(set != NULL);
398 
399  /* call presolving deinitialization method of propagator */
400  if( prop->propexitpre != NULL )
401  {
402  /* start timing */
403  SCIPclockStart(prop->setuptime, set);
404 
405  SCIP_CALL( prop->propexitpre(set->scip, prop) );
406 
407  /* stop timing */
408  SCIPclockStop(prop->setuptime, set);
409  }
410 
411  return SCIP_OKAY;
412 }
413 
414 /** informs propagator that the prop and bound process is being started */
416  SCIP_PROP* prop, /**< propagator */
417  SCIP_SET* set /**< global SCIP settings */
418  )
419 {
420  assert(prop != NULL);
421  assert(set != NULL);
422 
423  /* call solving process initialization method of propagator */
424  if( prop->propinitsol != NULL )
425  {
426  /* start timing */
427  SCIPclockStart(prop->setuptime, set);
428 
429  SCIP_CALL( prop->propinitsol(set->scip, prop) );
430 
431  /* stop timing */
432  SCIPclockStop(prop->setuptime, set);
433  }
434 
435  return SCIP_OKAY;
436 }
437 
438 /** informs propagator that the prop and bound process data is being freed */
440  SCIP_PROP* prop, /**< propagator */
441  SCIP_SET* set, /**< global SCIP settings */
442  SCIP_Bool restart /**< was this exit solve call triggered by a restart? */
443  )
444 {
445  assert(prop != NULL);
446  assert(set != NULL);
447 
448  /* call solving process deinitialization method of propagator */
449  if( prop->propexitsol != NULL )
450  {
451  /* start timing */
452  SCIPclockStart(prop->setuptime, set);
453 
454  SCIP_CALL( prop->propexitsol(set->scip, prop, restart) );
455 
456  /* stop timing */
457  SCIPclockStop(prop->setuptime, set);
458  }
459 
460  return SCIP_OKAY;
461 }
462 
463 /** executes presolving method of propagator */
465  SCIP_PROP* prop, /**< propagator */
466  SCIP_SET* set, /**< global SCIP settings */
467  SCIP_PRESOLTIMING timing, /**< current presolving timing */
468  int nrounds, /**< number of presolving rounds already done */
469  int* nfixedvars, /**< pointer to total number of variables fixed of all presolvers */
470  int* naggrvars, /**< pointer to total number of variables aggregated of all presolvers */
471  int* nchgvartypes, /**< pointer to total number of variable type changes of all presolvers */
472  int* nchgbds, /**< pointer to total number of variable bounds tightened of all presolvers */
473  int* naddholes, /**< pointer to total number of domain holes added of all presolvers */
474  int* ndelconss, /**< pointer to total number of deleted constraints of all presolvers */
475  int* naddconss, /**< pointer to total number of added constraints of all presolvers */
476  int* nupgdconss, /**< pointer to total number of upgraded constraints of all presolvers */
477  int* nchgcoefs, /**< pointer to total number of changed coefficients of all presolvers */
478  int* nchgsides, /**< pointer to total number of changed left/right hand sides of all presolvers */
479  SCIP_RESULT* result /**< pointer to store the result of the callback method */
480  )
481 {
482  assert(prop != NULL);
483  assert(set != NULL);
484  assert(nfixedvars != NULL);
485  assert(naggrvars != NULL);
486  assert(nchgvartypes != NULL);
487  assert(nchgbds != NULL);
488  assert(naddholes != NULL);
489  assert(ndelconss != NULL);
490  assert(naddconss != NULL);
491  assert(nupgdconss != NULL);
492  assert(nchgcoefs != NULL);
493  assert(nchgsides != NULL);
494  assert(result != NULL);
495 
496  *result = SCIP_DIDNOTRUN;
497 
498  if( prop->proppresol == NULL )
499  return SCIP_OKAY;
500 
501  /* check number of presolving rounds */
502  if( prop->maxprerounds >= 0 && nrounds >= prop->maxprerounds )
503  return SCIP_OKAY;
504 
505  /* check, if presolver should be delayed */
506  if( prop->presoltiming & timing )
507  {
508  int nnewfixedvars;
509  int nnewaggrvars;
510  int nnewchgvartypes;
511  int nnewchgbds;
512  int nnewaddholes;
513  int nnewdelconss;
514  int nnewaddconss;
515  int nnewupgdconss;
516  int nnewchgcoefs;
517  int nnewchgsides;
518 
519  SCIPsetDebugMsg(set, "calling presolving method of propagator <%s>\n", prop->name);
520 
521  /* calculate the number of changes since last call */
522  nnewfixedvars = *nfixedvars - prop->lastnfixedvars;
523  nnewaggrvars = *naggrvars - prop->lastnaggrvars;
524  nnewchgvartypes = *nchgvartypes - prop->lastnchgvartypes;
525  nnewchgbds = *nchgbds - prop->lastnchgbds;
526  nnewaddholes = *naddholes - prop->lastnaddholes;
527  nnewdelconss = *ndelconss - prop->lastndelconss;
528  nnewaddconss = *naddconss - prop->lastnaddconss;
529  nnewupgdconss = *nupgdconss - prop->lastnupgdconss;
530  nnewchgcoefs = *nchgcoefs - prop->lastnchgcoefs;
531  nnewchgsides = *nchgsides - prop->lastnchgsides;
532 
533  /* remember the number of changes prior to the call of the presolver method of the propagator */
534  prop->lastnfixedvars = *nfixedvars;
535  prop->lastnaggrvars = *naggrvars;
536  prop->lastnchgvartypes = *nchgvartypes;
537  prop->lastnchgbds = *nchgbds;
538  prop->lastnaddholes = *naddholes;
539  prop->lastndelconss = *ndelconss;
540  prop->lastnaddconss = *naddconss;
541  prop->lastnupgdconss = *nupgdconss;
542  prop->lastnchgcoefs = *nchgcoefs;
543  prop->lastnchgsides = *nchgsides;
544 
545  /* start timing */
546  SCIPclockStart(prop->presoltime, set);
547 
548  /* call external method */
549  SCIP_CALL( prop->proppresol(set->scip, prop, nrounds, timing,
550  nnewfixedvars, nnewaggrvars, nnewchgvartypes, nnewchgbds, nnewaddholes,
551  nnewdelconss, nnewaddconss, nnewupgdconss, nnewchgcoefs, nnewchgsides,
552  nfixedvars, naggrvars, nchgvartypes, nchgbds, naddholes,
553  ndelconss, naddconss, nupgdconss, nchgcoefs, nchgsides, result) );
554 
555  /* stop timing */
556  SCIPclockStop(prop->presoltime, set);
557 
558  /* add/count the new changes */
559  prop->nfixedvars += *nfixedvars - prop->lastnfixedvars;
560  prop->naggrvars += *naggrvars - prop->lastnaggrvars;
561  prop->nchgvartypes += *nchgvartypes - prop->lastnchgvartypes;
562  prop->nchgbds += *nchgbds - prop->lastnchgbds;
563  prop->naddholes += *naddholes - prop->lastnaddholes;
564  prop->ndelconss += *ndelconss - prop->lastndelconss;
565  prop->naddconss += *naddconss - prop->lastnaddconss;
566  prop->nupgdconss += *nupgdconss - prop->lastnupgdconss;
567  prop->nchgcoefs += *nchgcoefs - prop->lastnchgcoefs;
568  prop->nchgsides += *nchgsides - prop->lastnchgsides;
569 
570  /* check result code of callback method */
571  if( *result != SCIP_CUTOFF
572  && *result != SCIP_UNBOUNDED
573  && *result != SCIP_SUCCESS
574  && *result != SCIP_DIDNOTFIND
575  && *result != SCIP_DIDNOTRUN )
576  {
577  SCIPerrorMessage("propagator <%s> returned invalid result <%d>\n", prop->name, *result);
578  return SCIP_INVALIDRESULT;
579  }
580 
581  /* increase the number of presolving calls, if the propagator tried to find reductions */
582  if( *result != SCIP_DIDNOTRUN )
583  ++(prop->npresolcalls);
584  }
585 
586  return SCIP_OKAY;
587 }
588 
589 /** calls execution method of propagator */
591  SCIP_PROP* prop, /**< propagator */
592  SCIP_SET* set, /**< global SCIP settings */
593  SCIP_STAT* stat, /**< dynamic problem statistics */
594  int depth, /**< depth of current node */
595  SCIP_Bool execdelayed, /**< execute propagator even if it is marked to be delayed */
596  SCIP_Bool instrongbranching, /**< are we currently doing strong branching? */
597  SCIP_PROPTIMING proptiming, /**< current point in the node solving process */
598  SCIP_RESULT* result /**< pointer to store the result of the callback method */
599  )
600 {
601  assert(prop != NULL);
602  assert(prop->propexec != NULL);
603  assert(prop->freq >= -1);
604  assert(set != NULL);
605  assert(set->scip != NULL);
606  assert(stat != NULL);
607  assert(depth >= 0);
608  assert(result != NULL);
609 
610  if( (depth == 0 && prop->freq == 0) || (prop->freq > 0 && depth % prop->freq == 0) )
611  {
612  if( !prop->delay || execdelayed )
613  {
614  SCIP_Longint oldndomchgs;
615  SCIP_Longint oldnprobdomchgs;
616 
617  SCIPsetDebugMsg(set, "executing propagator <%s>\n", prop->name);
618 
619  oldndomchgs = stat->nboundchgs + stat->nholechgs;
620  oldnprobdomchgs = stat->nprobboundchgs + stat->nprobholechgs;
621 
622  /* start timing */
623  if( instrongbranching )
624  SCIPclockStart(prop->sbproptime, set);
625  else
626  SCIPclockStart(prop->proptime, set);
627 
628  /* call external propagation method */
629  SCIP_CALL( prop->propexec(set->scip, prop, proptiming, result) );
630 
631  /* stop timing */
632  if( instrongbranching )
633  SCIPclockStop(prop->sbproptime, set);
634  else
635  SCIPclockStop(prop->proptime, set);
636 
637  /* update statistics */
638  if( *result != SCIP_DIDNOTRUN && *result != SCIP_DELAYED )
639  prop->ncalls++;
640  if( *result == SCIP_CUTOFF )
641  prop->ncutoffs++;
642 
643  /* update domain reductions; therefore remove the domain
644  * reduction counts which were generated in probing mode */
645  prop->ndomredsfound += stat->nboundchgs + stat->nholechgs - oldndomchgs;
646  prop->ndomredsfound -= (stat->nprobboundchgs + stat->nprobholechgs - oldnprobdomchgs);
647 
648  /* evaluate result */
649  if( *result != SCIP_CUTOFF
650  && *result != SCIP_REDUCEDDOM
651  && *result != SCIP_DIDNOTFIND
652  && *result != SCIP_DIDNOTRUN
653  && *result != SCIP_DELAYED
654  && *result != SCIP_DELAYNODE )
655  {
656  SCIPerrorMessage("execution method of propagator <%s> returned invalid result <%d>\n",
657  prop->name, *result);
658  return SCIP_INVALIDRESULT;
659  }
660  }
661  else
662  {
663  SCIPsetDebugMsg(set, "propagator <%s> was delayed\n", prop->name);
664  *result = SCIP_DELAYED;
665  }
666 
667  /* remember whether propagator was delayed */
668  prop->wasdelayed = (*result == SCIP_DELAYED);
669  }
670  else
671  *result = SCIP_DIDNOTRUN;
672 
673  return SCIP_OKAY;
674 }
675 
676 /** resolves the given conflicting bound, that was deduced by the given propagator, by putting all "reason" bounds
677  * leading to the deduction into the conflict queue with calls to SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(),
678  * SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), or SCIPaddConflictBinvar();
679  *
680  * @note it is sufficient to explain the relaxed bound change
681  */
683  SCIP_PROP* prop, /**< propagator */
684  SCIP_SET* set, /**< global SCIP settings */
685  SCIP_VAR* infervar, /**< variable whose bound was deduced by the constraint */
686  int inferinfo, /**< user inference information attached to the bound change */
687  SCIP_BOUNDTYPE inferboundtype, /**< bound that was deduced (lower or upper bound) */
688  SCIP_BDCHGIDX* bdchgidx, /**< bound change index, representing the point of time where change took place */
689  SCIP_Real relaxedbd, /**< the relaxed bound */
690  SCIP_RESULT* result /**< pointer to store the result of the callback method */
691  )
692 {
693  assert(prop != NULL);
694  assert((inferboundtype == SCIP_BOUNDTYPE_LOWER
695  && SCIPgetVarLbAtIndex(set->scip, infervar, bdchgidx, TRUE) > SCIPvarGetLbGlobal(infervar))
696  || (inferboundtype == SCIP_BOUNDTYPE_UPPER
697  && SCIPgetVarUbAtIndex(set->scip, infervar, bdchgidx, TRUE) < SCIPvarGetUbGlobal(infervar)));
698  assert(result != NULL);
699 
700  *result = SCIP_DIDNOTRUN;
701 
702  if( prop->propresprop != NULL )
703  {
704 
705  /* start timing */
706  SCIPclockStart(prop->resproptime, set);
707 
708  SCIP_CALL( prop->propresprop(set->scip, prop, infervar, inferinfo, inferboundtype, bdchgidx,
709  relaxedbd, result) );
710 
711  /* stop timing */
712  SCIPclockStop(prop->resproptime, set);
713 
714  /* update statistic */
715  prop->nrespropcalls++;
716 
717  /* check result code */
718  if( *result != SCIP_SUCCESS && *result != SCIP_DIDNOTFIND )
719  {
720  SCIPerrorMessage("propagation conflict resolving method of propagator <%s> returned invalid result <%d>\n",
721  prop->name, *result);
722  return SCIP_INVALIDRESULT;
723  }
724  }
725  else
726  {
727  SCIPerrorMessage("propagation conflict resolving method of propagator <%s> is not implemented\n", prop->name);
728  return SCIP_PLUGINNOTFOUND;
729  }
730 
731  return SCIP_OKAY;
732 }
733 
734 /** gets user data of propagator */
736  SCIP_PROP* prop /**< propagator */
737  )
738 {
739  assert(prop != NULL);
740 
741  return prop->propdata;
742 }
743 
744 /** sets user data of propagator; user has to free old data in advance! */
746  SCIP_PROP* prop, /**< propagator */
747  SCIP_PROPDATA* propdata /**< new propagator user data */
748  )
749 {
750  assert(prop != NULL);
751 
752  prop->propdata = propdata;
753 }
754 
755 /** sets copy method of propagator */
757  SCIP_PROP* prop, /**< propagator */
758  SCIP_DECL_PROPCOPY ((*propcopy)) /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */
759  )
760 {
761  assert(prop != NULL);
762 
763  prop->propcopy = propcopy;
764 }
765 
766 /** sets destructor method of propagator */
768  SCIP_PROP* prop, /**< propagator */
769  SCIP_DECL_PROPFREE ((*propfree)) /**< destructor of propagator */
770  )
771 {
772  assert(prop != NULL);
773 
774  prop->propfree = propfree;
775 }
776 
777 /** sets initialization method of propagator */
779  SCIP_PROP* prop, /**< propagator */
780  SCIP_DECL_PROPINIT ((*propinit)) /**< initialize propagator */
781  )
782 {
783  assert(prop != NULL);
784 
785  prop->propinit = propinit;
786 }
787 
788 /** sets deinitialization method of propagator */
790  SCIP_PROP* prop, /**< propagator */
791  SCIP_DECL_PROPEXIT ((*propexit)) /**< deinitialize propagator */
792  )
793 {
794  assert(prop != NULL);
795 
796  prop->propexit = propexit;
797 }
798 
799 /** sets solving process initialization method of propagator */
801  SCIP_PROP* prop, /**< propagator */
802  SCIP_DECL_PROPINITSOL((*propinitsol)) /**< solving process initialization method of propagator */
803  )
804 {
805  assert(prop != NULL);
806 
807  prop->propinitsol = propinitsol;
808 }
809 
810 /** sets solving process deinitialization method of propagator */
812  SCIP_PROP* prop, /**< propagator */
813  SCIP_DECL_PROPEXITSOL ((*propexitsol)) /**< solving process deinitialization method of propagator */
814  )
815 {
816  assert(prop != NULL);
817 
818  prop->propexitsol = propexitsol;
819 }
820 
821 /** sets preprocessing initialization method of propagator */
823  SCIP_PROP* prop, /**< propagator */
824  SCIP_DECL_PROPINITPRE((*propinitpre)) /**< preprocessing initialization method of propagator */
825  )
826 {
827  assert(prop != NULL);
828 
829  prop->propinitpre = propinitpre;
830 }
831 
832 
833 
834 /** sets preprocessing deinitialization method of propagator */
836  SCIP_PROP* prop, /**< propagator */
837  SCIP_DECL_PROPEXITPRE((*propexitpre)) /**< preprocessing deinitialization method of propagator */
838  )
839 {
840  assert(prop != NULL);
841 
842  prop->propexitpre = propexitpre;
843 }
844 
845 /** sets presolving method of propagator */
847  SCIP_PROP* prop, /**< propagator */
848  SCIP_DECL_PROPPRESOL ((*proppresol)), /**< presolving method */
849  int presolpriority, /**< presolving priority of the propagator (>= 0: before, < 0: after constraint handlers) */
850  int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */
851  SCIP_PRESOLTIMING presoltiming /**< timing mask of the propagator's presolving method */
852  )
853 {
854  assert(prop != NULL);
855 
856  prop->proppresol = proppresol;
857  prop->presolpriority = presolpriority;
858  /* the interface change from delay flags to timings cannot be recognized at compile time: Exit with an appropriate
859  * error message
860  */
861  if( presoltiming < SCIP_PRESOLTIMING_FAST || presoltiming > SCIP_PRESOLTIMING_MAX )
862  {
863  SCIPmessagePrintError("ERROR: 'PRESOLDELAY'-flag no longer available since SCIP 3.2, use an appropriate "
864  "'SCIP_PRESOLTIMING' for <%s> constraint handler instead.\n", prop->name);
865 
866  return SCIP_PARAMETERWRONGVAL;
867  }
868 
869  prop->presoltiming = presoltiming;
870  prop->maxprerounds = presolmaxrounds;
871 
872  return SCIP_OKAY;
873 }
874 
875 /** sets propagation conflict resolving callback of propagator */
877  SCIP_PROP* prop, /**< propagator */
878  SCIP_DECL_PROPRESPROP ((*propresprop)) /**< propagation conflict resolving callback */
879  )
880 {
881  assert(prop != NULL);
882 
883  prop->propresprop = propresprop;
884 }
885 
886 /** gets name of propagator */
887 const char* SCIPpropGetName(
888  SCIP_PROP* prop /**< propagator */
889  )
890 {
891  assert(prop != NULL);
892 
893  return prop->name;
894 }
895 
896 /** gets description of propagator */
897 const char* SCIPpropGetDesc(
898  SCIP_PROP* prop /**< propagator */
899  )
900 {
901  assert(prop != NULL);
902 
903  return prop->desc;
904 }
905 
906 /** gets priority of propagator */
908  SCIP_PROP* prop /**< propagator */
909  )
910 {
911  assert(prop != NULL);
912 
913  return prop->priority;
914 }
915 
916 /** gets presolving priority of propagator */
918  SCIP_PROP* prop /**< propagator */
919  )
920 {
921  assert(prop != NULL);
922 
923  return prop->presolpriority;
924 }
925 
926 /** sets priority of propagator */
928  SCIP_PROP* prop, /**< propagator */
929  SCIP_SET* set, /**< global SCIP settings */
930  int priority /**< new priority of the propagator */
931  )
932 {
933  assert(prop != NULL);
934  assert(set != NULL);
935 
936  prop->priority = priority;
937  set->propssorted = FALSE;
938 }
939 
940 /** sets presolving priority of propagator */
942  SCIP_PROP* prop, /**< propagator */
943  SCIP_SET* set, /**< global SCIP settings */
944  int presolpriority /**< new priority of the propagator */
945  )
946 {
947  assert(prop != NULL);
948  assert(set != NULL);
949 
950  prop->presolpriority = presolpriority;
951  set->propspresolsorted = FALSE;
952 }
953 
954 /** gets frequency of propagator */
956  SCIP_PROP* prop /**< propagator */
957  )
958 {
959  assert(prop != NULL);
960 
961  return prop->freq;
962 }
963 
964 /** enables or disables all clocks of \p prop, depending on the value of the flag */
966  SCIP_PROP* prop, /**< the propagator for which all clocks should be enabled or disabled */
967  SCIP_Bool enable /**< should the clocks of the propagator be enabled? */
968  )
969 {
970  assert(prop != NULL);
971 
972  SCIPclockEnableOrDisable(prop->setuptime, enable);
973  SCIPclockEnableOrDisable(prop->presoltime, enable);
974  SCIPclockEnableOrDisable(prop->proptime, enable);
975  SCIPclockEnableOrDisable(prop->resproptime, enable);
976  SCIPclockEnableOrDisable(prop->sbproptime, enable);
977 }
978 
979 /** gets time in seconds used for setting up this propagator for new stages */
981  SCIP_PROP* prop /**< propagator */
982  )
983 {
984  assert(prop != NULL);
985 
986  return SCIPclockGetTime(prop->setuptime);
987 }
988 
989 /** sets frequency of propagator */
991  SCIP_PROP* prop, /**< propagator */
992  int freq /**< new frequency of propagator */
993  )
994 {
995  assert(prop != NULL);
996  assert(freq >= -1);
997 
998  prop->freq = freq;
999 }
1000 
1001 /** gets time in seconds used in this propagator for propagation */
1003  SCIP_PROP* prop /**< propagator */
1004  )
1005 {
1006  assert(prop != NULL);
1007 
1008  return SCIPclockGetTime(prop->proptime);
1009 }
1010 
1011 /** gets time in seconds used in this propagator for propagation during strong branching */
1013  SCIP_PROP* prop /**< propagator */
1014  )
1015 {
1016  assert(prop != NULL);
1017 
1018  return SCIPclockGetTime(prop->sbproptime);
1019 }
1020 
1021 /** gets time in seconds used in this propagator for resolve propagation */
1023  SCIP_PROP* prop /**< propagator */
1024  )
1025 {
1026  assert(prop != NULL);
1027 
1028  return SCIPclockGetTime(prop->resproptime);
1029 }
1030 
1031 /** gets time in seconds used in this propagator for presolving */
1033  SCIP_PROP* prop /**< propagator */
1034  )
1035 {
1036  assert(prop != NULL);
1037 
1038  return SCIPclockGetTime(prop->presoltime);
1039 }
1040 
1041 /** gets the total number of times, the propagator was called */
1043  SCIP_PROP* prop /**< propagator */
1044  )
1045 {
1046  assert(prop != NULL);
1047 
1048  return prop->ncalls;
1049 }
1050 
1051 /** gets the total number of times, the propagator was called for resolving a propagation */
1053  SCIP_PROP* prop /**< propagator */
1054  )
1055 {
1056  assert(prop != NULL);
1057 
1058  return prop->nrespropcalls;
1059 }
1060 
1061 /** gets total number of times, this propagator detected a cutoff */
1063  SCIP_PROP* prop /**< propagator */
1064  )
1065 {
1066  assert(prop != NULL);
1067 
1068  return prop->ncutoffs;
1069 }
1070 
1071 /** gets total number of domain reductions found by this propagator */
1073  SCIP_PROP* prop /**< propagator */
1074  )
1075 {
1076  assert(prop != NULL);
1077 
1078  return prop->ndomredsfound;
1079 }
1080 
1081 /** should propagator be delayed, if other propagators found reductions? */
1083  SCIP_PROP* prop /**< propagator */
1084  )
1085 {
1086  assert(prop != NULL);
1087 
1088  return prop->delay;
1089 }
1090 
1091 /** was propagator delayed at the last call? */
1093  SCIP_PROP* prop /**< propagator */
1094  )
1095 {
1096  assert(prop != NULL);
1097 
1098  return prop->wasdelayed;
1099 }
1100 
1101 /** is propagator initialized? */
1103  SCIP_PROP* prop /**< propagator */
1104  )
1105 {
1106  assert(prop != NULL);
1107 
1108  return prop->initialized;
1109 }
1110 
1111 /** gets number of variables fixed during presolving of propagator */
1113  SCIP_PROP* prop /**< propagator */
1114  )
1115 {
1116  assert(prop != NULL);
1117 
1118  return prop->nfixedvars;
1119 }
1120 
1121 /** gets number of variables aggregated during presolving of propagator */
1123  SCIP_PROP* prop /**< propagator */
1124  )
1125 {
1126  assert(prop != NULL);
1127 
1128  return prop->naggrvars;
1129 }
1130 
1131 /** gets number of variable types changed during presolving of propagator */
1133  SCIP_PROP* prop /**< propagator */
1134  )
1135 {
1136  assert(prop != NULL);
1137 
1138  return prop->nchgvartypes;
1139 }
1140 
1141 /** gets number of bounds changed during presolving of propagator */
1143  SCIP_PROP* prop /**< propagator */
1144  )
1145 {
1146  assert(prop != NULL);
1147 
1148  return prop->nchgbds;
1149 }
1150 
1151 /** gets number of holes added to domains of variables during presolving of propagator */
1153  SCIP_PROP* prop /**< propagator */
1154  )
1155 {
1156  assert(prop != NULL);
1157 
1158  return prop->naddholes;
1159 }
1160 
1161 /** gets number of constraints deleted during presolving of propagator */
1163  SCIP_PROP* prop /**< propagator */
1164  )
1165 {
1166  assert(prop != NULL);
1167 
1168  return prop->ndelconss;
1169 }
1170 
1171 /** gets number of constraints added during presolving of propagator */
1173  SCIP_PROP* prop /**< propagator */
1174  )
1175 {
1176  assert(prop != NULL);
1177 
1178  return prop->naddconss;
1179 }
1180 
1181 /** gets number of constraints upgraded during presolving of propagator */
1183  SCIP_PROP* prop /**< propagator */
1184  )
1185 {
1186  assert(prop != NULL);
1187 
1188  return prop->nupgdconss;
1189 }
1190 
1191 /** gets number of coefficients changed during presolving of propagator */
1193  SCIP_PROP* prop /**< propagator */
1194  )
1195 {
1196  assert(prop != NULL);
1197 
1198  return prop->nchgcoefs;
1199 }
1200 
1201 /** gets number of constraint sides changed during presolving of propagator */
1203  SCIP_PROP* prop /**< propagator */
1204  )
1205 {
1206  assert(prop != NULL);
1207 
1208  return prop->nchgsides;
1209 }
1210 
1211 /** gets number of times the propagator was called in presolving and tried to find reductions */
1213  SCIP_PROP* prop /**< propagator */
1214  )
1215 {
1216  assert(prop != NULL);
1217 
1218  return prop->npresolcalls;
1219 }
1220 
1221 /** returns the timing mask of the propagator */
1223  SCIP_PROP* prop /**< propagator */
1224  )
1225 {
1226  assert(prop != NULL);
1227 
1228  return prop->timingmask;
1229 }
1230 
1231 /** does the propagator perform presolving? */
1233  SCIP_PROP* prop /**< propagator */
1234  )
1235 {
1236  assert(prop != NULL);
1237 
1238  return (prop->proppresol != NULL);
1239 }
1240 
1241 /** returns the timing mask of the presolving method of the propagator */
1243  SCIP_PROP* prop /**< propagator */
1244  )
1245 {
1246  assert(prop != NULL);
1247 
1248  return prop->presoltiming;
1249 }
1250 
1251 /** sets the timing mask of the presolving method of the propagator */
1253  SCIP_PROP* prop, /**< propagator */
1254  SCIP_PRESOLTIMING presoltiming /** timing mask to be set */
1255  )
1256 {
1257  assert(prop != NULL);
1258 
1259  prop->presoltiming = presoltiming;
1260 }
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
int lastndelconss
Definition: struct_prop.h:73
enum SCIP_BoundType SCIP_BOUNDTYPE
Definition: type_lp.h:50
void SCIPpropSetPresolTiming(SCIP_PROP *prop, SCIP_PRESOLTIMING presoltiming)
Definition: prop.c:1252
SCIP_RETCODE SCIPpropExitpre(SCIP_PROP *prop, SCIP_SET *set)
Definition: prop.c:391
int nfixedvars
Definition: struct_prop.h:78
SCIP_RETCODE SCIPpropInitsol(SCIP_PROP *prop, SCIP_SET *set)
Definition: prop.c:415
int SCIPpropGetNUpgdConss(SCIP_PROP *prop)
Definition: prop.c:1182
void SCIPpropSetCopy(SCIP_PROP *prop, SCIP_DECL_PROPCOPY((*propcopy)))
Definition: prop.c:756
SCIP_Real SCIPgetVarUbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: scip.c:19649
SCIP_PRESOLTIMING SCIPpropGetPresolTiming(SCIP_PROP *prop)
Definition: prop.c:1242
SCIP_Real SCIPgetVarLbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: scip.c:19509
SCIP_Real SCIPpropGetRespropTime(SCIP_PROP *prop)
Definition: prop.c:1022
SCIP_RETCODE SCIPpropCopyInclude(SCIP_PROP *prop, SCIP_SET *set)
Definition: prop.c:90
SCIP_PARAMDATA * SCIPparamGetData(SCIP_PARAM *param)
Definition: paramset.c:661
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
Definition: var.c:17276
SCIP_Longint SCIPpropGetNRespropCalls(SCIP_PROP *prop)
Definition: prop.c:1052
int SCIPpropGetNChgSides(SCIP_PROP *prop)
Definition: prop.c:1202
#define SCIP_MAXSTRLEN
Definition: def.h:259
int lastnaddholes
Definition: struct_prop.h:72
internal methods for clocks and timing issues
int ndelconss
Definition: struct_prop.h:83
SCIP_RETCODE SCIPpropPresol(SCIP_PROP *prop, SCIP_SET *set, SCIP_PRESOLTIMING timing, int nrounds, int *nfixedvars, int *naggrvars, int *nchgvartypes, int *nchgbds, int *naddholes, int *ndelconss, int *naddconss, int *nupgdconss, int *nchgcoefs, int *nchgsides, SCIP_RESULT *result)
Definition: prop.c:464
char * desc
Definition: struct_prop.h:44
struct SCIP_ParamData SCIP_PARAMDATA
Definition: type_paramset.h:76
int maxprerounds
Definition: struct_prop.h:67
int SCIPpropGetPriority(SCIP_PROP *prop)
Definition: prop.c:907
SCIP_Bool SCIPpropIsDelayed(SCIP_PROP *prop)
Definition: prop.c:1082
int naddholes
Definition: struct_prop.h:82
SCIP_CLOCK * presoltime
Definition: struct_prop.h:61
SCIP_CLOCK * proptime
Definition: struct_prop.h:58
int npresolcalls
Definition: struct_prop.h:88
SCIP_Longint SCIPpropGetNCalls(SCIP_PROP *prop)
Definition: prop.c:1042
SCIP_Longint ncalls
Definition: struct_prop.h:39
SCIP_Longint nholechgs
Definition: struct_stat.h:105
#define SCIP_PROPTIMING_DURINGLPLOOP
Definition: type_timing.h:57
void SCIPclockStop(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:350
int nupgdconss
Definition: struct_prop.h:85
#define FALSE
Definition: def.h:64
int nchgbds
Definition: struct_prop.h:81
SCIP_Longint ncutoffs
Definition: struct_prop.h:41
void SCIPpropSetExitsol(SCIP_PROP *prop, SCIP_DECL_PROPEXITSOL((*propexitsol)))
Definition: prop.c:811
SCIP_Longint SCIPpropGetNCutoffs(SCIP_PROP *prop)
Definition: prop.c:1062
void SCIPclockStart(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:280
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:10011
#define TRUE
Definition: def.h:63
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
#define SCIP_DECL_PROPEXITPRE(x)
Definition: type_prop.h:100
#define SCIP_PRESOLTIMING_EXHAUSTIVE
Definition: type_timing.h:45
void SCIPpropSetFree(SCIP_PROP *prop, SCIP_DECL_PROPFREE((*propfree)))
Definition: prop.c:767
void SCIPpropSetInitpre(SCIP_PROP *prop, SCIP_DECL_PROPINITPRE((*propinitpre)))
Definition: prop.c:822
char * name
Definition: struct_prop.h:43
int lastnfixedvars
Definition: struct_prop.h:68
#define SCIP_PRESOLTIMING_NONE
Definition: type_timing.h:42
internal methods for handling parameter settings
void SCIPpropSetInitsol(SCIP_PROP *prop, SCIP_DECL_PROPINITSOL((*propinitsol)))
Definition: prop.c:800
void SCIPclockEnableOrDisable(SCIP_CLOCK *clck, SCIP_Bool enable)
Definition: clock.c:250
#define BMSfreeMemory(ptr)
Definition: memory.h:127
SCIP_RETCODE SCIPpropInit(SCIP_PROP *prop, SCIP_SET *set)
Definition: prop.c:259
#define SCIP_DECL_PROPEXEC(x)
Definition: type_prop.h:203
SCIP_Bool SCIPpropIsInitialized(SCIP_PROP *prop)
Definition: prop.c:1102
#define SCIP_PRESOLTIMING_FAST
Definition: type_timing.h:43
int SCIPpropGetNPresolCalls(SCIP_PROP *prop)
Definition: prop.c:1212
void SCIPpropSetPriority(SCIP_PROP *prop, SCIP_SET *set, int priority)
Definition: prop.c:927
internal methods for propagators
SCIP_PROPTIMING timingmask
Definition: struct_prop.h:64
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
Definition: var.c:17286
SCIP_Longint nrespropcalls
Definition: struct_prop.h:40
void SCIPpropSetExit(SCIP_PROP *prop, SCIP_DECL_PROPEXIT((*propexit)))
Definition: prop.c:789
SCIP_PRESOLTIMING presoltiming
Definition: struct_prop.h:65
#define SCIP_PRESOLTIMING_MEDIUM
Definition: type_timing.h:44
SCIP_Bool delay
Definition: struct_prop.h:89
#define BMSfreeMemoryArray(ptr)
Definition: memory.h:129
void SCIPmessagePrintError(const char *formatstr,...)
Definition: message.c:781
#define SCIPerrorMessage
Definition: pub_message.h:45
SCIP_Real SCIPpropGetSetupTime(SCIP_PROP *prop)
Definition: prop.c:980
SCIP_RETCODE SCIPpropCreate(SCIP_PROP **prop, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, int freq, SCIP_Bool delay, SCIP_PROPTIMING timingmask, int presolpriority, int presolmaxrounds, SCIP_PRESOLTIMING presoltiming, SCIP_DECL_PROPCOPY((*propcopy)), SCIP_DECL_PROPFREE((*propfree)), SCIP_DECL_PROPINIT((*propinit)), SCIP_DECL_PROPEXIT((*propexit)), SCIP_DECL_PROPINITPRE((*propinitpre)), SCIP_DECL_PROPEXITPRE((*propexitpre)), SCIP_DECL_PROPINITSOL((*propinitsol)), SCIP_DECL_PROPEXITSOL((*propexitsol)), SCIP_DECL_PROPPRESOL((*proppresol)), SCIP_DECL_PROPEXEC((*propexec)), SCIP_DECL_PROPRESPROP((*propresprop)), SCIP_PROPDATA *propdata)
Definition: prop.c:108
void SCIPclockReset(SCIP_CLOCK *clck)
Definition: clock.c:199
int lastnaggrvars
Definition: struct_prop.h:69
int lastnchgcoefs
Definition: struct_prop.h:76
#define SCIP_DECL_PROPEXITSOL(x)
Definition: type_prop.h:127
int lastnaddconss
Definition: struct_prop.h:74
#define SCIP_DECL_PROPCOPY(x)
Definition: type_prop.h:47
SCIP_Real SCIPclockGetTime(SCIP_CLOCK *clck)
Definition: clock.c:428
SCIP_CLOCK * resproptime
Definition: struct_prop.h:60
void SCIPpropEnableOrDisableClocks(SCIP_PROP *prop, SCIP_Bool enable)
Definition: prop.c:965
SCIP_Longint SCIPpropGetNDomredsFound(SCIP_PROP *prop)
Definition: prop.c:1072
#define SCIP_PROPTIMING_ALWAYS
Definition: type_timing.h:64
int nchgvartypes
Definition: struct_prop.h:80
SCIP_DECL_SORTPTRCOMP(SCIPpropComp)
Definition: prop.c:42
#define SCIP_PROPTIMING_AFTERLPLOOP
Definition: type_timing.h:58
internal methods for global SCIP settings
#define SCIP_CALL(x)
Definition: def.h:350
SCIP_RETCODE SCIPsetPropPriority(SCIP *scip, SCIP_PROP *prop, int priority)
Definition: scip.c:7910
unsigned int SCIP_PRESOLTIMING
Definition: type_timing.h:52
SCIP_Real SCIPpropGetPresolTime(SCIP_PROP *prop)
Definition: prop.c:1032
#define SCIP_DECL_PROPINITPRE(x)
Definition: type_prop.h:85
void SCIPpropSetPresolPriority(SCIP_PROP *prop, SCIP_SET *set, int presolpriority)
Definition: prop.c:941
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:2813
SCIP_CLOCK * setuptime
Definition: struct_prop.h:57
int SCIPpropGetNChgBds(SCIP_PROP *prop)
Definition: prop.c:1142
int nchgsides
Definition: struct_prop.h:87
#define BMSduplicateMemoryArray(ptr, source, num)
Definition: memory.h:125
SCIP_Longint nprobboundchgs
Definition: struct_stat.h:106
SCIP_RETCODE SCIPclockCreate(SCIP_CLOCK **clck, SCIP_CLOCKTYPE clocktype)
Definition: clock.c:160
internal methods for problem variables
public data structures and miscellaneous methods
#define SCIP_Bool
Definition: def.h:61
SCIP_Longint ndomredsfound
Definition: struct_prop.h:42
SCIP_CLOCK * sbproptime
Definition: struct_prop.h:59
SCIP_RETCODE SCIPpropResolvePropagation(SCIP_PROP *prop, SCIP_SET *set, SCIP_VAR *infervar, int inferinfo, SCIP_BOUNDTYPE inferboundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedbd, SCIP_RESULT *result)
Definition: prop.c:682
#define SCIP_DECL_PROPFREE(x)
Definition: type_prop.h:55
void SCIPclockFree(SCIP_CLOCK **clck)
Definition: clock.c:175
int SCIPpropGetNChgCoefs(SCIP_PROP *prop)
Definition: prop.c:1192
#define SCIPsetDebugMsg
Definition: set.h:1913
#define SCIP_DECL_PROPINITSOL(x)
Definition: type_prop.h:115
int SCIPpropGetNFixedVars(SCIP_PROP *prop)
Definition: prop.c:1112
int SCIPpropGetNAddConss(SCIP_PROP *prop)
Definition: prop.c:1172
#define SCIP_PRESOLTIMING_MAX
Definition: type_timing.h:50
const char * SCIPpropGetDesc(SCIP_PROP *prop)
Definition: prop.c:897
SCIP_RETCODE SCIPsetPropPresolPriority(SCIP *scip, SCIP_PROP *prop, int presolpriority)
Definition: scip.c:7925
#define SCIP_PROPTIMING_BEFORELP
Definition: type_timing.h:56
int nchgcoefs
Definition: struct_prop.h:86
SCIP_Real SCIPpropGetStrongBranchPropTime(SCIP_PROP *prop)
Definition: prop.c:1012
SCIP_RETCODE SCIPpropInitpre(SCIP_PROP *prop, SCIP_SET *set)
Definition: prop.c:355
#define SCIP_MAXTREEDEPTH
Definition: def.h:286
int SCIPpropGetNAggrVars(SCIP_PROP *prop)
Definition: prop.c:1122
const char * SCIPpropGetName(SCIP_PROP *prop)
Definition: prop.c:887
int priority
Definition: struct_prop.h:62
int SCIPparamGetInt(SCIP_PARAM *param)
Definition: paramset.c:716
int SCIPpropGetNChgVarTypes(SCIP_PROP *prop)
Definition: prop.c:1132
int SCIPpropGetPresolPriority(SCIP_PROP *prop)
Definition: prop.c:917
void SCIPpropSetFreq(SCIP_PROP *prop, int freq)
Definition: prop.c:990
void SCIPpropSetInit(SCIP_PROP *prop, SCIP_DECL_PROPINIT((*propinit)))
Definition: prop.c:778
int lastnchgbds
Definition: struct_prop.h:71
static SCIP_DECL_PARAMCHGD(paramChgdPropPriority)
Definition: prop.c:61
datastructures for propagators
SCIP_Bool SCIPpropWasDelayed(SCIP_PROP *prop)
Definition: prop.c:1092
unsigned int SCIP_PROPTIMING
Definition: type_timing.h:66
SCIP_PROPDATA * propdata
Definition: struct_prop.h:56
#define SCIP_PRESOLTIMING_FINAL
Definition: type_timing.h:46
SCIP_Bool wasdelayed
Definition: struct_prop.h:90
SCIP_PROPTIMING SCIPpropGetTimingmask(SCIP_PROP *prop)
Definition: prop.c:1222
#define SCIP_DECL_PROPRESPROP(x)
Definition: type_prop.h:244
public methods for message output
SCIP_RETCODE SCIPpropSetPresol(SCIP_PROP *prop, SCIP_DECL_PROPPRESOL((*proppresol)), int presolpriority, int presolmaxrounds, SCIP_PRESOLTIMING presoltiming)
Definition: prop.c:846
int lastnchgvartypes
Definition: struct_prop.h:70
#define SCIP_DECL_PROPPRESOL(x)
Definition: type_prop.h:179
SCIP_RETCODE SCIPpropExec(SCIP_PROP *prop, SCIP_SET *set, SCIP_STAT *stat, int depth, SCIP_Bool execdelayed, SCIP_Bool instrongbranching, SCIP_PROPTIMING proptiming, SCIP_RESULT *result)
Definition: prop.c:590
SCIP_Longint nboundchgs
Definition: struct_stat.h:104
#define SCIP_Real
Definition: def.h:149
internal methods for problem statistics
struct SCIP_PropData SCIP_PROPDATA
Definition: type_prop.h:38
#define BMSallocMemory(ptr)
Definition: memory.h:101
void SCIPpropSetResprop(SCIP_PROP *prop, SCIP_DECL_PROPRESPROP((*propresprop)))
Definition: prop.c:876
SCIP_PROPDATA * SCIPpropGetData(SCIP_PROP *prop)
Definition: prop.c:735
void SCIPpropSetData(SCIP_PROP *prop, SCIP_PROPDATA *propdata)
Definition: prop.c:745
#define SCIP_Longint
Definition: def.h:134
#define SCIP_DECL_PROPEXIT(x)
Definition: type_prop.h:71
int lastnchgsides
Definition: struct_prop.h:77
int SCIPpropGetFreq(SCIP_PROP *prop)
Definition: prop.c:955
void SCIPpropSetExitpre(SCIP_PROP *prop, SCIP_DECL_PROPEXITPRE((*propexitpre)))
Definition: prop.c:835
SCIP_Bool initialized
Definition: struct_prop.h:91
int naddconss
Definition: struct_prop.h:84
int presolpriority
Definition: struct_prop.h:66
int naggrvars
Definition: struct_prop.h:79
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:419
int SCIPpropGetNDelConss(SCIP_PROP *prop)
Definition: prop.c:1162
int SCIPpropGetNAddHoles(SCIP_PROP *prop)
Definition: prop.c:1152
int lastnupgdconss
Definition: struct_prop.h:75
#define SCIP_ALLOC(x)
Definition: def.h:361
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:2791
SCIP_Longint nprobholechgs
Definition: struct_stat.h:107
SCIP_Real SCIPpropGetTime(SCIP_PROP *prop)
Definition: prop.c:1002
SCIP_Bool SCIPpropDoesPresolve(SCIP_PROP *prop)
Definition: prop.c:1232
SCIP_RETCODE SCIPpropExit(SCIP_PROP *prop, SCIP_SET *set)
Definition: prop.c:325
SCIP_RETCODE SCIPpropFree(SCIP_PROP **prop, SCIP_SET *set)
Definition: prop.c:230
SCIP callable library.
SCIP_RETCODE SCIPpropExitsol(SCIP_PROP *prop, SCIP_SET *set, SCIP_Bool restart)
Definition: prop.c:439
#define SCIP_DECL_PROPINIT(x)
Definition: type_prop.h:63