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