Scippy

SCIP

Solving Constraint Integer Programs

relax.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 relax.c
17  * @brief methods and datastructures for relaxation handlers
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/scip.h"
33 #include "scip/relax.h"
34 #include "scip/pub_message.h"
35 #include "scip/pub_misc.h"
36 
37 #include "scip/struct_relax.h"
38 
39 
40 
41 /** compares two relaxation handlers w. r. to their priority */
42 SCIP_DECL_SORTPTRCOMP(SCIPrelaxComp)
43 { /*lint --e{715}*/
44  return ((SCIP_RELAX*)elem2)->priority - ((SCIP_RELAX*)elem1)->priority;
45 }
46 
47 /** comparison method for sorting relaxators w.r.t. to their name */
48 SCIP_DECL_SORTPTRCOMP(SCIPrelaxCompName)
49 {
50  return strcmp(SCIPrelaxGetName((SCIP_RELAX*)elem1), SCIPrelaxGetName((SCIP_RELAX*)elem2));
51 }
52 
53 /** method to call, when the priority of a relaxation handler was changed */
54 static
55 SCIP_DECL_PARAMCHGD(paramChgdRelaxPriority)
56 { /*lint --e{715}*/
57  SCIP_PARAMDATA* paramdata;
58 
59  paramdata = SCIPparamGetData(param);
60  assert(paramdata != NULL);
61 
62  /* use SCIPsetRelaxPriority() to mark the relaxs unsorted */
63  SCIP_CALL( SCIPsetRelaxPriority(scip, (SCIP_RELAX*)paramdata, SCIPparamGetInt(param)) ); /*lint !e740*/
64 
65  return SCIP_OKAY;
66 }
67 
68 /** copies the given relaxation handler to a new scip */
70  SCIP_RELAX* relax, /**< relaxation handler */
71  SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
72  )
73 {
74  assert(relax != NULL);
75  assert(set != NULL);
76  assert(set->scip != NULL);
77 
78  if( relax->relaxcopy != NULL )
79  {
80  SCIPdebugMessage("including relaxation handler %s in subscip %p\n", SCIPrelaxGetName(relax), (void*)set->scip);
81  SCIP_CALL( relax->relaxcopy(set->scip, relax) );
82  }
83  return SCIP_OKAY;
84 }
85 
86 /** creates a relaxation handler */
88  SCIP_RELAX** relax, /**< pointer to relaxation handler data structure */
89  SCIP_SET* set, /**< global SCIP settings */
90  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
91  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
92  const char* name, /**< name of relaxation handler */
93  const char* desc, /**< description of relaxation handler */
94  int priority, /**< priority of the relaxation handler (negative: after LP, non-negative: before LP) */
95  int freq, /**< frequency for calling relaxation handler */
96  SCIP_DECL_RELAXCOPY ((*relaxcopy)), /**< copy method of relaxation handler or NULL if you don't want to copy your plugin into sub-SCIPs */
97  SCIP_DECL_RELAXFREE ((*relaxfree)), /**< destructor of relaxation handler */
98  SCIP_DECL_RELAXINIT ((*relaxinit)), /**< initialize relaxation handler */
99  SCIP_DECL_RELAXEXIT ((*relaxexit)), /**< deinitialize relaxation handler */
100  SCIP_DECL_RELAXINITSOL((*relaxinitsol)), /**< solving process initialization method of relaxation handler */
101  SCIP_DECL_RELAXEXITSOL((*relaxexitsol)), /**< solving process deinitialization method of relaxation handler */
102  SCIP_DECL_RELAXEXEC ((*relaxexec)), /**< execution method of relaxation handler */
103  SCIP_RELAXDATA* relaxdata /**< relaxation handler data */
104  )
105 {
107  char paramdesc[SCIP_MAXSTRLEN];
108 
109  assert(relax != NULL);
110  assert(name != NULL);
111  assert(desc != NULL);
112  assert(freq >= -1);
113  assert(relaxexec != NULL);
114 
115  SCIP_ALLOC( BMSallocMemory(relax) );
116  SCIP_ALLOC( BMSduplicateMemoryArray(&(*relax)->name, name, strlen(name)+1) );
117  SCIP_ALLOC( BMSduplicateMemoryArray(&(*relax)->desc, desc, strlen(desc)+1) );
118  (*relax)->priority = priority;
119  (*relax)->freq = freq;
120  (*relax)->relaxcopy = relaxcopy;
121  (*relax)->relaxfree = relaxfree;
122  (*relax)->relaxinit = relaxinit;
123  (*relax)->relaxexit = relaxexit;
124  (*relax)->relaxinitsol = relaxinitsol;
125  (*relax)->relaxexitsol = relaxexitsol;
126  (*relax)->relaxexec = relaxexec;
127  (*relax)->relaxdata = relaxdata;
128  SCIP_CALL( SCIPclockCreate(&(*relax)->setuptime, SCIP_CLOCKTYPE_DEFAULT) );
129  SCIP_CALL( SCIPclockCreate(&(*relax)->relaxclock, SCIP_CLOCKTYPE_DEFAULT) );
130  (*relax)->ncalls = 0;
131  (*relax)->lastsolvednode = -1;
132  (*relax)->initialized = FALSE;
133 
134  /* add parameters */
135  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "relaxing/%s/priority", name);
136  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "priority of relaxation handler <%s>", name);
137  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem, paramname, paramdesc,
138  &(*relax)->priority, FALSE, priority, INT_MIN/4, INT_MAX/4,
139  paramChgdRelaxPriority, (SCIP_PARAMDATA*)(*relax)) ); /*lint !e740*/
140  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "relaxing/%s/freq", name);
141  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "frequency for calling relaxation handler <%s> (-1: never, 0: only in root node)", name);
142  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem, paramname, paramdesc,
143  &(*relax)->freq, FALSE, freq, -1, INT_MAX, NULL, NULL) );
144 
145  return SCIP_OKAY;
146 }
147 
148 /** calls destructor and frees memory of relaxation handler */
150  SCIP_RELAX** relax, /**< pointer to relaxation handler data structure */
151  SCIP_SET* set /**< global SCIP settings */
152  )
153 {
154  assert(relax != NULL);
155  assert(*relax != NULL);
156  assert(!(*relax)->initialized);
157  assert(set != NULL);
158 
159  /* call destructor of relaxation handler */
160  if( (*relax)->relaxfree != NULL )
161  {
162  SCIP_CALL( (*relax)->relaxfree(set->scip, *relax) );
163  }
164 
165  SCIPclockFree(&(*relax)->relaxclock);
166  SCIPclockFree(&(*relax)->setuptime);
167  BMSfreeMemoryArray(&(*relax)->name);
168  BMSfreeMemoryArray(&(*relax)->desc);
169  BMSfreeMemory(relax);
170 
171  return SCIP_OKAY;
172 }
173 
174 /** initializes relaxation handler */
176  SCIP_RELAX* relax, /**< relaxation handler */
177  SCIP_SET* set /**< global SCIP settings */
178  )
179 {
180  assert(relax != NULL);
181  assert(set != NULL);
182 
183  if( relax->initialized )
184  {
185  SCIPerrorMessage("relaxation handler <%s> already initialized\n", relax->name);
186  return SCIP_INVALIDCALL;
187  }
188 
189  if( set->misc_resetstat )
190  {
191  SCIPclockReset(relax->setuptime);
192  SCIPclockReset(relax->relaxclock);
193  relax->ncalls = 0;
194  relax->lastsolvednode = -1;
195  }
196 
197  if( relax->relaxinit != NULL )
198  {
199  /* start timing */
200  SCIPclockStart(relax->setuptime, set);
201 
202  SCIP_CALL( relax->relaxinit(set->scip, relax) );
203 
204  /* stop timing */
205  SCIPclockStop(relax->setuptime, set);
206  }
207  relax->initialized = TRUE;
208 
209  return SCIP_OKAY;
210 }
211 
212 /** calls exit method of relaxation handler */
214  SCIP_RELAX* relax, /**< relaxation handler */
215  SCIP_SET* set /**< global SCIP settings */
216  )
217 {
218  assert(relax != NULL);
219  assert(set != NULL);
220 
221  if( !relax->initialized )
222  {
223  SCIPerrorMessage("relaxation handler <%s> not initialized\n", relax->name);
224  return SCIP_INVALIDCALL;
225  }
226 
227  if( relax->relaxexit != NULL )
228  {
229  /* start timing */
230  SCIPclockStart(relax->setuptime, set);
231 
232  SCIP_CALL( relax->relaxexit(set->scip, relax) );
233 
234  /* stop timing */
235  SCIPclockStop(relax->setuptime, set);
236  }
237  relax->initialized = FALSE;
238 
239  return SCIP_OKAY;
240 }
241 
242 /** informs relaxation handler that the branch and bound process is being started */
244  SCIP_RELAX* relax, /**< relaxation handler */
245  SCIP_SET* set /**< global SCIP settings */
246  )
247 {
248  assert(relax != NULL);
249  assert(set != NULL);
250 
251  /* call solving process initialization method of relaxation handler */
252  if( relax->relaxinitsol != NULL )
253  {
254  /* start timing */
255  SCIPclockStart(relax->setuptime, set);
256 
257  SCIP_CALL( relax->relaxinitsol(set->scip, relax) );
258 
259  /* stop timing */
260  SCIPclockStop(relax->setuptime, set);
261  }
262 
263  return SCIP_OKAY;
264 }
265 
266 /** informs relaxation handler that the branch and bound process data is being freed */
268  SCIP_RELAX* relax, /**< relaxation handler */
269  SCIP_SET* set /**< global SCIP settings */
270  )
271 {
272  assert(relax != NULL);
273  assert(set != NULL);
274 
275  /* call solving process deinitialization method of relaxation handler */
276  if( relax->relaxexitsol != NULL )
277  {
278  /* start timing */
279  SCIPclockStart(relax->setuptime, set);
280 
281  SCIP_CALL( relax->relaxexitsol(set->scip, relax) );
282 
283  /* stop timing */
284  SCIPclockStop(relax->setuptime, set);
285  }
286 
287  return SCIP_OKAY;
288 }
289 
290 /** calls execution method of relaxation handler */
292  SCIP_RELAX* relax, /**< relaxation handler */
293  SCIP_SET* set, /**< global SCIP settings */
294  SCIP_STAT* stat, /**< dynamic problem statistics */
295  int depth, /**< depth of current node */
296  SCIP_Real* lowerbound, /**< pointer to lower bound computed by the relaxation handler */
297  SCIP_RESULT* result /**< pointer to store the result of the callback method */
298  )
299 {
300  assert(relax != NULL);
301  assert(relax->relaxexec != NULL);
302  assert(relax->freq >= -1);
303  assert(set != NULL);
304  assert(set->scip != NULL);
305  assert(depth >= 0);
306  assert(result != NULL);
307 
308  *result = SCIP_DIDNOTRUN;
309 
310  /* check, if the relaxation is already solved */
311  if( relax->lastsolvednode == stat->ntotalnodes )
312  return SCIP_OKAY;
313 
314  relax->lastsolvednode = stat->ntotalnodes;
315 
316  if( (depth == 0 && relax->freq == 0) || (relax->freq > 0 && depth % relax->freq == 0) )
317  {
318  SCIPdebugMessage("executing relaxation handler <%s>\n", relax->name);
319 
320  /* start timing */
321  SCIPclockStart(relax->relaxclock, set);
322 
323  /* call external relaxation method */
324  SCIP_CALL( relax->relaxexec(set->scip, relax, lowerbound, result) );
325 
326  /* stop timing */
327  SCIPclockStop(relax->relaxclock, set);
328 
329  /* evaluate result */
330  if( *result != SCIP_CUTOFF
331  && *result != SCIP_CONSADDED
332  && *result != SCIP_REDUCEDDOM
333  && *result != SCIP_SEPARATED
334  && *result != SCIP_SUCCESS
335  && *result != SCIP_SUSPENDED
336  && *result != SCIP_DIDNOTRUN )
337  {
338  SCIPerrorMessage("execution method of relaxation handler <%s> returned invalid result <%d>\n",
339  relax->name, *result);
340  return SCIP_INVALIDRESULT;
341  }
342  if( *result != SCIP_DIDNOTRUN )
343  {
344  relax->ncalls++;
345  if( *result == SCIP_SUSPENDED )
346  SCIPrelaxMarkUnsolved(relax);
347  }
348  }
349 
350  return SCIP_OKAY;
351 }
352 
353 /** gets user data of relaxation handler */
355  SCIP_RELAX* relax /**< relaxation handler */
356  )
357 {
358  assert(relax != NULL);
359 
360  return relax->relaxdata;
361 }
362 
363 /** sets user data of relaxation handler; user has to free old data in advance! */
365  SCIP_RELAX* relax, /**< relaxation handler */
366  SCIP_RELAXDATA* relaxdata /**< new relaxation handler user data */
367  )
368 {
369  assert(relax != NULL);
370 
371  relax->relaxdata = relaxdata;
372 }
373 
374 /** set copy method of relaxation handler */
376  SCIP_RELAX* relax, /**< relaxation handler */
377  SCIP_DECL_RELAXCOPY ((*relaxcopy)) /**< copy method of relaxation handler */
378  )
379 {
380  assert(relax != NULL);
381 
382  relax->relaxcopy = relaxcopy;
383 }
384 
385 /** set destructor of relaxation handler */
387  SCIP_RELAX* relax, /**< relaxation handler */
388  SCIP_DECL_RELAXFREE ((*relaxfree)) /**< destructor of relaxation handler */
389  )
390 {
391  assert(relax != NULL);
392 
393  relax->relaxfree = relaxfree;
394 }
395 
396 /** set initialization method of relaxation handler */
398  SCIP_RELAX* relax, /**< relaxation handler */
399  SCIP_DECL_RELAXINIT ((*relaxinit)) /**< initialize relaxation handler */
400  )
401 {
402  assert(relax != NULL);
403 
404  relax->relaxinit = relaxinit;
405 }
406 
407 /** set deinitialization method of relaxation handler */
409  SCIP_RELAX* relax, /**< relaxation handler */
410  SCIP_DECL_RELAXEXIT ((*relaxexit)) /**< deinitialize relaxation handler */
411  )
412 {
413  assert(relax != NULL);
414 
415  relax->relaxexit = relaxexit;
416 }
417 
418 /** set solving process initialization method of relaxation handler */
420  SCIP_RELAX* relax, /**< relaxation handler */
421  SCIP_DECL_RELAXINITSOL((*relaxinitsol)) /**< solving process initialization method of relaxation handler */
422  )
423 {
424  assert(relax != NULL);
425 
426  relax->relaxinitsol = relaxinitsol;
427 }
428 
429 /** set solving process deinitialization method of relaxation handler */
431  SCIP_RELAX* relax, /**< relaxation handler */
432  SCIP_DECL_RELAXEXITSOL((*relaxexitsol)) /**< solving process deinitialization relaxation handler */
433  )
434 {
435  assert(relax != NULL);
436 
437  relax->relaxexitsol = relaxexitsol;
438 }
439 
440 /** gets name of relaxation handler */
441 const char* SCIPrelaxGetName(
442  SCIP_RELAX* relax /**< relaxation handler */
443  )
444 {
445  assert(relax != NULL);
446 
447  return relax->name;
448 }
449 
450 /** gets description of relaxation handler */
451 const char* SCIPrelaxGetDesc(
452  SCIP_RELAX* relax /**< relaxation handler */
453  )
454 {
455  assert(relax != NULL);
456 
457  return relax->desc;
458 }
459 
460 /** gets priority of relaxation handler */
462  SCIP_RELAX* relax /**< relaxation handler */
463  )
464 {
465  assert(relax != NULL);
466 
467  return relax->priority;
468 }
469 
470 /** sets priority of relaxation handler */
472  SCIP_RELAX* relax, /**< relaxation handler */
473  SCIP_SET* set, /**< global SCIP settings */
474  int priority /**< new priority of the relaxation handler */
475  )
476 {
477  assert(relax != NULL);
478  assert(set != NULL);
479 
480  relax->priority = priority;
481  set->relaxssorted = FALSE;
482 }
483 
484 /** gets frequency of relaxation handler */
486  SCIP_RELAX* relax /**< relaxation handler */
487  )
488 {
489  assert(relax != NULL);
490 
491  return relax->freq;
492 }
493 
494 /** gets time in seconds used in this relaxator for setting up for next stages */
496  SCIP_RELAX* relax /**< relaxator */
497  )
498 {
499  assert(relax != NULL);
500 
501  return SCIPclockGetTime(relax->setuptime);
502 }
503 
504 /** enables or disables all clocks of \p relax, depending on the value of the flag */
506  SCIP_RELAX* relax, /**< the relaxation handler for which all clocks should be enabled or disabled */
507  SCIP_Bool enable /**< should the clocks of the relaxation handler be enabled? */
508  )
509 {
510  assert(relax != NULL);
511 
512  SCIPclockEnableOrDisable(relax->setuptime, enable);
513  SCIPclockEnableOrDisable(relax->relaxclock, enable);
514 }
515 
516 /** gets time in seconds used in this relaxation handler */
518  SCIP_RELAX* relax /**< relaxation handler */
519  )
520 {
521  assert(relax != NULL);
522 
523  return SCIPclockGetTime(relax->relaxclock);
524 }
525 
526 /** gets the total number of times, the relaxation handler was called */
528  SCIP_RELAX* relax /**< relaxation handler */
529  )
530 {
531  assert(relax != NULL);
532 
533  return relax->ncalls;
534 }
535 
536 /** is relaxation handler initialized? */
538  SCIP_RELAX* relax /**< relaxation handler */
539  )
540 {
541  assert(relax != NULL);
542 
543  return relax->initialized;
544 }
545 
546 /** returns whether the relaxation was completely solved at the current node */
548  SCIP_RELAX* relax, /**< relaxation handler */
549  SCIP_STAT* stat /**< dynamic problem statistics */
550  )
551 {
552  assert(relax != NULL);
553  assert(stat != NULL);
554 
555  return (relax->lastsolvednode == stat->ntotalnodes);
556 }
557 
558 /** marks the current relaxation unsolved, s.t. the relaxation handler is called again in the next solving round */
560  SCIP_RELAX* relax /**< relaxation handler */
561  )
562 {
563  assert(relax != NULL);
564 
565  relax->lastsolvednode = -1;
566 }
567 
568 /*
569  * methods for the global relaxation data
570  */
571 
572 /** creates global relaxation data */
574  SCIP_RELAXATION** relaxation /**< global relaxation data */
575  )
576 {
577  assert(relaxation != NULL);
578  SCIP_ALLOC( BMSallocMemory(relaxation) );
579  (*relaxation)->relaxsolobjval = 0.0;
580  (*relaxation)->relaxsolvalid = FALSE;
581  (*relaxation)->relaxsolzero = TRUE;
582 
583  return SCIP_OKAY;
584 }
585 
586 /** frees global relaxation data */
588  SCIP_RELAXATION** relaxation /**< global relaxation data */
589  )
590 {
591  assert(relaxation != NULL);
592 
593  BMSfreeMemory(relaxation);
594 
595  return SCIP_OKAY;
596 }
597 
598 /** sets the relaxsolzero flag in the relaxation data to the given value */
600  SCIP_RELAXATION* relaxation, /**< global relaxation data */
601  SCIP_Bool iszero /**< are all values of the relaxation solution set to zero? */
602  )
603 {
604  assert(relaxation != NULL);
605 
606  relaxation->relaxsolzero = iszero;
607 }
608 
609 /** returns whether the global relaxation solution is cleared and all values are set to zero */
611  SCIP_RELAXATION* relaxation /**< global relaxation data */
612  )
613 {
614  assert(relaxation != NULL);
615 
616  return relaxation->relaxsolzero;
617 }
618 
619 /** sets the relaxsolvalid flag in the relaxation data to the given value */
621  SCIP_RELAXATION* relaxation, /**< global relaxation data */
622  SCIP_Bool isvalid /**< is the stored solution valid? */
623  )
624 {
625  assert(relaxation != NULL);
626 
627  relaxation->relaxsolvalid = isvalid;
628 }
629 
630 /** returns whether the global relaxation solution is valid */
632  SCIP_RELAXATION* relaxation /**< global relaxation data */
633  )
634 {
635  assert(relaxation != NULL);
636 
637  return relaxation->relaxsolvalid;
638 }
639 
640 /** sets the objective value of the global relaxation solution */
642  SCIP_RELAXATION* relaxation, /**< global relaxation data */
643  SCIP_Real obj /**< objective value */
644  )
645 {
646  assert(relaxation != NULL);
647 
648  relaxation->relaxsolobjval = obj;
649 }
650 
651 /** returns the objective value of the global relaxation solution w.r.t. the transformed problem */
653  SCIP_RELAXATION* relaxation /**< global relaxation data */
654  )
655 {
656  assert(relaxation != NULL);
657 
658  return relaxation->relaxsolobjval;
659 }
660 
661 /** adds the given value to the global relaxation solution's objective value */
663  SCIP_RELAXATION* relaxation, /**< global relaxation data */
664  SCIP_Real val /**< value to add to the objective value */
665  )
666 {
667  assert(relaxation != NULL);
668 
669  relaxation->relaxsolobjval += val;
670 }
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:51
#define SCIP_DECL_RELAXFREE(x)
Definition: type_relax.h:55
#define BMSfreeMemoryArray(ptr)
Definition: memory.h:102
SCIP_DECL_SORTPTRCOMP(SCIPrelaxComp)
Definition: relax.c:42
SCIP_Real SCIPrelaxationGetSolObj(SCIP_RELAXATION *relaxation)
Definition: relax.c:652
SCIP_Real SCIPrelaxGetSetupTime(SCIP_RELAX *relax)
Definition: relax.c:495
const char * SCIPrelaxGetDesc(SCIP_RELAX *relax)
Definition: relax.c:451
char * desc
Definition: struct_relax.h:41
int SCIPrelaxGetFreq(SCIP_RELAX *relax)
Definition: relax.c:485
const char * SCIPrelaxGetName(SCIP_RELAX *relax)
Definition: relax.c:441
SCIP_RETCODE SCIPrelaxInit(SCIP_RELAX *relax, SCIP_SET *set)
Definition: relax.c:175
SCIP_PARAMDATA * SCIPparamGetData(SCIP_PARAM *param)
Definition: paramset.c:651
#define SCIP_MAXSTRLEN
Definition: def.h:201
internal methods for clocks and timing issues
SCIP_Longint ntotalnodes
Definition: struct_stat.h:66
#define NULL
Definition: lpi_spx.cpp:130
struct SCIP_ParamData SCIP_PARAMDATA
Definition: type_paramset.h:73
void SCIPrelaxationSetSolValid(SCIP_RELAXATION *relaxation, SCIP_Bool isvalid)
Definition: relax.c:620
void SCIPrelaxSetPriority(SCIP_RELAX *relax, SCIP_SET *set, int priority)
Definition: relax.c:471
SCIP_RETCODE SCIPsetRelaxPriority(SCIP *scip, SCIP_RELAX *relax, int priority)
Definition: scip.c:6591
void SCIPrelaxSetData(SCIP_RELAX *relax, SCIP_RELAXDATA *relaxdata)
Definition: relax.c:364
void SCIPclockStop(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:350
#define FALSE
Definition: def.h:56
#define SCIP_DECL_RELAXINIT(x)
Definition: type_relax.h:63
#define SCIP_DECL_RELAXINITSOL(x)
Definition: type_relax.h:82
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_CALL(x)
Definition: def.h:266
void SCIPrelaxSetCopy(SCIP_RELAX *relax, SCIP_DECL_RELAXCOPY((*relaxcopy)))
Definition: relax.c:375
SCIP_Longint SCIPrelaxGetNCalls(SCIP_RELAX *relax)
Definition: relax.c:527
#define SCIPdebugMessage
Definition: pub_message.h:77
SCIP_Bool SCIPrelaxIsInitialized(SCIP_RELAX *relax)
Definition: relax.c:537
SCIP_RETCODE SCIPrelaxFree(SCIP_RELAX **relax, SCIP_SET *set)
Definition: relax.c:149
internal methods for handling parameter settings
SCIP_Bool SCIPrelaxationIsSolValid(SCIP_RELAXATION *relaxation)
Definition: relax.c:631
void SCIPclockEnableOrDisable(SCIP_CLOCK *clck, SCIP_Bool enable)
Definition: clock.c:250
#define SCIP_DECL_RELAXEXIT(x)
Definition: type_relax.h:71
SCIP_RELAXDATA * relaxdata
Definition: struct_relax.h:49
void SCIPrelaxSetFree(SCIP_RELAX *relax, SCIP_DECL_RELAXFREE((*relaxfree)))
Definition: relax.c:386
SCIP_RETCODE SCIPrelaxationCreate(SCIP_RELAXATION **relaxation)
Definition: relax.c:573
SCIP_CLOCK * relaxclock
Definition: struct_relax.h:51
SCIP_RETCODE SCIPrelaxCreate(SCIP_RELAX **relax, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, int freq, SCIP_DECL_RELAXCOPY((*relaxcopy)), SCIP_DECL_RELAXFREE((*relaxfree)), SCIP_DECL_RELAXINIT((*relaxinit)), SCIP_DECL_RELAXEXIT((*relaxexit)), SCIP_DECL_RELAXINITSOL((*relaxinitsol)), SCIP_DECL_RELAXEXITSOL((*relaxexitsol)), SCIP_DECL_RELAXEXEC((*relaxexec)), SCIP_RELAXDATA *relaxdata)
Definition: relax.c:87
#define SCIPerrorMessage
Definition: pub_message.h:45
SCIP_RETCODE SCIPrelaxExit(SCIP_RELAX *relax, SCIP_SET *set)
Definition: relax.c:213
SCIP_Bool SCIPrelaxationIsSolZero(SCIP_RELAXATION *relaxation)
Definition: relax.c:610
void SCIPclockReset(SCIP_CLOCK *clck)
Definition: clock.c:199
SCIP_Real relaxsolobjval
Definition: struct_relax.h:60
#define BMSallocMemory(ptr)
Definition: memory.h:74
SCIP_Real SCIPclockGetTime(SCIP_CLOCK *clck)
Definition: clock.c:428
#define SCIP_DECL_RELAXCOPY(x)
Definition: type_relax.h:47
void SCIPrelaxSetInitsol(SCIP_RELAX *relax, SCIP_DECL_RELAXINITSOL((*relaxinitsol)))
Definition: relax.c:419
void SCIPrelaxSetExitsol(SCIP_RELAX *relax, SCIP_DECL_RELAXEXITSOL((*relaxexitsol)))
Definition: relax.c:430
SCIP_Bool relaxsolvalid
Definition: struct_relax.h:61
internal methods for global SCIP settings
SCIP_RETCODE SCIPrelaxCopyInclude(SCIP_RELAX *relax, SCIP_SET *set)
Definition: relax.c:69
SCIP_CLOCK * setuptime
Definition: struct_relax.h:50
#define BMSfreeMemory(ptr)
Definition: memory.h:100
internal methods for relaxators
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
#define BMSduplicateMemoryArray(ptr, source, num)
Definition: memory.h:98
SCIP_RETCODE SCIPclockCreate(SCIP_CLOCK **clck, SCIP_CLOCKTYPE clocktype)
Definition: clock.c:160
char * name
Definition: struct_relax.h:40
public data structures and miscellaneous methods
SCIP_RETCODE SCIPrelaxationFree(SCIP_RELAXATION **relaxation)
Definition: relax.c:587
#define SCIP_Bool
Definition: def.h:53
SCIP_Bool SCIPrelaxIsSolved(SCIP_RELAX *relax, SCIP_STAT *stat)
Definition: relax.c:547
SCIP_RETCODE SCIPrelaxInitsol(SCIP_RELAX *relax, SCIP_SET *set)
Definition: relax.c:243
static const char * paramname[]
Definition: lpi_msk.c:4201
void SCIPclockFree(SCIP_CLOCK **clck)
Definition: clock.c:175
SCIP_Bool initialized
Definition: struct_relax.h:54
static SCIP_DECL_PARAMCHGD(paramChgdRelaxPriority)
Definition: relax.c:55
SCIP_Longint lastsolvednode
Definition: struct_relax.h:39
void SCIPrelaxEnableOrDisableClocks(SCIP_RELAX *relax, SCIP_Bool enable)
Definition: relax.c:505
void SCIPrelaxationSetSolObj(SCIP_RELAXATION *relaxation, SCIP_Real obj)
Definition: relax.c:641
int SCIPparamGetInt(SCIP_PARAM *param)
Definition: paramset.c:706
SCIP_Longint ncalls
Definition: struct_relax.h:38
void SCIPrelaxationSetSolZero(SCIP_RELAXATION *relaxation, SCIP_Bool iszero)
Definition: relax.c:599
SCIP_Real SCIPrelaxGetTime(SCIP_RELAX *relax)
Definition: relax.c:517
struct SCIP_RelaxData SCIP_RELAXDATA
Definition: type_relax.h:38
#define SCIP_DECL_RELAXEXEC(x)
Definition: type_relax.h:118
void SCIPrelaxationSolObjAdd(SCIP_RELAXATION *relaxation, SCIP_Real val)
Definition: relax.c:662
int SCIPrelaxGetPriority(SCIP_RELAX *relax)
Definition: relax.c:461
SCIP_Bool relaxsolzero
Definition: struct_relax.h:62
SCIP_RELAXDATA * SCIPrelaxGetData(SCIP_RELAX *relax)
Definition: relax.c:354
public methods for message output
void SCIPrelaxMarkUnsolved(SCIP_RELAX *relax)
Definition: relax.c:559
#define SCIP_Real
Definition: def.h:127
internal methods for problem statistics
#define SCIP_Longint
Definition: def.h:112
datastructures for relaxators
#define SCIP_DECL_RELAXEXITSOL(x)
Definition: type_relax.h:93
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:392
void SCIPrelaxSetExit(SCIP_RELAX *relax, SCIP_DECL_RELAXEXIT((*relaxexit)))
Definition: relax.c:408
#define SCIP_ALLOC(x)
Definition: def.h:277
SCIP_RETCODE SCIPrelaxExec(SCIP_RELAX *relax, SCIP_SET *set, SCIP_STAT *stat, int depth, SCIP_Real *lowerbound, SCIP_RESULT *result)
Definition: relax.c:291
SCIP callable library.
void SCIPrelaxSetInit(SCIP_RELAX *relax, SCIP_DECL_RELAXINIT((*relaxinit)))
Definition: relax.c:397
SCIP_RETCODE SCIPrelaxExitsol(SCIP_RELAX *relax, SCIP_SET *set)
Definition: relax.c:267