Scippy

SCIP

Solving Constraint Integer Programs

paramset.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-2014 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 paramset.c
17  * @brief methods for handling parameter settings
18  * @author Tobias Achterberg
19  * @author Timo Berthold
20  * @author Stefan Heinz
21  * @author Gerald Gamrath
22  */
23 
24 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
25 
26 #include <assert.h>
27 #include <string.h>
28 
29 #include "scip/scip.h"
30 #include "scip/set.h"
31 #include "scip/paramset.h"
32 
33 #include "scip/struct_paramset.h"
34 
35 
36 
37 /*
38  * Parameter methods
39  */
40 
41 /** hash key retrieval function for parameters */
42 static
43 SCIP_DECL_HASHGETKEY(hashGetKeyParam)
44 { /*lint --e{715}*/
45  SCIP_PARAM* param;
46 
47  param = (SCIP_PARAM*)elem;
48  assert(param != NULL);
49 
50  return param->name;
51 }
52 
53 /** checks whether parameter can be changed and issues a warning message if it is fixed */
54 static
56  SCIP_PARAM* param, /**< parameter */
57  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
58  )
59 {
60  assert(param != NULL);
61 
62  if( param->isfixed )
63  {
64  SCIPmessagePrintWarning(messagehdlr, "parameter <%s> is fixed and cannot be changed. Unfix it to allow changing the value.\n",
65  param->name);
67  }
68 
69  return SCIP_OKAY;
70 }
71 
72 /** checks parameter value according to the given feasible domain; issues a warning message if value was invalid */
73 static
75  SCIP_PARAM* param, /**< parameter */
76  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
77  SCIP_Bool value /**< value to check */
78  )
79 {
80  assert(param != NULL);
81  assert(param->paramtype == SCIP_PARAMTYPE_BOOL);
82 
83  if( value != TRUE && value != FALSE )
84  {
85  SCIPmessagePrintWarning(messagehdlr, "Invalid value <%d> for bool parameter <%s>. Must be <0> (FALSE) or <1> (TRUE).\n",
86  value, param->name);
88  }
89 
90  SCIP_CALL_QUIET( paramCheckFixed(param, messagehdlr) );
91 
92  return SCIP_OKAY;
93 }
94 
95 /** checks parameter value according to the given feasible domain; issues a warning message if value was invalid */
96 static
98  SCIP_PARAM* param, /**< parameter */
99  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
100  int value /**< value to check */
101  )
102 {
103  assert(param != NULL);
104  assert(param->paramtype == SCIP_PARAMTYPE_INT);
105 
106  if( value < param->data.intparam.minvalue || value > param->data.intparam.maxvalue )
107  {
108  SCIPmessagePrintWarning(messagehdlr, "Invalid value <%d> for int parameter <%s>. Must be in range [%d,%d].\n",
109  value, param->name, param->data.intparam.minvalue, param->data.intparam.maxvalue);
110  return SCIP_PARAMETERWRONGVAL;
111  }
112 
113  SCIP_CALL_QUIET( paramCheckFixed(param, messagehdlr) );
114 
115  return SCIP_OKAY;
116 }
117 
118 /** checks parameter value according to the given feasible domain; issues a warning message if value was invalid */
119 static
121  SCIP_PARAM* param, /**< parameter */
122  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
123  SCIP_Longint value /**< value to check */
124  )
125 {
126  assert(param != NULL);
127  assert(param->paramtype == SCIP_PARAMTYPE_LONGINT);
128 
129  if( value < param->data.longintparam.minvalue || value > param->data.longintparam.maxvalue )
130  {
131  SCIPmessagePrintWarning(messagehdlr, "Invalid value <%"SCIP_LONGINT_FORMAT"> for longint parameter <%s>. Must be in range [%"SCIP_LONGINT_FORMAT",%"SCIP_LONGINT_FORMAT"].\n",
132  value, param->name, param->data.longintparam.minvalue, param->data.longintparam.maxvalue);
133  return SCIP_PARAMETERWRONGVAL;
134  }
135 
136  SCIP_CALL_QUIET( paramCheckFixed(param, messagehdlr) );
137 
138  return SCIP_OKAY;
139 }
140 
141 /** checks parameter value according to the given feasible domain; issues a warning message if value was invalid */
142 static
144  SCIP_PARAM* param, /**< parameter */
145  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
146  SCIP_Real value /**< value to check */
147  )
148 {
149  assert(param != NULL);
150  assert(param->paramtype == SCIP_PARAMTYPE_REAL);
151 
152  if( value < param->data.realparam.minvalue || value > param->data.realparam.maxvalue )
153  {
154  SCIPmessagePrintWarning(messagehdlr, "Invalid real parameter value <%.15g> for parameter <%s>. Must be in range [%.15g,%.15g].\n",
155  value, param->name, param->data.realparam.minvalue, param->data.realparam.maxvalue);
156  return SCIP_PARAMETERWRONGVAL;
157  }
158 
159  SCIP_CALL_QUIET( paramCheckFixed(param, messagehdlr) );
160 
161  return SCIP_OKAY;
162 }
163 
164 /** checks parameter value according to the given feasible domain; issues a warning message if value was invalid */
165 static
167  SCIP_PARAM* param, /**< parameter */
168  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
169  char value /**< value to check */
170  )
171 {
172  assert(param != NULL);
173  assert(param->paramtype == SCIP_PARAMTYPE_CHAR);
174 
175  if( value == '\b' || value == '\f' || value == '\n' || value == '\r' || value == '\v' )
176  {
177  SCIPmessagePrintWarning(messagehdlr, "Invalid char parameter value <%x>.\n", (int)value);
178  return SCIP_PARAMETERWRONGVAL;
179  }
180 
181  if( param->data.charparam.allowedvalues != NULL )
182  {
183  char* c;
184 
185  c = param->data.charparam.allowedvalues;
186  while( *c != '\0' && *c != value )
187  c++;
188 
189  if( *c != value )
190  {
191  SCIPmessagePrintWarning(messagehdlr, "Invalid char parameter value <%c>. Must be in set {%s}.\n",
192  value, param->data.charparam.allowedvalues);
193  return SCIP_PARAMETERWRONGVAL;
194  }
195  }
196 
197  SCIP_CALL_QUIET( paramCheckFixed(param, messagehdlr) );
198 
199  return SCIP_OKAY;
200 }
201 
202 /** checks parameter value according to the given feasible domain; issues a warning message if value was invalid */
203 static
205  SCIP_PARAM* param, /**< parameter */
206  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
207  const char* value /**< value to check */
208  )
209 {
210  unsigned int i;
211 
212  assert(param != NULL);
213  assert(param->paramtype == SCIP_PARAMTYPE_STRING);
214 
215  if( value == NULL )
216  {
217  SCIPmessagePrintWarning(messagehdlr, "Cannot assign a NULL string to a string parameter.\n");
218  return SCIP_PARAMETERWRONGVAL;
219  }
220 
221  for( i = 0; i < (unsigned int) strlen(value); ++i )
222  {
223  if( value[i] == '\b' || value[i] == '\f' || value[i] == '\n' || value[i] == '\r' || value[i] == '\v' )
224  {
225  SCIPmessagePrintWarning(messagehdlr, "Invalid character <%x> in string parameter at position %d.\n", (int)value[i], i);
226  return SCIP_PARAMETERWRONGVAL;
227  }
228  }
229 
230  SCIP_CALL_QUIET( paramCheckFixed(param, messagehdlr) );
231 
232  return SCIP_OKAY;
233 }
234 
235 /** writes the parameter to a file */
236 static
238  SCIP_PARAM* param, /**< parameter */
239  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
240  FILE* file, /**< file stream to write parameter to, or NULL for stdout */
241  SCIP_Bool comments, /**< should parameter descriptions be written as comments? */
242  SCIP_Bool onlychanged /**< should only the parameters been written, that are changed from default? */
243  )
244 {
245  assert(param != NULL);
246 
247  /* write parameters at default values only, if the onlychanged flag is not set or if the parameter is fixed */
248  if( onlychanged && SCIPparamIsDefault(param) && !SCIPparamIsFixed(param) )
249  return SCIP_OKAY;
250 
251  /* write parameter description, bounds, and defaults as comments */
252  if( comments )
253  {
254  SCIPmessageFPrintInfo(messagehdlr, file, "# %s\n", param->desc);
255  switch( param->paramtype )
256  {
257  case SCIP_PARAMTYPE_BOOL:
258  SCIPmessageFPrintInfo(messagehdlr, file, "# [type: bool, range: {TRUE,FALSE}, default: %s]\n",
259  param->data.boolparam.defaultvalue ? "TRUE" : "FALSE");
260  break;
261  case SCIP_PARAMTYPE_INT:
262  SCIPmessageFPrintInfo(messagehdlr, file, "# [type: int, range: [%d,%d], default: %d]\n",
264  break;
266  SCIPmessageFPrintInfo(messagehdlr, file, "# [type: longint, range: [%"SCIP_LONGINT_FORMAT",%"SCIP_LONGINT_FORMAT"], default: %"SCIP_LONGINT_FORMAT"]\n",
268  break;
269  case SCIP_PARAMTYPE_REAL:
270  SCIPmessageFPrintInfo(messagehdlr, file, "# [type: real, range: [%.15g,%.15g], default: %.15g]\n",
272  break;
273  case SCIP_PARAMTYPE_CHAR:
274  SCIPmessageFPrintInfo(messagehdlr, file, "# [type: char, range: {%s}, default: %c]\n",
275  param->data.charparam.allowedvalues != NULL ? param->data.charparam.allowedvalues : "all chars",
276  param->data.charparam.defaultvalue);
277  break;
279  SCIPmessageFPrintInfo(messagehdlr, file, "# [type: string, default: \"%s\"]\n", param->data.stringparam.defaultvalue);
280  break;
281  default:
282  SCIPerrorMessage("unknown parameter type\n");
283  return SCIP_INVALIDDATA;
284  }
285  }
286 
287  /* write parameter value */
288  SCIPmessageFPrintInfo(messagehdlr, file, "%s = ", param->name);
289  switch( param->paramtype )
290  {
291  case SCIP_PARAMTYPE_BOOL:
292  SCIPmessageFPrintInfo(messagehdlr, file, "%s", SCIPparamGetBool(param) ? "TRUE" : "FALSE");
293  break;
294  case SCIP_PARAMTYPE_INT:
295  SCIPmessageFPrintInfo(messagehdlr, file, "%d", SCIPparamGetInt(param));
296  break;
298  SCIPmessageFPrintInfo(messagehdlr, file, "%"SCIP_LONGINT_FORMAT"", SCIPparamGetLongint(param));
299  break;
300  case SCIP_PARAMTYPE_REAL:
301  SCIPmessageFPrintInfo(messagehdlr, file, "%.15g", SCIPparamGetReal(param));
302  break;
303  case SCIP_PARAMTYPE_CHAR:
304  SCIPmessageFPrintInfo(messagehdlr, file, "%c", SCIPparamGetChar(param));
305  break;
307  SCIPmessageFPrintInfo(messagehdlr, file, "\"%s\"", SCIPparamGetString(param));
308  break;
309  default:
310  SCIPerrorMessage("unknown parameter type\n");
311  return SCIP_INVALIDDATA;
312  }
313 
314  /* write "fix" after value if parameter is fixed */
315  if( SCIPparamIsFixed(param) )
316  SCIPmessageFPrintInfo(messagehdlr, file, " fix");
317 
318  SCIPmessageFPrintInfo(messagehdlr, file, "\n");
319 
320  if( comments )
321  SCIPmessageFPrintInfo(messagehdlr, file, "\n");
322 
323  return SCIP_OKAY;
324 }
325 
326 /** if a bool parameter exits with the given parameter name it is set to the new value */
327 static
329  SCIP_PARAMSET* paramset, /**< parameter set */
330  SCIP_SET* set, /**< global SCIP settings */
331  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
332  const char* paramname, /**< parameter name */
333  SCIP_Bool value, /**< new value of the parameter */
334  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
335  )
336 {
337  SCIP_PARAM* param;
338 
339  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
340  if( param != NULL )
341  {
342  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_BOOL);
343 
344  if( SCIPparamIsFixed(param) )
345  {
346  SCIPdebugMessage("hard coded parameter <%s> is fixed and is thus not changed.\n", param->name);
347 
348  return SCIP_OKAY;
349  }
350  SCIP_CALL( SCIPparamSetBool(param, set, messagehdlr, value, quiet) );
351  }
352 #ifndef NDEBUG
353  else
354  {
355  SCIPmessagePrintWarning(messagehdlr, "unknown hard coded bool parameter <%s>\n", paramname);
356  }
357 #endif
358 
359  return SCIP_OKAY;
360 }
361 
362 /** if an char parameter exits with the given parameter name it is set to the new value */
363 static
365  SCIP_PARAMSET* paramset, /**< parameter set */
366  SCIP_SET* set, /**< global SCIP settings */
367  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
368  const char* paramname, /**< parameter name */
369  char value, /**< new value of the parameter */
370  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
371  )
372 {
373  SCIP_PARAM* param;
374 
375  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
376  if( param != NULL )
377  {
378  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_CHAR);
379 
380  if( SCIPparamIsFixed(param) )
381  {
382  SCIPdebugMessage("hard coded parameter <%s> is fixed and is thus not changed.\n", param->name);
383 
384  return SCIP_OKAY;
385  }
386  SCIP_CALL( SCIPparamSetChar(param, set, messagehdlr, value, quiet) );
387  }
388 #ifndef NDEBUG
389  else
390  {
391  SCIPmessagePrintWarning(messagehdlr, "unknown hard coded char parameter <%s>\n", paramname);
392  }
393 #endif
394 
395  return SCIP_OKAY;
396 }
397 
398 /** if an integer parameter exits with the given parameter name it is set to the new value */
399 static
401  SCIP_PARAMSET* paramset, /**< parameter set */
402  SCIP_SET* set, /**< global SCIP settings */
403  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
404  const char* paramname, /**< parameter name */
405  int value, /**< new value of the parameter */
406  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
407  )
408 {
409  SCIP_PARAM* param;
410 
411  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
412  if( param != NULL )
413  {
414  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
415 
416  if( SCIPparamIsFixed(param) )
417  {
418  SCIPdebugMessage("hard coded parameter <%s> is fixed and is thus not changed.\n", param->name);
419 
420  return SCIP_OKAY;
421  }
422  SCIP_CALL( SCIPparamSetInt(param, set, messagehdlr, value, quiet) );
423  }
424 #ifndef NDEBUG
425  else
426  {
427  SCIPmessagePrintWarning(messagehdlr, "unknown hard coded int parameter <%s>\n", paramname);
428  }
429 #endif
430 
431  return SCIP_OKAY;
432 }
433 
434 /** if a long integer parameter exits with the given parameter name it is set to the new value */
435 static
437  SCIP_PARAMSET* paramset, /**< parameter set */
438  SCIP_SET* set, /**< global SCIP settings */
439  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
440  const char* paramname, /**< parameter name */
441  SCIP_Longint value, /**< new value of the parameter */
442  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
443  )
444 {
445  SCIP_PARAM* param;
446 
447  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
448  if( param != NULL )
449  {
450  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_LONGINT);
451 
452  if( SCIPparamIsFixed(param) )
453  {
454  SCIPdebugMessage("hard coded parameter <%s> is fixed and is thus not changed.\n", param->name);
455 
456  return SCIP_OKAY;
457  }
458  SCIP_CALL( SCIPparamSetLongint(param, set, messagehdlr, value, quiet) );
459  }
460 #ifndef NDEBUG
461  else
462  {
463  SCIPmessagePrintWarning(messagehdlr, "unknown hard coded longint parameter <%s>\n", paramname);
464  }
465 #endif
466 
467  return SCIP_OKAY;
468 }
469 
470 /** if a real parameter exits with the given parameter name it is set to the new value */
471 static
473  SCIP_PARAMSET* paramset, /**< parameter set */
474  SCIP_SET* set, /**< global SCIP settings */
475  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
476  const char* paramname, /**< parameter name */
477  SCIP_Real value, /**< new value of the parameter */
478  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
479  )
480 {
481  SCIP_PARAM* param;
482 
483  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
484  if( param != NULL )
485  {
486  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_REAL);
487 
488  if( SCIPparamIsFixed(param) )
489  {
490  SCIPdebugMessage("hard coded parameter <%s> is fixed and is thus not changed.\n", param->name);
491 
492  return SCIP_OKAY;
493  }
494  SCIP_CALL( SCIPparamSetReal(param, set, messagehdlr, value, quiet) );
495  }
496 #ifndef NDEBUG
497  else
498  {
499  SCIPmessagePrintWarning(messagehdlr, "unknown hard coded real parameter <%s>\n", paramname);
500  }
501 #endif
502 
503  return SCIP_OKAY;
504 }
505 
506 /** copies value of source Bool parameter to target Bool parameter*/
507 static
509  SCIP_PARAM* sourceparam, /**< source Bool parameter */
510  SCIP_PARAM* targetparam, /**< target Bool parameter */
511  SCIP_SET* set, /**< global SCIP settings of target SCIP */
512  SCIP_MESSAGEHDLR* messagehdlr /**< message handler of target SCIP */
513  )
514 {
515  SCIP_Bool value;
516 
517  assert(sourceparam != NULL);
518  assert(targetparam != NULL);
519 
520  /* get value of source parameter and copy it to target parameter */
521  value = SCIPparamGetBool(sourceparam);
522  SCIP_CALL( SCIPparamSetBool(targetparam, set, messagehdlr, value, TRUE) );
523 
524  return SCIP_OKAY;
525 }
526 
527 /** copies value of source int parameter to target int parameter*/
528 static
530  SCIP_PARAM* sourceparam, /**< source int parameter */
531  SCIP_PARAM* targetparam, /**< target int parameter */
532  SCIP_SET* set, /**< global SCIP settings of target SCIP */
533  SCIP_MESSAGEHDLR* messagehdlr /**< message handler of target SCIP */
534  )
535 {
536  int value;
537 
538  assert(sourceparam != NULL);
539  assert(targetparam != NULL);
540 
541  /* get value of source parameter and copy it to target parameter */
542  value = SCIPparamGetInt(sourceparam);
543  SCIP_CALL( SCIPparamSetInt(targetparam, set, messagehdlr, value, TRUE) );
544 
545  return SCIP_OKAY;
546 }
547 
548 /** copies value of source longint parameter to target longint parameter*/
549 static
551  SCIP_PARAM* sourceparam, /**< source longint parameter */
552  SCIP_PARAM* targetparam, /**< target longint parameter */
553  SCIP_SET* set, /**< global SCIP settings of target SCIP */
554  SCIP_MESSAGEHDLR* messagehdlr /**< message handler of target SCIP */
555  )
556 {
557  SCIP_Longint value;
558 
559  assert(sourceparam != NULL);
560  assert(targetparam != NULL);
561 
562  /* get value of source parameter and copy it to target parameter */
563  value = SCIPparamGetLongint(sourceparam);
564  SCIP_CALL( SCIPparamSetLongint(targetparam, set, messagehdlr, value, TRUE) );
565 
566  return SCIP_OKAY;
567 }
568 
569 /** copies value of source real parameter to target real parameter*/
570 static
572  SCIP_PARAM* sourceparam, /**< source real parameter */
573  SCIP_PARAM* targetparam, /**< target real parameter */
574  SCIP_SET* set, /**< global SCIP settings of target SCIP */
575  SCIP_MESSAGEHDLR* messagehdlr /**< message handler of target SCIP */
576  )
577 {
578  SCIP_Real value;
579 
580  assert(sourceparam != NULL);
581  assert(targetparam != NULL);
582 
583  /* get value of source parameter and copy it to target parameter */
584  value = SCIPparamGetReal(sourceparam);
585  SCIP_CALL( SCIPparamSetReal(targetparam, set, messagehdlr, value, TRUE) );
586 
587  return SCIP_OKAY;
588 }
589 
590 /** copies value of source char parameter to target char parameter*/
591 static
593  SCIP_PARAM* sourceparam, /**< source char parameter */
594  SCIP_PARAM* targetparam, /**< target char parameter */
595  SCIP_SET* set, /**< global SCIP settings of target SCIP */
596  SCIP_MESSAGEHDLR* messagehdlr /**< message handler of target SCIP */
597  )
598 {
599  char value;
600 
601  assert(sourceparam != NULL);
602  assert(targetparam != NULL);
603 
604  /* get value of source parameter and copy it to target parameter */
605  value = SCIPparamGetChar(sourceparam);
606  SCIP_CALL( SCIPparamSetChar(targetparam, set, messagehdlr, value, TRUE) );
607 
608  return SCIP_OKAY;
609 }
610 
611 /** copies value of source string parameter to target string parameter*/
612 static
614  SCIP_PARAM* sourceparam, /**< source string parameter */
615  SCIP_PARAM* targetparam, /**< target string parameter */
616  SCIP_SET* set, /**< global SCIP settings of target SCIP */
617  SCIP_MESSAGEHDLR* messagehdlr /**< message handler of target SCIP */
618  )
619 {
620  char* value;
621 
622  assert(sourceparam != NULL);
623  assert(targetparam != NULL);
624 
625  /* get value of source parameter and copy it to target parameter */
626  value = SCIPparamGetString(sourceparam);
627  SCIP_CALL( SCIPparamSetString(targetparam, set, messagehdlr, value, TRUE) );
628 
629  return SCIP_OKAY;
630 }
631 
632 /** returns type of parameter */
634  SCIP_PARAM* param /**< parameter */
635  )
636 {
637  assert(param != NULL);
638 
639  return param->paramtype;
640 }
641 
642 /** returns name of parameter */
643 const char* SCIPparamGetName(
644  SCIP_PARAM* param /**< parameter */
645  )
646 {
647  assert(param != NULL);
648 
649  return param->name;
650 }
651 
652 /** returns description of parameter */
653 const char* SCIPparamGetDesc(
654  SCIP_PARAM* param /**< parameter */
655  )
656 {
657  assert(param != NULL);
658 
659  return param->desc;
660 }
661 
662 /** returns locally defined parameter specific data */
664  SCIP_PARAM* param /**< parameter */
665  )
666 {
667  assert(param != NULL);
668 
669  return param->paramdata;
670 }
671 
672 /** returns whether parameter is advanced */
674  SCIP_PARAM* param /**< parameter */
675  )
676 {
677  assert(param != NULL);
678 
679  return param->isadvanced;
680 }
681 
682 /** returns whether parameter is fixed */
684  SCIP_PARAM* param /**< parameter */
685  )
686 {
687  assert(param != NULL);
688 
689  return param->isfixed;
690 }
691 
692 /** returns value of SCIP_Bool parameter */
694  SCIP_PARAM* param /**< parameter */
695  )
696 {
697  assert(param != NULL);
698  assert(param->paramtype == SCIP_PARAMTYPE_BOOL);
699 
700  if( param->data.boolparam.valueptr != NULL )
701  return *param->data.boolparam.valueptr;
702  else
703  return param->data.boolparam.curvalue;
704 }
705 
706 /** returns default value of SCIP_Bool parameter */
708  SCIP_PARAM* param /**< parameter */
709  )
710 {
711  assert(param != NULL);
712  assert(param->paramtype == SCIP_PARAMTYPE_BOOL);
713 
714  return param->data.boolparam.defaultvalue;
715 }
716 
717 /** returns value of int parameter */
719  SCIP_PARAM* param /**< parameter */
720  )
721 {
722  assert(param != NULL);
723  assert(param->paramtype == SCIP_PARAMTYPE_INT);
724 
725  if( param->data.intparam.valueptr != NULL )
726  return *param->data.intparam.valueptr;
727  else
728  return param->data.intparam.curvalue;
729 }
730 
731 /** returns minimal value of int parameter */
733  SCIP_PARAM* param /**< parameter */
734  )
735 {
736  assert(param != NULL);
737  assert(param->paramtype == SCIP_PARAMTYPE_INT);
738 
739  return param->data.intparam.minvalue;
740 }
741 
742 /** returns maximal value of int parameter */
744  SCIP_PARAM* param /**< parameter */
745  )
746 {
747  assert(param != NULL);
748  assert(param->paramtype == SCIP_PARAMTYPE_INT);
749 
750  return param->data.intparam.maxvalue;
751 }
752 
753 /** returns default value of int parameter */
755  SCIP_PARAM* param /**< parameter */
756  )
757 {
758  assert(param != NULL);
759  assert(param->paramtype == SCIP_PARAMTYPE_INT);
760 
761  return param->data.intparam.defaultvalue;
762 }
763 
764 /** returns value of SCIP_Longint parameter */
766  SCIP_PARAM* param /**< parameter */
767  )
768 {
769  assert(param != NULL);
770  assert(param->paramtype == SCIP_PARAMTYPE_LONGINT);
771 
772  if( param->data.longintparam.valueptr != NULL )
773  return *param->data.longintparam.valueptr;
774  else
775  return param->data.longintparam.curvalue;
776 }
777 
778 /** returns minimal value of longint parameter */
780  SCIP_PARAM* param /**< parameter */
781  )
782 {
783  assert(param != NULL);
784  assert(param->paramtype == SCIP_PARAMTYPE_LONGINT);
785 
786  return param->data.longintparam.minvalue;
787 }
788 
789 /** returns maximal value of longint parameter */
791  SCIP_PARAM* param /**< parameter */
792  )
793 {
794  assert(param != NULL);
795  assert(param->paramtype == SCIP_PARAMTYPE_LONGINT);
796 
797  return param->data.longintparam.maxvalue;
798 }
799 
800 /** returns default value of SCIP_Longint parameter */
802  SCIP_PARAM* param /**< parameter */
803  )
804 {
805  assert(param != NULL);
806  assert(param->paramtype == SCIP_PARAMTYPE_LONGINT);
807 
808  return param->data.longintparam.defaultvalue;
809 }
810 
811 /** returns value of SCIP_Real parameter */
813  SCIP_PARAM* param /**< parameter */
814  )
815 {
816  assert(param != NULL);
817  assert(param->paramtype == SCIP_PARAMTYPE_REAL);
818 
819  if( param->data.realparam.valueptr != NULL )
820  return *param->data.realparam.valueptr;
821  else
822  return param->data.realparam.curvalue;
823 }
824 
825 /** returns minimal value of real parameter */
827  SCIP_PARAM* param /**< parameter */
828  )
829 {
830  assert(param != NULL);
831  assert(param->paramtype == SCIP_PARAMTYPE_REAL);
832 
833  return param->data.realparam.minvalue;
834 }
835 
836 /** returns maximal value of real parameter */
838  SCIP_PARAM* param /**< parameter */
839  )
840 {
841  assert(param != NULL);
842  assert(param->paramtype == SCIP_PARAMTYPE_REAL);
843 
844  return param->data.realparam.maxvalue;
845 }
846 
847 /** returns default value of SCIP_Real parameter */
849  SCIP_PARAM* param /**< parameter */
850  )
851 {
852  assert(param != NULL);
853  assert(param->paramtype == SCIP_PARAMTYPE_REAL);
854 
855  return param->data.realparam.defaultvalue;
856 }
857 
858 /** returns value of char parameter */
860  SCIP_PARAM* param /**< parameter */
861  )
862 {
863  assert(param != NULL);
864  assert(param->paramtype == SCIP_PARAMTYPE_CHAR);
865 
866  if( param->data.charparam.valueptr != NULL )
867  return *param->data.charparam.valueptr;
868  else
869  return param->data.charparam.curvalue;
870 }
871 
872 /** returns allowed values of char parameter, or NULL if everything is allowed */
874  SCIP_PARAM* param /**< parameter */
875  )
876 {
877  assert(param != NULL);
878  assert(param->paramtype == SCIP_PARAMTYPE_CHAR);
879 
880  return param->data.charparam.allowedvalues;
881 }
882 
883 /** returns default value of char parameter */
885  SCIP_PARAM* param /**< parameter */
886  )
887 {
888  assert(param != NULL);
889  assert(param->paramtype == SCIP_PARAMTYPE_CHAR);
890 
891  return param->data.charparam.defaultvalue;
892 }
893 
894 /** returns value of string parameter */
896  SCIP_PARAM* param /**< parameter */
897  )
898 {
899  assert(param != NULL);
900  assert(param->paramtype == SCIP_PARAMTYPE_STRING);
901 
902  if( param->data.stringparam.valueptr != NULL )
903  return *param->data.stringparam.valueptr;
904  else
905  return param->data.stringparam.curvalue;
906 }
907 
908 /** returns default value of String parameter */
910  SCIP_PARAM* param /**< parameter */
911  )
912 {
913  assert(param != NULL);
914  assert(param->paramtype == SCIP_PARAMTYPE_STRING);
915 
916  return param->data.stringparam.defaultvalue;
917 }
918 
919 /** returns whether the parameter is on its default setting */
921  SCIP_PARAM* param /**< parameter */
922  )
923 {
924  assert(param != NULL);
925 
926  switch( param->paramtype )
927  {
928  case SCIP_PARAMTYPE_BOOL:
929  return (SCIPparamGetBool(param) == SCIPparamGetBoolDefault(param));
930 
931  case SCIP_PARAMTYPE_INT:
932  return (SCIPparamGetInt(param) == SCIPparamGetIntDefault(param));
933 
935  return (SCIPparamGetLongint(param) == SCIPparamGetLongintDefault(param));
936 
937  case SCIP_PARAMTYPE_REAL:
938  return EPSZ(SCIPparamGetReal(param) - SCIPparamGetRealDefault(param), 1e-16);
939 
940  case SCIP_PARAMTYPE_CHAR:
941  return (SCIPparamGetChar(param) == SCIPparamGetCharDefault(param));
942 
944  return (strcmp(SCIPparamGetString(param), SCIPparamGetStringDefault(param)) == 0);
945 
946  default:
947  SCIPerrorMessage("unknown parameter type\n");
948  SCIPABORT();
949  return FALSE; /*lint !e527*/
950  }
951 }
952 
953 /** creates a parameter with name and description, does not set the type specific parameter values themselves */
954 static
956  SCIP_PARAM** param, /**< pointer to the parameter */
957  BMS_BLKMEM* blkmem, /**< block memory */
958  const char* name, /**< name of the parameter */
959  const char* desc, /**< description of the parameter */
960  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
961  SCIP_PARAMDATA* paramdata, /**< locally defined parameter specific data */
962  SCIP_Bool isadvanced /**< is the parameter advanced? */
963  )
964 {
965  assert(param != NULL);
966  assert(name != NULL);
967  assert(desc != NULL);
968 
969  SCIP_ALLOC( BMSallocBlockMemory(blkmem, param) );
970 
971  SCIP_ALLOC( BMSduplicateMemoryArray(&(*param)->name, name, strlen(name)+1) );
972  SCIP_ALLOC( BMSduplicateMemoryArray(&(*param)->desc, desc, strlen(desc)+1) );
973 
974  (*param)->paramchgd = paramchgd;
975  (*param)->paramdata = paramdata;
976  (*param)->isadvanced = isadvanced;
977  (*param)->isfixed = FALSE;
978 
979  return SCIP_OKAY;
980 }
981 
982 /** creates a SCIP_Bool parameter, and sets its value to default */
983 static
985  SCIP_PARAM** param, /**< pointer to the parameter */
986  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
987  BMS_BLKMEM* blkmem, /**< block memory */
988  const char* name, /**< name of the parameter */
989  const char* desc, /**< description of the parameter */
990  SCIP_Bool* valueptr, /**< pointer to store the current parameter value, or NULL */
991  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
992  SCIP_Bool defaultvalue, /**< default value of the parameter */
993  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
994  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
995  )
996 {
997  assert(param != NULL);
998  assert(name != NULL);
999 
1000  SCIP_CALL( paramCreate(param, blkmem, name, desc, paramchgd, paramdata, isadvanced) );
1001 
1002  (*param)->paramtype = SCIP_PARAMTYPE_BOOL;
1003  (*param)->data.boolparam.valueptr = valueptr;
1004  (*param)->data.boolparam.defaultvalue = defaultvalue;
1005 
1006  SCIP_CALL( SCIPparamSetBool(*param, NULL, messagehdlr, defaultvalue, TRUE) );
1007 
1008  return SCIP_OKAY;
1009 }
1010 
1011 /** creates a int parameter, and sets its value to default */
1012 static
1014  SCIP_PARAM** param, /**< pointer to the parameter */
1015  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1016  BMS_BLKMEM* blkmem, /**< block memory */
1017  const char* name, /**< name of the parameter */
1018  const char* desc, /**< description of the parameter */
1019  int* valueptr, /**< pointer to store the current parameter value, or NULL */
1020  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
1021  int defaultvalue, /**< default value of the parameter */
1022  int minvalue, /**< minimum value for parameter */
1023  int maxvalue, /**< maximum value for parameter */
1024  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
1025  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
1026  )
1027 {
1028  assert(param != NULL);
1029  assert(name != NULL);
1030 
1031  SCIP_CALL( paramCreate(param, blkmem, name, desc, paramchgd, paramdata, isadvanced) );
1032 
1033  (*param)->paramtype = SCIP_PARAMTYPE_INT;
1034  (*param)->data.intparam.valueptr = valueptr;
1035  (*param)->data.intparam.defaultvalue = defaultvalue;
1036  (*param)->data.intparam.minvalue = minvalue;
1037  (*param)->data.intparam.maxvalue = maxvalue;
1038 
1039  SCIP_CALL( SCIPparamSetInt(*param, NULL, messagehdlr, defaultvalue, TRUE) );
1040 
1041  return SCIP_OKAY;
1042 }
1043 
1044 /** creates a SCIP_Longint parameter, and sets its value to default */
1045 static
1047  SCIP_PARAM** param, /**< pointer to the parameter */
1048  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1049  BMS_BLKMEM* blkmem, /**< block memory */
1050  const char* name, /**< name of the parameter */
1051  const char* desc, /**< description of the parameter */
1052  SCIP_Longint* valueptr, /**< pointer to store the current parameter value, or NULL */
1053  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
1054  SCIP_Longint defaultvalue, /**< default value of the parameter */
1055  SCIP_Longint minvalue, /**< minimum value for parameter */
1056  SCIP_Longint maxvalue, /**< maximum value for parameter */
1057  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
1058  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
1059  )
1060 {
1061  assert(param != NULL);
1062  assert(name != NULL);
1063 
1064  SCIP_CALL( paramCreate(param, blkmem, name, desc, paramchgd, paramdata, isadvanced) );
1065 
1066  (*param)->paramtype = SCIP_PARAMTYPE_LONGINT;
1067  (*param)->data.longintparam.valueptr = valueptr;
1068  (*param)->data.longintparam.defaultvalue = defaultvalue;
1069  (*param)->data.longintparam.minvalue = minvalue;
1070  (*param)->data.longintparam.maxvalue = maxvalue;
1071 
1072  SCIP_CALL( SCIPparamSetLongint(*param, NULL, messagehdlr, defaultvalue, TRUE) );
1073 
1074  return SCIP_OKAY;
1075 }
1076 
1077 /** creates a SCIP_Real parameter, and sets its value to default */
1078 static
1080  SCIP_PARAM** param, /**< pointer to the parameter */
1081  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1082  BMS_BLKMEM* blkmem, /**< block memory */
1083  const char* name, /**< name of the parameter */
1084  const char* desc, /**< description of the parameter */
1085  SCIP_Real* valueptr, /**< pointer to store the current parameter value, or NULL */
1086  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
1087  SCIP_Real defaultvalue, /**< default value of the parameter */
1088  SCIP_Real minvalue, /**< minimum value for parameter */
1089  SCIP_Real maxvalue, /**< maximum value for parameter */
1090  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
1091  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
1092  )
1093 {
1094  assert(param != NULL);
1095  assert(name != NULL);
1096 
1097  SCIP_CALL( paramCreate(param, blkmem, name, desc, paramchgd, paramdata, isadvanced) );
1098 
1099  (*param)->paramtype = SCIP_PARAMTYPE_REAL;
1100  (*param)->data.realparam.valueptr = valueptr;
1101  (*param)->data.realparam.defaultvalue = defaultvalue;
1102  (*param)->data.realparam.minvalue = minvalue;
1103  (*param)->data.realparam.maxvalue = maxvalue;
1104 
1105  SCIP_CALL( SCIPparamSetReal(*param, NULL, messagehdlr, defaultvalue, TRUE) );
1106 
1107  return SCIP_OKAY;
1108 }
1109 
1110 /** creates a char parameter, and sets its value to default */
1111 static
1113  SCIP_PARAM** param, /**< pointer to the parameter */
1114  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1115  BMS_BLKMEM* blkmem, /**< block memory */
1116  const char* name, /**< name of the parameter */
1117  const char* desc, /**< description of the parameter */
1118  char* valueptr, /**< pointer to store the current parameter value, or NULL */
1119  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
1120  char defaultvalue, /**< default value of the parameter */
1121  const char* allowedvalues, /**< array with possible parameter values, or NULL if not restricted */
1122  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
1123  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
1124  )
1125 {
1126  assert(param != NULL);
1127  assert(name != NULL);
1128 
1129  SCIP_CALL( paramCreate(param, blkmem, name, desc, paramchgd, paramdata, isadvanced) );
1130 
1131  (*param)->paramtype = SCIP_PARAMTYPE_CHAR;
1132  (*param)->data.charparam.valueptr = valueptr;
1133  (*param)->data.charparam.defaultvalue = defaultvalue;
1134  if( allowedvalues != NULL )
1135  {
1136  SCIP_ALLOC( BMSduplicateMemoryArray(&(*param)->data.charparam.allowedvalues, allowedvalues, strlen(allowedvalues)+1) );
1137  }
1138  else
1139  (*param)->data.charparam.allowedvalues = NULL;
1140 
1141  SCIP_CALL( SCIPparamSetChar(*param, NULL, messagehdlr, defaultvalue, TRUE) );
1142 
1143  return SCIP_OKAY;
1144 }
1145 
1146 /** creates a string parameter, and sets its value to default */
1147 static
1149  SCIP_PARAM** param, /**< pointer to the parameter */
1150  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1151  BMS_BLKMEM* blkmem, /**< block memory */
1152  const char* name, /**< name of the parameter */
1153  const char* desc, /**< description of the parameter */
1154  char** valueptr, /**< pointer to store the current parameter value, or NULL */
1155  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
1156  const char* defaultvalue, /**< default value of the parameter */
1157  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
1158  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
1159  )
1160 {
1161  assert(param != NULL);
1162  assert(name != NULL);
1163  assert(valueptr == NULL || *valueptr == NULL);
1164  assert(defaultvalue != NULL);
1165 
1166  SCIP_CALL( paramCreate(param, blkmem, name, desc, paramchgd, paramdata, isadvanced) );
1167 
1168  (*param)->paramtype = SCIP_PARAMTYPE_STRING;
1169  (*param)->data.stringparam.valueptr = valueptr;
1170  SCIP_ALLOC( BMSduplicateMemoryArray(&(*param)->data.stringparam.defaultvalue, defaultvalue, strlen(defaultvalue)+1) );
1171  (*param)->data.stringparam.curvalue = NULL;
1172 
1173  SCIP_CALL( SCIPparamSetString(*param, NULL, messagehdlr, defaultvalue, TRUE) );
1174 
1175  return SCIP_OKAY;
1176 }
1177 
1178 /** frees a single parameter */
1179 static
1181  SCIP_PARAM** param, /**< pointer to the parameter */
1182  BMS_BLKMEM* blkmem /**< block memory */
1183  )
1184 {
1185  assert(param != NULL);
1186  assert(*param != NULL);
1187 
1188  switch( (*param)->paramtype )
1189  {
1190  case SCIP_PARAMTYPE_BOOL:
1191  case SCIP_PARAMTYPE_INT:
1193  case SCIP_PARAMTYPE_REAL:
1194  break;
1195  case SCIP_PARAMTYPE_CHAR:
1196  BMSfreeMemoryArrayNull(&(*param)->data.charparam.allowedvalues);
1197  break;
1198  case SCIP_PARAMTYPE_STRING:
1199  BMSfreeMemoryArray(&(*param)->data.stringparam.defaultvalue);
1200  if( (*param)->data.stringparam.valueptr == NULL )
1201  {
1202  BMSfreeMemoryArray(&(*param)->data.stringparam.curvalue);
1203  }
1204  else
1205  {
1206  BMSfreeMemoryArray((*param)->data.stringparam.valueptr);
1207  }
1208  break;
1209  default:
1210  SCIPerrorMessage("invalid parameter type\n");
1211  /* just continuing the function in this case seems save */
1212  SCIPABORT();
1213  }
1214 
1215  BMSfreeMemoryArray(&(*param)->name);
1216  BMSfreeMemoryArray(&(*param)->desc);
1217  BMSfreeBlockMemory(blkmem, param);
1218 }
1219 
1220 /** sets SCIP_Bool parameter according to the value of the given string */
1221 static
1223  SCIP_PARAM* param, /**< parameter */
1224  SCIP_SET* set, /**< global SCIP settings */
1225  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1226  char* valuestr /**< value in string format (may be modified during parse) */
1227  )
1228 {
1229  assert(param != NULL);
1230  assert(param->paramtype == SCIP_PARAMTYPE_BOOL);
1231  assert(set != NULL);
1232  assert(valuestr != NULL);
1233 
1234  if( strcasecmp(valuestr, "TRUE") == 0 )
1235  {
1236  SCIP_CALL( SCIPparamSetBool(param, set, messagehdlr, TRUE, TRUE) );
1237  }
1238  else if( strcasecmp(valuestr, "FALSE") == 0 )
1239  {
1240  SCIP_CALL( SCIPparamSetBool(param, set, messagehdlr, FALSE, TRUE) );
1241  }
1242  else
1243  {
1244  SCIPerrorMessage("invalid parameter value <%s> for SCIP_Bool parameter <%s>\n", valuestr, param->name);
1245  return SCIP_READERROR;
1246  }
1247 
1248  return SCIP_OKAY;
1249 }
1250 
1251 /** sets int parameter according to the value of the given string */
1252 static
1254  SCIP_PARAM* param, /**< parameter */
1255  SCIP_SET* set, /**< global SCIP settings */
1256  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1257  char* valuestr /**< value in string format (may be modified during parse) */
1258  )
1259 {
1260  int value;
1261 
1262  assert(param != NULL);
1263  assert(param->paramtype == SCIP_PARAMTYPE_INT);
1264  assert(set != NULL);
1265  assert(valuestr != NULL);
1266 
1267  if( sscanf(valuestr, "%d", &value) == 1 )
1268  {
1269  SCIP_CALL( SCIPparamSetInt(param, set, messagehdlr, value, TRUE) );
1270  }
1271  else
1272  {
1273  SCIPerrorMessage("invalid parameter value <%s> for int parameter <%s>\n", valuestr, param->name);
1274  return SCIP_READERROR;
1275  }
1276 
1277  return SCIP_OKAY;
1278 }
1279 
1280 /** sets SCIP_Longint parameter according to the value of the given string */
1281 static
1283  SCIP_PARAM* param, /**< parameter */
1284  SCIP_SET* set, /**< global SCIP settings */
1285  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1286  char* valuestr /**< value in string format (may be modified during parse) */
1287  )
1288 {
1289  SCIP_Longint value;
1290 
1291  assert(param != NULL);
1292  assert(param->paramtype == SCIP_PARAMTYPE_LONGINT);
1293  assert(set != NULL);
1294  assert(valuestr != NULL);
1295 
1296  if( sscanf(valuestr, "%"SCIP_LONGINT_FORMAT, &value) == 1 )
1297  {
1298  SCIP_CALL( SCIPparamSetLongint(param, set, messagehdlr, value, TRUE) );
1299  }
1300  else
1301  {
1302  SCIPerrorMessage("invalid parameter value <%s> for SCIP_Longint parameter <%s>\n", valuestr, param->name);
1303  return SCIP_READERROR;
1304  }
1305 
1306  return SCIP_OKAY;
1307 }
1308 
1309 /** sets SCIP_Real parameter according to the value of the given string */
1310 static
1312  SCIP_PARAM* param, /**< parameter */
1313  SCIP_SET* set, /**< global SCIP settings */
1314  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1315  char* valuestr /**< value in string format (may be modified during parse) */
1316  )
1317 {
1318  SCIP_Real value;
1319 
1320  assert(param != NULL);
1321  assert(param->paramtype == SCIP_PARAMTYPE_REAL);
1322  assert(set != NULL);
1323  assert(valuestr != NULL);
1324 
1325  if( sscanf(valuestr, "%"SCIP_REAL_FORMAT, &value) == 1 )
1326  {
1327  SCIP_CALL( SCIPparamSetReal(param, set, messagehdlr, value, TRUE) );
1328  }
1329  else
1330  {
1331  SCIPerrorMessage("invalid parameter value <%s> for SCIP_Real parameter <%s>\n", valuestr, param->name);
1332  return SCIP_READERROR;
1333  }
1334 
1335  return SCIP_OKAY;
1336 }
1337 
1338 /** sets Char parameter according to the value of the given string */
1339 static
1341  SCIP_PARAM* param, /**< parameter */
1342  SCIP_SET* set, /**< global SCIP settings */
1343  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1344  char* valuestr /**< value in string format (may be modified during parse) */
1345  )
1346 {
1347  char value;
1348 
1349  assert(param != NULL);
1350  assert(param->paramtype == SCIP_PARAMTYPE_CHAR);
1351  assert(set != NULL);
1352  assert(valuestr != NULL);
1353 
1354  if( sscanf(valuestr, "%c", &value) == 1 )
1355  {
1356  SCIP_CALL( SCIPparamSetChar(param, set, messagehdlr, value, TRUE) );
1357  }
1358  else
1359  {
1360  SCIPerrorMessage("invalid parameter value <%s> for char parameter <%s>\n", valuestr, param->name);
1361  return SCIP_READERROR;
1362  }
1363 
1364  return SCIP_OKAY;
1365 }
1366 
1367 /** sets String parameter according to the value of the given string */
1368 static
1370  SCIP_PARAM* param, /**< parameter */
1371  SCIP_SET* set, /**< global SCIP settings */
1372  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1373  char* valuestr /**< value in string format (may be modified during parse) */
1374  )
1375 {
1376  unsigned int len;
1377 
1378  assert(param != NULL);
1379  assert(param->paramtype == SCIP_PARAMTYPE_STRING);
1380  assert(set != NULL);
1381  assert(valuestr != NULL);
1382 
1383  /* check for quotes */
1384  len = (unsigned int) strlen(valuestr);
1385  if( len <= 1 || valuestr[0] != '"' || valuestr[len-1] != '"' )
1386  {
1387  SCIPerrorMessage("invalid parameter value <%s> for string parameter <%s> (string has to be in double quotes)\n",
1388  valuestr, param->name);
1389  return SCIP_READERROR;
1390  }
1391 
1392  /* remove the quotes */
1393  valuestr[len-1] = '\0';
1394  valuestr++;
1395  SCIP_CALL( SCIPparamSetString(param, set, messagehdlr, valuestr, TRUE) );
1396 
1397  return SCIP_OKAY;
1398 }
1399 
1400 
1401 /*
1402  * Parameter set methods
1403  */
1404 
1405 /** creates parameter set */
1407  SCIP_PARAMSET** paramset, /**< pointer to store the parameter set */
1408  BMS_BLKMEM* blkmem /**< block memory */
1409  )
1410 {
1411  assert(paramset != NULL);
1412 
1413  SCIP_ALLOC( BMSallocMemory(paramset) );
1414 
1415  SCIP_CALL( SCIPhashtableCreate(&(*paramset)->hashtable, blkmem, SCIP_HASHSIZE_PARAMS,
1416  hashGetKeyParam, SCIPhashKeyEqString, SCIPhashKeyValString, NULL) );
1417 
1418  (*paramset)->params = NULL;
1419  (*paramset)->nparams = 0;
1420  (*paramset)->paramssize = 0;
1421 
1422  return SCIP_OKAY;
1423 }
1424 
1425 /** frees parameter set */
1427  SCIP_PARAMSET** paramset, /**< pointer to the parameter set */
1428  BMS_BLKMEM* blkmem /**< block memory */
1429  )
1430 {
1431  int i;
1432 
1433  assert(paramset != NULL);
1434  assert(*paramset != NULL);
1435  assert((*paramset)->paramssize == 0 || (*paramset)->params != NULL);
1436  assert((*paramset)->paramssize >= (*paramset)->nparams);
1437 
1438  for( i = (*paramset)->nparams - 1; i >= 0; --i )
1439  {
1440  paramFree(&(*paramset)->params[i], blkmem);
1441  }
1442 
1443  SCIPhashtableFree(&(*paramset)->hashtable);
1444 
1445  BMSfreeMemoryArrayNull(&(*paramset)->params);
1446  BMSfreeMemory(paramset);
1447 }
1448 
1449 /** adds parameter to the parameter set */
1450 static
1452  SCIP_PARAMSET* paramset, /**< parameter set */
1453  SCIP_PARAM* param /**< parameter to add */
1454  )
1455 {
1456  assert(paramset != NULL);
1457  assert(param != NULL);
1458 
1459  /* insert the parameter name to the hash table */
1460  SCIP_CALL( SCIPhashtableSafeInsert(paramset->hashtable, (void*)param) );
1461 
1462  /* ensure, that there is enough space in the params array */
1463  if( paramset->nparams >= paramset->paramssize )
1464  {
1465  paramset->paramssize *= 2;
1466  paramset->paramssize = MAX(paramset->paramssize, paramset->nparams+1);
1467  SCIP_ALLOC( BMSreallocMemoryArray(&paramset->params, paramset->paramssize) );
1468  }
1469  assert(paramset->nparams < paramset->paramssize);
1470 
1471  /* insert parameter in the params array */
1472  paramset->params[paramset->nparams] = param;
1473  paramset->nparams++;
1474 
1475  return SCIP_OKAY;
1476 }
1477 
1478 /** creates a SCIP_Bool parameter, sets it to its default value, and adds it to the parameter set */
1480  SCIP_PARAMSET* paramset, /**< parameter set */
1481  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1482  BMS_BLKMEM* blkmem, /**< block memory */
1483  const char* name, /**< name of the parameter */
1484  const char* desc, /**< description of the parameter */
1485  SCIP_Bool* valueptr, /**< pointer to store the current parameter value, or NULL */
1486  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
1487  SCIP_Bool defaultvalue, /**< default value of the parameter */
1488  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
1489  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
1490  )
1491 {
1492  SCIP_PARAM* param;
1493 
1494  assert(paramset != NULL);
1495 
1496  /* create the parameter */
1497  SCIP_CALL( paramCreateBool(&param, messagehdlr, blkmem, name, desc, valueptr, isadvanced, defaultvalue, paramchgd, paramdata) );
1498 
1499  /* add parameter to the parameter set */
1500  SCIP_CALL( paramsetAdd(paramset, param) );
1501 
1502  return SCIP_OKAY;
1503 }
1504 
1505 /** creates a int parameter, sets it to its default value, and adds it to the parameter set */
1507  SCIP_PARAMSET* paramset, /**< parameter set */
1508  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1509  BMS_BLKMEM* blkmem, /**< block memory */
1510  const char* name, /**< name of the parameter */
1511  const char* desc, /**< description of the parameter */
1512  int* valueptr, /**< pointer to store the current parameter value, or NULL */
1513  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
1514  int defaultvalue, /**< default value of the parameter */
1515  int minvalue, /**< minimum value for parameter */
1516  int maxvalue, /**< maximum value for parameter */
1517  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
1518  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
1519  )
1520 {
1521  SCIP_PARAM* param;
1522 
1523  assert(paramset != NULL);
1524 
1525  /* create the parameter */
1526  SCIP_CALL( paramCreateInt(&param, messagehdlr, blkmem, name, desc, valueptr, isadvanced, defaultvalue, minvalue, maxvalue,
1527  paramchgd, paramdata) );
1528 
1529  /* add parameter to the parameter set */
1530  SCIP_CALL( paramsetAdd(paramset, param) );
1531 
1532  return SCIP_OKAY;
1533 }
1534 
1535 /** creates a SCIP_Longint parameter, sets it to its default value, and adds it to the parameter set */
1537  SCIP_PARAMSET* paramset, /**< parameter set */
1538  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1539  BMS_BLKMEM* blkmem, /**< block memory */
1540  const char* name, /**< name of the parameter */
1541  const char* desc, /**< description of the parameter */
1542  SCIP_Longint* valueptr, /**< pointer to store the current parameter value, or NULL */
1543  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
1544  SCIP_Longint defaultvalue, /**< default value of the parameter */
1545  SCIP_Longint minvalue, /**< minimum value for parameter */
1546  SCIP_Longint maxvalue, /**< maximum value for parameter */
1547  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
1548  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
1549  )
1550 {
1551  SCIP_PARAM* param;
1552 
1553  assert(paramset != NULL);
1554 
1555  /* create the parameter */
1556  SCIP_CALL( paramCreateLongint(&param, messagehdlr, blkmem, name, desc, valueptr, isadvanced, defaultvalue, minvalue, maxvalue,
1557  paramchgd, paramdata) );
1558 
1559  /* add parameter to the parameter set */
1560  SCIP_CALL( paramsetAdd(paramset, param) );
1561 
1562  return SCIP_OKAY;
1563 }
1564 
1565 /** creates a SCIP_Real parameter, sets it to its default value, and adds it to the parameter set */
1567  SCIP_PARAMSET* paramset, /**< parameter set */
1568  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1569  BMS_BLKMEM* blkmem, /**< block memory */
1570  const char* name, /**< name of the parameter */
1571  const char* desc, /**< description of the parameter */
1572  SCIP_Real* valueptr, /**< pointer to store the current parameter value, or NULL */
1573  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
1574  SCIP_Real defaultvalue, /**< default value of the parameter */
1575  SCIP_Real minvalue, /**< minimum value for parameter */
1576  SCIP_Real maxvalue, /**< maximum value for parameter */
1577  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
1578  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
1579  )
1580 {
1581  SCIP_PARAM* param;
1582 
1583  assert(paramset != NULL);
1584 
1585  /* create the parameter */
1586  SCIP_CALL( paramCreateReal(&param, messagehdlr, blkmem, name, desc, valueptr, isadvanced, defaultvalue, minvalue, maxvalue,
1587  paramchgd, paramdata) );
1588 
1589  /* add parameter to the parameter set */
1590  SCIP_CALL( paramsetAdd(paramset, param) );
1591 
1592  return SCIP_OKAY;
1593 }
1594 
1595 /** creates a char parameter, sets it to its default value, and adds it to the parameter set */
1597  SCIP_PARAMSET* paramset, /**< parameter set */
1598  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1599  BMS_BLKMEM* blkmem, /**< block memory */
1600  const char* name, /**< name of the parameter */
1601  const char* desc, /**< description of the parameter */
1602  char* valueptr, /**< pointer to store the current parameter value, or NULL */
1603  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
1604  char defaultvalue, /**< default value of the parameter */
1605  const char* allowedvalues, /**< array with possible parameter values, or NULL if not restricted */
1606  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
1607  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
1608  )
1609 {
1610  SCIP_PARAM* param;
1611 
1612  assert(paramset != NULL);
1613 
1614  /* create the parameter */
1615  SCIP_CALL( paramCreateChar(&param, messagehdlr, blkmem, name, desc, valueptr, isadvanced, defaultvalue, allowedvalues,
1616  paramchgd, paramdata) );
1617 
1618  /* add parameter to the parameter set */
1619  SCIP_CALL( paramsetAdd(paramset, param) );
1620 
1621  return SCIP_OKAY;
1622 }
1623 
1624 /** creates a string parameter, sets it to its default value, and adds it to the parameter set */
1626  SCIP_PARAMSET* paramset, /**< parameter set */
1627  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1628  BMS_BLKMEM* blkmem, /**< block memory */
1629  const char* name, /**< name of the parameter */
1630  const char* desc, /**< description of the parameter */
1631  char** valueptr, /**< pointer to store the current parameter value, or NULL */
1632  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
1633  const char* defaultvalue, /**< default value of the parameter */
1634  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
1635  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
1636  )
1637 {
1638  SCIP_PARAM* param;
1639 
1640  assert(paramset != NULL);
1641 
1642  /* create the parameter */
1643  SCIP_CALL( paramCreateString(&param, messagehdlr, blkmem, name, desc, valueptr, isadvanced, defaultvalue, paramchgd, paramdata) );
1644 
1645  /* add parameter to the parameter set */
1646  SCIP_CALL( paramsetAdd(paramset, param) );
1647 
1648  return SCIP_OKAY;
1649 }
1650 
1651 /** returns the name of the given parameter type */
1652 static
1653 const char* paramtypeGetName(
1654  SCIP_PARAMTYPE paramtype /**< type of parameter */
1655  )
1656 {
1657  static const char* paramtypename[] = {
1658  "Bool", /* SCIP_PARAMTYPE_BOOL = 0 */
1659  "int", /* SCIP_PARAMTYPE_INT = 1 */
1660  "Longint", /* SCIP_PARAMTYPE_LONGINT = 2 */
1661  "Real", /* SCIP_PARAMTYPE_REAL = 3 */
1662  "char", /* SCIP_PARAMTYPE_CHAR = 4 */
1663  "string" /* SCIP_PARAMTYPE_STRING = 5 */
1664  };
1665 
1666  return paramtypename[(int)paramtype];
1667 }
1668 
1669 /** returns whether an existing parameter is fixed */
1671  SCIP_PARAMSET* paramset, /**< parameter set */
1672  const char* name /**< name of the parameter */
1673  )
1674 {
1675  SCIP_PARAM* param;
1676 
1677  assert(paramset != NULL);
1678 
1679  /* retrieve parameter from hash table */
1680  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1681  if( param == NULL )
1682  {
1683  SCIPerrorMessage("parameter <%s> unknown\n", name);
1684  SCIPABORT();
1685  return FALSE; /*lint !e527*/
1686  }
1687 
1688  return SCIPparamIsFixed(param);
1689 }
1690 
1691 /** returns the pointer to an existing SCIP parameter */
1693  SCIP_PARAMSET* paramset, /**< parameter set */
1694  const char* name /**< name of the parameter */
1695  )
1696 {
1697  assert(paramset != NULL);
1698 
1699  /* retrieve parameter from hash table and return it */
1700  return (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1701 }
1702 
1703 /** gets the value of an existing SCIP_Bool parameter */
1705  SCIP_PARAMSET* paramset, /**< parameter set */
1706  const char* name, /**< name of the parameter */
1707  SCIP_Bool* value /**< pointer to store the parameter */
1708  )
1709 {
1710  SCIP_PARAM* param;
1711 
1712  assert(paramset != NULL);
1713  assert(value != NULL);
1714 
1715  /* retrieve parameter from hash table */
1716  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1717  if( param == NULL )
1718  {
1719  SCIPerrorMessage("parameter <%s> unknown\n", name);
1720  return SCIP_PARAMETERUNKNOWN;
1721  }
1722  if( param->paramtype != SCIP_PARAMTYPE_BOOL )
1723  {
1724  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
1726  return SCIP_PARAMETERWRONGTYPE;
1727  }
1728 
1729  /* get the parameter's current value */
1730  *value = SCIPparamGetBool(param);
1731 
1732  return SCIP_OKAY;
1733 }
1734 
1735 /** gets the value of an existing int parameter */
1737  SCIP_PARAMSET* paramset, /**< parameter set */
1738  const char* name, /**< name of the parameter */
1739  int* value /**< pointer to store the parameter */
1740  )
1741 {
1742  SCIP_PARAM* param;
1743 
1744  assert(paramset != NULL);
1745  assert(value != NULL);
1746 
1747  /* retrieve parameter from hash table */
1748  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1749  if( param == NULL )
1750  {
1751  SCIPerrorMessage("parameter <%s> unknown\n", name);
1752  return SCIP_PARAMETERUNKNOWN;
1753  }
1754  if( param->paramtype != SCIP_PARAMTYPE_INT )
1755  {
1756  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
1758  return SCIP_PARAMETERWRONGTYPE;
1759  }
1760 
1761  /* get the parameter's current value */
1762  *value = SCIPparamGetInt(param);
1763 
1764  return SCIP_OKAY;
1765 }
1766 
1767 /** gets the value of an existing SCIP_Longint parameter */
1769  SCIP_PARAMSET* paramset, /**< parameter set */
1770  const char* name, /**< name of the parameter */
1771  SCIP_Longint* value /**< pointer to store the parameter */
1772  )
1773 {
1774  SCIP_PARAM* param;
1775 
1776  assert(paramset != NULL);
1777  assert(value != NULL);
1778 
1779  /* retrieve parameter from hash table */
1780  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1781  if( param == NULL )
1782  {
1783  SCIPerrorMessage("parameter <%s> unknown\n", name);
1784  return SCIP_PARAMETERUNKNOWN;
1785  }
1786  if( param->paramtype != SCIP_PARAMTYPE_LONGINT )
1787  {
1788  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
1790  return SCIP_PARAMETERWRONGTYPE;
1791  }
1792 
1793  /* get the parameter's current value */
1794  *value = SCIPparamGetLongint(param);
1795 
1796  return SCIP_OKAY;
1797 }
1798 
1799 /** gets the value of an existing SCIP_Real parameter */
1801  SCIP_PARAMSET* paramset, /**< parameter set */
1802  const char* name, /**< name of the parameter */
1803  SCIP_Real* value /**< pointer to store the parameter */
1804  )
1805 {
1806  SCIP_PARAM* param;
1807 
1808  assert(paramset != NULL);
1809  assert(value != NULL);
1810 
1811  /* retrieve parameter from hash table */
1812  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1813  if( param == NULL )
1814  {
1815  SCIPerrorMessage("parameter <%s> unknown\n", name);
1816  return SCIP_PARAMETERUNKNOWN;
1817  }
1818  if( param->paramtype != SCIP_PARAMTYPE_REAL )
1819  {
1820  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
1822  return SCIP_PARAMETERWRONGTYPE;
1823  }
1824 
1825  /* get the parameter's current value */
1826  *value = SCIPparamGetReal(param);
1827 
1828  return SCIP_OKAY;
1829 }
1830 
1831 /** gets the value of an existing char parameter */
1833  SCIP_PARAMSET* paramset, /**< parameter set */
1834  const char* name, /**< name of the parameter */
1835  char* value /**< pointer to store the parameter */
1836  )
1837 {
1838  SCIP_PARAM* param;
1839 
1840  assert(paramset != NULL);
1841  assert(value != NULL);
1842 
1843  /* retrieve parameter from hash table */
1844  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1845  if( param == NULL )
1846  {
1847  SCIPerrorMessage("parameter <%s> unknown\n", name);
1848  return SCIP_PARAMETERUNKNOWN;
1849  }
1850  if( param->paramtype != SCIP_PARAMTYPE_CHAR )
1851  {
1852  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
1854  return SCIP_PARAMETERWRONGTYPE;
1855  }
1856 
1857  /* get the parameter's current value */
1858  *value = SCIPparamGetChar(param);
1859 
1860  return SCIP_OKAY;
1861 }
1862 
1863 /** gets the value of an existing string parameter */
1865  SCIP_PARAMSET* paramset, /**< parameter set */
1866  const char* name, /**< name of the parameter */
1867  char** value /**< pointer to store the parameter */
1868  )
1869 {
1870  SCIP_PARAM* param;
1871 
1872  assert(paramset != NULL);
1873  assert(value != NULL);
1874 
1875  /* retrieve parameter from hash table */
1876  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1877  if( param == NULL )
1878  {
1879  SCIPerrorMessage("parameter <%s> unknown\n", name);
1880  return SCIP_PARAMETERUNKNOWN;
1881  }
1882  if( param->paramtype != SCIP_PARAMTYPE_STRING )
1883  {
1884  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
1886  return SCIP_PARAMETERWRONGTYPE;
1887  }
1888 
1889  /* get the parameter's current value */
1890  *value = SCIPparamGetString(param);
1891 
1892  return SCIP_OKAY;
1893 }
1894 
1895 /** changes the fixing status of an existing parameter */
1897  SCIP_PARAMSET* paramset, /**< parameter set */
1898  const char* name, /**< name of the parameter */
1899  SCIP_Bool fixed /**< new fixing status of the parameter */
1900  )
1901 {
1902  SCIP_PARAM* param;
1903 
1904  assert(paramset != NULL);
1905 
1906  /* retrieve parameter from hash table */
1907  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1908  if( param == NULL )
1909  {
1910  SCIPerrorMessage("parameter <%s> unknown\n", name);
1911  return SCIP_PARAMETERUNKNOWN;
1912  }
1913 
1914  SCIPparamSetFixed(param, fixed);
1915 
1916  return SCIP_OKAY;
1917 }
1918 
1919 /** changes the value of an existing parameter */
1921  SCIP_PARAMSET* paramset, /**< parameter set */
1922  SCIP_SET* set, /**< global SCIP settings */
1923  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1924  const char* name, /**< name of the parameter */
1925  void* value /**< new value of the parameter */
1926  )
1927 {
1928  SCIP_PARAM* param;
1929 
1930  assert(paramset != NULL);
1931  assert(set != NULL);
1932 
1933  /* retrieve parameter from hash table */
1934  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1935  if( param == NULL )
1936  {
1937  SCIPerrorMessage("parameter <%s> unknown\n", name);
1938  return SCIP_PARAMETERUNKNOWN;
1939  }
1940 
1941  switch( param->paramtype )
1942  {
1943  case SCIP_PARAMTYPE_BOOL:
1944  /* set the parameter's current value */
1945  SCIP_CALL( SCIPparamSetBool(param, set, messagehdlr, (SCIP_Bool) (size_t) value, TRUE) );
1946  break;
1947 
1948  case SCIP_PARAMTYPE_INT:
1949  /* set the parameter's current value */
1950  SCIP_CALL( SCIPparamSetInt(param, set, messagehdlr, (int) (size_t) value, TRUE) );
1951  break;
1952 
1954  /* set the parameter's current value */
1955  SCIP_CALL( SCIPparamSetLongint(param, set, messagehdlr, (SCIP_Longint) (size_t) value, TRUE) );
1956  break;
1957 
1958  case SCIP_PARAMTYPE_REAL:
1959  /* set the parameter's current value */
1960  SCIP_CALL( SCIPparamSetReal(param, set, messagehdlr, (SCIP_Real) (size_t) value, TRUE) );
1961  break;
1962 
1963  case SCIP_PARAMTYPE_CHAR:
1964  /* set the parameter's current value */
1965  SCIP_CALL( SCIPparamSetChar(param, set, messagehdlr, (char) (size_t) value, TRUE) );
1966  break;
1967 
1968  case SCIP_PARAMTYPE_STRING:
1969  /* set the parameter's current value */
1970  SCIP_CALL( SCIPparamSetString(param, set, messagehdlr, (char*) value, TRUE) );
1971  break;
1972 
1973  default:
1974  SCIPerrorMessage("unknown parameter type\n");
1975  return SCIP_INVALIDDATA;
1976  }
1977 
1978  return SCIP_OKAY;
1979 }
1980 
1981 /** changes the value of an existing SCIP_Bool parameter */
1983  SCIP_PARAMSET* paramset, /**< parameter set */
1984  SCIP_SET* set, /**< global SCIP settings */
1985  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1986  const char* name, /**< name of the parameter */
1987  SCIP_Bool value /**< new value of the parameter */
1988  )
1989 {
1990  SCIP_PARAM* param;
1991 
1992  assert(paramset != NULL);
1993  assert(set != NULL);
1994 
1995  /* retrieve parameter from hash table */
1996  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1997  if( param == NULL )
1998  {
1999  SCIPerrorMessage("parameter <%s> unknown\n", name);
2000  return SCIP_PARAMETERUNKNOWN;
2001  }
2002  if( param->paramtype != SCIP_PARAMTYPE_BOOL )
2003  {
2004  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
2006  return SCIP_PARAMETERWRONGTYPE;
2007  }
2008 
2009  /* set the parameter's current value */
2010  SCIP_CALL( SCIPparamSetBool(param, set, messagehdlr, value, TRUE) );
2011 
2012  return SCIP_OKAY;
2013 }
2014 
2015 /** changes the default value of an existing SCIP_Bool parameter */
2017  SCIP_PARAMSET* paramset, /**< parameter set */
2018  const char* name, /**< name of the parameter */
2019  SCIP_Bool defaultvalue /**< new default value of the parameter */
2020  )
2021 {
2022  SCIP_PARAM* param;
2023 
2024  assert(paramset != NULL);
2025 
2026  /* retrieve parameter from hash table */
2027  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
2028  if( param == NULL )
2029  {
2030  SCIPerrorMessage("parameter <%s> unknown\n", name);
2031  return SCIP_PARAMETERUNKNOWN;
2032  }
2033  if( param->paramtype != SCIP_PARAMTYPE_BOOL )
2034  {
2035  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
2037  return SCIP_PARAMETERWRONGTYPE;
2038  }
2039 
2040  /* set the parameter's default value */
2041  SCIPparamSetDefaultBool(param, defaultvalue);
2042 
2043  return SCIP_OKAY;
2044 }
2045 
2046 /** changes the value of an existing int parameter */
2048  SCIP_PARAMSET* paramset, /**< parameter set */
2049  SCIP_SET* set, /**< global SCIP settings */
2050  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2051  const char* name, /**< name of the parameter */
2052  int value /**< new value of the parameter */
2053  )
2054 {
2055  SCIP_PARAM* param;
2056 
2057  assert(paramset != NULL);
2058  assert(set != NULL);
2059 
2060  /* retrieve parameter from hash table */
2061  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
2062  if( param == NULL )
2063  {
2064  SCIPerrorMessage("parameter <%s> unknown\n", name);
2065  return SCIP_PARAMETERUNKNOWN;
2066  }
2067  if( param->paramtype != SCIP_PARAMTYPE_INT )
2068  {
2069  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
2071  return SCIP_PARAMETERWRONGTYPE;
2072  }
2073 
2074  /* set the parameter's current value */
2075  SCIP_CALL( SCIPparamSetInt(param, set, messagehdlr, value, TRUE) );
2076 
2077  return SCIP_OKAY;
2078 }
2079 
2080 /** changes the default value of an existing int parameter */
2082  SCIP_PARAMSET* paramset, /**< parameter set */
2083  const char* name, /**< name of the parameter */
2084  int defaultvalue /**< new default value of the parameter */
2085  )
2086 {
2087  SCIP_PARAM* param;
2088 
2089  assert(paramset != NULL);
2090 
2091  /* retrieve parameter from hash table */
2092  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
2093  if( param == NULL )
2094  {
2095  SCIPerrorMessage("parameter <%s> unknown\n", name);
2096  return SCIP_PARAMETERUNKNOWN;
2097  }
2098  if( param->paramtype != SCIP_PARAMTYPE_INT )
2099  {
2100  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
2102  return SCIP_PARAMETERWRONGTYPE;
2103  }
2104 
2105  /* set the parameter's default value */
2106  SCIPparamSetDefaultInt(param, defaultvalue);
2107 
2108  return SCIP_OKAY;
2109 }
2110 
2111 /** changes the value of an existing SCIP_Longint parameter */
2113  SCIP_PARAMSET* paramset, /**< parameter set */
2114  SCIP_SET* set, /**< global SCIP settings */
2115  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2116  const char* name, /**< name of the parameter */
2117  SCIP_Longint value /**< new value of the parameter */
2118  )
2119 {
2120  SCIP_PARAM* param;
2121 
2122  assert(paramset != NULL);
2123  assert(set != NULL);
2124 
2125  /* retrieve parameter from hash table */
2126  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
2127  if( param == NULL )
2128  {
2129  SCIPerrorMessage("parameter <%s> unknown\n", name);
2130  return SCIP_PARAMETERUNKNOWN;
2131  }
2132  if( param->paramtype != SCIP_PARAMTYPE_LONGINT )
2133  {
2134  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
2136  return SCIP_PARAMETERWRONGTYPE;
2137  }
2138 
2139  /* set the parameter's current value */
2140  SCIP_CALL( SCIPparamSetLongint(param, set, messagehdlr, value, TRUE) );
2141 
2142  return SCIP_OKAY;
2143 }
2144 
2145 /** changes the value of an existing SCIP_Real parameter */
2147  SCIP_PARAMSET* paramset, /**< parameter set */
2148  SCIP_SET* set, /**< global SCIP settings */
2149  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2150  const char* name, /**< name of the parameter */
2151  SCIP_Real value /**< new value of the parameter */
2152  )
2153 {
2154  SCIP_PARAM* param;
2155 
2156  assert(paramset != NULL);
2157  assert(set != NULL);
2158 
2159  /* retrieve parameter from hash table */
2160  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
2161  if( param == NULL )
2162  {
2163  SCIPerrorMessage("parameter <%s> unknown\n", name);
2164  return SCIP_PARAMETERUNKNOWN;
2165  }
2166  if( param->paramtype != SCIP_PARAMTYPE_REAL )
2167  {
2168  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
2170  return SCIP_PARAMETERWRONGTYPE;
2171  }
2172 
2173  /* set the parameter's current value */
2174  SCIP_CALL( SCIPparamSetReal(param, set, messagehdlr, value, TRUE) );
2175 
2176  return SCIP_OKAY;
2177 }
2178 
2179 /** changes the value of an existing char parameter */
2181  SCIP_PARAMSET* paramset, /**< parameter set */
2182  SCIP_SET* set, /**< global SCIP settings */
2183  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2184  const char* name, /**< name of the parameter */
2185  char value /**< new value of the parameter */
2186  )
2187 {
2188  SCIP_PARAM* param;
2189 
2190  assert(paramset != NULL);
2191  assert(set != NULL);
2192 
2193  /* retrieve parameter from hash table */
2194  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
2195  if( param == NULL )
2196  {
2197  SCIPerrorMessage("parameter <%s> unknown\n", name);
2198  return SCIP_PARAMETERUNKNOWN;
2199  }
2200  if( param->paramtype != SCIP_PARAMTYPE_CHAR )
2201  {
2202  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
2204  return SCIP_PARAMETERWRONGTYPE;
2205  }
2206 
2207  /* set the parameter's current value */
2208  SCIP_CALL( SCIPparamSetChar(param, set, messagehdlr, value, TRUE) );
2209 
2210  return SCIP_OKAY;
2211 }
2212 
2213 /** changes the value of an existing string parameter */
2215  SCIP_PARAMSET* paramset, /**< parameter set */
2216  SCIP_SET* set, /**< global SCIP settings */
2217  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2218  const char* name, /**< name of the parameter */
2219  const char* value /**< new value of the parameter */
2220  )
2221 {
2222  SCIP_PARAM* param;
2223 
2224  assert(paramset != NULL);
2225  assert(set != NULL);
2226 
2227  /* retrieve parameter from hash table */
2228  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
2229  if( param == NULL )
2230  {
2231  SCIPerrorMessage("parameter <%s> unknown\n", name);
2232  return SCIP_PARAMETERUNKNOWN;
2233  }
2234  if( param->paramtype != SCIP_PARAMTYPE_STRING )
2235  {
2236  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
2238  return SCIP_PARAMETERWRONGTYPE;
2239  }
2240 
2241  /* set the parameter's current value */
2242  SCIP_CALL( SCIPparamSetString(param, set, messagehdlr, value, TRUE) );
2243 
2244  return SCIP_OKAY;
2245 }
2246 
2247 /** parses a parameter file line "paramname = paramvalue" and sets parameter accordingly */
2248 static
2250  SCIP_PARAMSET* paramset, /**< parameter set */
2251  SCIP_SET* set, /**< global SCIP settings */
2252  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2253  char* line /**< line to parse (is modified during parse, but not freed) */
2254  )
2255 {
2256  SCIP_PARAM* param;
2257  char* paramname;
2258  char* paramvaluestr;
2259  char* lastquote;
2260  SCIP_Bool quoted;
2261  SCIP_Bool fix;
2262 
2263  assert(paramset != NULL);
2264  assert(line != NULL);
2265 
2266  fix = FALSE;
2267 
2268  /* find the start of the parameter name */
2269  while( *line == ' ' || *line == '\t' || *line == '\r' )
2270  line++;
2271  if( *line == '\0' || *line == '\n' || *line == '#' )
2272  return SCIP_OKAY;
2273  paramname = line;
2274 
2275  /* find the end of the parameter name */
2276  while( *line != ' ' && *line != '\t' && *line != '\r' && *line != '\n' && *line != '#' && *line != '\0' && *line != '=' )
2277  line++;
2278  if( *line == '=' )
2279  {
2280  *line = '\0';
2281  line++;
2282  }
2283  else
2284  {
2285  *line = '\0';
2286  line++;
2287 
2288  /* search for the '=' char in the line */
2289  while( *line == ' ' || *line == '\t' || *line == '\r' )
2290  line++;
2291  if( *line != '=' )
2292  {
2293  SCIPerrorMessage("character '=' was expected after the parameter name\n");
2294  return SCIP_READERROR;
2295  }
2296  line++;
2297  }
2298 
2299  /* find the start of the parameter value string */
2300  while( *line == ' ' || *line == '\t' || *line == '\r' )
2301  line++;
2302  if( *line == '\0' || *line == '\n' || *line == '#' )
2303  {
2304  SCIPerrorMessage("parameter value is missing\n");
2305  return SCIP_READERROR;
2306  }
2307  paramvaluestr = line;
2308 
2309  /* find the end of the parameter value string */
2310  quoted = (*paramvaluestr == '"');
2311  lastquote = NULL;
2312  while( (quoted || (*line != ' ' && *line != '\t' && *line != '\r' && *line != '\n' && *line != '#')) && *line != '\0' )
2313  {
2314  if( *line == '"' )
2315  lastquote = line;
2316  line++;
2317  }
2318  if( lastquote != NULL )
2319  line = lastquote+1;
2320  if( *line == '#' )
2321  *line = '\0';
2322  else if( *line != '\0' )
2323  {
2324  /* check, if the rest of the line is clean */
2325  *line = '\0';
2326  line++;
2327  while( *line == ' ' || *line == '\t' || *line == '\r' )
2328  line++;
2329  if( *line == 'f' && *(line+1) == 'i' && *(line+2) == 'x' )
2330  {
2331  fix = TRUE;
2332  line += 3;
2333 
2334  while( *line == ' ' || *line == '\t' || *line == '\r' )
2335  line++;
2336  }
2337  if( *line != '\0' && *line != '\n' && *line != '#' )
2338  {
2339  SCIPerrorMessage("additional characters <%c> after parameter value (and possible 'fix' keyword)\n", *line);
2340  return SCIP_READERROR;
2341  }
2342  }
2343 
2344  /* retrieve parameter from hash table */
2345  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
2346  if( param == NULL )
2347  {
2348  SCIPmessagePrintWarning(messagehdlr, "unknown parameter <%s>\n", paramname);
2349  return SCIP_OKAY;
2350  }
2351 
2352  SCIPparamSetFixed(param, FALSE);
2353 
2354  /* set parameter's value */
2355  switch( param->paramtype )
2356  {
2357  case SCIP_PARAMTYPE_BOOL:
2358  SCIP_CALL( paramParseBool(param, set, messagehdlr, paramvaluestr) );
2359  break;
2360  case SCIP_PARAMTYPE_INT:
2361  SCIP_CALL( paramParseInt(param, set, messagehdlr, paramvaluestr) );
2362  break;
2364  SCIP_CALL( paramParseLongint(param, set, messagehdlr, paramvaluestr) );
2365  break;
2366  case SCIP_PARAMTYPE_REAL:
2367  SCIP_CALL( paramParseReal(param, set, messagehdlr, paramvaluestr) );
2368  break;
2369  case SCIP_PARAMTYPE_CHAR:
2370  SCIP_CALL( paramParseChar(param, set, messagehdlr, paramvaluestr) );
2371  break;
2372  case SCIP_PARAMTYPE_STRING:
2373  SCIP_CALL( paramParseString(param, set, messagehdlr, paramvaluestr) );
2374  break;
2375  default:
2376  SCIPerrorMessage("unknown parameter type\n");
2377  return SCIP_INVALIDDATA;
2378  }
2379 
2380  if( fix )
2381  SCIPparamSetFixed(param, TRUE);
2382 
2383  return SCIP_OKAY;
2384 }
2385 
2386 /** reads parameters from a file */
2388  SCIP_PARAMSET* paramset, /**< parameter set */
2389  SCIP_SET* set, /**< global SCIP settings */
2390  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2391  const char* filename /**< file name */
2392  )
2393 {
2394  SCIP_RETCODE retcode;
2395  FILE* file;
2396  char line[1024];
2397  int lineno;
2398 
2399  assert(paramset != NULL);
2400  assert(filename != NULL);
2401 
2402  /* open the file for reading */
2403  file = fopen(filename, "r");
2404  if( file == NULL )
2405  {
2406  SCIPerrorMessage("cannot open file <%s> for reading\n", filename);
2407  SCIPprintSysError(filename);
2408  return SCIP_NOFILE;
2409  }
2410 
2411  /* read the parameters from the file */
2412  lineno = 0;
2413  retcode = SCIP_OKAY;
2414  while( fgets(line, (int) sizeof(line), file) != NULL && retcode == SCIP_OKAY )
2415  {
2416  lineno++;
2417  retcode = paramsetParse(paramset, set, messagehdlr, line);
2418  }
2419 
2420  /* close input file */
2421  fclose(file);
2422 
2423  if( retcode == SCIP_READERROR )
2424  {
2425  SCIPerrorMessage("input error in file <%s> line %d\n", filename, lineno);
2426  }
2427  else
2428  {
2429  SCIP_CALL( retcode );
2430  }
2431 
2432  return SCIP_OKAY;
2433 }
2434 
2435 /** writes all parameters in the parameter set to a file */
2437  SCIP_PARAMSET* paramset, /**< parameter set */
2438  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2439  const char* filename, /**< file name, or NULL for stdout */
2440  SCIP_Bool comments, /**< should parameter descriptions be written as comments? */
2441  SCIP_Bool onlychanged /**< should only the parameters been written, that are changed from default? */
2442  )
2443 {
2444  SCIP_RETCODE retcode;
2445  FILE* file;
2446  int i;
2447 
2448  assert(paramset != NULL);
2449 
2450  /* open the file for writing */
2451  if( filename != NULL )
2452  {
2453  file = fopen(filename, "w");
2454  if( file == NULL )
2455  {
2456  SCIPerrorMessage("cannot open file <%s> for writing\n", filename);
2457  SCIPprintSysError(filename);
2458  return SCIP_FILECREATEERROR;
2459  }
2460  }
2461  else
2462  file = NULL;
2463 
2464  if( comments )
2465  {
2466  /* display the SCIP version as comment in the first line */
2467 #if( SCIP_SUBVERSION == 0 )
2468  SCIPmessageFPrintInfo(messagehdlr, file, "# SCIP version %d.%d.%d\n",
2469  SCIP_VERSION/100, (SCIP_VERSION/10) % 10, SCIP_VERSION % 10); /*lint !e778*/
2470 #else
2471  SCIPmessageFPrintInfo(messagehdlr, file, "# SCIP version %d.%d.%d.%d\n",
2472  SCIP_VERSION/100, (SCIP_VERSION/10) % 10, SCIP_VERSION % 10, SCIP_SUBVERSION); /*lint !e778*/
2473 #endif
2474 
2475  SCIPmessageFPrintInfo(messagehdlr, file, "\n");
2476  }
2477 
2478  /* write the parameters to the file */
2479  for( i = 0; i < paramset->nparams; ++i )
2480  {
2481  retcode = paramWrite(paramset->params[i], messagehdlr, file, comments, onlychanged);
2482  if( retcode != SCIP_OKAY )
2483  {
2484  if( filename != NULL )
2485  {
2486  assert(file != NULL);
2487  fclose(file);
2488  }
2489  SCIP_CALL( retcode );
2490  }
2491  }
2492 
2493  /* close output file */
2494  if( filename != NULL )
2495  {
2496  assert(file != NULL); /*lint !e449*/
2497  fclose(file);
2498  }
2499 
2500  return SCIP_OKAY;
2501 }
2502 
2503 /** installs default values for all parameters */
2505  SCIP_PARAMSET* paramset, /**< parameter set */
2506  SCIP_SET* set, /**< global SCIP settings */
2507  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
2508  )
2509 {
2510  int i;
2511 
2512  /* set all parameters to their default values */
2513  for( i = 0; i < paramset->nparams; ++i )
2514  {
2515  SCIP_CALL( SCIPparamSetToDefault(paramset->params[i], set, messagehdlr) );
2516  }
2517 
2518  return SCIP_OKAY;
2519 }
2520 
2521 /** installs default value for a single parameter */
2523  SCIP_PARAMSET* paramset, /**< parameter set */
2524  SCIP_SET* set, /**< global SCIP settings */
2525  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2526  const char* paramname /**< name of the parameter */
2527  )
2528 {
2529  SCIP_PARAM* param;
2530 
2531  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
2532 
2533  if( param != NULL )
2534  {
2535  SCIP_CALL( SCIPparamSetToDefault(param, set, messagehdlr) );
2536  }
2537 
2538  return SCIP_OKAY;
2539 }
2540 
2541 /** resets parameters changed by SCIPparamsetSetHeuristicsXyz functions to their default values
2542  *
2543  * @note fixed parameters stay as they are; you need to unfix them first if they should be changed, too
2544  */
2545 static
2547  SCIP_PARAMSET* paramset, /**< parameter set */
2548  SCIP_SET* set, /**< global SCIP settings */
2549  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2550  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
2551  )
2552 { /*lint --e{715}*/
2553  SCIP_HEUR** heurs;
2554  char paramname[SCIP_MAXSTRLEN];
2555  int nheurs;
2556  int i;
2557 
2558  heurs = set->heurs;
2559  nheurs = set->nheurs;
2560 
2561  for( i = 0; i < nheurs; ++i )
2562  {
2563  const char* heurname;
2564  heurname = SCIPheurGetName(heurs[i]);
2565 
2566  /* set frequency parameter to default */
2567  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/freq", heurname);
2568  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
2569 
2570  /* set LP iteration offset to default */
2571  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxlpiterofs", heurname);
2572  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
2573 
2574  /* set LP iteration quota to default */
2575  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxlpiterquot", heurname);
2576  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
2577  }
2578 
2579  /* set specific parameters for RENS heuristic */
2580  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "heuristics/rens/nodesofs") );
2581  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "heuristics/rens/minfixingrate") );
2582 
2583  /* set specific parameters for Crossover heuristic */
2584  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "heuristics/crossover/nwaitingnodes") );
2585  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "heuristics/crossover/dontwaitatroot") );
2586  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "heuristics/crossover/nodesquot") );
2587  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "heuristics/crossover/minfixingrate") );
2588 
2589  return SCIP_OKAY;
2590 }
2591 
2592 /** sets heuristics to aggressive */
2593 static
2595  SCIP_PARAMSET* paramset, /**< parameter set */
2596  SCIP_SET* set, /**< global SCIP settings */
2597  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2598  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
2599  )
2600 {
2601  SCIP_HEUR** heurs;
2602  SCIP_PARAM* param;
2603  char paramname[SCIP_MAXSTRLEN];
2604  int nheurs;
2605  int i;
2606 
2607  heurs = set->heurs;
2608  nheurs = set->nheurs;
2609 
2610  SCIP_CALL( paramsetSetHeuristicsDefault(paramset, set, messagehdlr, quiet) );
2611 
2612  for( i = 0; i < nheurs; ++i )
2613  {
2614  const char* heurname;
2615  heurname = SCIPheurGetName(heurs[i]);
2616 
2617  /* dualval heuristic should stay disabled */
2618  if( strcmp(heurname, "dualval") == 0 )
2619  continue;
2620 
2621  /* get frequency parameter of heuristic */
2622  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/freq", heurname);
2623  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
2624 
2625  if( param != NULL )
2626  {
2627  int deffreq;
2628  int newfreq;
2629 
2630  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
2631  deffreq = SCIPparamGetIntDefault(param);
2632 
2633  /* change frequency to half of the default value, if it is > 0, otherwise set to 20 */
2634  if( deffreq == -1 || deffreq == 0 )
2635  {
2636  newfreq = 20;
2637  }
2638  else
2639  {
2640  newfreq = (int) SCIPsetCeil(set, deffreq/2.0);
2641  newfreq = MAX(newfreq, 1);
2642  }
2643 
2644  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, newfreq, quiet) );
2645  }
2646 
2647  /* LP iteration limits only get increased for heuristics which are activated by default */
2648  if( SCIPparamGetIntDefault(param) > -1 )
2649  {
2650  /* construct (possible) parameter name for LP iteration offset */
2651  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxlpiterofs", heurname);
2652  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
2653 
2654  if( param != NULL && SCIPparamGetType(param) == SCIP_PARAMTYPE_INT )
2655  {
2656  /* set LP iteration offset to 1.5 time the current value */
2657  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, (int) (1.5 * SCIPparamGetIntDefault(param)), quiet) );
2658  }
2659 
2660  /* construct (possible) parameter name for LP iteration quotient parameter */
2661  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxlpiterquot", heurname);
2662  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
2663 
2664  if( param != NULL && SCIPparamGetType(param) == SCIP_PARAMTYPE_REAL )
2665  {
2666  /* set LP iteration quotient to 1.5 time the current value */
2667  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, paramname, 1.5 * SCIPparamGetRealDefault(param), quiet) );
2668  }
2669  }
2670  }
2671 
2672  /* set specific parameters for RENS heuristic, if the heuristic is included */
2673 #ifndef NDEBUG
2674  if( SCIPsetFindHeur(set, "rens") != NULL )
2675 #endif
2676  {
2677  SCIP_CALL( paramSetLongint(paramset, set, messagehdlr, "heuristics/rens/nodesofs", (SCIP_Longint)2000, quiet) );
2678  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "heuristics/rens/minfixingrate", 0.3, quiet) );
2679  }
2680 
2681  /* set specific parameters for Crossover heuristic, if the heuristic is included */
2682 #ifndef NDEBUG
2683  if( SCIPsetFindHeur(set, "crossover") != NULL )
2684 #endif
2685  {
2686  SCIP_CALL( paramSetLongint(paramset, set, messagehdlr, "heuristics/crossover/nwaitingnodes", (SCIP_Longint)20, quiet) );
2687  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "heuristics/crossover/dontwaitatroot", TRUE, quiet) );
2688  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "heuristics/crossover/nodesquot", 0.15, quiet) );
2689  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "heuristics/crossover/minfixingrate", 0.5, quiet) );
2690  }
2691 
2692  return SCIP_OKAY;
2693 }
2694 
2695 /** sets heuristics to fast */
2696 static
2698  SCIP_PARAMSET* paramset, /**< parameter set */
2699  SCIP_SET* set, /**< global SCIP settings */
2700  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2701  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
2702  )
2703 {
2704  int i;
2705 
2706 #define NEXPENSIVEHEURFREQS 14
2707  static const char* const expensiveheurfreqs[NEXPENSIVEHEURFREQS] = {
2708  "heuristics/coefdiving/freq",
2709  "heuristics/crossover/freq",
2710  "heuristics/feaspump/freq",
2711  "heuristics/fracdiving/freq",
2712  "heuristics/guideddiving/freq",
2713  "heuristics/linesearchdiving/freq",
2714  "heuristics/nlpdiving/freq",
2715  "heuristics/subnlp/freq",
2716  "heuristics/objpscostdiving/freq",
2717  "heuristics/pscostdiving/freq",
2718  "heuristics/rens/freq",
2719  "heuristics/rootsoldiving/freq",
2720  "heuristics/undercover/freq",
2721  "heuristics/veclendiving/freq"
2722  };
2723 
2724  SCIP_CALL( paramsetSetHeuristicsDefault(paramset, set, messagehdlr, quiet) );
2725 
2726  /* explicitly turn off expensive heuristics, if included */
2727  for( i = 0; i < NEXPENSIVEHEURFREQS; ++i )
2728  if( SCIPhashtableRetrieve(paramset->hashtable, (void*)expensiveheurfreqs[i]) != NULL )
2729  {
2730  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, expensiveheurfreqs[i], -1, quiet) );
2731  }
2732 
2733  return SCIP_OKAY;
2734 }
2735 
2736 /** turns all heuristics off */
2737 static
2739  SCIP_PARAMSET* paramset, /**< parameter set */
2740  SCIP_SET* set, /**< global SCIP settings */
2741  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2742  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
2743  )
2744 {
2745  SCIP_HEUR** heurs;
2746  char paramname[SCIP_MAXSTRLEN];
2747  int nheurs;
2748  int i;
2749 
2750  heurs = set->heurs;
2751  nheurs = set->nheurs;
2752 
2753  SCIP_CALL( paramsetSetHeuristicsDefault(paramset, set, messagehdlr, quiet) );
2754 
2755  for( i = 0; i < nheurs; ++i )
2756  {
2757  const char* heurname;
2758  heurname = SCIPheurGetName(heurs[i]);
2759 
2760  /* get frequency parameter of heuristic */
2761  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/freq", heurname);
2762 
2763  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, -1, quiet) );
2764  }
2765 
2766  return SCIP_OKAY;
2767 }
2768 
2769 /** resets all parameters that start with "presolving" in their name to their default value; additionally set the
2770  * parameters which might have previously been changed by the methods SCIPparamsetSetToPresolving{Off,Fast,Aggressive}
2771  * to their default value
2772  *
2773  * @note fixed parameters stay as they are; you need to unfix them first if they should be changed, too
2774  */
2775 static
2777  SCIP_PARAMSET* paramset, /**< parameter set */
2778  SCIP_SET* set, /**< global SCIP settings */
2779  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2780  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
2781  )
2782 { /*lint --e{715}*/
2783  SCIP_PROP** props;
2784  SCIP_CONSHDLR** conshdlrs;
2785  SCIP_PRESOL** presols;
2786  char paramname[SCIP_MAXSTRLEN];
2787  int nprops;
2788  int nconshdlrs;
2789  int npresols;
2790  int i;
2791 
2792  presols = set->presols;
2793  npresols = set->npresols;
2794 
2795  /* reset each individual presolver */
2796  for( i = 0; i < npresols; ++i )
2797  {
2798  const char* presolname;
2799  presolname = SCIPpresolGetName(presols[i]);
2800 
2801  /* reset maxrounds parameter of presolvers */
2802  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "presolving/%s/maxrounds", presolname);
2803 
2804  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
2805  }
2806 
2807  props = set->props;
2808  nprops = set->nprops;
2809 
2810  /* reset presolving for each individual propagator */
2811  for( i = 0; i < nprops; ++i )
2812  {
2813  const char* propname;
2814  propname = SCIPpropGetName(props[i]);
2815 
2816  /* reset maxprerounds parameter of propagator */
2817  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/maxprerounds", propname);
2818  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
2819  }
2820 
2821  conshdlrs = set->conshdlrs;
2822  nconshdlrs = set->nconshdlrs;
2823 
2824  /* reset presolving settings for each individual constraint handler */
2825  for( i = 0; i < nconshdlrs; ++i )
2826  {
2827  const char* conshdlrname;
2828  conshdlrname = SCIPconshdlrGetName(conshdlrs[i]);
2829 
2830  /* reset maxprerounds parameter of constraint handler */
2831  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/maxprerounds", conshdlrname);
2832  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
2833 
2834  /* reset presolpairwise parameter of constraint handler */
2835  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/presolpairwise", conshdlrname);
2836  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
2837  }
2838 
2839  /* explicitly reset parameters of setppc constraint handler, if the constraint handler is included */
2840  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "constraints/setppc/cliquelifting") );
2841 
2842  /* explicitly reset parameters of knapsack constraint handler, if the constraint handler is included */
2843  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "constraints/knapsack/disaggregation") );
2844 
2845  /* explicitly reset restart parameters */
2846  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "presolving/maxrestarts") );
2847  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "presolving/restartfac") );
2848  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "presolving/restartminred") );
2849 
2850  /* explicitly reset probing parameters */
2851  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "propagating/probing/maxuseless") );
2852  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "propagating/probing/maxtotaluseless") );
2853  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "propagating/probing/maxprerounds") );
2854 
2855  return SCIP_OKAY;
2856 }
2857 
2858 /** sets presolving to aggressive */
2859 static
2861  SCIP_PARAMSET* paramset, /**< parameter set */
2862  SCIP_SET* set, /**< global SCIP settings */
2863  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2864  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
2865  )
2866 {
2867  SCIP_PARAM* param;
2868  char paramname[SCIP_MAXSTRLEN];
2869 
2870  /* reset previous changes on presolving parameters */
2871  SCIP_CALL( paramsetSetPresolvingDefault(paramset, set, messagehdlr, quiet) );
2872 
2873  /* explicitly change restart parameters */
2874  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "presolving/restartfac", 0.03, quiet) );
2875  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "presolving/restartminred", 0.06, quiet) );
2876 
2877  /* explicitly change parameters of setppc constraint handler, if included */
2878 #ifndef NDEBUG
2879  if( SCIPsetFindConshdlr(set, "setppc") != NULL )
2880 #endif
2881  {
2882  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "constraints/setppc/cliquelifting", TRUE, quiet) );
2883  }
2884 
2885  /* explicitly change parameters of presolver boundshift, if included */
2886 #ifndef NDEBUG
2887  if( SCIPsetFindPresol(set, "boundshift") != NULL )
2888 #endif
2889  {
2890  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/boundshift/maxrounds", -1, quiet) );
2891  }
2892 
2893  /* explicitly change parameters of presolver convertinttobin, if included */
2894 #ifndef NDEBUG
2895  if( SCIPsetFindPresol(set, "convertinttobin") != NULL )
2896 #endif
2897  {
2898  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/convertinttobin/maxrounds", 0, quiet) );
2899  }
2900 
2901  /* explicitly change parameters of probing */
2902  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/probing/maxuseless");
2903  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
2904  if( param != NULL )
2905  {
2906  int defvalue;
2907 
2908  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
2909  defvalue = SCIPparamGetIntDefault(param);
2910 
2911  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, (int) (1.5 * defvalue), quiet) );
2912  }
2913  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/probing/maxtotaluseless");
2914  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
2915  if( param != NULL )
2916  {
2917  int defvalue;
2918 
2919  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
2920  defvalue = SCIPparamGetIntDefault(param);
2921 
2922  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, (int) (1.5 * defvalue), quiet) );
2923  }
2924 
2925  return SCIP_OKAY;
2926 }
2927 
2928 /** sets presolving to fast */
2929 static
2931  SCIP_PARAMSET* paramset, /**< parameter set */
2932  SCIP_SET* set, /**< global SCIP settings */
2933  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2934  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
2935  )
2936 {
2937  SCIP_CONSHDLR** conshdlrs;
2938  SCIP_PARAM* param;
2939  char paramname[SCIP_MAXSTRLEN];
2940  int nconshdlrs;
2941  int i;
2942 
2943  /* reset previous changes on presolving parameters */
2944  SCIP_CALL( paramsetSetPresolvingDefault(paramset, set, messagehdlr, quiet) );
2945 
2946  conshdlrs = set->conshdlrs;
2947  nconshdlrs = set->nconshdlrs;
2948 
2949  /* turn off pairwise comparison for each constraint handler that has this feature */
2950  for( i = 0; i < nconshdlrs; ++i )
2951  {
2952  const char* conshdlrname;
2953  conshdlrname = SCIPconshdlrGetName(conshdlrs[i]);
2954 
2955  /* get presolpairwise parameter of constraint handler */
2956  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/presolpairwise", conshdlrname);
2957  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
2958 
2959  if( param != NULL && SCIPparamGetType(param) == SCIP_PARAMTYPE_BOOL )
2960  {
2961  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, paramname, FALSE, quiet) );
2962  }
2963  }
2964 
2965  /* explicitly turn off restarts */
2966  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/maxrestarts", 0, quiet) );
2967 
2968  /* explicitly change parameters of presolver convertinttobin, if included */
2969 #ifndef NDEBUG
2970  if( SCIPsetFindPresol(set, "convertinttobin") != NULL )
2971 #endif
2972  {
2973  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/convertinttobin/maxrounds", 0, quiet) );
2974  }
2975 
2976  /* turn off probing, if included */
2977 #ifndef NDEBUG
2978  if( SCIPsetFindProp(set, "probing") != NULL )
2979 #endif
2980  {
2981  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "propagating/probing/maxprerounds", 0, quiet) );
2982  }
2983 
2984  /* explicitly disable components presolver, if included */
2985 #ifndef NDEBUG
2986  if( SCIPsetFindPresol(set, "components") != NULL )
2987 #endif
2988  {
2989  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/components/maxrounds", 0, quiet) );
2990  }
2991 
2992  /* explicitly disable dominated columns presolver, if included */
2993 #ifndef NDEBUG
2994  if( SCIPsetFindPresol(set, "domcol") != NULL )
2995 #endif
2996  {
2997  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/domcol/maxrounds", 0, quiet) );
2998  }
2999 
3000  /* explicitly disable gate extraction presolver, if included */
3001 #ifndef NDEBUG
3002  if( SCIPsetFindPresol(set, "gateextraction") != NULL )
3003 #endif
3004  {
3005  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/gateextraction/maxrounds", 0, quiet) );
3006  }
3007 
3008  return SCIP_OKAY;
3009 }
3010 
3011 /** turns all presolving off */
3012 static
3014  SCIP_PARAMSET* paramset, /**< parameter set */
3015  SCIP_SET* set, /**< global SCIP settings */
3016  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3017  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3018  )
3019 {
3020  SCIP_PRESOL** presols;
3021  SCIP_PROP** props;
3022  SCIP_CONSHDLR** conshdlrs;
3023  char paramname[SCIP_MAXSTRLEN];
3024  int npresols;
3025  int nprops;
3026  int nconshdlrs;
3027  int i;
3028 
3029  /* reset previous changes on presolving parameters */
3030  SCIP_CALL( paramsetSetPresolvingDefault(paramset, set, messagehdlr, quiet) );
3031 
3032  presols = set->presols;
3033  npresols = set->npresols;
3034 
3035  /* turn each individual presolver off */
3036  for( i = 0; i < npresols; ++i )
3037  {
3038  const char* presolname;
3039  presolname = SCIPpresolGetName(presols[i]);
3040 
3041  /* get maxrounds parameter of presolvers */
3042  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "presolving/%s/maxrounds", presolname);
3043 
3044  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, 0, quiet) );
3045  }
3046 
3047  props = set->props;
3048  nprops = set->nprops;
3049 
3050  /* turn off presolving for each individual propagator */
3051  for( i = 0; i < nprops; ++i )
3052  {
3053  const char* propname;
3054  propname = SCIPpropGetName(props[i]);
3055 
3056  /* get maxrounds parameter of propagator */
3057  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/maxprerounds", propname);
3058 
3059  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, 0, quiet) );
3060  }
3061 
3062  conshdlrs = set->conshdlrs;
3063  nconshdlrs = set->nconshdlrs;
3064 
3065  /* turn off presolving for each individual constraint handler */
3066  for( i = 0; i < nconshdlrs; ++i )
3067  {
3068  const char* conshdlrname;
3069  conshdlrname = SCIPconshdlrGetName(conshdlrs[i]);
3070 
3071  /* get maxprerounds parameter of constraint handler */
3072  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/maxprerounds", conshdlrname);
3073 
3074  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, 0, quiet) );
3075  }
3076 
3077  /* explicitly turn off restarts */
3078  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/maxrestarts", 0, quiet) );
3079 
3080  return SCIP_OKAY;
3081 }
3082 
3083 /** reset parameters that may have been changed by other SCIPparamsetSetSeparatingXyz to their default values
3084  *
3085  * @note fixed parameters stay as they are; you need to unfix them first if they should be changed, too
3086  */
3087 static
3089  SCIP_PARAMSET* paramset, /**< parameter set */
3090  SCIP_SET* set, /**< global SCIP settings */
3091  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3092  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3093  )
3094 { /*lint --e{715}*/
3095  SCIP_SEPA** sepas;
3096  SCIP_CONSHDLR** conshdlrs;
3097  char paramname[SCIP_MAXSTRLEN];
3098  int nconshdlrs;
3099  int nsepas;
3100  int i;
3101 
3102  sepas = set->sepas;
3103  nsepas = set->nsepas;
3104 
3105  /* reset separating parameters of all separators */
3106  for( i = 0; i < nsepas; ++i )
3107  {
3108  const char* sepaname;
3109  sepaname = SCIPsepaGetName(sepas[i]);
3110 
3111  /* reset frequency parameter of separator */
3112  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/freq", sepaname);
3113  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
3114 
3115  /* reset maximum number of rounds in root node */
3116  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/maxroundsroot", sepaname);
3117  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
3118 
3119  /* reset maximum number of cuts per separation in root node */
3120  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/maxsepacutsroot", sepaname);
3121  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
3122  }
3123 
3124  conshdlrs = set->conshdlrs;
3125  nconshdlrs = set->nconshdlrs;
3126 
3127  /* reset each individual constraint handler separation settings */
3128  for( i = 0; i < nconshdlrs; ++i )
3129  {
3130  const char* conshdlrname;
3131  conshdlrname = SCIPconshdlrGetName(conshdlrs[i]);
3132 
3133  /* reset separation frequency parameter of constraint handler, if available */
3134  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/sepafreq", conshdlrname);
3135  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
3136 
3137  /* reset maximal separated cuts in root node of constraint handler, if available */
3138  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/maxsepacutsroot", conshdlrname);
3139  if( SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname) != NULL )
3140  {
3141  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
3142  }
3143  }
3144 
3145  /* explicitly reset individual parameters */
3146  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "constraints/linear/separateall") );
3147  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/minorthoroot") );
3148  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/maxroundsrootsubrun") );
3149  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/maxaddrounds") );
3150  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/maxcutsroot") );
3151  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/poolfreq") );
3152  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/cmir/maxfailsroot") );
3153  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/mcf/maxtestdelta") );
3154  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/mcf/trynegscaling") );
3155  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/cmir/maxtriesroot") );
3156  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/cmir/maxaggrsroot") );
3157  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/maxbounddist") );
3158 
3159  return SCIP_OKAY;
3160 }
3161 
3162 /** sets separating to aggressive */
3163 static
3165  SCIP_PARAMSET* paramset, /**< parameter set */
3166  SCIP_SET* set, /**< global SCIP settings */
3167  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3168  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3169  )
3170 {
3171  SCIP_CONSHDLR** conshdlrs;
3172  SCIP_SEPA** sepas;
3173  SCIP_PARAM* param;
3174  char paramname[SCIP_MAXSTRLEN];
3175  int nconshdlrs;
3176  int nsepas;
3177  int i;
3178 
3179  sepas = set->sepas;
3180  nsepas = set->nsepas;
3181 
3182  /* set all separating parameters to default values */
3183  SCIP_CALL( paramsetSetSeparatingDefault(paramset, set, messagehdlr, quiet) );
3184 
3185  /* set separating parameters of all separators */
3186  for( i = 0; i < nsepas; ++i )
3187  {
3188  const char* sepaname;
3189  sepaname = SCIPsepaGetName(sepas[i]);
3190 
3191  /* intobj and cgmip separators should stay disabled */
3192  if( strcmp(sepaname, "intobj") == 0 || strcmp(sepaname, "cgmip") == 0 )
3193  continue;
3194 
3195  /* get frequency parameter of separator */
3196  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/freq", sepaname);
3197  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
3198 
3199  if( param != NULL )
3200  {
3201  int deffreq;
3202  int newfreq;
3203 
3204  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
3205  deffreq = SCIPparamGetIntDefault(param);
3206 
3207  /* for enabled separators, change frequency to at least every 20th depths and
3208  * enable disabled separators
3209  */
3210  if( deffreq == -1 )
3211  newfreq = 0;
3212  else if( deffreq == 0 )
3213  newfreq = 20;
3214  else
3215  newfreq = MIN(deffreq, 20);
3216 
3217  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, newfreq, quiet) );
3218  }
3219 
3220  /* get maximum number of rounds in root node */
3221  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/maxroundsroot", sepaname);
3222  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
3223 
3224  if( param != NULL )
3225  {
3226  int defrounds;
3227 
3228  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
3229  defrounds = SCIPparamGetIntDefault(param);
3230 
3231  /* increase the maximum number of rounds in the root node by factor of 1.5 */
3232  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, (int) (1.5 * defrounds), quiet) );
3233  }
3234 
3235  /* get maximum number of cuts per separation in root node */
3236  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/maxsepacutsroot", sepaname);
3237  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
3238 
3239  if( param != NULL )
3240  {
3241  int defnumber;
3242 
3243  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
3244  defnumber = SCIPparamGetIntDefault(param);
3245 
3246  /* increase the maximum number of cut per separation rounds in the root node by factor of 2 */
3247  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, 2*defnumber, quiet) );
3248  }
3249  }
3250 
3251  conshdlrs = set->conshdlrs;
3252  nconshdlrs = set->nconshdlrs;
3253 
3254  /* set separating parameters of all constraint handlers */
3255  for( i = 0; i < nconshdlrs; ++i )
3256  {
3257  const char* conshdlrname;
3258  conshdlrname = SCIPconshdlrGetName(conshdlrs[i]);
3259 
3260  /* get separating frequency parameter of constraint handler */
3261  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/sepafreq", conshdlrname);
3262  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
3263 
3264  if( param != NULL )
3265  {
3266  int deffreq;
3267  int newfreq;
3268 
3269  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
3270  deffreq = SCIPparamGetIntDefault(param);
3271 
3272  /* for constraint handlers with enabled separation, change frequency to at least every 10th depths and
3273  * enable disabled separation routines
3274  */
3275  if( deffreq == -1 )
3276  newfreq = 0;
3277  else if( deffreq == 0 )
3278  newfreq = 10;
3279  else
3280  newfreq = MIN(deffreq, 10);
3281 
3282  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, newfreq, quiet) );
3283  }
3284 
3285  /* get maximal separated cuts in root node of constraint handler */
3286  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/maxsepacutsroot", conshdlrname);
3287  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
3288 
3289  if( param != NULL )
3290  {
3291  int defnumber;
3292 
3293  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
3294  defnumber = SCIPparamGetIntDefault(param);
3295 
3296  /* change maximal cuts in root node to at least 500 */
3297  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, MAX(defnumber, 500), quiet) );
3298  }
3299  }
3300 
3301  /* explicitly change general separating parameters */
3302  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "separating/minorthoroot", 0.1, quiet) );
3303  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/maxroundsrootsubrun", 5, quiet) );
3304  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/maxaddrounds", 5, quiet) );
3305  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/maxcutsroot", 5000, quiet) );
3306  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/poolfreq", 10, quiet) );
3307 
3308  /* explicitly change a separating parameter of the linear constraint handler, if included */
3309 #ifndef NDEBUG
3310  if( SCIPsetFindConshdlr(set, "linear") != NULL )
3311 #endif
3312  {
3313  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "constraints/linear/separateall", TRUE, quiet) );
3314  }
3315 
3316  /* explicitly change a separating parameter of cmir separator, if included */
3317 #ifndef NDEBUG
3318  if( SCIPsetFindSepa(set, "cmir") != NULL )
3319 #endif
3320  {
3321  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/cmir/maxfailsroot", 200, quiet) );
3322  }
3323 
3324  /* explicitly change separating parameters of mcf separator, if included */
3325 #ifndef NDEBUG
3326  if( SCIPsetFindSepa(set, "mcf") != NULL )
3327 #endif
3328  {
3329  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/mcf/maxtestdelta", -1, quiet) );
3330  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "separating/mcf/trynegscaling", TRUE, quiet) );
3331  }
3332 
3333  return SCIP_OKAY;
3334 }
3335 
3336 /** sets separating to fast */
3337 static
3339  SCIP_PARAMSET* paramset, /**< parameter set */
3340  SCIP_SET* set, /**< global SCIP settings */
3341  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3342  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3343  )
3344 {
3345  /* reset previous changes on separating parameters */
3346  SCIP_CALL( paramsetSetSeparatingDefault(paramset, set, messagehdlr, quiet) );
3347 
3348  /* explicitly decrease maxbounddist */
3349  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "separating/maxbounddist", 0.0, quiet) );
3350 
3351  /* explicitly turn off expensive separators, if included */
3352 #ifndef NDEBUG
3353  if( SCIPsetFindConshdlr(set, "and") != NULL )
3354 #endif
3355  {
3356  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "constraints/and/sepafreq", 0, quiet) );
3357  }
3358 #ifndef NDEBUG
3359  if( SCIPsetFindSepa(set, "cmir") != NULL )
3360 #endif
3361  {
3362  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/cmir/maxroundsroot", 5, quiet) );
3363  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/cmir/maxtriesroot", 100, quiet) );
3364  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/cmir/maxaggrsroot", 3, quiet) );
3365  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/cmir/maxsepacutsroot", 200, quiet) );
3366  }
3367 #ifndef NDEBUG
3368  if( SCIPsetFindSepa(set, "flowcover") != NULL )
3369 #endif
3370  {
3371  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/flowcover/freq", -1, quiet) );
3372  }
3373 #ifndef NDEBUG
3374  if( SCIPsetFindSepa(set, "gomory") != NULL )
3375 #endif
3376  {
3377  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/gomory/maxroundsroot", 20, quiet) );
3378  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/gomory/maxsepacutsroot", 200, quiet) );
3379  }
3380 #ifndef NDEBUG
3381  if( SCIPsetFindSepa(set, "mcf") != NULL )
3382 #endif
3383  {
3384  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/mcf/freq", -1, quiet) );
3385  }
3386 #ifndef NDEBUG
3387  if( SCIPsetFindSepa(set, "strongcg") != NULL )
3388 #endif
3389  {
3390  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/strongcg/maxroundsroot", 10, quiet) );
3391  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/strongcg/maxsepacutsroot", 200, quiet) );
3392  }
3393 
3394  return SCIP_OKAY;
3395 }
3396 
3397 /** turns all cuts off */
3398 static
3400  SCIP_PARAMSET* paramset, /**< parameter set */
3401  SCIP_SET* set, /**< global SCIP settings */
3402  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3403  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3404  )
3405 {
3406  SCIP_SEPA** sepas;
3407  SCIP_CONSHDLR** conshdlrs;
3408  char paramname[SCIP_MAXSTRLEN];
3409  int nsepas;
3410  int nconshdlrs;
3411  int i;
3412 
3413  /* reset previous changes on separating parameters */
3414  SCIP_CALL( paramsetSetSeparatingDefault(paramset, set, messagehdlr, quiet) );
3415 
3416  sepas = set->sepas;
3417  nsepas = set->nsepas;
3418 
3419  /* turn each individual separator off */
3420  for( i = 0; i < nsepas; ++i )
3421  {
3422  const char* sepaname;
3423  sepaname = SCIPsepaGetName(sepas[i]);
3424 
3425  /* get frequency parameter of separator */
3426  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/freq", sepaname);
3427  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, -1, quiet) );
3428  }
3429 
3430  conshdlrs = set->conshdlrs;
3431  nconshdlrs = set->nconshdlrs;
3432 
3433  /* turn off separation for each individual constraint handler */
3434  for( i = 0; i < nconshdlrs; ++i )
3435  {
3436  const char* conshdlrname;
3437  conshdlrname = SCIPconshdlrGetName(conshdlrs[i]);
3438 
3439  /* get separation frequency parameter of constraint handler */
3440  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/sepafreq", conshdlrname);
3441  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, -1, quiet) );
3442  }
3443 
3444  return SCIP_OKAY;
3445 }
3446 
3447 /** sets parameters to
3448  * - SCIP_PARAMSETTING_DEFAULT to use default values (see also SCIPparamsetSetToDefault())
3449  * - SCIP_PARAMSETTING_COUNTER to get feasible and "fast" counting process
3450  * - SCIP_PARAMSETTING_CPSOLVER to get CP like search (e.g. no LP relaxation)
3451  * - SCIP_PARAMSETTING_EASYCIP to solve easy problems fast
3452  * - SCIP_PARAMSETTING_FEASIBILITY to detect feasibility fast
3453  * - SCIP_PARAMSETTING_HARDLP to be capable to handle hard LPs
3454  * - SCIP_PARAMSETTING_OPTIMALITY to prove optimality fast
3455  */
3457  SCIP_PARAMSET* paramset, /**< parameter set */
3458  SCIP_SET* set, /**< global SCIP settings */
3459  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3460  SCIP_PARAMEMPHASIS paramemphasis, /**< parameter emphasis */
3461  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3462  )
3463 {
3464  /* reset all parameter to default */
3465  SCIP_CALL( SCIPparamsetSetToDefaults(paramset, set, messagehdlr) );
3466 
3467  switch( paramemphasis )
3468  {
3470  /* the default values are already set */
3471  break;
3472 
3474  /* TODO: should constraints/linear/detectlowerbound and detectcutoffbound be set to FALSE? */
3475  /* avoid logicor upgrade since the logicor constraint handler does not perform full propagation */
3476  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "constraints/linear/upgrade/logicor", FALSE, quiet) );
3477 
3478  /* set priority for inference branching to highest possible value */
3479  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "branching/inference/priority", INT_MAX/4, quiet) );
3480 
3481  /* set priority for depth first search to highest possible value */
3482  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "nodeselection/dfs/stdpriority", INT_MAX/4, quiet) );
3483 
3484  /* avoid that the ZIMPL reader transforms the problem before the problem is generated */
3485  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "reading/zplreader/usestartsol", FALSE, quiet) );
3486 
3487  /* turn off all heuristics */
3488  SCIP_CALL( paramsetSetHeuristicsOff(paramset, set, messagehdlr, quiet) );
3489 
3490  /* turn off all separation */
3491  SCIP_CALL( paramsetSetSeparatingOff(paramset, set, messagehdlr, quiet) );
3492 
3493  /* turn off restart */
3494  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/maxrestarts", 0, quiet) );
3495 
3496  /* unlimited number of propagation rounds in any branch and bound node */
3497  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "propagating/maxrounds", -1, quiet) );
3498  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "propagating/maxroundsroot", -1, quiet) );
3499 
3500  /* adjust conflict analysis for depth first search */
3501  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "conflict/fuiplevels", 1, quiet) );
3502  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "conflict/dynamic", FALSE, quiet) );
3503 
3504  /* prefer binary variables for branching */
3505  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "branching/preferbinary", TRUE, quiet) );
3506 
3507  /* turn on aggressive constraint aging */
3508  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "constraints/agelimit", 1, quiet) );
3509 
3510  /* turn off components presolver since we are currently not able to handle that in case of counting */
3511  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/components/maxrounds", 0, quiet) );
3512  break;
3513 
3515  /* shrink the minimal maximum value for the conflict length */
3516  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "conflict/minmaxvars", 10, quiet) );
3517 
3518  /* use only first unique implication point */
3519  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "conflict/fuiplevels", 1, quiet) );
3520 
3521  /* do not use reconversion conflicts */
3522  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "conflict/reconvlevels", 0, quiet) );
3523 
3524  /* after 250 conflict we force a restart since then the variable statistics are reasonable initialized */
3525  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "conflict/restartnum", 250, quiet) );
3526 
3527  /* increase the number of conflicts which induce a restart */
3528  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "conflict/restartfac", 2.0, quiet) );
3529 
3530  /* weight the variable which made into a conflict */
3531  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "conflict/conflictweight", 1.0, quiet) );
3532 
3533  /* do not check pseudo solution (for performance reasons) */
3534  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "constraints/disableenfops", TRUE, quiet) );
3535 
3536  /* use value based history to detect a reasonable branching point */
3537  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "history/valuebased", TRUE, quiet) );
3538 
3539  /* turn of LP relaxation */
3540  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "lp/solvefreq", -1, quiet) );
3541 
3542  /* prefer the down branch in case the value based history does not suggest something */
3543  SCIP_CALL( paramSetChar(paramset, set, messagehdlr, "nodeselection/childsel", 'd', quiet) );
3544 
3545  /* accept any bound change */
3546  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "numerics/boundstreps", 1e-6, quiet) );
3547 
3548  /* allow for at most 10 restart, after that the value based history should be reliable */
3549  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/maxrestarts", 10, quiet) );
3550 
3551  /* set priority for depth first search to highest possible value */
3552  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "nodeselection/dfs/stdpriority", INT_MAX/4, quiet) );
3553 
3554  break;
3555 
3557  /* set heuristics to fast, to avoid spending to much time for involved heuristics */
3558  SCIP_CALL( paramsetSetHeuristicsFast(paramset, set, messagehdlr, quiet) );
3559 
3560  /* set presolving to fast, to avoid spending to much time for involved presolving */
3561  SCIP_CALL( paramsetSetPresolvingFast(paramset, set, messagehdlr, quiet) );
3562 
3563  /* set separating to fast, to avoid spending to much time for involved separators */
3564  SCIP_CALL( paramsetSetSeparatingFast(paramset, set, messagehdlr, quiet) );
3565 
3566  break;
3567 
3569  /* set heuristics aggressive */
3570  SCIP_CALL( paramsetSetHeuristicsAggressive(paramset, set, messagehdlr, quiet) );
3571 
3572  /* reduce the amount of separation rounds and disable most expensive separators */
3573  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/maxrounds", 1, quiet) );
3574  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/maxroundsroot", 5, quiet) );
3575  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/cmir/freq", -1, quiet) );
3576  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/flowcover/freq", -1, quiet) );
3577  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/mcf/freq", -1, quiet) );
3578 
3579  /* set priority for node selection "restartdfs" to be higher as the current used one */
3580  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "nodeselection/restartdfs/stdpriority", INT_MAX/4, quiet) );
3581  break;
3582 
3584  /* set heuristics to fast, to avoid heuristics which solve also an LP */
3585  SCIP_CALL( paramsetSetHeuristicsFast(paramset, set, messagehdlr, quiet) );
3586 
3587  /* set presolving to fast, to avoid spending to much time for involved presolving */
3588  SCIP_CALL( paramsetSetPresolvingFast(paramset, set, messagehdlr, quiet) );
3589 
3590  /* reduce the amount of strong branching */
3591  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "branching/relpscost/maxreliable", 1.0, quiet) );
3592  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "branching/relpscost/inititer", 10, quiet) );
3593 
3594  /* reduce the amount of separation rounds */
3595  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/maxrounds", 1, quiet) );
3596  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/maxroundsroot", 5, quiet) );
3597 
3598  break;
3599 
3601  /* set cuts aggressive */
3602  SCIP_CALL( paramsetSetSeparatingAggressive(paramset, set, messagehdlr, quiet) );
3603 
3604  /* increase the amount of strong branching */
3605  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "branching/fullstrong/maxdepth", 10, quiet) );
3606  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "branching/fullstrong/maxbounddist", 0.0, quiet) );
3607  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "branching/relpscost/sbiterquot", 1.0, quiet) );
3608  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "branching/relpscost/sbiterofs", 1000000, quiet) );
3609 
3610  break;
3611 
3612  default:
3613  SCIPerrorMessage("the parameter setting <%d> is not allowed for emphasis call\n", paramemphasis);
3614  return SCIP_INVALIDCALL;
3615  }
3616  return SCIP_OKAY;
3617 }
3618 
3619 /** sets parameters to deactivate separators and heuristics that use auxiliary SCIP instances; should be called for
3620  * auxiliary SCIP instances to avoid recursion
3621  */
3623  SCIP_PARAMSET* paramset, /**< parameter set */
3624  SCIP_SET* set, /**< global SCIP settings */
3625  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3626  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3627  )
3628 {
3629  SCIP_HEUR** heurs;
3630  SCIP_SEPA** sepas;
3631 
3632  char paramname[SCIP_MAXSTRLEN];
3633 
3634  int nheurs;
3635  int nsepas;
3636  int i;
3637 
3638  heurs = set->heurs;
3639  nheurs = set->nheurs;
3640 
3641  /* disable all heuristics that use auxiliary SCIP instances */
3642  for( i = 0; i < nheurs; ++i )
3643  {
3644  if( SCIPheurUsesSubscip(heurs[i]) )
3645  {
3646  const char* heurname;
3647  heurname = SCIPheurGetName(heurs[i]);
3648 
3649  /* get frequency parameter of heuristic */
3650  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/freq", heurname);
3651 
3652  /* we have to unfix the parameter if it fixed and not already set to -1 */
3653  if( SCIPparamsetIsFixed(paramset, paramname) )
3654  {
3655  int oldfreq;
3656 
3657  SCIP_CALL( SCIPparamsetGetInt(paramset, paramname, &oldfreq) );
3658 
3659  /* if the frequency is already set to -1, we do not have to unfix it, but must not try to set it, either */
3660  if( oldfreq == -1 )
3661  continue;
3662 
3663  /* unfix parameter */
3664  SCIPmessageFPrintInfo(messagehdlr, NULL, "unfixing parameter %s in order to disable sub-SCIPs in the current (sub-)SCIP instance\n", paramname);
3665  SCIP_CALL( SCIPparamsetFix(paramset, paramname, FALSE) );
3666  }
3667 
3668  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, -1, quiet) );
3669  }
3670  }
3671 
3672  sepas = set->sepas;
3673  nsepas = set->nsepas;
3674 
3675  /* disable all separators that use auxiliary SCIP instances */
3676  for( i = 0; i < nsepas; ++i )
3677  {
3678  if( SCIPsepaUsesSubscip(sepas[i]) )
3679  {
3680  const char* sepaname;
3681  sepaname = SCIPsepaGetName(sepas[i]);
3682 
3683  /* get frequency parameter of separator */
3684  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/freq", sepaname);
3685 
3686  /* we have to unfix the parameter if it fixed and not already set to -1 */
3687  if( SCIPparamsetIsFixed(paramset, paramname) )
3688  {
3689  int oldfreq;
3690 
3691  SCIP_CALL( SCIPparamsetGetInt(paramset, paramname, &oldfreq) );
3692 
3693  /* if the frequency is already set to -1, we do not have to unfix it, but must not try to set it, either */
3694  if( oldfreq == -1 )
3695  continue;
3696 
3697  /* unfix parameter */
3698  SCIPmessageFPrintInfo(messagehdlr, NULL, "unfixing parameter %s in order to disable sub-SCIPs in the current (sub-)SCIP instance\n", paramname);
3699  SCIP_CALL( SCIPparamsetFix(paramset, paramname, FALSE) );
3700  }
3701 
3702  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, -1, quiet) );
3703  }
3704  }
3705 
3706  return SCIP_OKAY;
3707 }
3708 
3709 /** sets heuristic parameters values to
3710  * - SCIP_PARAMSETTING_DEFAULT which are the default values of all heuristic parameters
3711  * - SCIP_PARAMSETTING_FAST such that the time spend for heuristic is decreased
3712  * - SCIP_PARAMSETTING_AGGRESSIVE such that the heuristic are called more aggregative
3713  * - SCIP_PARAMSETTING_OFF which turn off all heuristics
3714  */
3716  SCIP_PARAMSET* paramset, /**< parameter set */
3717  SCIP_SET* set, /**< global SCIP settings */
3718  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3719  SCIP_PARAMSETTING paramsetting, /**< parameter settings */
3720  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3721  )
3722 {
3723  switch( paramsetting )
3724  {
3726  SCIP_CALL( paramsetSetHeuristicsDefault(paramset, set, messagehdlr, quiet) );
3727  break;
3728  case SCIP_PARAMSETTING_OFF:
3729  SCIP_CALL( paramsetSetHeuristicsOff(paramset, set, messagehdlr, quiet) );
3730  break;
3732  SCIP_CALL( paramsetSetHeuristicsFast(paramset, set, messagehdlr, quiet) );
3733  break;
3735  SCIP_CALL( paramsetSetHeuristicsAggressive(paramset, set, messagehdlr, quiet) );
3736  break;
3737  default:
3738  SCIPerrorMessage("the parameter setting <%d> is not allowed for heuristics\n", paramsetting);
3739  return SCIP_INVALIDCALL;
3740  }
3741 
3742  return SCIP_OKAY;
3743 }
3744 
3745 /** sets presolving parameters to
3746  * - SCIP_PARAMSETTING_DEFAULT which are the default values of all presolving parameters
3747  * - SCIP_PARAMSETTING_FAST such that the time spend for presolving is decreased
3748  * - SCIP_PARAMSETTING_AGGRESSIVE such that the presolving is more aggregative
3749  * - SCIP_PARAMSETTING_OFF which turn off all presolving
3750  */
3752  SCIP_PARAMSET* paramset, /**< parameter set */
3753  SCIP_SET* set, /**< global SCIP settings */
3754  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3755  SCIP_PARAMSETTING paramsetting, /**< parameter settings */
3756  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3757  )
3758 {
3759  switch( paramsetting )
3760  {
3762  SCIP_CALL( paramsetSetPresolvingDefault(paramset, set, messagehdlr, quiet) );
3763  break;
3764  case SCIP_PARAMSETTING_OFF:
3765  SCIP_CALL( paramsetSetPresolvingOff(paramset, set, messagehdlr, quiet) );
3766  break;
3768  SCIP_CALL( paramsetSetPresolvingFast(paramset, set, messagehdlr, quiet) );
3769  break;
3771  SCIP_CALL( paramsetSetPresolvingAggressive(paramset, set, messagehdlr, quiet) );
3772  break;
3773  default:
3774  SCIPerrorMessage("the parameter setting <%d> is not allowed for presolving\n", paramsetting);
3775  return SCIP_INVALIDCALL;
3776  }
3777 
3778  return SCIP_OKAY;
3779 }
3780 
3781 /** sets separating parameters to
3782  * - SCIP_PARAMSETTING_DEFAULT which are the default values of all separating parameters
3783  * - SCIP_PARAMSETTING_FAST such that the time spend for separating is decreased
3784  * - SCIP_PARAMSETTING_AGGRESSIVE such that the separating is done more aggregative
3785  * - SCIP_PARAMSETTING_OFF which turn off all separating
3786  */
3788  SCIP_PARAMSET* paramset, /**< parameter set */
3789  SCIP_SET* set, /**< global SCIP settings */
3790  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3791  SCIP_PARAMSETTING paramsetting, /**< parameter settings */
3792  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3793  )
3794 {
3795  switch( paramsetting )
3796  {
3798  SCIP_CALL( paramsetSetSeparatingDefault(paramset, set, messagehdlr, quiet) );
3799  break;
3800  case SCIP_PARAMSETTING_OFF:
3801  SCIP_CALL( paramsetSetSeparatingOff(paramset, set, messagehdlr, quiet) );
3802  break;
3804  SCIP_CALL( paramsetSetSeparatingFast(paramset, set, messagehdlr, quiet) );
3805  break;
3807  SCIP_CALL( paramsetSetSeparatingAggressive(paramset, set, messagehdlr, quiet) );
3808  break;
3809  default:
3810  SCIPerrorMessage("the parameter setting <%d> is not allowed for separating\n", paramsetting);
3811  return SCIP_INVALIDCALL;
3812  }
3813 
3814  return SCIP_OKAY;
3815 }
3816 
3817 /** returns the array of parameters */
3819  SCIP_PARAMSET* paramset /**< parameter set */
3820  )
3821 {
3822  assert(paramset != NULL);
3823 
3824  return paramset->params;
3825 }
3826 
3827 /** returns the number of parameters in the parameter set */
3829  SCIP_PARAMSET* paramset /**< parameter set */
3830  )
3831 {
3832  assert(paramset != NULL);
3833 
3834  return paramset->nparams;
3835 }
3836 
3837 /** copies all parameter values of the source parameter set to the corresponding parameters in the target set */
3839  SCIP_PARAMSET* sourceparamset, /**< source parameter set */
3840  SCIP_PARAMSET* targetparamset, /**< target parameter set */
3841  SCIP_SET* set, /**< global SCIP settings of target SCIP */
3842  SCIP_MESSAGEHDLR* messagehdlr /**< message handler of target SCIP */
3843  )
3844 {
3845  int i;
3846 
3847  assert(sourceparamset != NULL);
3848  assert(targetparamset != NULL);
3849  assert(sourceparamset != targetparamset);
3850  assert(set != NULL);
3851 
3852  assert(sourceparamset->nparams == 0 || sourceparamset->params != NULL);
3853  assert(targetparamset->nparams == 0 || targetparamset->params != NULL);
3854 
3855  for( i = 0; i < sourceparamset->nparams; ++i )
3856  {
3857  SCIP_PARAM* sourceparam;
3858  SCIP_PARAM* targetparam;
3859  const char* paramname;
3860 
3861  sourceparam = sourceparamset->params[i];
3862  assert(sourceparam != NULL);
3863 
3864  /* find parameter of same name in target scip */
3865  paramname = SCIPparamGetName(sourceparam);
3866  targetparam = (SCIP_PARAM*)SCIPhashtableRetrieve(targetparamset->hashtable, (void*)paramname);
3867 
3868  /* if a plugin was not copied, the parameter does not exist in the target SCIP */
3869  if( targetparam == NULL )
3870  continue;
3871 
3872  assert(SCIPparamGetType(sourceparam) == SCIPparamGetType(targetparam));
3873 
3874  /* set value of target parameter to value of source parameter */
3875  switch( SCIPparamGetType(sourceparam) )
3876  {
3877  case SCIP_PARAMTYPE_BOOL:
3878  SCIP_CALL( paramCopyBool(sourceparam, targetparam, set, messagehdlr) );
3879  break;
3880 
3881  case SCIP_PARAMTYPE_INT:
3882  SCIP_CALL( paramCopyInt(sourceparam, targetparam, set, messagehdlr) );
3883  break;
3884 
3886  SCIP_CALL( paramCopyLongint(sourceparam, targetparam, set, messagehdlr) );
3887  break;
3888 
3889  case SCIP_PARAMTYPE_REAL:
3890  SCIP_CALL( paramCopyReal(sourceparam, targetparam, set, messagehdlr) );
3891  break;
3892 
3893  case SCIP_PARAMTYPE_CHAR:
3894  SCIP_CALL( paramCopyChar(sourceparam, targetparam, set, messagehdlr) );
3895  break;
3896 
3897  case SCIP_PARAMTYPE_STRING:
3898  /* the vbc parameters are explicitly not copied to avoid that the vbc file of the original SCIP is overwritten;
3899  * to avoid that hard coded comparison, each parameter could get a Bool flag which tells if the value
3900  * of that parameter can be copied
3901  */
3902  if( strncmp(sourceparam->name, "vbc/", 4) != 0 )
3903  {
3904  SCIP_CALL( paramCopyString(sourceparam, targetparam, set, messagehdlr) );
3905  }
3906  break;
3907 
3908  default:
3909  SCIPerrorMessage("unknown parameter type\n");
3910  return SCIP_INVALIDDATA;
3911  }
3912 
3913  /* copy fixing status of parameter */
3914  SCIPparamSetFixed(targetparam, SCIPparamIsFixed(sourceparam));
3915  }
3916 
3917  return SCIP_OKAY;
3918 }
3919 
3920 /** sets fixing status of given parameter */
3922  SCIP_PARAM* param, /**< parameter */
3923  SCIP_Bool fixed /**< new fixing status of the parameter */
3924  )
3925 {
3926  assert(param != NULL);
3927 
3928  param->isfixed = fixed;
3929 }
3930 
3931 /** sets value of SCIP_Bool parameter */
3933  SCIP_PARAM* param, /**< parameter */
3934  SCIP_SET* set, /**< global SCIP settings, or NULL if param change method should not be called */
3935  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3936  SCIP_Bool value, /**< new value of the parameter */
3937  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3938  )
3939 {
3940  assert(param != NULL);
3941 
3942  /* check, if value is possible for the parameter and the parameter is not fixed */
3943  SCIP_CALL_QUIET( paramCheckBool(param, messagehdlr, value) );
3944 
3945  /* set the parameter's current value */
3946  if( param->data.boolparam.valueptr != NULL )
3947  *param->data.boolparam.valueptr = value;
3948  else
3949  param->data.boolparam.curvalue = value;
3950 
3951  /* call the parameter's change information method */
3952  if( param->paramchgd != NULL && set != NULL )
3953  {
3954  SCIP_CALL( param->paramchgd(set->scip, param) );
3955  }
3956 
3957  if( !quiet )
3958  {
3959  SCIP_CALL( paramWrite(param, messagehdlr, NULL, FALSE, TRUE) );
3960  }
3961 
3962  return SCIP_OKAY;
3963 }
3964 
3965 /** sets value of int parameter */
3967  SCIP_PARAM* param, /**< parameter */
3968  SCIP_SET* set, /**< global SCIP settings, or NULL if param change method should not be called */
3969  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3970  int value, /**< new value of the parameter */
3971  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3972  )
3973 {
3974  assert(param != NULL);
3975 
3976  /* check, if value is possible for the parameter and the parameter is not fixed */
3977  SCIP_CALL_QUIET( paramCheckInt(param, messagehdlr, value) );
3978 
3979  /* set the parameter's current value */
3980  if( param->data.intparam.valueptr != NULL )
3981  *param->data.intparam.valueptr = value;
3982  else
3983  param->data.intparam.curvalue = value;
3984 
3985  /* call the parameter's change information method */
3986  if( param->paramchgd != NULL && set != NULL )
3987  {
3988  SCIP_CALL( param->paramchgd(set->scip, param) );
3989  }
3990 
3991  if( !quiet )
3992  {
3993  SCIP_CALL( paramWrite(param, messagehdlr, NULL, FALSE, TRUE) );
3994  }
3995 
3996  return SCIP_OKAY;
3997 }
3998 
3999 /** sets value of SCIP_Longint parameter */
4001  SCIP_PARAM* param, /**< parameter */
4002  SCIP_SET* set, /**< global SCIP settings, or NULL if param change method should not be called */
4003  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4004  SCIP_Longint value, /**< new value of the parameter */
4005  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4006  )
4007 {
4008  assert(param != NULL);
4009 
4010  /* check, if value is possible for the parameter and the parameter is not fixed */
4011  SCIP_CALL_QUIET( paramCheckLongint(param, messagehdlr, value) );
4012 
4013  /* set the parameter's current value */
4014  if( param->data.longintparam.valueptr != NULL )
4015  *param->data.longintparam.valueptr = value;
4016  else
4017  param->data.longintparam.curvalue = value;
4018 
4019  /* call the parameter's change information method */
4020  if( param->paramchgd != NULL && set != NULL )
4021  {
4022  SCIP_CALL( param->paramchgd(set->scip, param) );
4023  }
4024 
4025  if( !quiet )
4026  {
4027  SCIP_CALL( paramWrite(param, messagehdlr, NULL, FALSE, TRUE) );
4028  }
4029 
4030  return SCIP_OKAY;
4031 }
4032 
4033 /** sets value of SCIP_Real parameter */
4035  SCIP_PARAM* param, /**< parameter */
4036  SCIP_SET* set, /**< global SCIP settings, or NULL if param change method should not be called */
4037  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4038  SCIP_Real value, /**< new value of the parameter */
4039  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4040  )
4041 {
4042  assert(param != NULL);
4043 
4044  /* check, if value is possible for the parameter and the parameter is not fixed */
4045  value = MAX(value, SCIP_REAL_MIN);
4046  value = MIN(value, SCIP_REAL_MAX);
4047  SCIP_CALL_QUIET( paramCheckReal(param, messagehdlr, value) );
4048 
4049  /* set the parameter's current value */
4050  if( param->data.realparam.valueptr != NULL )
4051  *param->data.realparam.valueptr = value;
4052  else
4053  param->data.realparam.curvalue = value;
4054 
4055  /* call the parameter's change information method */
4056  if( param->paramchgd != NULL && set != NULL )
4057  {
4058  SCIP_CALL( param->paramchgd(set->scip, param) );
4059  }
4060 
4061  if( !quiet )
4062  {
4063  SCIP_CALL( paramWrite(param, messagehdlr, NULL, FALSE, TRUE) );
4064  }
4065 
4066  return SCIP_OKAY;
4067 }
4068 
4069 /** sets value of char parameter */
4071  SCIP_PARAM* param, /**< parameter */
4072  SCIP_SET* set, /**< global SCIP settings, or NULL if param change method should not be called */
4073  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4074  char value, /**< new value of the parameter */
4075  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4076  )
4077 {
4078  assert(param != NULL);
4079 
4080  /* check, if value is possible for the parameter and the parameter is not fixed */
4081  SCIP_CALL_QUIET( paramCheckChar(param, messagehdlr, value) );
4082 
4083  /* set the parameter's current value */
4084  if( param->data.charparam.valueptr != NULL )
4085  *param->data.charparam.valueptr = value;
4086  else
4087  param->data.charparam.curvalue = value;
4088 
4089  /* call the parameter's change information method */
4090  if( param->paramchgd != NULL && set != NULL )
4091  {
4092  SCIP_CALL( param->paramchgd(set->scip, param) );
4093  }
4094 
4095  if( !quiet )
4096  {
4097  SCIP_CALL( paramWrite(param, messagehdlr, NULL, FALSE, TRUE) );
4098  }
4099 
4100  return SCIP_OKAY;
4101 }
4102 
4103 /** sets value of string parameter */
4105  SCIP_PARAM* param, /**< parameter */
4106  SCIP_SET* set, /**< global SCIP settings, or NULL if param change method should not be called */
4107  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4108  const char* value, /**< new value of the parameter */
4109  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4110  )
4111 {
4112  assert(param != NULL);
4113 
4114  /* check, if value is possible for the parameter and the parameter is not fixed */
4115  SCIP_CALL_QUIET( paramCheckString(param, messagehdlr, value) );
4116 
4117  /* set the parameter's current value */
4118  if( param->data.stringparam.valueptr != NULL )
4119  {
4121  SCIP_ALLOC( BMSduplicateMemoryArray(param->data.stringparam.valueptr, value, strlen(value)+1) );
4122  }
4123  else
4124  {
4126  SCIP_ALLOC( BMSduplicateMemoryArray(&param->data.stringparam.curvalue, value, strlen(value)+1) );
4127  }
4128 
4129  /* call the parameter's change information method */
4130  if( param->paramchgd != NULL && set != NULL )
4131  {
4132  SCIP_CALL( param->paramchgd(set->scip, param) );
4133  }
4134 
4135  if( !quiet )
4136  {
4137  SCIP_CALL( paramWrite(param, messagehdlr, NULL, FALSE, TRUE) );
4138  }
4139 
4140  return SCIP_OKAY;
4141 }
4142 
4143 
4144 /** changes default value of SCIP_Bool parameter */
4146  SCIP_PARAM* param, /**< parameter */
4147  SCIP_Bool defaultvalue /**< new default value */
4148  )
4149 {
4150  assert(param != NULL);
4151  assert(param->paramtype == SCIP_PARAMTYPE_BOOL);
4152 
4153  param->data.boolparam.defaultvalue = defaultvalue;
4154 }
4155 
4156 /** changes default value of int parameter */
4158  SCIP_PARAM* param, /**< parameter */
4159  int defaultvalue /**< new default value */
4160  )
4161 {
4162  assert(param != NULL);
4163  assert(param->paramtype == SCIP_PARAMTYPE_INT);
4164 
4165  assert(param->data.intparam.minvalue <= defaultvalue && param->data.intparam.maxvalue >= defaultvalue);
4166 
4167  param->data.intparam.defaultvalue = defaultvalue;
4168 }
4169 
4170 /** sets the parameter to its default setting */
4172  SCIP_PARAM* param, /**< parameter */
4173  SCIP_SET* set, /**< global SCIP settings */
4174  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
4175  )
4176 {
4177  assert(param != NULL);
4178 
4179  /* do not change the parameter if it is fixed */
4180  if( SCIPparamIsFixed(param) )
4181  {
4182  SCIPdebugMessage("parameter <%s> is fixed and is not reset to its default value.\n", param->name);
4183 
4184  return SCIP_OKAY;
4185  }
4186 
4187  switch( param->paramtype )
4188  {
4189  case SCIP_PARAMTYPE_BOOL:
4190  SCIP_CALL( SCIPparamSetBool(param, set, messagehdlr, SCIPparamGetBoolDefault(param), TRUE) );
4191  break;
4192 
4193  case SCIP_PARAMTYPE_INT:
4194  SCIP_CALL( SCIPparamSetInt(param, set, messagehdlr, SCIPparamGetIntDefault(param), TRUE) );
4195  break;
4196 
4198  SCIP_CALL( SCIPparamSetLongint(param, set, messagehdlr, SCIPparamGetLongintDefault(param), TRUE) );
4199  break;
4200 
4201  case SCIP_PARAMTYPE_REAL:
4202  SCIP_CALL( SCIPparamSetReal(param, set, messagehdlr, SCIPparamGetRealDefault(param), TRUE) );
4203  break;
4204 
4205  case SCIP_PARAMTYPE_CHAR:
4206  SCIP_CALL( SCIPparamSetChar(param, set, messagehdlr, SCIPparamGetCharDefault(param), TRUE) );
4207  break;
4208 
4209  case SCIP_PARAMTYPE_STRING:
4210  SCIP_CALL( SCIPparamSetString(param, set, messagehdlr, SCIPparamGetStringDefault(param), TRUE) );
4211  break;
4212 
4213  default:
4214  SCIPerrorMessage("unknown parameter type\n");
4215  return SCIP_INVALIDDATA;
4216  }
4217 
4218  return SCIP_OKAY;
4219 }
SCIP_INTPARAM intparam
SCIP_RETCODE SCIPparamsetFix(SCIP_PARAMSET *paramset, const char *name, SCIP_Bool fixed)
Definition: paramset.c:1896
SCIP_RETCODE SCIPparamsetAddChar(SCIP_PARAMSET *paramset, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, char *valueptr, SCIP_Bool isadvanced, char defaultvalue, const char *allowedvalues, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: paramset.c:1596
enum SCIP_ParamType SCIP_PARAMTYPE
Definition: type_paramset.h:45
SCIP_PARAM ** params
SCIP_RETCODE SCIPparamsetWrite(SCIP_PARAMSET *paramset, SCIP_MESSAGEHDLR *messagehdlr, const char *filename, SCIP_Bool comments, SCIP_Bool onlychanged)
Definition: paramset.c:2436
static SCIP_RETCODE paramsetSetPresolvingFast(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:2930
#define NEXPENSIVEHEURFREQS
static void paramFree(SCIP_PARAM **param, BMS_BLKMEM *blkmem)
Definition: paramset.c:1180
#define BMSfreeMemoryArrayNull(ptr)
Definition: memory.h:122
SCIP_Longint defaultvalue
const char * SCIPheurGetName(SCIP_HEUR *heur)
Definition: heur.c:591
SCIP_PARAMDATA * SCIPparamGetData(SCIP_PARAM *param)
Definition: paramset.c:663
void SCIPparamSetDefaultBool(SCIP_PARAM *param, SCIP_Bool defaultvalue)
Definition: paramset.c:4145
SCIP_RETCODE SCIPparamSetInt(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, int value, SCIP_Bool quiet)
Definition: paramset.c:3966
static const char * paramtypeGetName(SCIP_PARAMTYPE paramtype)
Definition: paramset.c:1653
#define SCIP_MAXSTRLEN
Definition: def.h:196
static SCIP_RETCODE paramCheckString(SCIP_PARAM *param, SCIP_MESSAGEHDLR *messagehdlr, const char *value)
Definition: paramset.c:204
SCIP_RETCODE SCIPparamsetSetToDefault(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *paramname)
Definition: paramset.c:2522
SCIP_HASHTABLE * hashtable
char SCIPparamGetChar(SCIP_PARAM *param)
Definition: paramset.c:859
#define NULL
Definition: lpi_spx.cpp:129
int nprops
Definition: struct_set.h:97
struct SCIP_ParamData SCIP_PARAMDATA
Definition: type_paramset.h:73
static SCIP_RETCODE paramSetBool(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *paramname, SCIP_Bool value, SCIP_Bool quiet)
Definition: paramset.c:328
SCIP_Real curvalue
SCIP_BOOLPARAM boolparam
SCIP_Longint minvalue
#define SCIP_SUBVERSION
Definition: def.h:85
SCIP_RETCODE SCIPparamsetSetSeparating(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: paramset.c:3787
static SCIP_RETCODE paramsetSetPresolvingAggressive(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:2860
static SCIP_RETCODE paramCreate(SCIP_PARAM **param, BMS_BLKMEM *blkmem, const char *name, const char *desc, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata, SCIP_Bool isadvanced)
Definition: paramset.c:955
SCIP_Bool SCIPsepaUsesSubscip(SCIP_SEPA *sepa)
Definition: sepa.c:708
static SCIP_RETCODE paramCheckInt(SCIP_PARAM *param, SCIP_MESSAGEHDLR *messagehdlr, int value)
Definition: paramset.c:97
SCIP_CHARPARAM charparam
union SCIP_Param::@8 data
const char * SCIPpresolGetName(SCIP_PRESOL *presol)
Definition: presol.c:551
#define FALSE
Definition: def.h:52
SCIP_SEPA ** sepas
Definition: struct_set.h:70
SCIP_PROP * SCIPsetFindProp(SCIP_SET *set, const char *name)
Definition: set.c:3304
SCIP_Longint curvalue
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:7579
#define TRUE
Definition: def.h:51
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_PRESOL * SCIPsetFindPresol(SCIP_SET *set, const char *name)
Definition: set.c:3082
SCIP_PARAM * SCIPparamsetGetParam(SCIP_PARAMSET *paramset, const char *name)
Definition: paramset.c:1692
static SCIP_RETCODE paramParseChar(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, char *valuestr)
Definition: paramset.c:1340
const char * SCIPparamGetName(SCIP_PARAM *param)
Definition: paramset.c:643
SCIP_LONGINTPARAM longintparam
SCIP_RETCODE SCIPparamsetSetToDefaults(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: paramset.c:2504
int nheurs
Definition: struct_set.h:99
SCIP_Bool SCIPparamIsDefault(SCIP_PARAM *param)
Definition: paramset.c:920
#define SCIPdebugMessage
Definition: pub_message.h:77
SCIP_Real SCIPparamGetRealDefault(SCIP_PARAM *param)
Definition: paramset.c:848
internal methods for handling parameter settings
SCIP_PRESOL ** presols
Definition: struct_set.h:68
datastructures for handling parameter settings
#define BMSfreeMemory(ptr)
Definition: memory.h:117
const char * SCIPsepaGetName(SCIP_SEPA *sepa)
Definition: sepa.c:633
SCIP_Real SCIPparamGetReal(SCIP_PARAM *param)
Definition: paramset.c:812
SCIP_Real SCIPsetCeil(SCIP_SET *set, SCIP_Real val)
Definition: set.c:4837
SCIP_Longint * valueptr
static SCIP_RETCODE paramSetInt(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *paramname, int value, SCIP_Bool quiet)
Definition: paramset.c:400
SCIP * scip
Definition: struct_set.h:58
enum SCIP_ParamSetting SCIP_PARAMSETTING
Definition: type_paramset.h:56
SCIP_RETCODE SCIPhashtableCreate(SCIP_HASHTABLE **hashtable, BMS_BLKMEM *blkmem, int tablesize, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr)
Definition: misc.c:1287
SCIP_RETCODE SCIPparamSetLongint(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Longint value, SCIP_Bool quiet)
Definition: paramset.c:4000
#define SCIP_REAL_FORMAT
Definition: def.h:126
static SCIP_RETCODE paramCopyBool(SCIP_PARAM *sourceparam, SCIP_PARAM *targetparam, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: paramset.c:508
SCIP_STRINGPARAM stringparam
SCIP_Longint SCIPparamGetLongint(SCIP_PARAM *param)
Definition: paramset.c:765
static SCIP_RETCODE paramCopyChar(SCIP_PARAM *sourceparam, SCIP_PARAM *targetparam, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: paramset.c:592
char * SCIPparamGetString(SCIP_PARAM *param)
Definition: paramset.c:895
SCIP_RETCODE SCIPparamsetSetToSubscipsOff(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:3622
SCIP_CONSHDLR * SCIPsetFindConshdlr(SCIP_SET *set, const char *name)
Definition: set.c:2965
SCIP_RETCODE SCIPparamsetGetInt(SCIP_PARAMSET *paramset, const char *name, int *value)
Definition: paramset.c:1736
#define BMSfreeMemoryArray(ptr)
Definition: memory.h:120
SCIP_RETCODE SCIPparamSetBool(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool value, SCIP_Bool quiet)
Definition: paramset.c:3932
SCIP_Bool curvalue
#define SCIPerrorMessage
Definition: pub_message.h:45
SCIP_RETCODE SCIPparamsetSetReal(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_Real value)
Definition: paramset.c:2146
static SCIP_RETCODE paramParseReal(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, char *valuestr)
Definition: paramset.c:1311
static SCIP_RETCODE paramParseLongint(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, char *valuestr)
Definition: paramset.c:1282
SCIP_RETCODE SCIPparamsetSetDefaultInt(SCIP_PARAMSET *paramset, const char *name, int defaultvalue)
Definition: paramset.c:2081
SCIP_RETCODE SCIPparamsetGetBool(SCIP_PARAMSET *paramset, const char *name, SCIP_Bool *value)
Definition: paramset.c:1704
unsigned int isadvanced
SCIP_RETCODE SCIPparamSetChar(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, char value, SCIP_Bool quiet)
Definition: paramset.c:4070
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:3873
static SCIP_RETCODE paramsetSetHeuristicsOff(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:2738
SCIP_Bool SCIPparamIsFixed(SCIP_PARAM *param)
Definition: paramset.c:683
SCIP_CONSHDLR ** conshdlrs
Definition: struct_set.h:63
static SCIP_RETCODE paramsetSetPresolvingDefault(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:2776
SCIP_RETCODE SCIPparamSetString(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *value, SCIP_Bool quiet)
Definition: paramset.c:4104
SCIP_Bool * valueptr
SCIP_RETCODE SCIPparamsetGetLongint(SCIP_PARAMSET *paramset, const char *name, SCIP_Longint *value)
Definition: paramset.c:1768
SCIP_RETCODE SCIPparamsetCreate(SCIP_PARAMSET **paramset, BMS_BLKMEM *blkmem)
Definition: paramset.c:1406
#define SCIP_DECL_PARAMCHGD(x)
Definition: type_paramset.h:88
void SCIPmessagePrintWarning(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...)
Definition: message.c:411
SCIP_RETCODE SCIPparamsetSetEmphasis(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMEMPHASIS paramemphasis, SCIP_Bool quiet)
Definition: paramset.c:3456
SCIP_RETCODE SCIPparamsetAddLongint(SCIP_PARAMSET *paramset, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, SCIP_Longint *valueptr, SCIP_Bool isadvanced, SCIP_Longint defaultvalue, SCIP_Longint minvalue, SCIP_Longint maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: paramset.c:1536
SCIP_RETCODE SCIPparamsetAddString(SCIP_PARAMSET *paramset, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, char **valueptr, SCIP_Bool isadvanced, const char *defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: paramset.c:1625
static SCIP_RETCODE paramCopyReal(SCIP_PARAM *sourceparam, SCIP_PARAM *targetparam, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: paramset.c:571
SCIP_SEPA * SCIPsetFindSepa(SCIP_SET *set, const char *name)
Definition: set.c:3230
internal methods for global SCIP settings
#define SCIP_CALL(x)
Definition: def.h:258
static SCIP_RETCODE paramsetSetSeparatingOff(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:3399
SCIP_Real maxvalue
SCIP_RETCODE SCIPparamsetSetHeuristics(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: paramset.c:3715
static SCIP_RETCODE paramWrite(SCIP_PARAM *param, SCIP_MESSAGEHDLR *messagehdlr, FILE *file, SCIP_Bool comments, SCIP_Bool onlychanged)
Definition: paramset.c:237
int SCIPparamsetGetNParams(SCIP_PARAMSET *paramset)
Definition: paramset.c:3828
int nsepas
Definition: struct_set.h:95
static SCIP_RETCODE paramCreateString(SCIP_PARAM **param, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, char **valueptr, SCIP_Bool isadvanced, const char *defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: paramset.c:1148
#define BMSduplicateMemoryArray(ptr, source, num)
Definition: memory.h:111
#define BMSfreeBlockMemory(mem, ptr)
Definition: memory.h:417
static SCIP_RETCODE paramCopyLongint(SCIP_PARAM *sourceparam, SCIP_PARAM *targetparam, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: paramset.c:550
SCIP_Bool SCIPheurUsesSubscip(SCIP_HEUR *heur)
Definition: heur.c:642
static SCIP_RETCODE paramsetSetHeuristicsFast(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:2697
SCIP_PARAMTYPE SCIPparamGetType(SCIP_PARAM *param)
Definition: paramset.c:633
SCIP_RETCODE SCIPparamSetReal(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Real value, SCIP_Bool quiet)
Definition: paramset.c:4034
#define SCIP_Bool
Definition: def.h:49
unsigned int isfixed
static SCIP_RETCODE paramSetReal(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *paramname, SCIP_Real value, SCIP_Bool quiet)
Definition: paramset.c:472
static SCIP_RETCODE paramParseBool(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, char *valuestr)
Definition: paramset.c:1222
static SCIP_RETCODE paramsetSetSeparatingFast(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:3338
SCIP_RETCODE SCIPparamsetSetInt(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, int value)
Definition: paramset.c:2047
static SCIP_RETCODE paramCheckFixed(SCIP_PARAM *param, SCIP_MESSAGEHDLR *messagehdlr)
Definition: paramset.c:55
void SCIPprintSysError(const char *message)
Definition: misc.c:7515
static const char * paramname[]
Definition: lpi_msk.c:4129
SCIP_RETCODE SCIPparamsetGetReal(SCIP_PARAMSET *paramset, const char *name, SCIP_Real *value)
Definition: paramset.c:1800
SCIP_HEUR ** heurs
Definition: struct_set.h:72
#define MAX(x, y)
Definition: tclique_def.h:75
SCIP_RETCODE SCIPparamsetSetDefaultBool(SCIP_PARAMSET *paramset, const char *name, SCIP_Bool defaultvalue)
Definition: paramset.c:2016
static SCIP_RETCODE paramCreateLongint(SCIP_PARAM **param, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, SCIP_Longint *valueptr, SCIP_Bool isadvanced, SCIP_Longint defaultvalue, SCIP_Longint minvalue, SCIP_Longint maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: paramset.c:1046
SCIP_RETCODE SCIPparamsetGetString(SCIP_PARAMSET *paramset, const char *name, char **value)
Definition: paramset.c:1864
SCIP_RETCODE SCIPparamsetSetBool(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_Bool value)
Definition: paramset.c:1982
SCIP_RETCODE SCIPhashtableSafeInsert(SCIP_HASHTABLE *hashtable, void *element)
Definition: misc.c:1415
static SCIP_DECL_HASHGETKEY(hashGetKeyParam)
Definition: paramset.c:43
SCIP_RETCODE SCIPparamsetCopyParams(SCIP_PARAMSET *sourceparamset, SCIP_PARAMSET *targetparamset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: paramset.c:3838
SCIP_Real * valueptr
SCIP_RETCODE SCIPparamsetSetPresolving(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: paramset.c:3751
static SCIP_RETCODE paramSetLongint(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *paramname, SCIP_Longint value, SCIP_Bool quiet)
Definition: paramset.c:436
SCIP_HEUR * SCIPsetFindHeur(SCIP_SET *set, const char *name)
Definition: set.c:3396
static SCIP_RETCODE paramsetSetPresolvingOff(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:3013
SCIP_Bool SCIPparamGetBool(SCIP_PARAM *param)
Definition: paramset.c:693
void * SCIPhashtableRetrieve(SCIP_HASHTABLE *hashtable, void *key)
Definition: misc.c:1434
SCIP_RETCODE SCIPparamsetAddInt(SCIP_PARAMSET *paramset, 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: paramset.c:1506
static SCIP_RETCODE paramCreateReal(SCIP_PARAM **param, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: paramset.c:1079
int SCIPparamGetIntMax(SCIP_PARAM *param)
Definition: paramset.c:743
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
Definition: misc.c:1317
#define SCIP_HASHSIZE_PARAMS
Definition: def.h:202
enum SCIP_ParamEmphasis SCIP_PARAMEMPHASIS
Definition: type_paramset.h:70
#define SCIP_REAL_MAX
Definition: def.h:124
int SCIPparamGetInt(SCIP_PARAM *param)
Definition: paramset.c:718
SCIP_RETCODE SCIPparamsetSetString(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, const char *value)
Definition: paramset.c:2214
static SCIP_RETCODE paramCopyString(SCIP_PARAM *sourceparam, SCIP_PARAM *targetparam, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: paramset.c:613
#define SCIP_CALL_QUIET(x)
Definition: def.h:233
#define SCIP_REAL_MIN
Definition: def.h:125
static SCIP_RETCODE paramsetSetHeuristicsDefault(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:2546
static SCIP_RETCODE paramSetChar(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *paramname, char value, SCIP_Bool quiet)
Definition: paramset.c:364
#define SCIP_VERSION
Definition: def.h:84
static SCIP_RETCODE paramParseInt(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, char *valuestr)
Definition: paramset.c:1253
static SCIP_RETCODE paramCreateChar(SCIP_PARAM **param, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, char *valueptr, SCIP_Bool isadvanced, char defaultvalue, const char *allowedvalues, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: paramset.c:1112
static SCIP_RETCODE paramCopyInt(SCIP_PARAM *sourceparam, SCIP_PARAM *targetparam, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: paramset.c:529
char * SCIPparamGetCharAllowedValues(SCIP_PARAM *param)
Definition: paramset.c:873
static SCIP_RETCODE paramCheckReal(SCIP_PARAM *param, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Real value)
Definition: paramset.c:143
SCIP_RETCODE SCIPparamsetAddReal(SCIP_PARAMSET *paramset, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: paramset.c:1566
SCIP_PARAMTYPE paramtype
SCIP_PROP ** props
Definition: struct_set.h:71
SCIP_Bool defaultvalue
SCIP_PARAMDATA * paramdata
void SCIPmessageFPrintInfo(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *formatstr,...)
Definition: message.c:602
SCIP_Longint SCIPparamGetLongintMax(SCIP_PARAM *param)
Definition: paramset.c:790
static SCIP_RETCODE paramCheckBool(SCIP_PARAM *param, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool value)
Definition: paramset.c:74
const char * SCIPparamGetDesc(SCIP_PARAM *param)
Definition: paramset.c:653
SCIP_Real defaultvalue
#define SCIP_Real
Definition: def.h:123
#define MIN(x, y)
Definition: memory.c:59
SCIP_Longint SCIPparamGetLongintDefault(SCIP_PARAM *param)
Definition: paramset.c:801
int SCIPparamGetIntMin(SCIP_PARAM *param)
Definition: paramset.c:732
void SCIPparamsetFree(SCIP_PARAMSET **paramset, BMS_BLKMEM *blkmem)
Definition: paramset.c:1426
int SCIPparamGetIntDefault(SCIP_PARAM *param)
Definition: paramset.c:754
SCIP_Longint maxvalue
SCIP_RETCODE SCIPparamsetRead(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *filename)
Definition: paramset.c:2387
#define BMSallocMemory(ptr)
Definition: memory.h:92
#define BMSreallocMemoryArray(ptr, num)
Definition: memory.h:80
char * SCIPparamGetStringDefault(SCIP_PARAM *param)
Definition: paramset.c:909
SCIP_RETCODE SCIPparamSetToDefault(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: paramset.c:4171
SCIP_RETCODE SCIPparamsetSetLongint(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_Longint value)
Definition: paramset.c:2112
static SCIP_RETCODE paramsetSetHeuristicsAggressive(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:2594
SCIP_RETCODE SCIPparamsetSetChar(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, char value)
Definition: paramset.c:2180
static SCIP_RETCODE paramsetSetSeparatingAggressive(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:3164
#define SCIP_Longint
Definition: def.h:107
SCIP_Bool SCIPparamsetIsFixed(SCIP_PARAMSET *paramset, const char *name)
Definition: paramset.c:1670
SCIP_RETCODE SCIPparamsetGetChar(SCIP_PARAMSET *paramset, const char *name, char *value)
Definition: paramset.c:1832
SCIP_Real SCIPparamGetRealMin(SCIP_PARAM *param)
Definition: paramset.c:826
static SCIP_RETCODE paramsetSetSeparatingDefault(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:3088
SCIP_PARAM ** SCIPparamsetGetParams(SCIP_PARAMSET *paramset)
Definition: paramset.c:3818
static SCIP_RETCODE paramCreateInt(SCIP_PARAM **param, 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: paramset.c:1013
#define BMSallocBlockMemory(mem, ptr)
Definition: memory.h:404
SCIP_Bool SCIPparamGetBoolDefault(SCIP_PARAM *param)
Definition: paramset.c:707
int nconshdlrs
Definition: struct_set.h:87
static SCIP_RETCODE paramParseString(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, char *valuestr)
Definition: paramset.c:1369
static SCIP_RETCODE paramsetParse(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, char *line)
Definition: paramset.c:2249
SCIP_RETCODE SCIPparamsetAddBool(SCIP_PARAMSET *paramset, 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: paramset.c:1479
static SCIP_RETCODE paramCheckLongint(SCIP_PARAM *param, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Longint value)
Definition: paramset.c:120
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:371
static SCIP_RETCODE paramCreateBool(SCIP_PARAM **param, 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: paramset.c:984
SCIP_Longint SCIPparamGetLongintMin(SCIP_PARAM *param)
Definition: paramset.c:779
SCIP_Bool SCIPparamIsAdvanced(SCIP_PARAM *param)
Definition: paramset.c:673
void SCIPparamSetDefaultInt(SCIP_PARAM *param, int defaultvalue)
Definition: paramset.c:4157
int npresols
Definition: struct_set.h:91
#define SCIP_ALLOC(x)
Definition: def.h:269
#define SCIPABORT()
Definition: def.h:230
static SCIP_RETCODE paramsetAdd(SCIP_PARAMSET *paramset, SCIP_PARAM *param)
Definition: paramset.c:1451
char SCIPparamGetCharDefault(SCIP_PARAM *param)
Definition: paramset.c:884
static SCIP_RETCODE paramCheckChar(SCIP_PARAM *param, SCIP_MESSAGEHDLR *messagehdlr, char value)
Definition: paramset.c:166
SCIP_REALPARAM realparam
#define EPSZ(x, eps)
Definition: def.h:152
const char * SCIPpropGetName(SCIP_PROP *prop)
Definition: prop.c:872
SCIP_Real SCIPparamGetRealMax(SCIP_PARAM *param)
Definition: paramset.c:837
SCIP callable library.
void SCIPparamSetFixed(SCIP_PARAM *param, SCIP_Bool fixed)
Definition: paramset.c:3921
SCIP_Real minvalue
SCIP_RETCODE SCIPparamsetSet(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, void *value)
Definition: paramset.c:1920