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-2016 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 
42 /** compares two propagators w. r. to their priority */
43 SCIP_DECL_SORTPTRCOMP(SCIPpropComp)
44 { /*lint --e{715}*/
45  return ((SCIP_PROP*)elem2)->priority - ((SCIP_PROP*)elem1)->priority;
46 }
47 
48 /** compares two propagators w. r. to their priority */
49 SCIP_DECL_SORTPTRCOMP(SCIPpropCompPresol)
50 { /*lint --e{715}*/
51  return ((SCIP_PROP*)elem2)->presolpriority - ((SCIP_PROP*)elem1)->presolpriority;
52 }
53 
54 /** comparison method for sorting propagators w.r.t. to their name */
55 SCIP_DECL_SORTPTRCOMP(SCIPpropCompName)
56 {
57  return strcmp(SCIPpropGetName((SCIP_PROP*)elem1), SCIPpropGetName((SCIP_PROP*)elem2));
58 }
59 
60 /** method to call, when the priority of a propagator was changed */
61 static
62 SCIP_DECL_PARAMCHGD(paramChgdPropPriority)
63 { /*lint --e{715}*/
64  SCIP_PARAMDATA* paramdata;
65 
66  paramdata = SCIPparamGetData(param);
67  assert(paramdata != NULL);
68 
69  /* use SCIPsetPropPriority() to mark the props unsorted */
70  SCIP_CALL( SCIPsetPropPriority(scip, (SCIP_PROP*)paramdata, SCIPparamGetInt(param)) ); /*lint !e740*/
71 
72  return SCIP_OKAY;
73 }
74 
75 /** method to call, when the presolving priority of a propagator was changed */
76 static
77 SCIP_DECL_PARAMCHGD(paramChgdPropPresolPriority)
78 { /*lint --e{715}*/
79  SCIP_PARAMDATA* paramdata;
80 
81  paramdata = SCIPparamGetData(param);
82  assert(paramdata != NULL);
83 
84  /* use SCIPsetPropPriority() to mark the props unsorted */
85  SCIP_CALL( SCIPsetPropPresolPriority(scip, (SCIP_PROP*)paramdata, SCIPparamGetInt(param)) ); /*lint !e740*/
86 
87  return SCIP_OKAY;
88 }
89 
90 /** copies the given propagator to a new scip */
92  SCIP_PROP* prop, /**< propagator */
93  SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
94  )
95 {
96  assert(prop != NULL);
97  assert(set != NULL);
98  assert(set->scip != NULL);
99 
100  if( prop->propcopy != NULL )
101  {
102  SCIPdebugMessage("including propagator %s in subscip %p\n", SCIPpropGetName(prop), (void*)set->scip);
103  SCIP_CALL( prop->propcopy(set->scip, prop) );
104  }
105  return SCIP_OKAY;
106 }
107 
108 /** creates a propagator */
110  SCIP_PROP** prop, /**< pointer to propagator data structure */
111  SCIP_SET* set, /**< global SCIP settings */
112  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
113  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
114  const char* name, /**< name of propagator */
115  const char* desc, /**< description of propagator */
116  int priority, /**< priority of the propagator (>= 0: before, < 0: after constraint handlers) */
117  int freq, /**< frequency for calling propagator */
118  SCIP_Bool delay, /**< should propagator be delayed, if other propagators found reductions? */
119  SCIP_PROPTIMING timingmask, /**< positions in the node solving loop where propagator should be executed */
120  int presolpriority, /**< priority of the propagator (>= 0: before, < 0: after constraint handlers) */
121  int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */
122  SCIP_PRESOLTIMING presoltiming, /**< timing mask of the propagator's presolving method */
123  SCIP_DECL_PROPCOPY ((*propcopy)), /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */
124  SCIP_DECL_PROPFREE ((*propfree)), /**< destructor of propagator */
125  SCIP_DECL_PROPINIT ((*propinit)), /**< initialize propagator */
126  SCIP_DECL_PROPEXIT ((*propexit)), /**< deinitialize propagator */
127  SCIP_DECL_PROPINITPRE ((*propinitpre)), /**< presolving initialization method of propagator */
128  SCIP_DECL_PROPEXITPRE ((*propexitpre)), /**< presolving deinitialization method of propagator */
129  SCIP_DECL_PROPINITSOL ((*propinitsol)), /**< solving process initialization method of propagator */
130  SCIP_DECL_PROPEXITSOL ((*propexitsol)), /**< solving process deinitialization method of propagator */
131  SCIP_DECL_PROPPRESOL ((*proppresol)), /**< presolving method */
132  SCIP_DECL_PROPEXEC ((*propexec)), /**< execution method of propagator */
133  SCIP_DECL_PROPRESPROP ((*propresprop)), /**< propagation conflict resolving method */
134  SCIP_PROPDATA* propdata /**< propagator data */
135  )
136 {
138  char paramdesc[SCIP_MAXSTRLEN];
139 
140  assert(prop != NULL);
141  assert(name != NULL);
142  assert(desc != NULL);
143  assert(freq >= -1);
144  assert(propexec != NULL);
145 
146  /* the interface change from delay flags to timings cannot be recognized at compile time: Exit with an appropriate
147  * error message
148  */
149  if( presoltiming < SCIP_PRESOLTIMING_NONE || presoltiming > SCIP_PRESOLTIMING_ALWAYS )
150  {
151  SCIPmessagePrintError("ERROR: 'PRESOLDELAY'-flag no longer available since SCIP 3.2, use an appropriate "
152  "'SCIP_PRESOLTIMING' for <%s> propagator instead.\n", name);
153 
154  return SCIP_PARAMETERWRONGVAL;
155  }
156 
157  SCIP_ALLOC( BMSallocMemory(prop) );
158  SCIP_ALLOC( BMSduplicateMemoryArray(&(*prop)->name, name, strlen(name)+1) );
159  SCIP_ALLOC( BMSduplicateMemoryArray(&(*prop)->desc, desc, strlen(desc)+1) );
160  (*prop)->priority = priority;
161  (*prop)->freq = freq;
162  (*prop)->propcopy = propcopy;
163  (*prop)->propfree = propfree;
164  (*prop)->propinit = propinit;
165  (*prop)->propexit = propexit;
166  (*prop)->propinitpre = propinitpre;
167  (*prop)->propexitpre = propexitpre;
168  (*prop)->propinitsol = propinitsol;
169  (*prop)->propexitsol = propexitsol;
170  (*prop)->proppresol = proppresol;
171  (*prop)->propexec = propexec;
172  (*prop)->propresprop = propresprop;
173  (*prop)->propdata = propdata;
174  SCIP_CALL( SCIPclockCreate(&(*prop)->setuptime, SCIP_CLOCKTYPE_DEFAULT) );
175  SCIP_CALL( SCIPclockCreate(&(*prop)->proptime, SCIP_CLOCKTYPE_DEFAULT) );
176  SCIP_CALL( SCIPclockCreate(&(*prop)->sbproptime, SCIP_CLOCKTYPE_DEFAULT) );
177  SCIP_CALL( SCIPclockCreate(&(*prop)->resproptime, SCIP_CLOCKTYPE_DEFAULT) );
178  SCIP_CALL( SCIPclockCreate(&(*prop)->presoltime, SCIP_CLOCKTYPE_DEFAULT) );
179  (*prop)->ncalls = 0;
180  (*prop)->nrespropcalls = 0;
181  (*prop)->ncutoffs = 0;
182  (*prop)->ndomredsfound = 0;
183  (*prop)->wasdelayed = FALSE;
184  (*prop)->initialized = FALSE;
185 
186  /* add parameters */
187  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/priority", name);
188  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "priority of propagator <%s>", name);
189  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem, paramname, paramdesc,
190  &(*prop)->priority, TRUE, priority, INT_MIN/4, INT_MAX/4,
191  paramChgdPropPriority, (SCIP_PARAMDATA*)(*prop)) ); /*lint !e740*/
192 
193  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/freq", name);
194  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "frequency for calling propagator <%s> (-1: never, 0: only in root node)", name);
195  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem, paramname, paramdesc,
196  &(*prop)->freq, FALSE, freq, -1, INT_MAX, NULL, NULL) );
197 
198  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/delay", name);
199  SCIP_CALL( SCIPsetAddBoolParam(set, messagehdlr, blkmem, paramname,
200  "should propagator be delayed, if other propagators found reductions?",
201  &(*prop)->delay, TRUE, delay, NULL, NULL) ); /*lint !e740*/
202 
203  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/timingmask", name);
204  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "timing when propagator should be called (%u:BEFORELP, %u:DURINGLPLOOP, %u:AFTERLPLOOP, %u:ALWAYS))",
206  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem, paramname, paramdesc,
207  (int*)(&(*prop)->timingmask), TRUE, timingmask, (int) SCIP_PROPTIMING_BEFORELP, (int) SCIP_PROPTIMING_ALWAYS, NULL, NULL) ); /*lint !e713*/
208 
209  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/presolpriority", name);
210  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "presolving priority of propagator <%s>", name);
211  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem, paramname, paramdesc,
212  &(*prop)->presolpriority, TRUE, presolpriority, INT_MIN/4, INT_MAX/4,
213  paramChgdPropPresolPriority, (SCIP_PARAMDATA*)(*prop)) ); /*lint !e740*/
214 
215  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/maxprerounds", name);
216  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem, paramname,
217  "maximal number of presolving rounds the propagator participates in (-1: no limit)",
218  &(*prop)->maxprerounds, FALSE, presolmaxrounds, -1, INT_MAX, NULL, NULL) ); /*lint !e740*/
219 
220  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/presoltiming", name);
221  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "timing mask of the presolving method of propagator <%s> (%u:FAST, %u:MEDIUM, %u:EXHAUSTIVE)",
223  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem, paramname, paramdesc,
224  (int*)&(*prop)->presoltiming, TRUE, (int)presoltiming, (int) SCIP_PRESOLTIMING_NONE, (int) SCIP_PRESOLTIMING_ALWAYS, NULL, NULL) ); /*lint !e740*/
225 
226 
227  return SCIP_OKAY;
228 }
229 
230 /** calls destructor and frees memory of propagator */
232  SCIP_PROP** prop, /**< pointer to propagator data structure */
233  SCIP_SET* set /**< global SCIP settings */
234  )
235 {
236  assert(prop != NULL);
237  assert(*prop != NULL);
238  assert(!(*prop)->initialized);
239  assert(set != NULL);
240 
241  /* call destructor of propagator */
242  if( (*prop)->propfree != NULL )
243  {
244  SCIP_CALL( (*prop)->propfree(set->scip, *prop) );
245  }
246 
247  SCIPclockFree(&(*prop)->presoltime);
248  SCIPclockFree(&(*prop)->resproptime);
249  SCIPclockFree(&(*prop)->sbproptime);
250  SCIPclockFree(&(*prop)->proptime);
251  SCIPclockFree(&(*prop)->setuptime);
252  BMSfreeMemoryArray(&(*prop)->desc);
253  BMSfreeMemoryArray(&(*prop)->name);
254  BMSfreeMemory(prop);
255 
256  return SCIP_OKAY;
257 }
258 
259 /** initializes propagator */
261  SCIP_PROP* prop, /**< propagator */
262  SCIP_SET* set /**< global SCIP settings */
263  )
264 {
265  assert(prop != NULL);
266  assert(set != NULL);
267 
268  if( prop->initialized )
269  {
270  SCIPerrorMessage("propagator <%s> already initialized\n", prop->name);
271  return SCIP_INVALIDCALL;
272  }
273 
274  if( set->misc_resetstat )
275  {
276  SCIPclockReset(prop->proptime);
277  SCIPclockReset(prop->sbproptime);
279  SCIPclockReset(prop->presoltime);
280  SCIPclockReset(prop->setuptime);
281 
282  prop->ncalls = 0;
283  prop->nrespropcalls = 0;
284  prop->ncutoffs = 0;
285  prop->ndomredsfound = 0;
286  prop->lastnfixedvars = 0;
287  prop->lastnaggrvars = 0;
288  prop->lastnchgvartypes = 0;
289  prop->lastnchgbds = 0;
290  prop->lastnaddholes = 0;
291  prop->lastndelconss = 0;
292  prop->lastnaddconss = 0;
293  prop->lastnupgdconss = 0;
294  prop->lastnchgcoefs = 0;
295  prop->lastnchgsides = 0;
296  prop->nfixedvars = 0;
297  prop->naggrvars = 0;
298  prop->nchgvartypes = 0;
299  prop->nchgbds = 0;
300  prop->naddholes = 0;
301  prop->ndelconss = 0;
302  prop->naddconss = 0;
303  prop->nupgdconss = 0;
304  prop->nchgcoefs = 0;
305  prop->nchgsides = 0;
306  prop->npresolcalls = 0;
307  prop->wasdelayed = FALSE;
308  }
309 
310  if( prop->propinit != NULL )
311  {
312  /* start timing */
313  SCIPclockStart(prop->setuptime, set);
314 
315  SCIP_CALL( prop->propinit(set->scip, prop) );
316 
317  /* stop timing */
318  SCIPclockStop(prop->setuptime, set);
319  }
320  prop->initialized = TRUE;
321 
322  return SCIP_OKAY;
323 }
324 
325 /** calls exit method of propagator */
327  SCIP_PROP* prop, /**< propagator */
328  SCIP_SET* set /**< global SCIP settings */
329  )
330 {
331  assert(prop != NULL);
332  assert(set != NULL);
333 
334  if( !prop->initialized )
335  {
336  SCIPerrorMessage("propagator <%s> not initialized\n", prop->name);
337  return SCIP_INVALIDCALL;
338  }
339 
340  if( prop->propexit != NULL )
341  {
342  /* start timing */
343  SCIPclockStart(prop->setuptime, set);
344 
345  SCIP_CALL( prop->propexit(set->scip, prop) );
346 
347  /* stop timing */
348  SCIPclockStop(prop->setuptime, set);
349  }
350  prop->initialized = FALSE;
351 
352  return SCIP_OKAY;
353 }
354 
355 /** informs propagator that the presolving process is being started */
357  SCIP_PROP* prop, /**< propagator */
358  SCIP_SET* set /**< global SCIP settings */
359  )
360 {
361  assert(prop != NULL);
362  assert(set != NULL);
363 
364  prop->lastnfixedvars = 0;
365  prop->lastnaggrvars = 0;
366  prop->lastnchgvartypes = 0;
367  prop->lastnchgbds = 0;
368  prop->lastnaddholes = 0;
369  prop->lastndelconss = 0;
370  prop->lastnaddconss = 0;
371  prop->lastnupgdconss = 0;
372  prop->lastnchgcoefs = 0;
373  prop->lastnchgsides = 0;
374  prop->wasdelayed = FALSE;
375 
376  /* call presolving initialization method of propagator */
377  if( prop->propinitpre != NULL )
378  {
379  /* start timing */
380  SCIPclockStart(prop->setuptime, set);
381 
382  SCIP_CALL( prop->propinitpre(set->scip, prop) );
383 
384  /* stop timing */
385  SCIPclockStop(prop->setuptime, set);
386  }
387 
388  return SCIP_OKAY;
389 }
390 
391 /** informs propagator that the presolving process is finished */
393  SCIP_PROP* prop, /**< propagator */
394  SCIP_SET* set /**< global SCIP settings */
395  )
396 {
397  assert(prop != NULL);
398  assert(set != NULL);
399 
400  /* call presolving deinitialization method of propagator */
401  if( prop->propexitpre != NULL )
402  {
403  /* start timing */
404  SCIPclockStart(prop->setuptime, set);
405 
406  SCIP_CALL( prop->propexitpre(set->scip, prop) );
407 
408  /* stop timing */
409  SCIPclockStop(prop->setuptime, set);
410  }
411 
412  return SCIP_OKAY;
413 }
414 
415 /** informs propagator that the prop and bound process is being started */
417  SCIP_PROP* prop, /**< propagator */
418  SCIP_SET* set /**< global SCIP settings */
419  )
420 {
421  assert(prop != NULL);
422  assert(set != NULL);
423 
424  /* call solving process initialization method of propagator */
425  if( prop->propinitsol != NULL )
426  {
427  /* start timing */
428  SCIPclockStart(prop->setuptime, set);
429 
430  SCIP_CALL( prop->propinitsol(set->scip, prop) );
431 
432  /* stop timing */
433  SCIPclockStop(prop->setuptime, set);
434  }
435 
436  return SCIP_OKAY;
437 }
438 
439 /** informs propagator that the prop and bound process data is being freed */
441  SCIP_PROP* prop, /**< propagator */
442  SCIP_SET* set, /**< global SCIP settings */
443  SCIP_Bool restart /**< was this exit solve call triggered by a restart? */
444  )
445 {
446  assert(prop != NULL);
447  assert(set != NULL);
448 
449  /* call solving process deinitialization method of propagator */
450  if( prop->propexitsol != NULL )
451  {
452  /* start timing */
453  SCIPclockStart(prop->setuptime, set);
454 
455  SCIP_CALL( prop->propexitsol(set->scip, prop, restart) );
456 
457  /* stop timing */
458  SCIPclockStop(prop->setuptime, set);
459  }
460 
461  return SCIP_OKAY;
462 }
463 
464 /** executes presolving method of propagator */
466  SCIP_PROP* prop, /**< propagator */
467  SCIP_SET* set, /**< global SCIP settings */
468  SCIP_PRESOLTIMING timing, /**< current presolving timing */
469  int nrounds, /**< number of presolving rounds already done */
470  int* nfixedvars, /**< pointer to total number of variables fixed of all presolvers */
471  int* naggrvars, /**< pointer to total number of variables aggregated of all presolvers */
472  int* nchgvartypes, /**< pointer to total number of variable type changes of all presolvers */
473  int* nchgbds, /**< pointer to total number of variable bounds tightened of all presolvers */
474  int* naddholes, /**< pointer to total number of domain holes added of all presolvers */
475  int* ndelconss, /**< pointer to total number of deleted constraints of all presolvers */
476  int* naddconss, /**< pointer to total number of added constraints of all presolvers */
477  int* nupgdconss, /**< pointer to total number of upgraded constraints of all presolvers */
478  int* nchgcoefs, /**< pointer to total number of changed coefficients of all presolvers */
479  int* nchgsides, /**< pointer to total number of changed left/right hand sides of all presolvers */
480  SCIP_RESULT* result /**< pointer to store the result of the callback method */
481  )
482 {
483  assert(prop != NULL);
484  assert(set != NULL);
485  assert(nfixedvars != NULL);
486  assert(naggrvars != NULL);
487  assert(nchgvartypes != NULL);
488  assert(nchgbds != NULL);
489  assert(naddholes != NULL);
490  assert(ndelconss != NULL);
491  assert(naddconss != NULL);
492  assert(nupgdconss != NULL);
493  assert(nchgcoefs != NULL);
494  assert(nchgsides != NULL);
495  assert(result != NULL);
496 
497  *result = SCIP_DIDNOTRUN;
498 
499  if( prop->proppresol == NULL )
500  return SCIP_OKAY;
501 
502  /* check number of presolving rounds */
503  if( prop->maxprerounds >= 0 && nrounds >= prop->maxprerounds )
504  return SCIP_OKAY;
505 
506  /* check, if presolver should be delayed */
507  if( prop->presoltiming & timing )
508  {
509  int nnewfixedvars;
510  int nnewaggrvars;
511  int nnewchgvartypes;
512  int nnewchgbds;
513  int nnewaddholes;
514  int nnewdelconss;
515  int nnewaddconss;
516  int nnewupgdconss;
517  int nnewchgcoefs;
518  int nnewchgsides;
519 
520  SCIPdebugMessage("calling presolving method of propagator <%s>\n", prop->name);
521 
522  /* calculate the number of changes since last call */
523  nnewfixedvars = *nfixedvars - prop->lastnfixedvars;
524  nnewaggrvars = *naggrvars - prop->lastnaggrvars;
525  nnewchgvartypes = *nchgvartypes - prop->lastnchgvartypes;
526  nnewchgbds = *nchgbds - prop->lastnchgbds;
527  nnewaddholes = *naddholes - prop->lastnaddholes;
528  nnewdelconss = *ndelconss - prop->lastndelconss;
529  nnewaddconss = *naddconss - prop->lastnaddconss;
530  nnewupgdconss = *nupgdconss - prop->lastnupgdconss;
531  nnewchgcoefs = *nchgcoefs - prop->lastnchgcoefs;
532  nnewchgsides = *nchgsides - prop->lastnchgsides;
533 
534  /* remember the number of changes prior to the call of the presolver method of the propagator */
535  prop->lastnfixedvars = *nfixedvars;
536  prop->lastnaggrvars = *naggrvars;
537  prop->lastnchgvartypes = *nchgvartypes;
538  prop->lastnchgbds = *nchgbds;
539  prop->lastnaddholes = *naddholes;
540  prop->lastndelconss = *ndelconss;
541  prop->lastnaddconss = *naddconss;
542  prop->lastnupgdconss = *nupgdconss;
543  prop->lastnchgcoefs = *nchgcoefs;
544  prop->lastnchgsides = *nchgsides;
545 
546  /* start timing */
547  SCIPclockStart(prop->presoltime, set);
548 
549  /* call external method */
550  SCIP_CALL( prop->proppresol(set->scip, prop, nrounds, timing,
551  nnewfixedvars, nnewaggrvars, nnewchgvartypes, nnewchgbds, nnewaddholes,
552  nnewdelconss, nnewaddconss, nnewupgdconss, nnewchgcoefs, nnewchgsides,
553  nfixedvars, naggrvars, nchgvartypes, nchgbds, naddholes,
554  ndelconss, naddconss, nupgdconss, nchgcoefs, nchgsides, result) );
555 
556  /* stop timing */
557  SCIPclockStop(prop->presoltime, set);
558 
559  /* add/count the new changes */
560  prop->nfixedvars += *nfixedvars - prop->lastnfixedvars;
561  prop->naggrvars += *naggrvars - prop->lastnaggrvars;
562  prop->nchgvartypes += *nchgvartypes - prop->lastnchgvartypes;
563  prop->nchgbds += *nchgbds - prop->lastnchgbds;
564  prop->naddholes += *naddholes - prop->lastnaddholes;
565  prop->ndelconss += *ndelconss - prop->lastndelconss;
566  prop->naddconss += *naddconss - prop->lastnaddconss;
567  prop->nupgdconss += *nupgdconss - prop->lastnupgdconss;
568  prop->nchgcoefs += *nchgcoefs - prop->lastnchgcoefs;
569  prop->nchgsides += *nchgsides - prop->lastnchgsides;
570 
571  /* check result code of callback method */
572  if( *result != SCIP_CUTOFF
573  && *result != SCIP_UNBOUNDED
574  && *result != SCIP_SUCCESS
575  && *result != SCIP_DIDNOTFIND
576  && *result != SCIP_DIDNOTRUN )
577  {
578  SCIPerrorMessage("propagator <%s> returned invalid result <%d>\n", prop->name, *result);
579  return SCIP_INVALIDRESULT;
580  }
581 
582  /* increase the number of presolving calls, if the propagator tried to find reductions */
583  if( *result != SCIP_DIDNOTRUN )
584  ++(prop->npresolcalls);
585  }
586 
587  return SCIP_OKAY;
588 }
589 
590 /** calls execution method of propagator */
592  SCIP_PROP* prop, /**< propagator */
593  SCIP_SET* set, /**< global SCIP settings */
594  SCIP_STAT* stat, /**< dynamic problem statistics */
595  int depth, /**< depth of current node */
596  SCIP_Bool execdelayed, /**< execute propagator even if it is marked to be delayed */
597  SCIP_Bool instrongbranching, /**< are we currently doing strong branching? */
598  SCIP_PROPTIMING proptiming, /**< current point in the node solving process */
599  SCIP_RESULT* result /**< pointer to store the result of the callback method */
600  )
601 {
602  assert(prop != NULL);
603  assert(prop->propexec != NULL);
604  assert(prop->freq >= -1);
605  assert(set != NULL);
606  assert(set->scip != NULL);
607  assert(stat != NULL);
608  assert(depth >= 0);
609  assert(result != NULL);
610 
611  if( (depth == 0 && prop->freq == 0) || (prop->freq > 0 && depth % prop->freq == 0) )
612  {
613  if( !prop->delay || execdelayed )
614  {
615  SCIP_Longint oldndomchgs;
616  SCIP_Longint oldnprobdomchgs;
617 
618  SCIPdebugMessage("executing propagator <%s>\n", prop->name);
619 
620  oldndomchgs = stat->nboundchgs + stat->nholechgs;
621  oldnprobdomchgs = stat->nprobboundchgs + stat->nprobholechgs;
622 
623  /* start timing */
624  if( instrongbranching )
625  SCIPclockStart(prop->sbproptime, set);
626  else
627  SCIPclockStart(prop->proptime, set);
628 
629  /* call external propagation method */
630  SCIP_CALL( prop->propexec(set->scip, prop, proptiming, result) );
631 
632  /* stop timing */
633  if( instrongbranching )
634  SCIPclockStop(prop->sbproptime, set);
635  else
636  SCIPclockStop(prop->proptime, set);
637 
638  /* update statistics */
639  if( *result != SCIP_DIDNOTRUN && *result != SCIP_DELAYED )
640  prop->ncalls++;
641  if( *result == SCIP_CUTOFF )
642  prop->ncutoffs++;
643 
644  /* update domain reductions; therefore remove the domain
645  * reduction counts which were generated in probing mode */
646  prop->ndomredsfound += stat->nboundchgs + stat->nholechgs - oldndomchgs;
647  prop->ndomredsfound -= (stat->nprobboundchgs + stat->nprobholechgs - oldnprobdomchgs);
648 
649  /* evaluate result */
650  if( *result != SCIP_CUTOFF
651  && *result != SCIP_REDUCEDDOM
652  && *result != SCIP_DIDNOTFIND
653  && *result != SCIP_DIDNOTRUN
654  && *result != SCIP_DELAYED )
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  SCIPdebugMessage("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  && SCIPvarGetLbAtIndex(infervar, bdchgidx, TRUE) > SCIPvarGetLbGlobal(infervar))
696  || (inferboundtype == SCIP_BOUNDTYPE_UPPER
697  && SCIPvarGetUbAtIndex(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_ALWAYS )
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:51
int lastndelconss
Definition: struct_prop.h:72
#define BMSfreeMemoryArray(ptr)
Definition: memory.h:102
enum SCIP_BoundType SCIP_BOUNDTYPE
Definition: type_lp.h:50
SCIP_RETCODE SCIPpropExitpre(SCIP_PROP *prop, SCIP_SET *set)
Definition: prop.c:392
int nfixedvars
Definition: struct_prop.h:77
SCIP_RETCODE SCIPpropInitsol(SCIP_PROP *prop, SCIP_SET *set)
Definition: prop.c:416
void SCIPpropSetCopy(SCIP_PROP *prop, SCIP_DECL_PROPCOPY((*propcopy)))
Definition: prop.c:756
SCIP_RETCODE SCIPpropCopyInclude(SCIP_PROP *prop, SCIP_SET *set)
Definition: prop.c:91
void SCIPpropSetPresolTiming(SCIP_PROP *prop, SCIP_PRESOLTIMING presoltiming)
Definition: prop.c:1252
SCIP_Longint SCIPpropGetNDomredsFound(SCIP_PROP *prop)
Definition: prop.c:1072
SCIP_PARAMDATA * SCIPparamGetData(SCIP_PARAM *param)
Definition: paramset.c:651
int SCIPpropGetNDelConss(SCIP_PROP *prop)
Definition: prop.c:1162
#define SCIP_MAXSTRLEN
Definition: def.h:201
int lastnaddholes
Definition: struct_prop.h:71
internal methods for clocks and timing issues
int ndelconss
Definition: struct_prop.h:82
#define NULL
Definition: lpi_spx.cpp:130
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:465
char * desc
Definition: struct_prop.h:43
struct SCIP_ParamData SCIP_PARAMDATA
Definition: type_paramset.h:73
int maxprerounds
Definition: struct_prop.h:66
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
Definition: var.c:17067
int naddholes
Definition: struct_prop.h:81
SCIP_CLOCK * presoltime
Definition: struct_prop.h:60
int SCIPpropGetFreq(SCIP_PROP *prop)
Definition: prop.c:955
SCIP_CLOCK * proptime
Definition: struct_prop.h:57
int npresolcalls
Definition: struct_prop.h:87
SCIP_Longint ncalls
Definition: struct_prop.h:38
SCIP_Longint nholechgs
Definition: struct_stat.h:87
#define SCIP_PROPTIMING_DURINGLPLOOP
Definition: type_timing.h:55
void SCIPclockStop(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:350
int nupgdconss
Definition: struct_prop.h:84
#define FALSE
Definition: def.h:56
int nchgbds
Definition: struct_prop.h:80
SCIP_Longint ncutoffs
Definition: struct_prop.h:40
void SCIPpropSetExitsol(SCIP_PROP *prop, SCIP_DECL_PROPEXITSOL((*propexitsol)))
Definition: prop.c:811
void SCIPclockStart(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:280
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:8174
#define TRUE
Definition: def.h:55
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
#define SCIP_CALL(x)
Definition: def.h:266
SCIP_RETCODE SCIPsetPropPresolPriority(SCIP *scip, SCIP_PROP *prop, int presolpriority)
Definition: scip.c:7175
SCIP_Real SCIPpropGetRespropTime(SCIP_PROP *prop)
Definition: prop.c:1022
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:42
int lastnfixedvars
Definition: struct_prop.h:67
SCIP_Real SCIPvarGetLbAtIndex(SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: var.c:15737
#define SCIPdebugMessage
Definition: pub_message.h:77
SCIP_Real SCIPpropGetTime(SCIP_PROP *prop)
Definition: prop.c:1002
#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
SCIP_RETCODE SCIPpropInit(SCIP_PROP *prop, SCIP_SET *set)
Definition: prop.c:260
#define SCIP_DECL_PROPEXEC(x)
Definition: type_prop.h:202
int SCIPpropGetNUpgdConss(SCIP_PROP *prop)
Definition: prop.c:1182
#define SCIP_PRESOLTIMING_FAST
Definition: type_timing.h:43
void SCIPpropSetPriority(SCIP_PROP *prop, SCIP_SET *set, int priority)
Definition: prop.c:927
SCIP_Real SCIPpropGetSetupTime(SCIP_PROP *prop)
Definition: prop.c:980
internal methods for propagators
SCIP_Real SCIPpropGetPresolTime(SCIP_PROP *prop)
Definition: prop.c:1032
SCIP_PROPTIMING timingmask
Definition: struct_prop.h:63
SCIP_Longint nrespropcalls
Definition: struct_prop.h:39
SCIP_DECL_SORTPTRCOMP(SCIPpropComp)
Definition: prop.c:43
void SCIPpropSetExit(SCIP_PROP *prop, SCIP_DECL_PROPEXIT((*propexit)))
Definition: prop.c:789
int SCIPpropGetNPresolCalls(SCIP_PROP *prop)
Definition: prop.c:1212
SCIP_PRESOLTIMING presoltiming
Definition: struct_prop.h:64
#define SCIP_PRESOLTIMING_MEDIUM
Definition: type_timing.h:44
SCIP_Bool delay
Definition: struct_prop.h:88
const char * SCIPpropGetDesc(SCIP_PROP *prop)
Definition: prop.c:897
int SCIPpropGetNAddHoles(SCIP_PROP *prop)
Definition: prop.c:1152
SCIP_PROPDATA * SCIPpropGetData(SCIP_PROP *prop)
Definition: prop.c:735
void SCIPmessagePrintError(const char *formatstr,...)
Definition: message.c:775
#define SCIPerrorMessage
Definition: pub_message.h:45
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:109
void SCIPclockReset(SCIP_CLOCK *clck)
Definition: clock.c:199
int lastnaggrvars
Definition: struct_prop.h:68
SCIP_Real SCIPvarGetUbAtIndex(SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: var.c:15859
SCIP_Bool SCIPpropIsInitialized(SCIP_PROP *prop)
Definition: prop.c:1102
int lastnchgcoefs
Definition: struct_prop.h:75
#define SCIP_DECL_PROPEXITSOL(x)
Definition: type_prop.h:127
int lastnaddconss
Definition: struct_prop.h:73
#define SCIP_DECL_PROPCOPY(x)
Definition: type_prop.h:47
#define BMSallocMemory(ptr)
Definition: memory.h:74
SCIP_Real SCIPclockGetTime(SCIP_CLOCK *clck)
Definition: clock.c:428
SCIP_CLOCK * resproptime
Definition: struct_prop.h:59
void SCIPpropEnableOrDisableClocks(SCIP_PROP *prop, SCIP_Bool enable)
Definition: prop.c:965
#define SCIP_PROPTIMING_ALWAYS
Definition: type_timing.h:62
int nchgvartypes
Definition: struct_prop.h:79
#define SCIP_PROPTIMING_AFTERLPLOOP
Definition: type_timing.h:56
internal methods for global SCIP settings
unsigned int SCIP_PRESOLTIMING
Definition: type_timing.h:50
SCIP_Bool SCIPpropWasDelayed(SCIP_PROP *prop)
Definition: prop.c:1092
#define SCIP_DECL_PROPINITPRE(x)
Definition: type_prop.h:85
#define BMSfreeMemory(ptr)
Definition: memory.h:100
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:2455
SCIP_CLOCK * setuptime
Definition: struct_prop.h:56
int nchgsides
Definition: struct_prop.h:86
void SCIPpropSetData(SCIP_PROP *prop, SCIP_PROPDATA *propdata)
Definition: prop.c:745
int SCIPpropGetNAggrVars(SCIP_PROP *prop)
Definition: prop.c:1122
#define BMSduplicateMemoryArray(ptr, source, num)
Definition: memory.h:98
int SCIPpropGetNAddConss(SCIP_PROP *prop)
Definition: prop.c:1172
SCIP_Longint nprobboundchgs
Definition: struct_stat.h:88
int SCIPpropGetNChgVarTypes(SCIP_PROP *prop)
Definition: prop.c:1132
SCIP_RETCODE SCIPclockCreate(SCIP_CLOCK **clck, SCIP_CLOCKTYPE clocktype)
Definition: clock.c:160
internal methods for problem variables
void SCIPpropSetFreq(SCIP_PROP *prop, int freq)
Definition: prop.c:990
int SCIPpropGetPresolPriority(SCIP_PROP *prop)
Definition: prop.c:917
int SCIPpropGetNChgBds(SCIP_PROP *prop)
Definition: prop.c:1142
public data structures and miscellaneous methods
#define SCIP_Bool
Definition: def.h:53
SCIP_Longint ndomredsfound
Definition: struct_prop.h:41
SCIP_CLOCK * sbproptime
Definition: struct_prop.h:58
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
SCIP_Bool SCIPpropDoesPresolve(SCIP_PROP *prop)
Definition: prop.c:1232
static const char * paramname[]
Definition: lpi_msk.c:4201
#define SCIP_DECL_PROPFREE(x)
Definition: type_prop.h:55
int SCIPpropGetPriority(SCIP_PROP *prop)
Definition: prop.c:907
void SCIPclockFree(SCIP_CLOCK **clck)
Definition: clock.c:175
SCIP_Bool SCIPpropIsDelayed(SCIP_PROP *prop)
Definition: prop.c:1082
#define SCIP_DECL_PROPINITSOL(x)
Definition: type_prop.h:115
#define SCIP_PRESOLTIMING_ALWAYS
Definition: type_timing.h:48
#define SCIP_PROPTIMING_BEFORELP
Definition: type_timing.h:54
int nchgcoefs
Definition: struct_prop.h:85
SCIP_RETCODE SCIPpropInitpre(SCIP_PROP *prop, SCIP_SET *set)
Definition: prop.c:356
int priority
Definition: struct_prop.h:61
SCIP_Longint SCIPpropGetNCalls(SCIP_PROP *prop)
Definition: prop.c:1042
int SCIPpropGetNFixedVars(SCIP_PROP *prop)
Definition: prop.c:1112
int SCIPparamGetInt(SCIP_PARAM *param)
Definition: paramset.c:706
int SCIPpropGetNChgCoefs(SCIP_PROP *prop)
Definition: prop.c:1192
void SCIPpropSetInit(SCIP_PROP *prop, SCIP_DECL_PROPINIT((*propinit)))
Definition: prop.c:778
int lastnchgbds
Definition: struct_prop.h:70
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
Definition: var.c:17057
static SCIP_DECL_PARAMCHGD(paramChgdPropPriority)
Definition: prop.c:62
datastructures for propagators
int SCIPpropGetNChgSides(SCIP_PROP *prop)
Definition: prop.c:1202
unsigned int SCIP_PROPTIMING
Definition: type_timing.h:64
SCIP_PROPDATA * propdata
Definition: struct_prop.h:55
SCIP_Bool wasdelayed
Definition: struct_prop.h:89
SCIP_Longint SCIPpropGetNCutoffs(SCIP_PROP *prop)
Definition: prop.c:1062
#define SCIP_DECL_PROPRESPROP(x)
Definition: type_prop.h:243
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:69
#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:591
SCIP_Longint nboundchgs
Definition: struct_stat.h:86
#define SCIP_Real
Definition: def.h:127
internal methods for problem statistics
struct SCIP_PropData SCIP_PROPDATA
Definition: type_prop.h:38
SCIP_PRESOLTIMING SCIPpropGetPresolTiming(SCIP_PROP *prop)
Definition: prop.c:1242
void SCIPpropSetResprop(SCIP_PROP *prop, SCIP_DECL_PROPRESPROP((*propresprop)))
Definition: prop.c:876
SCIP_Longint SCIPpropGetNRespropCalls(SCIP_PROP *prop)
Definition: prop.c:1052
#define SCIP_Longint
Definition: def.h:112
#define SCIP_DECL_PROPEXIT(x)
Definition: type_prop.h:71
SCIP_Real SCIPpropGetStrongBranchPropTime(SCIP_PROP *prop)
Definition: prop.c:1012
int lastnchgsides
Definition: struct_prop.h:76
void SCIPpropSetExitpre(SCIP_PROP *prop, SCIP_DECL_PROPEXITPRE((*propexitpre)))
Definition: prop.c:835
SCIP_Bool initialized
Definition: struct_prop.h:90
int naddconss
Definition: struct_prop.h:83
int presolpriority
Definition: struct_prop.h:65
int naggrvars
Definition: struct_prop.h:78
SCIP_PROPTIMING SCIPpropGetTimingmask(SCIP_PROP *prop)
Definition: prop.c:1222
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:392
SCIP_RETCODE SCIPsetPropPriority(SCIP *scip, SCIP_PROP *prop, int priority)
Definition: scip.c:7160
int lastnupgdconss
Definition: struct_prop.h:74
#define SCIP_ALLOC(x)
Definition: def.h:277
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:2433
SCIP_Longint nprobholechgs
Definition: struct_stat.h:89
SCIP_RETCODE SCIPpropExit(SCIP_PROP *prop, SCIP_SET *set)
Definition: prop.c:326
const char * SCIPpropGetName(SCIP_PROP *prop)
Definition: prop.c:887
SCIP_RETCODE SCIPpropFree(SCIP_PROP **prop, SCIP_SET *set)
Definition: prop.c:231
SCIP callable library.
SCIP_RETCODE SCIPpropExitsol(SCIP_PROP *prop, SCIP_SET *set, SCIP_Bool restart)
Definition: prop.c:440
#define SCIP_DECL_PROPINIT(x)
Definition: type_prop.h:63