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