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