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-2018 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  if( sscanf(valuestr, "%d", &value) == 1 )
1266  {
1267  SCIP_CALL( SCIPparamSetInt(param, set, messagehdlr, value, FALSE, TRUE) );
1268  }
1269  else
1270  {
1271  SCIPerrorMessage("invalid parameter value <%s> for int parameter <%s>\n", valuestr, param->name);
1272  return SCIP_READERROR;
1273  }
1274 
1275  return SCIP_OKAY;
1276 }
1277 
1278 /** sets SCIP_Longint parameter according to the value of the given string */
1279 static
1281  SCIP_PARAM* param, /**< parameter */
1282  SCIP_SET* set, /**< global SCIP settings */
1283  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1284  char* valuestr /**< value in string format (may be modified during parse) */
1285  )
1286 {
1287  SCIP_Longint value;
1288 
1289  assert(param != NULL);
1290  assert(param->paramtype == SCIP_PARAMTYPE_LONGINT);
1291  assert(set != NULL);
1292  assert(valuestr != NULL);
1293 
1294  if( sscanf(valuestr, "%" SCIP_LONGINT_FORMAT, &value) == 1 )
1295  {
1296  SCIP_CALL( SCIPparamSetLongint(param, set, messagehdlr, value, FALSE, TRUE) );
1297  }
1298  else
1299  {
1300  SCIPerrorMessage("invalid parameter value <%s> for SCIP_Longint parameter <%s>\n", valuestr, param->name);
1301  return SCIP_READERROR;
1302  }
1303 
1304  return SCIP_OKAY;
1305 }
1306 
1307 /** sets SCIP_Real parameter according to the value of the given string */
1308 static
1310  SCIP_PARAM* param, /**< parameter */
1311  SCIP_SET* set, /**< global SCIP settings */
1312  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1313  char* valuestr /**< value in string format (may be modified during parse) */
1314  )
1315 {
1316  SCIP_Real value;
1317 
1318  assert(param != NULL);
1319  assert(param->paramtype == SCIP_PARAMTYPE_REAL);
1320  assert(set != NULL);
1321  assert(valuestr != NULL);
1322 
1323  if( sscanf(valuestr, "%" SCIP_REAL_FORMAT, &value) == 1 )
1324  {
1325  SCIP_CALL( SCIPparamSetReal(param, set, messagehdlr, value, FALSE, TRUE) );
1326  }
1327  else
1328  {
1329  SCIPerrorMessage("invalid parameter value <%s> for SCIP_Real parameter <%s>\n", valuestr, param->name);
1330  return SCIP_READERROR;
1331  }
1332 
1333  return SCIP_OKAY;
1334 }
1335 
1336 /** sets Char parameter according to the value of the given string */
1337 static
1339  SCIP_PARAM* param, /**< parameter */
1340  SCIP_SET* set, /**< global SCIP settings */
1341  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1342  char* valuestr /**< value in string format (may be modified during parse) */
1343  )
1344 {
1345  char value;
1346 
1347  assert(param != NULL);
1348  assert(param->paramtype == SCIP_PARAMTYPE_CHAR);
1349  assert(set != NULL);
1350  assert(valuestr != NULL);
1351 
1352  if( sscanf(valuestr, "%c", &value) == 1 )
1353  {
1354  SCIP_CALL( SCIPparamSetChar(param, set, messagehdlr, value, FALSE, TRUE) );
1355  }
1356  else
1357  {
1358  SCIPerrorMessage("invalid parameter value <%s> for char parameter <%s>\n", valuestr, param->name);
1359  return SCIP_READERROR;
1360  }
1361 
1362  return SCIP_OKAY;
1363 }
1364 
1365 /** sets string parameter according to the value of the given string */
1366 static
1368  SCIP_PARAM* param, /**< parameter */
1369  SCIP_SET* set, /**< global SCIP settings */
1370  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1371  char* valuestr /**< value in string format (may be modified during parse) */
1372  )
1373 {
1374  unsigned int len;
1375 
1376  assert(param != NULL);
1377  assert(param->paramtype == SCIP_PARAMTYPE_STRING);
1378  assert(set != NULL);
1379  assert(valuestr != NULL);
1380 
1381  /* check for quotes */
1382  len = (unsigned int) strlen(valuestr);
1383  if( len <= 1 || valuestr[0] != '"' || valuestr[len-1] != '"' )
1384  {
1385  SCIPerrorMessage("invalid parameter value <%s> for string parameter <%s> (string has to be in double quotes)\n",
1386  valuestr, param->name);
1387  return SCIP_READERROR;
1388  }
1389 
1390  /* remove the quotes */
1391  valuestr[len-1] = '\0';
1392  valuestr++;
1393  SCIP_CALL( SCIPparamSetString(param, set, messagehdlr, valuestr, TRUE) );
1394 
1395  return SCIP_OKAY;
1396 }
1397 
1398 
1399 /*
1400  * Parameter set methods
1401  */
1402 
1403 /** creates parameter set */
1405  SCIP_PARAMSET** paramset, /**< pointer to store the parameter set */
1406  BMS_BLKMEM* blkmem /**< block memory */
1407  )
1408 {
1409  assert(paramset != NULL);
1410 
1411  SCIP_ALLOC( BMSallocMemory(paramset) );
1412 
1413  SCIP_CALL( SCIPhashtableCreate(&(*paramset)->hashtable, blkmem, SCIP_HASHSIZE_PARAMS,
1414  hashGetKeyParam, SCIPhashKeyEqString, SCIPhashKeyValString, NULL) );
1415 
1416  (*paramset)->params = NULL;
1417  (*paramset)->nparams = 0;
1418  (*paramset)->paramssize = 0;
1419 
1420  return SCIP_OKAY;
1421 }
1422 
1423 /** frees parameter set */
1425  SCIP_PARAMSET** paramset, /**< pointer to the parameter set */
1426  BMS_BLKMEM* blkmem /**< block memory */
1427  )
1428 {
1429  int i;
1430 
1431  assert(paramset != NULL);
1432  assert(*paramset != NULL);
1433  assert((*paramset)->paramssize == 0 || (*paramset)->params != NULL);
1434  assert((*paramset)->paramssize >= (*paramset)->nparams);
1435 
1436  for( i = (*paramset)->nparams - 1; i >= 0; --i )
1437  {
1438  paramFree(&(*paramset)->params[i], blkmem);
1439  }
1440 
1441  SCIPhashtableFree(&(*paramset)->hashtable);
1442 
1443  BMSfreeMemoryArrayNull(&(*paramset)->params);
1444  BMSfreeMemory(paramset);
1445 }
1446 
1447 /** adds parameter to the parameter set */
1448 static
1450  SCIP_PARAMSET* paramset, /**< parameter set */
1451  SCIP_PARAM* param /**< parameter to add */
1452  )
1453 {
1454  assert(paramset != NULL);
1455  assert(param != NULL);
1456 
1457  /* insert the parameter name to the hash table */
1458  SCIP_CALL( SCIPhashtableSafeInsert(paramset->hashtable, (void*)param) );
1459 
1460  /* ensure, that there is enough space in the params array */
1461  if( paramset->nparams >= paramset->paramssize )
1462  {
1463  paramset->paramssize *= 2;
1464  paramset->paramssize = MAX(paramset->paramssize, paramset->nparams+1);
1465  SCIP_ALLOC( BMSreallocMemoryArray(&paramset->params, paramset->paramssize) );
1466  }
1467  assert(paramset->nparams < paramset->paramssize);
1468 
1469  /* insert parameter in the params array */
1470  paramset->params[paramset->nparams] = param;
1471  paramset->nparams++;
1472 
1473  return SCIP_OKAY;
1474 }
1475 
1476 /** creates a SCIP_Bool parameter, sets it to its default value, and adds it to the parameter set */
1478  SCIP_PARAMSET* paramset, /**< parameter set */
1479  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1480  BMS_BLKMEM* blkmem, /**< block memory */
1481  const char* name, /**< name of the parameter */
1482  const char* desc, /**< description of the parameter */
1483  SCIP_Bool* valueptr, /**< pointer to store the current parameter value, or NULL */
1484  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
1485  SCIP_Bool defaultvalue, /**< default value of the parameter */
1486  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
1487  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
1488  )
1489 {
1490  SCIP_PARAM* param;
1491 
1492  assert(paramset != NULL);
1493 
1494  /* create the parameter */
1495  SCIP_CALL( paramCreateBool(&param, messagehdlr, blkmem, name, desc, valueptr, isadvanced, defaultvalue, paramchgd, paramdata) );
1496 
1497  /* add parameter to the parameter set */
1498  SCIP_CALL( paramsetAdd(paramset, param) );
1499 
1500  return SCIP_OKAY;
1501 }
1502 
1503 /** creates a int parameter, sets it to its default value, and adds it to the parameter set */
1505  SCIP_PARAMSET* paramset, /**< parameter set */
1506  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1507  BMS_BLKMEM* blkmem, /**< block memory */
1508  const char* name, /**< name of the parameter */
1509  const char* desc, /**< description of the parameter */
1510  int* valueptr, /**< pointer to store the current parameter value, or NULL */
1511  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
1512  int defaultvalue, /**< default value of the parameter */
1513  int minvalue, /**< minimum value for parameter */
1514  int maxvalue, /**< maximum value for parameter */
1515  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
1516  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
1517  )
1518 {
1519  SCIP_PARAM* param;
1520 
1521  assert(paramset != NULL);
1522 
1523  /* create the parameter */
1524  SCIP_CALL( paramCreateInt(&param, messagehdlr, blkmem, name, desc, valueptr, isadvanced, defaultvalue, minvalue, maxvalue,
1525  paramchgd, paramdata) );
1526 
1527  /* add parameter to the parameter set */
1528  SCIP_CALL( paramsetAdd(paramset, param) );
1529 
1530  return SCIP_OKAY;
1531 }
1532 
1533 /** creates a SCIP_Longint parameter, sets it to its default value, and adds it to the parameter set */
1535  SCIP_PARAMSET* paramset, /**< parameter set */
1536  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1537  BMS_BLKMEM* blkmem, /**< block memory */
1538  const char* name, /**< name of the parameter */
1539  const char* desc, /**< description of the parameter */
1540  SCIP_Longint* valueptr, /**< pointer to store the current parameter value, or NULL */
1541  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
1542  SCIP_Longint defaultvalue, /**< default value of the parameter */
1543  SCIP_Longint minvalue, /**< minimum value for parameter */
1544  SCIP_Longint maxvalue, /**< maximum value for parameter */
1545  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
1546  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
1547  )
1548 {
1549  SCIP_PARAM* param;
1550 
1551  assert(paramset != NULL);
1552 
1553  /* create the parameter */
1554  SCIP_CALL( paramCreateLongint(&param, messagehdlr, blkmem, name, desc, valueptr, isadvanced, defaultvalue, minvalue, maxvalue,
1555  paramchgd, paramdata) );
1556 
1557  /* add parameter to the parameter set */
1558  SCIP_CALL( paramsetAdd(paramset, param) );
1559 
1560  return SCIP_OKAY;
1561 }
1562 
1563 /** creates a SCIP_Real parameter, sets it to its default value, and adds it to the parameter set */
1565  SCIP_PARAMSET* paramset, /**< parameter set */
1566  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1567  BMS_BLKMEM* blkmem, /**< block memory */
1568  const char* name, /**< name of the parameter */
1569  const char* desc, /**< description of the parameter */
1570  SCIP_Real* valueptr, /**< pointer to store the current parameter value, or NULL */
1571  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
1572  SCIP_Real defaultvalue, /**< default value of the parameter */
1573  SCIP_Real minvalue, /**< minimum value for parameter */
1574  SCIP_Real maxvalue, /**< maximum value for parameter */
1575  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
1576  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
1577  )
1578 {
1579  SCIP_PARAM* param;
1580 
1581  assert(paramset != NULL);
1582 
1583  /* create the parameter */
1584  SCIP_CALL( paramCreateReal(&param, messagehdlr, blkmem, name, desc, valueptr, isadvanced, defaultvalue, minvalue, maxvalue,
1585  paramchgd, paramdata) );
1586 
1587  /* add parameter to the parameter set */
1588  SCIP_CALL( paramsetAdd(paramset, param) );
1589 
1590  return SCIP_OKAY;
1591 }
1592 
1593 /** creates a char parameter, sets it to its default value, and adds it to the parameter set */
1595  SCIP_PARAMSET* paramset, /**< parameter set */
1596  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1597  BMS_BLKMEM* blkmem, /**< block memory */
1598  const char* name, /**< name of the parameter */
1599  const char* desc, /**< description of the parameter */
1600  char* valueptr, /**< pointer to store the current parameter value, or NULL */
1601  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
1602  char defaultvalue, /**< default value of the parameter */
1603  const char* allowedvalues, /**< array with possible parameter values, or NULL if not restricted */
1604  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
1605  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
1606  )
1607 {
1608  SCIP_PARAM* param;
1609 
1610  assert(paramset != NULL);
1611 
1612  /* create the parameter */
1613  SCIP_CALL( paramCreateChar(&param, messagehdlr, blkmem, name, desc, valueptr, isadvanced, defaultvalue, allowedvalues,
1614  paramchgd, paramdata) );
1615 
1616  /* add parameter to the parameter set */
1617  SCIP_CALL( paramsetAdd(paramset, param) );
1618 
1619  return SCIP_OKAY;
1620 }
1621 
1622 /** creates a string parameter, sets it to its default value, and adds it to the parameter set */
1624  SCIP_PARAMSET* paramset, /**< parameter set */
1625  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1626  BMS_BLKMEM* blkmem, /**< block memory */
1627  const char* name, /**< name of the parameter */
1628  const char* desc, /**< description of the parameter */
1629  char** valueptr, /**< pointer to store the current parameter value, or NULL */
1630  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
1631  const char* defaultvalue, /**< default value of the parameter */
1632  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
1633  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
1634  )
1635 {
1636  SCIP_PARAM* param;
1637 
1638  assert(paramset != NULL);
1639 
1640  /* create the parameter */
1641  SCIP_CALL( paramCreateString(&param, messagehdlr, blkmem, name, desc, valueptr, isadvanced, defaultvalue, paramchgd, paramdata) );
1642 
1643  /* add parameter to the parameter set */
1644  SCIP_CALL( paramsetAdd(paramset, param) );
1645 
1646  return SCIP_OKAY;
1647 }
1648 
1649 /** returns the name of the given parameter type */
1650 static
1651 const char* paramtypeGetName(
1652  SCIP_PARAMTYPE paramtype /**< type of parameter */
1653  )
1654 {
1655  static const char* paramtypename[] = {
1656  "Bool", /* SCIP_PARAMTYPE_BOOL = 0 */
1657  "int", /* SCIP_PARAMTYPE_INT = 1 */
1658  "Longint", /* SCIP_PARAMTYPE_LONGINT = 2 */
1659  "Real", /* SCIP_PARAMTYPE_REAL = 3 */
1660  "char", /* SCIP_PARAMTYPE_CHAR = 4 */
1661  "string" /* SCIP_PARAMTYPE_STRING = 5 */
1662  };
1663 
1664  return paramtypename[(int)paramtype];
1665 }
1666 
1667 /** returns whether an existing parameter is fixed */
1669  SCIP_PARAMSET* paramset, /**< parameter set */
1670  const char* name /**< name of the parameter */
1671  )
1672 {
1673  SCIP_PARAM* param;
1674 
1675  assert(paramset != NULL);
1676 
1677  /* retrieve parameter from hash table */
1678  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1679  if( param == NULL )
1680  {
1681  SCIPerrorMessage("parameter <%s> unknown\n", name);
1682  SCIPABORT();
1683  return FALSE; /*lint !e527*/
1684  }
1685 
1686  return SCIPparamIsFixed(param);
1687 }
1688 
1689 /** returns the pointer to an existing SCIP parameter */
1691  SCIP_PARAMSET* paramset, /**< parameter set */
1692  const char* name /**< name of the parameter */
1693  )
1694 {
1695  assert(paramset != NULL);
1696 
1697  /* retrieve parameter from hash table and return it */
1698  return (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1699 }
1700 
1701 /** gets the value of an existing SCIP_Bool parameter */
1703  SCIP_PARAMSET* paramset, /**< parameter set */
1704  const char* name, /**< name of the parameter */
1705  SCIP_Bool* value /**< pointer to store the parameter */
1706  )
1707 {
1708  SCIP_PARAM* param;
1709 
1710  assert(paramset != NULL);
1711  assert(value != NULL);
1712 
1713  /* retrieve parameter from hash table */
1714  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1715  if( param == NULL )
1716  {
1717  SCIPerrorMessage("parameter <%s> unknown\n", name);
1718  return SCIP_PARAMETERUNKNOWN;
1719  }
1720  if( param->paramtype != SCIP_PARAMTYPE_BOOL )
1721  {
1722  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
1724  return SCIP_PARAMETERWRONGTYPE;
1725  }
1726 
1727  /* get the parameter's current value */
1728  *value = SCIPparamGetBool(param);
1729 
1730  return SCIP_OKAY;
1731 }
1732 
1733 /** gets the value of an existing int parameter */
1735  SCIP_PARAMSET* paramset, /**< parameter set */
1736  const char* name, /**< name of the parameter */
1737  int* value /**< pointer to store the parameter */
1738  )
1739 {
1740  SCIP_PARAM* param;
1741 
1742  assert(paramset != NULL);
1743  assert(value != NULL);
1744 
1745  /* retrieve parameter from hash table */
1746  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1747  if( param == NULL )
1748  {
1749  SCIPerrorMessage("parameter <%s> unknown\n", name);
1750  return SCIP_PARAMETERUNKNOWN;
1751  }
1752  if( param->paramtype != SCIP_PARAMTYPE_INT )
1753  {
1754  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
1756  return SCIP_PARAMETERWRONGTYPE;
1757  }
1758 
1759  /* get the parameter's current value */
1760  *value = SCIPparamGetInt(param);
1761 
1762  return SCIP_OKAY;
1763 }
1764 
1765 /** gets the value of an existing SCIP_Longint parameter */
1767  SCIP_PARAMSET* paramset, /**< parameter set */
1768  const char* name, /**< name of the parameter */
1769  SCIP_Longint* value /**< pointer to store the parameter */
1770  )
1771 {
1772  SCIP_PARAM* param;
1773 
1774  assert(paramset != NULL);
1775  assert(value != NULL);
1776 
1777  /* retrieve parameter from hash table */
1778  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1779  if( param == NULL )
1780  {
1781  SCIPerrorMessage("parameter <%s> unknown\n", name);
1782  return SCIP_PARAMETERUNKNOWN;
1783  }
1784  if( param->paramtype != SCIP_PARAMTYPE_LONGINT )
1785  {
1786  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
1788  return SCIP_PARAMETERWRONGTYPE;
1789  }
1790 
1791  /* get the parameter's current value */
1792  *value = SCIPparamGetLongint(param);
1793 
1794  return SCIP_OKAY;
1795 }
1796 
1797 /** gets the value of an existing SCIP_Real parameter */
1799  SCIP_PARAMSET* paramset, /**< parameter set */
1800  const char* name, /**< name of the parameter */
1801  SCIP_Real* value /**< pointer to store the parameter */
1802  )
1803 {
1804  SCIP_PARAM* param;
1805 
1806  assert(paramset != NULL);
1807  assert(value != NULL);
1808 
1809  /* retrieve parameter from hash table */
1810  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1811  if( param == NULL )
1812  {
1813  SCIPerrorMessage("parameter <%s> unknown\n", name);
1814  return SCIP_PARAMETERUNKNOWN;
1815  }
1816  if( param->paramtype != SCIP_PARAMTYPE_REAL )
1817  {
1818  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
1820  return SCIP_PARAMETERWRONGTYPE;
1821  }
1822 
1823  /* get the parameter's current value */
1824  *value = SCIPparamGetReal(param);
1825 
1826  return SCIP_OKAY;
1827 }
1828 
1829 /** gets the value of an existing char parameter */
1831  SCIP_PARAMSET* paramset, /**< parameter set */
1832  const char* name, /**< name of the parameter */
1833  char* value /**< pointer to store the parameter */
1834  )
1835 {
1836  SCIP_PARAM* param;
1837 
1838  assert(paramset != NULL);
1839  assert(value != NULL);
1840 
1841  /* retrieve parameter from hash table */
1842  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1843  if( param == NULL )
1844  {
1845  SCIPerrorMessage("parameter <%s> unknown\n", name);
1846  return SCIP_PARAMETERUNKNOWN;
1847  }
1848  if( param->paramtype != SCIP_PARAMTYPE_CHAR )
1849  {
1850  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
1852  return SCIP_PARAMETERWRONGTYPE;
1853  }
1854 
1855  /* get the parameter's current value */
1856  *value = SCIPparamGetChar(param);
1857 
1858  return SCIP_OKAY;
1859 }
1860 
1861 /** gets the value of an existing string parameter */
1863  SCIP_PARAMSET* paramset, /**< parameter set */
1864  const char* name, /**< name of the parameter */
1865  char** value /**< pointer to store the parameter */
1866  )
1867 {
1868  SCIP_PARAM* param;
1869 
1870  assert(paramset != NULL);
1871  assert(value != NULL);
1872 
1873  /* retrieve parameter from hash table */
1874  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1875  if( param == NULL )
1876  {
1877  SCIPerrorMessage("parameter <%s> unknown\n", name);
1878  return SCIP_PARAMETERUNKNOWN;
1879  }
1880  if( param->paramtype != SCIP_PARAMTYPE_STRING )
1881  {
1882  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
1884  return SCIP_PARAMETERWRONGTYPE;
1885  }
1886 
1887  /* get the parameter's current value */
1888  *value = SCIPparamGetString(param);
1889 
1890  return SCIP_OKAY;
1891 }
1892 
1893 /** changes the fixing status of an existing parameter */
1895  SCIP_PARAMSET* paramset, /**< parameter set */
1896  const char* name, /**< name of the parameter */
1897  SCIP_Bool fixed /**< new fixing status of the parameter */
1898  )
1899 {
1900  SCIP_PARAM* param;
1901 
1902  assert(paramset != NULL);
1903 
1904  /* retrieve parameter from hash table */
1905  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1906  if( param == NULL )
1907  {
1908  SCIPerrorMessage("parameter <%s> unknown\n", name);
1909  return SCIP_PARAMETERUNKNOWN;
1910  }
1911 
1912  SCIPparamSetFixed(param, fixed);
1913 
1914  return SCIP_OKAY;
1915 }
1916 
1917 /** changes the value of an existing parameter */
1919  SCIP_PARAMSET* paramset, /**< parameter set */
1920  SCIP_SET* set, /**< global SCIP settings */
1921  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1922  const char* name, /**< name of the parameter */
1923  void* value /**< new value of the parameter */
1924  )
1925 {
1926  SCIP_PARAM* param;
1927 
1928  assert(paramset != NULL);
1929  assert(set != NULL);
1930 
1931  /* retrieve parameter from hash table */
1932  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1933  if( param == NULL )
1934  {
1935  SCIPerrorMessage("parameter <%s> unknown\n", name);
1936  return SCIP_PARAMETERUNKNOWN;
1937  }
1938 
1939  switch( param->paramtype )
1940  {
1941  case SCIP_PARAMTYPE_BOOL:
1942  /* set the parameter's current value */
1943  SCIP_CALL( SCIPparamSetBool(param, set, messagehdlr, (SCIP_Bool) (size_t) value, FALSE, TRUE) );
1944  break;
1945 
1946  case SCIP_PARAMTYPE_INT:
1947  /* set the parameter's current value */
1948  SCIP_CALL( SCIPparamSetInt(param, set, messagehdlr, (int) (size_t) value, FALSE, TRUE) );
1949  break;
1950 
1952  /* set the parameter's current value */
1953  SCIP_CALL( SCIPparamSetLongint(param, set, messagehdlr, (SCIP_Longint) (size_t) value, FALSE, TRUE) );
1954  break;
1955 
1956  case SCIP_PARAMTYPE_REAL:
1957  /* set the parameter's current value */
1958  SCIP_CALL( SCIPparamSetReal(param, set, messagehdlr, (SCIP_Real) (size_t) value, FALSE, TRUE) );
1959  break;
1960 
1961  case SCIP_PARAMTYPE_CHAR:
1962  /* set the parameter's current value */
1963  SCIP_CALL( SCIPparamSetChar(param, set, messagehdlr, (char) (size_t) value, FALSE, TRUE) );
1964  break;
1965 
1966  case SCIP_PARAMTYPE_STRING:
1967  /* set the parameter's current value */
1968  SCIP_CALL( SCIPparamSetString(param, set, messagehdlr, (char*) value, TRUE) );
1969  break;
1970 
1971  default:
1972  SCIPerrorMessage("unknown parameter type\n");
1973  return SCIP_INVALIDDATA;
1974  }
1975 
1976  return SCIP_OKAY;
1977 }
1978 
1979 /** changes the value of an existing SCIP_Bool parameter */
1981  SCIP_PARAMSET* paramset, /**< parameter set */
1982  SCIP_SET* set, /**< global SCIP settings */
1983  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1984  const char* name, /**< name of the parameter */
1985  SCIP_Bool value /**< new value of the parameter */
1986  )
1987 {
1988  SCIP_PARAM* param;
1989 
1990  assert(paramset != NULL);
1991  assert(set != NULL);
1992 
1993  /* retrieve parameter from hash table */
1994  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
1995  if( param == NULL )
1996  {
1997  SCIPerrorMessage("parameter <%s> unknown\n", name);
1998  return SCIP_PARAMETERUNKNOWN;
1999  }
2000  if( param->paramtype != SCIP_PARAMTYPE_BOOL )
2001  {
2002  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
2004  return SCIP_PARAMETERWRONGTYPE;
2005  }
2006 
2007  /* set the parameter's current value */
2008  SCIP_CALL( SCIPparamSetBool(param, set, messagehdlr, value, FALSE, TRUE) );
2009 
2010  return SCIP_OKAY;
2011 }
2012 
2013 /** changes the default value of an existing SCIP_Bool parameter */
2015  SCIP_PARAMSET* paramset, /**< parameter set */
2016  const char* name, /**< name of the parameter */
2017  SCIP_Bool defaultvalue /**< new default value of the parameter */
2018  )
2019 {
2020  SCIP_PARAM* param;
2021 
2022  assert(paramset != NULL);
2023 
2024  /* retrieve parameter from hash table */
2025  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
2026  if( param == NULL )
2027  {
2028  SCIPerrorMessage("parameter <%s> unknown\n", name);
2029  return SCIP_PARAMETERUNKNOWN;
2030  }
2031  if( param->paramtype != SCIP_PARAMTYPE_BOOL )
2032  {
2033  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
2035  return SCIP_PARAMETERWRONGTYPE;
2036  }
2037 
2038  /* set the parameter's default value */
2039  SCIPparamSetDefaultBool(param, defaultvalue);
2040 
2041  return SCIP_OKAY;
2042 }
2043 
2044 /** changes the value of an existing int parameter */
2046  SCIP_PARAMSET* paramset, /**< parameter set */
2047  SCIP_SET* set, /**< global SCIP settings */
2048  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2049  const char* name, /**< name of the parameter */
2050  int value /**< new value of the parameter */
2051  )
2052 {
2053  SCIP_PARAM* param;
2054 
2055  assert(paramset != NULL);
2056  assert(set != NULL);
2057 
2058  /* retrieve parameter from hash table */
2059  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
2060  if( param == NULL )
2061  {
2062  SCIPerrorMessage("parameter <%s> unknown\n", name);
2063  return SCIP_PARAMETERUNKNOWN;
2064  }
2065  if( param->paramtype != SCIP_PARAMTYPE_INT )
2066  {
2067  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
2069  return SCIP_PARAMETERWRONGTYPE;
2070  }
2071 
2072  /* set the parameter's current value */
2073  SCIP_CALL( SCIPparamSetInt(param, set, messagehdlr, value, FALSE, TRUE) );
2074 
2075  return SCIP_OKAY;
2076 }
2077 
2078 /** changes the default value of an existing int parameter */
2080  SCIP_PARAMSET* paramset, /**< parameter set */
2081  const char* name, /**< name of the parameter */
2082  int defaultvalue /**< new default value of the parameter */
2083  )
2084 {
2085  SCIP_PARAM* param;
2086 
2087  assert(paramset != NULL);
2088 
2089  /* retrieve parameter from hash table */
2090  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
2091  if( param == NULL )
2092  {
2093  SCIPerrorMessage("parameter <%s> unknown\n", name);
2094  return SCIP_PARAMETERUNKNOWN;
2095  }
2096  if( param->paramtype != SCIP_PARAMTYPE_INT )
2097  {
2098  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
2100  return SCIP_PARAMETERWRONGTYPE;
2101  }
2102 
2103  /* set the parameter's default value */
2104  SCIPparamSetDefaultInt(param, defaultvalue);
2105 
2106  return SCIP_OKAY;
2107 }
2108 
2109 /** changes the value of an existing SCIP_Longint parameter */
2111  SCIP_PARAMSET* paramset, /**< parameter set */
2112  SCIP_SET* set, /**< global SCIP settings */
2113  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2114  const char* name, /**< name of the parameter */
2115  SCIP_Longint value /**< new value of the parameter */
2116  )
2117 {
2118  SCIP_PARAM* param;
2119 
2120  assert(paramset != NULL);
2121  assert(set != NULL);
2122 
2123  /* retrieve parameter from hash table */
2124  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
2125  if( param == NULL )
2126  {
2127  SCIPerrorMessage("parameter <%s> unknown\n", name);
2128  return SCIP_PARAMETERUNKNOWN;
2129  }
2130  if( param->paramtype != SCIP_PARAMTYPE_LONGINT )
2131  {
2132  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
2134  return SCIP_PARAMETERWRONGTYPE;
2135  }
2136 
2137  /* set the parameter's current value */
2138  SCIP_CALL( SCIPparamSetLongint(param, set, messagehdlr, value, FALSE, TRUE) );
2139 
2140  return SCIP_OKAY;
2141 }
2142 
2143 /** changes the value of an existing SCIP_Real parameter */
2145  SCIP_PARAMSET* paramset, /**< parameter set */
2146  SCIP_SET* set, /**< global SCIP settings */
2147  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2148  const char* name, /**< name of the parameter */
2149  SCIP_Real value /**< new value of the parameter */
2150  )
2151 {
2152  SCIP_PARAM* param;
2153 
2154  assert(paramset != NULL);
2155  assert(set != NULL);
2156 
2157  /* retrieve parameter from hash table */
2158  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
2159  if( param == NULL )
2160  {
2161  SCIPerrorMessage("parameter <%s> unknown\n", name);
2162  return SCIP_PARAMETERUNKNOWN;
2163  }
2164  if( param->paramtype != SCIP_PARAMTYPE_REAL )
2165  {
2166  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
2168  return SCIP_PARAMETERWRONGTYPE;
2169  }
2170 
2171  /* set the parameter's current value */
2172  SCIP_CALL( SCIPparamSetReal(param, set, messagehdlr, value, FALSE, TRUE) );
2173 
2174  return SCIP_OKAY;
2175 }
2176 
2177 /** changes the value of an existing char parameter */
2179  SCIP_PARAMSET* paramset, /**< parameter set */
2180  SCIP_SET* set, /**< global SCIP settings */
2181  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2182  const char* name, /**< name of the parameter */
2183  char value /**< new value of the parameter */
2184  )
2185 {
2186  SCIP_PARAM* param;
2187 
2188  assert(paramset != NULL);
2189  assert(set != NULL);
2190 
2191  /* retrieve parameter from hash table */
2192  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
2193  if( param == NULL )
2194  {
2195  SCIPerrorMessage("parameter <%s> unknown\n", name);
2196  return SCIP_PARAMETERUNKNOWN;
2197  }
2198  if( param->paramtype != SCIP_PARAMTYPE_CHAR )
2199  {
2200  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
2202  return SCIP_PARAMETERWRONGTYPE;
2203  }
2204 
2205  /* set the parameter's current value */
2206  SCIP_CALL( SCIPparamSetChar(param, set, messagehdlr, value, FALSE, TRUE) );
2207 
2208  return SCIP_OKAY;
2209 }
2210 
2211 /** changes the value of an existing string parameter */
2213  SCIP_PARAMSET* paramset, /**< parameter set */
2214  SCIP_SET* set, /**< global SCIP settings */
2215  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2216  const char* name, /**< name of the parameter */
2217  const char* value /**< new value of the parameter */
2218  )
2219 {
2220  SCIP_PARAM* param;
2221 
2222  assert(paramset != NULL);
2223  assert(set != NULL);
2224 
2225  /* retrieve parameter from hash table */
2226  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)name);
2227  if( param == NULL )
2228  {
2229  SCIPerrorMessage("parameter <%s> unknown\n", name);
2230  return SCIP_PARAMETERUNKNOWN;
2231  }
2232  if( param->paramtype != SCIP_PARAMTYPE_STRING )
2233  {
2234  SCIPerrorMessage("wrong parameter type - parameter <%s> has type <%s> instead of <%s>\n",
2236  return SCIP_PARAMETERWRONGTYPE;
2237  }
2238 
2239  /* set the parameter's current value */
2240  SCIP_CALL( SCIPparamSetString(param, set, messagehdlr, value, TRUE) );
2241 
2242  return SCIP_OKAY;
2243 }
2244 
2245 /** parses emphasis settings */
2246 static
2248  SCIP_PARAMSET* paramset, /**< parameter set */
2249  SCIP_SET* set, /**< global SCIP settings */
2250  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2251  char* line /**< line to parse (is modified during parse, but not freed) */
2252  )
2253 {
2254  SCIP_PARAMSETTING paramsetting;
2255  SCIP_Bool globalemphasis = FALSE;
2256  char* paramname;
2257  char* paramvaluestr;
2258 
2259  assert( paramset != NULL );
2260  assert( line != NULL );
2261 
2262  /* find the start of the parameter name */
2263  while ( *line == ' ' || *line == '\t' || *line == '\r' )
2264  line++;
2265  if ( *line == '\0' || *line == '\n' || *line == '#' )
2266  return SCIP_OKAY;
2267  paramname = line;
2268 
2269  /* find the end of the parameter name */
2270  while ( *line != ' ' && *line != '\t' && *line != '\r' && *line != '\n' && *line != '#' && *line != '\0' && *line != '=' && *line != ':' )
2271  line++;
2272  *line = '\0';
2273  ++line;
2274 
2275  /* check for global emphasis settings */
2276  if ( strcmp(paramname, "default") == 0 )
2277  {
2278  SCIP_CALL( SCIPparamsetSetEmphasis(paramset, set, messagehdlr, SCIP_PARAMEMPHASIS_DEFAULT, FALSE) );
2279  globalemphasis = TRUE;
2280  }
2281  else if ( strcmp(paramname, "counter") == 0 )
2282  {
2283  SCIP_CALL( SCIPparamsetSetEmphasis(paramset, set, messagehdlr, SCIP_PARAMEMPHASIS_COUNTER, FALSE) );
2284  globalemphasis = TRUE;
2285  }
2286  else if ( strcmp(paramname, "cpsolver") == 0 )
2287  {
2288  SCIP_CALL( SCIPparamsetSetEmphasis(paramset, set, messagehdlr, SCIP_PARAMEMPHASIS_CPSOLVER, FALSE) );
2289  globalemphasis = TRUE;
2290  }
2291  else if ( strcmp(paramname, "easycip") == 0 )
2292  {
2293  SCIP_CALL( SCIPparamsetSetEmphasis(paramset, set, messagehdlr, SCIP_PARAMEMPHASIS_EASYCIP, FALSE) );
2294  globalemphasis = TRUE;
2295  }
2296  else if ( strcmp(paramname, "feasibility") == 0 )
2297  {
2298  SCIP_CALL( SCIPparamsetSetEmphasis(paramset, set, messagehdlr, SCIP_PARAMEMPHASIS_FEASIBILITY, FALSE) );
2299  globalemphasis = TRUE;
2300  }
2301  else if ( strcmp(paramname, "hardlp") == 0 )
2302  {
2303  SCIP_CALL( SCIPparamsetSetEmphasis(paramset, set, messagehdlr, SCIP_PARAMEMPHASIS_HARDLP, FALSE) );
2304  globalemphasis = TRUE;
2305  }
2306  else if ( strcmp(paramname, "optimality") == 0 )
2307  {
2308  SCIP_CALL( SCIPparamsetSetEmphasis(paramset, set, messagehdlr, SCIP_PARAMEMPHASIS_OPTIMALITY, FALSE) );
2309  globalemphasis = TRUE;
2310  }
2311 
2312  /* check whether rest of line is clean */
2313  if ( globalemphasis )
2314  {
2315  /* check, if the rest of the line is clean */
2316  while ( *line == ' ' || *line == '\t' || *line == '\r' )
2317  ++line;
2318  if ( *line != '\0' && *line != '\n' && *line != '#' )
2319  {
2320  SCIPerrorMessage("additional characters after global emphasis setting: %s.\n", line);
2321  return SCIP_READERROR;
2322  }
2323  return SCIP_OKAY;
2324  }
2325 
2326  /* find the start of the parameter value string */
2327  while ( *line == ' ' || *line == '\t' || *line == '\r' )
2328  ++line;
2329  if ( *line == '\0' || *line == '\n' || *line == '#' )
2330  {
2331  SCIPerrorMessage("emphasis parameter value is missing\n");
2332  return SCIP_READERROR;
2333  }
2334  paramvaluestr = line;
2335 
2336  /* find the end of the parameter value string */
2337  while ( *line != ' ' && *line != '\t' && *line != '\r' && *line != '\n' && *line != '#' && *line != '\0' )
2338  ++line;
2339 
2340  if ( *line == '#' )
2341  *line = '\0';
2342  else if ( *line != '\0' )
2343  {
2344  *line = '\0';
2345  ++line;
2346  /* check, if the rest of the line is clean */
2347  while ( *line == ' ' || *line == '\t' || *line == '\r' )
2348  ++line;
2349  if ( *line != '\0' && *line != '\n' && *line != '#' )
2350  {
2351  SCIPerrorMessage("additional characters after emphasis parameter value: %s.\n", line);
2352  return SCIP_READERROR;
2353  }
2354  }
2355 
2356  /* determine type of setting */
2357  if ( strcmp(paramvaluestr, "default") == 0 )
2358  paramsetting = SCIP_PARAMSETTING_DEFAULT;
2359  else if ( strcmp(paramvaluestr, "aggressive") == 0 )
2360  paramsetting = SCIP_PARAMSETTING_AGGRESSIVE;
2361  else if ( strcmp(paramvaluestr, "fast") == 0 )
2362  paramsetting = SCIP_PARAMSETTING_FAST;
2363  else if ( strcmp(paramvaluestr, "off") == 0 )
2364  paramsetting = SCIP_PARAMSETTING_OFF;
2365  else
2366  {
2367  SCIPerrorMessage("unkown parameter setting: %s.\n", paramvaluestr);
2368  return SCIP_READERROR;
2369  }
2370 
2371  /* check which kind of emphasis we want to set */
2372  if ( strcmp(paramname, "heuristics") == 0 )
2373  {
2374  SCIP_CALL( SCIPsetSetHeuristics(set, messagehdlr, paramsetting, FALSE) );
2375  }
2376  else if ( strcmp(paramname, "presolving") == 0 )
2377  {
2378  SCIP_CALL( SCIPsetSetPresolving(set, messagehdlr, paramsetting, FALSE) );
2379  }
2380  else if ( strcmp(paramname, "separating") == 0 )
2381  {
2382  SCIP_CALL( SCIPsetSetSeparating(set, messagehdlr, paramsetting, FALSE) );
2383  }
2384 
2385  return SCIP_OKAY;
2386 }
2387 
2388 /** parses a parameter file line "paramname = paramvalue" and sets parameter accordingly */
2389 static
2391  SCIP_PARAMSET* paramset, /**< parameter set */
2392  SCIP_SET* set, /**< global SCIP settings */
2393  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2394  char* line, /**< line to parse (is modified during parse, but not freed) */
2395  SCIP_Bool* foundnormalparam /**< pointer to store whether a normal parameter (not emphasis setting) has been found */
2396  )
2397 {
2398  SCIP_PARAM* param;
2399  char* paramname;
2400  char* paramvaluestr;
2401  char* paramend;
2402  char* lastquote;
2403  SCIP_Bool quoted;
2404  SCIP_Bool fix = FALSE;
2405 
2406  assert(paramset != NULL);
2407  assert(line != NULL);
2408  assert(foundnormalparam != NULL);
2409 
2410  /* find the start of the parameter name */
2411  while( *line == ' ' || *line == '\t' || *line == '\r' )
2412  line++;
2413  if( *line == '\0' || *line == '\n' || *line == '#' )
2414  return SCIP_OKAY;
2415  paramname = line;
2416 
2417  /* find the end of the parameter name */
2418  while( *line != ' ' && *line != '\t' && *line != '\r' && *line != '\n' && *line != '#' && *line != '\0' && *line != '=' && *line != ':' )
2419  line++;
2420  paramend = line;
2421 
2422  /* skip possible whitespace */
2423  while( *line == ' ' || *line == '\t' || *line == '\r' )
2424  line++;
2425 
2426  /* check whether first part consists of "emphasis:" */
2427  if ( *line == ':' )
2428  {
2429  *paramend = '\0'; /* could have paramend == line */
2430  if ( strcmp(paramname, "emphasis") != 0 )
2431  {
2432  SCIPerrorMessage("expected \"emphasis:\" at beginning of line.\n");
2433  return SCIP_READERROR;
2434  }
2435 
2436  /* check that emphasis settings only appear at beginning of file */
2437  if ( *foundnormalparam )
2438  {
2439  SCIPerrorMessage("emphasis settings have to appear at top of file.\n");
2440  return SCIP_READERROR;
2441  }
2442 
2443  /* parse emphasis line */
2444  SCIP_CALL( emphasisParse(paramset, set, messagehdlr, line+1) ); /* message handler */
2445  return SCIP_OKAY;
2446  }
2447  else if ( *line != '=' )
2448  {
2449  SCIPerrorMessage("expected character '=' after the parameter name.\n");
2450  return SCIP_READERROR;
2451  }
2452  *paramend = '\0'; /* could have paramend == line */
2453  ++line;
2454 
2455  /* find the start of the parameter value string */
2456  while( *line == ' ' || *line == '\t' || *line == '\r' )
2457  line++;
2458  if( *line == '\0' || *line == '\n' || *line == '#' )
2459  {
2460  SCIPerrorMessage("parameter value is missing\n");
2461  return SCIP_READERROR;
2462  }
2463  paramvaluestr = line;
2464 
2465  /* find the end of the parameter value string */
2466  quoted = (*paramvaluestr == '"');
2467  lastquote = NULL;
2468  while( (quoted || (*line != ' ' && *line != '\t' && *line != '\r' && *line != '\n' && *line != '#')) && *line != '\0' )
2469  {
2470  if( *line == '"' )
2471  lastquote = line;
2472  line++;
2473  }
2474  if( lastquote != NULL )
2475  line = lastquote+1;
2476  if( *line == '#' )
2477  *line = '\0';
2478  else if( *line != '\0' )
2479  {
2480  /* check, if the rest of the line is clean */
2481  *line = '\0';
2482  line++;
2483  while( *line == ' ' || *line == '\t' || *line == '\r' )
2484  line++;
2485  if( *line == 'f' && *(line+1) == 'i' && *(line+2) == 'x' )
2486  {
2487  fix = TRUE;
2488  line += 3;
2489 
2490  while( *line == ' ' || *line == '\t' || *line == '\r' )
2491  line++;
2492  }
2493  if( *line != '\0' && *line != '\n' && *line != '#' )
2494  {
2495  SCIPerrorMessage("additional characters <%c> after parameter value (and possible 'fix' keyword)\n", *line);
2496  return SCIP_READERROR;
2497  }
2498  }
2499 
2500  /* retrieve parameter from hash table */
2501  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
2502  if( param == NULL )
2503  {
2504  SCIPmessagePrintWarning(messagehdlr, "unknown parameter <%s>\n", paramname);
2505  return SCIP_OKAY;
2506  }
2507 
2508  SCIPparamSetFixed(param, FALSE);
2509 
2510  /* set parameter's value */
2511  switch( param->paramtype )
2512  {
2513  case SCIP_PARAMTYPE_BOOL:
2514  SCIP_CALL( paramParseBool(param, set, messagehdlr, paramvaluestr) );
2515  break;
2516  case SCIP_PARAMTYPE_INT:
2517  SCIP_CALL( paramParseInt(param, set, messagehdlr, paramvaluestr) );
2518  break;
2520  SCIP_CALL( paramParseLongint(param, set, messagehdlr, paramvaluestr) );
2521  break;
2522  case SCIP_PARAMTYPE_REAL:
2523  SCIP_CALL( paramParseReal(param, set, messagehdlr, paramvaluestr) );
2524  break;
2525  case SCIP_PARAMTYPE_CHAR:
2526  SCIP_CALL( paramParseChar(param, set, messagehdlr, paramvaluestr) );
2527  break;
2528  case SCIP_PARAMTYPE_STRING:
2529  SCIP_CALL( paramParseString(param, set, messagehdlr, paramvaluestr) );
2530  break;
2531  default:
2532  SCIPerrorMessage("unknown parameter type\n");
2533  return SCIP_INVALIDDATA;
2534  }
2535 
2536  if( fix )
2537  SCIPparamSetFixed(param, TRUE);
2538 
2539  *foundnormalparam = TRUE;
2540 
2541  return SCIP_OKAY;
2542 }
2543 
2544 /** reads parameters from a file */
2546  SCIP_PARAMSET* paramset, /**< parameter set */
2547  SCIP_SET* set, /**< global SCIP settings */
2548  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2549  const char* filename /**< file name */
2550  )
2551 {
2552  SCIP_RETCODE retcode;
2553  SCIP_Bool foundnormalparam = FALSE;
2554  FILE* file;
2555  char line[1024];
2556  int lineno;
2557 
2558  assert(paramset != NULL);
2559  assert(filename != NULL);
2560 
2561  /* open the file for reading */
2562  file = fopen(filename, "r");
2563  if( file == NULL )
2564  {
2565  SCIPerrorMessage("cannot open file <%s> for reading\n", filename);
2566  SCIPprintSysError(filename);
2567  return SCIP_NOFILE;
2568  }
2569 
2570  /* read the parameters from the file */
2571  lineno = 0;
2572  retcode = SCIP_OKAY;
2573  while( fgets(line, (int) sizeof(line), file) != NULL && retcode == SCIP_OKAY )
2574  {
2575  lineno++;
2576  retcode = paramsetParse(paramset, set, messagehdlr, line, &foundnormalparam);
2577  }
2578 
2579  /* close input file */
2580  fclose(file);
2581 
2582  if( retcode == SCIP_READERROR )
2583  {
2584  SCIPerrorMessage("input error in file <%s> line %d\n", filename, lineno);
2585  }
2586  else
2587  {
2588  SCIP_CALL( retcode );
2589  }
2590 
2591  return SCIP_OKAY;
2592 }
2593 
2594 /** writes all parameters in the parameter set to a file */
2596  SCIP_PARAMSET* paramset, /**< parameter set */
2597  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2598  const char* filename, /**< file name, or NULL for stdout */
2599  SCIP_Bool comments, /**< should parameter descriptions be written as comments? */
2600  SCIP_Bool onlychanged /**< should only the parameters been written, that are changed from default? */
2601  )
2602 {
2603  SCIP_RETCODE retcode;
2604  FILE* file;
2605  SCIP_Bool oldquiet = FALSE;
2606  int i;
2607 
2608  assert(paramset != NULL);
2609 
2610  /* open the file for writing */
2611  if( filename != NULL )
2612  {
2613  file = fopen(filename, "w");
2614  if( file == NULL )
2615  {
2616  SCIPerrorMessage("cannot open file <%s> for writing\n", filename);
2617  SCIPprintSysError(filename);
2618  return SCIP_FILECREATEERROR;
2619  }
2620 
2621  /* temporarily set the quiet flag of the message handler to FALSE */
2622  if( messagehdlr != NULL )
2623  {
2624  oldquiet = SCIPmessagehdlrIsQuiet(messagehdlr);
2625  SCIPmessagehdlrSetQuiet(messagehdlr, FALSE);
2626  }
2627  }
2628  else
2629  file = NULL;
2630 
2631  if( comments )
2632  {
2633  /* display the SCIP version as comment in the first line */
2634 #if( SCIP_SUBVERSION == 0 )
2635  SCIPmessageFPrintInfo(messagehdlr, file, "# SCIP version %d.%d.%d\n",
2636  SCIP_VERSION/100, (SCIP_VERSION/10) % 10, SCIP_VERSION % 10); /*lint !e778*/
2637 #else
2638  SCIPmessageFPrintInfo(messagehdlr, file, "# SCIP version %d.%d.%d.%d\n",
2639  SCIP_VERSION/100, (SCIP_VERSION/10) % 10, SCIP_VERSION % 10, SCIP_SUBVERSION); /*lint !e778*/
2640 #endif
2641 
2642  SCIPmessageFPrintInfo(messagehdlr, file, "\n");
2643  }
2644 
2645  /* write the parameters to the file */
2646  for( i = 0; i < paramset->nparams; ++i )
2647  {
2648  retcode = paramWrite(paramset->params[i], messagehdlr, file, comments, onlychanged);
2649  if( retcode != SCIP_OKAY )
2650  {
2651  if( filename != NULL )
2652  {
2653  assert(file != NULL);
2654  fclose(file);
2655  }
2656  SCIP_CALL( retcode );
2657  }
2658  }
2659 
2660  /* close output file */
2661  if( filename != NULL )
2662  {
2663  assert(file != NULL); /*lint !e449*/
2664 
2665  /* reset the quiet flag of the message handler */
2666  if( messagehdlr != NULL )
2667  {
2668  SCIPmessagehdlrSetQuiet(messagehdlr, oldquiet);
2669  }
2670 
2671  fclose(file);
2672  }
2673 
2674  return SCIP_OKAY;
2675 }
2676 
2677 /** installs default values for all parameters */
2679  SCIP_PARAMSET* paramset, /**< parameter set */
2680  SCIP_SET* set, /**< global SCIP settings */
2681  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
2682  )
2683 {
2684  int i;
2685 
2686  /* set all parameters to their default values */
2687  for( i = 0; i < paramset->nparams; ++i )
2688  {
2689  SCIP_CALL( SCIPparamSetToDefault(paramset->params[i], set, messagehdlr) );
2690  }
2691 
2692  return SCIP_OKAY;
2693 }
2694 
2695 /** installs default value for a single parameter */
2697  SCIP_PARAMSET* paramset, /**< parameter set */
2698  SCIP_SET* set, /**< global SCIP settings */
2699  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2700  const char* paramname /**< name of the parameter */
2701  )
2702 {
2703  SCIP_PARAM* param;
2704 
2705  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
2706 
2707  if( param != NULL )
2708  {
2709  SCIP_CALL( SCIPparamSetToDefault(param, set, messagehdlr) );
2710  }
2711 
2712  return SCIP_OKAY;
2713 }
2714 
2715 /** resets parameters changed by SCIPparamsetSetHeuristicsXyz functions to their default values
2716  *
2717  * @note fixed parameters stay as they are; you need to unfix them first if they should be changed, too
2718  */
2719 static
2721  SCIP_PARAMSET* paramset, /**< parameter set */
2722  SCIP_SET* set, /**< global SCIP settings */
2723  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2724  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
2725  )
2726 { /*lint --e{715}*/
2727  SCIP_HEUR** heurs;
2728  char paramname[SCIP_MAXSTRLEN];
2729  int nheurs;
2730  int i;
2731 
2732  heurs = set->heurs;
2733  nheurs = set->nheurs;
2734 
2735  for( i = 0; i < nheurs; ++i )
2736  {
2737  const char* heurname;
2738  heurname = SCIPheurGetName(heurs[i]);
2739 
2740  /* set frequency parameter to default */
2741  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/freq", heurname);
2742  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
2743 
2744  /* set LP iteration offset to default */
2745  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxlpiterofs", heurname);
2746  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
2747 
2748  /* set LP iteration quota to default */
2749  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxlpiterquot", heurname);
2750  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
2751  }
2752 
2753  /* set specific parameters for RENS heuristic */
2754  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "heuristics/rens/nodesofs") );
2755  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "heuristics/rens/minfixingrate") );
2756 
2757  /* set specific parameters for Crossover heuristic */
2758  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "heuristics/crossover/nwaitingnodes") );
2759  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "heuristics/crossover/dontwaitatroot") );
2760  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "heuristics/crossover/nodesquot") );
2761  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "heuristics/crossover/minfixingrate") );
2762 
2763  return SCIP_OKAY;
2764 }
2765 
2766 /** sets heuristics to aggressive */
2767 static
2769  SCIP_PARAMSET* paramset, /**< parameter set */
2770  SCIP_SET* set, /**< global SCIP settings */
2771  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2772  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
2773  )
2774 {
2775  SCIP_HEUR** heurs;
2776  SCIP_PARAM* param;
2777  char paramname[SCIP_MAXSTRLEN];
2778  int nheurs;
2779  int i;
2780 
2781  heurs = set->heurs;
2782  nheurs = set->nheurs;
2783 
2784  SCIP_CALL( paramsetSetHeuristicsDefault(paramset, set, messagehdlr, quiet) );
2785 
2786  for( i = 0; i < nheurs; ++i )
2787  {
2788  const char* heurname;
2789  heurname = SCIPheurGetName(heurs[i]);
2790 
2791  /* dualval heuristic should stay disabled */
2792  if( strcmp(heurname, "dualval") == 0 )
2793  continue;
2794 
2795  /* the aggressive Benders' decomposition heuristics should remain disabled */
2796  if( strstr(heurname, "benders") != NULL )
2797  continue;
2798 
2799  /* get frequency parameter of heuristic */
2800  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/freq", heurname);
2801  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
2802 
2803  if( param != NULL )
2804  {
2805  int deffreq;
2806  int newfreq;
2807 
2808  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
2809  deffreq = SCIPparamGetIntDefault(param);
2810 
2811  /* change frequency to half of the default value, if it is > 0, otherwise set to 20 */
2812  if( deffreq == -1 || deffreq == 0 )
2813  {
2814  newfreq = 20;
2815  }
2816  else
2817  {
2818  newfreq = (int) SCIPsetCeil(set, deffreq/2.0);
2819  newfreq = MAX(newfreq, 1);
2820  }
2821 
2822  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, newfreq, quiet) );
2823 
2824  /* LP iteration limits only get increased for heuristics which are activated by default */
2825  if( SCIPparamGetIntDefault(param) > -1 )
2826  {
2827  /* construct (possible) parameter name for LP iteration offset */
2828  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxlpiterofs", heurname);
2829  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
2830 
2831  if( param != NULL && SCIPparamGetType(param) == SCIP_PARAMTYPE_INT )
2832  {
2833  /* set LP iteration offset to 1.5 time the current value */
2834  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, (int) (1.5 * SCIPparamGetIntDefault(param)), quiet) );
2835  }
2836 
2837  /* construct (possible) parameter name for LP iteration quotient parameter */
2838  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxlpiterquot", heurname);
2839  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
2840 
2841  if( param != NULL && SCIPparamGetType(param) == SCIP_PARAMTYPE_REAL )
2842  {
2843  /* set LP iteration quotient to 1.5 time the current value */
2844  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, paramname, 1.5 * SCIPparamGetRealDefault(param), quiet) );
2845  }
2846  }
2847  }
2848  }
2849 
2850  /* set specific parameters for RENS heuristic, if the heuristic is included */
2851 #ifndef NDEBUG
2852  if( SCIPsetFindHeur(set, "rens") != NULL )
2853 #endif
2854  {
2855  SCIP_CALL( paramSetLongint(paramset, set, messagehdlr, "heuristics/rens/nodesofs", (SCIP_Longint)2000, quiet) );
2856  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "heuristics/rens/minfixingrate", 0.3, quiet) );
2857  }
2858 
2859  /* set specific parameters for Crossover heuristic, if the heuristic is included */
2860 #ifndef NDEBUG
2861  if( SCIPsetFindHeur(set, "crossover") != NULL )
2862 #endif
2863  {
2864  SCIP_CALL( paramSetLongint(paramset, set, messagehdlr, "heuristics/crossover/nwaitingnodes", (SCIP_Longint)20, quiet) );
2865  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "heuristics/crossover/dontwaitatroot", TRUE, quiet) );
2866  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "heuristics/crossover/nodesquot", 0.15, quiet) );
2867  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "heuristics/crossover/minfixingrate", 0.5, quiet) );
2868  }
2869 
2870  return SCIP_OKAY;
2871 }
2872 
2873 /** sets heuristics to fast */
2874 static
2876  SCIP_PARAMSET* paramset, /**< parameter set */
2877  SCIP_SET* set, /**< global SCIP settings */
2878  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2879  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
2880  )
2881 {
2882  int i;
2883 
2884 #define NEXPENSIVEHEURFREQS 19
2885  static const char* const expensiveheurfreqs[NEXPENSIVEHEURFREQS] = {
2886  "heuristics/coefdiving/freq",
2887  "heuristics/crossover/freq",
2888  "heuristics/distributiondiving/freq",
2889  "heuristics/feaspump/freq",
2890  "heuristics/fracdiving/freq",
2891  "heuristics/gins/freq",
2892  "heuristics/guideddiving/freq",
2893  "heuristics/linesearchdiving/freq",
2894  "heuristics/lpface/freq",
2895  "heuristics/mpec/freq",
2896  "heuristics/nlpdiving/freq",
2897  "heuristics/subnlp/freq",
2898  "heuristics/objpscostdiving/freq",
2899  "heuristics/pscostdiving/freq",
2900  "heuristics/rens/freq",
2901  "heuristics/rins/freq",
2902  "heuristics/rootsoldiving/freq",
2903  "heuristics/undercover/freq",
2904  "heuristics/veclendiving/freq"
2905  };
2906 
2907  SCIP_CALL( paramsetSetHeuristicsDefault(paramset, set, messagehdlr, quiet) );
2908 
2909  /* explicitly turn off expensive heuristics, if included */
2910  for( i = 0; i < NEXPENSIVEHEURFREQS; ++i )
2911  if( SCIPhashtableRetrieve(paramset->hashtable, (void*)expensiveheurfreqs[i]) != NULL )
2912  {
2913  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, expensiveheurfreqs[i], -1, quiet) );
2914  }
2915 
2916  return SCIP_OKAY;
2917 }
2918 
2919 /** turns all heuristics off */
2920 static
2922  SCIP_PARAMSET* paramset, /**< parameter set */
2923  SCIP_SET* set, /**< global SCIP settings */
2924  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2925  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
2926  )
2927 {
2928  SCIP_HEUR** heurs;
2929  char paramname[SCIP_MAXSTRLEN];
2930  int nheurs;
2931  int i;
2932 
2933  heurs = set->heurs;
2934  nheurs = set->nheurs;
2935 
2936  SCIP_CALL( paramsetSetHeuristicsDefault(paramset, set, messagehdlr, quiet) );
2937 
2938  for( i = 0; i < nheurs; ++i )
2939  {
2940  const char* heurname;
2941  heurname = SCIPheurGetName(heurs[i]);
2942 
2943  /* get frequency parameter of heuristic */
2944  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/freq", heurname);
2945 
2946  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, -1, quiet) );
2947  }
2948 
2949  return SCIP_OKAY;
2950 }
2951 
2952 /** resets all parameters that start with "presolving" in their name to their default value; additionally set the
2953  * parameters which might have previously been changed by the methods SCIPparamsetSetToPresolving{Off,Fast,Aggressive}
2954  * to their default value
2955  *
2956  * @note fixed parameters stay as they are; you need to unfix them first if they should be changed, too
2957  */
2958 static
2960  SCIP_PARAMSET* paramset, /**< parameter set */
2961  SCIP_SET* set, /**< global SCIP settings */
2962  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2963  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
2964  )
2965 { /*lint --e{715}*/
2966  SCIP_PROP** props;
2967  SCIP_CONSHDLR** conshdlrs;
2968  SCIP_PRESOL** presols;
2969  char paramname[SCIP_MAXSTRLEN];
2970  int nprops;
2971  int nconshdlrs;
2972  int npresols;
2973  int i;
2974 
2975  presols = set->presols;
2976  npresols = set->npresols;
2977 
2978  /* reset each individual presolver */
2979  for( i = 0; i < npresols; ++i )
2980  {
2981  const char* presolname;
2982  presolname = SCIPpresolGetName(presols[i]);
2983 
2984  /* reset maxrounds parameter of presolvers */
2985  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "presolving/%s/maxrounds", presolname);
2986 
2987  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
2988  }
2989 
2990  props = set->props;
2991  nprops = set->nprops;
2992 
2993  /* reset presolving for each individual propagator */
2994  for( i = 0; i < nprops; ++i )
2995  {
2996  const char* propname;
2997  propname = SCIPpropGetName(props[i]);
2998 
2999  /* reset maxprerounds parameter of propagator */
3000  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/maxprerounds", propname);
3001  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
3002  }
3003 
3004  conshdlrs = set->conshdlrs;
3005  nconshdlrs = set->nconshdlrs;
3006 
3007  /* reset presolving settings for each individual constraint handler */
3008  for( i = 0; i < nconshdlrs; ++i )
3009  {
3010  const char* conshdlrname;
3011  conshdlrname = SCIPconshdlrGetName(conshdlrs[i]);
3012 
3013  /* reset maxprerounds parameter of constraint handler */
3014  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/maxprerounds", conshdlrname);
3015  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
3016 
3017  /* reset presolpairwise parameter of constraint handler */
3018  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/presolpairwise", conshdlrname);
3019  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
3020  }
3021 
3022  /* explicitly reset parameters of setppc constraint handler, if the constraint handler is included */
3023  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "constraints/setppc/cliquelifting") );
3024 
3025  /* explicitly reset parameters of knapsack constraint handler, if the constraint handler is included */
3026  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "constraints/knapsack/disaggregation") );
3027 
3028  /* explicitly reset restart and maxrounds parameters */
3029  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "presolving/maxrestarts") );
3030  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "presolving/restartfac") );
3031  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "presolving/restartminred") );
3032  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "presolving/maxrounds") );
3033 
3034  /* explicitly reset probing parameters */
3035  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "propagating/probing/maxuseless") );
3036  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "propagating/probing/maxtotaluseless") );
3037  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "propagating/probing/maxprerounds") );
3038 
3039  return SCIP_OKAY;
3040 }
3041 
3042 /** sets presolving to aggressive */
3043 static
3045  SCIP_PARAMSET* paramset, /**< parameter set */
3046  SCIP_SET* set, /**< global SCIP settings */
3047  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3048  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3049  )
3050 {
3051  SCIP_PARAM* param;
3052  char paramname[SCIP_MAXSTRLEN];
3053 
3054  /* reset previous changes on presolving parameters */
3055  SCIP_CALL( paramsetSetPresolvingDefault(paramset, set, messagehdlr, quiet) );
3056 
3057  /* explicitly change restart parameters */
3058  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "presolving/restartfac", 0.03, quiet) );
3059  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "presolving/restartminred", 0.06, quiet) );
3060 
3061  /* explicitly change parameters of setppc constraint handler, if included */
3062 #ifndef NDEBUG
3063  if( SCIPsetFindConshdlr(set, "setppc") != NULL )
3064 #endif
3065  {
3066  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "constraints/setppc/cliquelifting", TRUE, quiet) );
3067  }
3068 
3069  /* explicitly change parameters of presolver boundshift, if included */
3070 #ifndef NDEBUG
3071  if( SCIPsetFindPresol(set, "boundshift") != NULL )
3072 #endif
3073  {
3074  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/boundshift/maxrounds", -1, quiet) );
3075  }
3076 
3077  /* explicitly change parameters of presolver convertinttobin, if included */
3078 #ifndef NDEBUG
3079  if( SCIPsetFindPresol(set, "convertinttobin") != NULL )
3080 #endif
3081  {
3082  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/convertinttobin/maxrounds", 0, quiet) );
3083  }
3084 
3085  /* explicitly change parameters of presolver dualagg, if included */
3086 #ifndef NDEBUG
3087  if( SCIPsetFindPresol(set, "dualagg") != NULL )
3088 #endif
3089  {
3090  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/dualagg/maxrounds", -1, quiet) );
3091  }
3092 
3093  /* explicitly change parameters of presolver tworowbnd, if included */
3094 #ifndef NDEBUG
3095  if( SCIPsetFindPresol(set, "tworowbnd") != NULL )
3096 #endif
3097  {
3098  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/tworowbnd/maxrounds", -1, quiet) );
3099  }
3100 
3101  /* explicitly change parameters of presolver redvub, if included */
3102 #ifndef NDEBUG
3103  if( SCIPsetFindPresol(set, "redvub") != NULL )
3104 #endif
3105  {
3106  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/redvub/maxrounds", -1, quiet) );
3107  }
3108 
3109  /* explicitly change parameters of probing */
3110  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/probing/maxuseless");
3111  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
3112  if( param != NULL )
3113  {
3114  int defvalue;
3115 
3116  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
3117  defvalue = SCIPparamGetIntDefault(param);
3118 
3119  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, (int) (1.5 * defvalue), quiet) );
3120  }
3121  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/probing/maxtotaluseless");
3122  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
3123  if( param != NULL )
3124  {
3125  int defvalue;
3126 
3127  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
3128  defvalue = SCIPparamGetIntDefault(param);
3129 
3130  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, (int) (1.5 * defvalue), quiet) );
3131  }
3132 
3133  return SCIP_OKAY;
3134 }
3135 
3136 /** sets presolving to fast */
3137 static
3139  SCIP_PARAMSET* paramset, /**< parameter set */
3140  SCIP_SET* set, /**< global SCIP settings */
3141  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3142  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3143  )
3144 {
3145  SCIP_CONSHDLR** conshdlrs;
3146  SCIP_PARAM* param;
3147  char paramname[SCIP_MAXSTRLEN];
3148  int nconshdlrs;
3149  int i;
3150 
3151  /* reset previous changes on presolving parameters */
3152  SCIP_CALL( paramsetSetPresolvingDefault(paramset, set, messagehdlr, quiet) );
3153 
3154  conshdlrs = set->conshdlrs;
3155  nconshdlrs = set->nconshdlrs;
3156 
3157  /* turn off pairwise comparison for each constraint handler that has this feature */
3158  for( i = 0; i < nconshdlrs; ++i )
3159  {
3160  const char* conshdlrname;
3161  conshdlrname = SCIPconshdlrGetName(conshdlrs[i]);
3162 
3163  /* get presolpairwise parameter of constraint handler */
3164  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/presolpairwise", conshdlrname);
3165  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
3166 
3167  if( param != NULL && SCIPparamGetType(param) == SCIP_PARAMTYPE_BOOL )
3168  {
3169  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, paramname, FALSE, quiet) );
3170  }
3171  }
3172 
3173  /* explicitly turn off restarts */
3174  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/maxrestarts", 0, quiet) );
3175 
3176  /* explicitly change parameters of presolver convertinttobin, if included */
3177 #ifndef NDEBUG
3178  if( SCIPsetFindPresol(set, "convertinttobin") != NULL )
3179 #endif
3180  {
3181  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/convertinttobin/maxrounds", 0, quiet) );
3182  }
3183 
3184  /* turn off probing, if included */
3185 #ifndef NDEBUG
3186  if( SCIPsetFindProp(set, "probing") != NULL )
3187 #endif
3188  {
3189  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "propagating/probing/maxprerounds", 0, quiet) );
3190  }
3191 
3192  /* explicitly disable components constraint handler, if included */
3193 #ifndef NDEBUG
3194  if( SCIPsetFindConshdlr(set, "components") != NULL )
3195 #endif
3196  {
3197  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "constraints/components/maxprerounds", 0, quiet) );
3198  }
3199 
3200  /* explicitly disable dominated columns presolver, if included */
3201 #ifndef NDEBUG
3202  if( SCIPsetFindPresol(set, "domcol") != NULL )
3203 #endif
3204  {
3205  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/domcol/maxrounds", 0, quiet) );
3206  }
3207 
3208  /* explicitly disable gate extraction presolver, if included */
3209 #ifndef NDEBUG
3210  if( SCIPsetFindPresol(set, "gateextraction") != NULL )
3211 #endif
3212  {
3213  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/gateextraction/maxrounds", 0, quiet) );
3214  }
3215 
3216  /* explicitly forbid the use of implications in logicor presolving */
3217 #ifndef NDEBUG
3218  if( SCIPsetFindConshdlr(set, "logicor") != NULL )
3219 #endif
3220  {
3221  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "constraints/logicor/implications", 0, quiet) );
3222  }
3223 
3224  return SCIP_OKAY;
3225 }
3226 
3227 /** turns all presolving off */
3228 static
3230  SCIP_PARAMSET* paramset, /**< parameter set */
3231  SCIP_SET* set, /**< global SCIP settings */
3232  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3233  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3234  )
3235 {
3236  SCIP_PRESOL** presols;
3237  SCIP_PROP** props;
3238  SCIP_CONSHDLR** conshdlrs;
3239  char paramname[SCIP_MAXSTRLEN];
3240  int npresols;
3241  int nprops;
3242  int nconshdlrs;
3243  int i;
3244 
3245  /* reset previous changes on presolving parameters */
3246  SCIP_CALL( paramsetSetPresolvingDefault(paramset, set, messagehdlr, quiet) );
3247 
3248  presols = set->presols;
3249  npresols = set->npresols;
3250 
3251  /* turn each individual presolver off */
3252  for( i = 0; i < npresols; ++i )
3253  {
3254  const char* presolname;
3255  presolname = SCIPpresolGetName(presols[i]);
3256 
3257  /* get maxrounds parameter of presolvers */
3258  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "presolving/%s/maxrounds", presolname);
3259 
3260  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, 0, quiet) );
3261  }
3262 
3263  props = set->props;
3264  nprops = set->nprops;
3265 
3266  /* turn off presolving for each individual propagator */
3267  for( i = 0; i < nprops; ++i )
3268  {
3269  const char* propname;
3270  propname = SCIPpropGetName(props[i]);
3271 
3272  /* get maxrounds parameter of propagator */
3273  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/maxprerounds", propname);
3274 
3275  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, 0, quiet) );
3276  }
3277 
3278  conshdlrs = set->conshdlrs;
3279  nconshdlrs = set->nconshdlrs;
3280 
3281  /* turn off presolving for each individual constraint handler */
3282  for( i = 0; i < nconshdlrs; ++i )
3283  {
3284  const char* conshdlrname;
3285  conshdlrname = SCIPconshdlrGetName(conshdlrs[i]);
3286 
3287  /* get maxprerounds parameter of constraint handler */
3288  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/maxprerounds", conshdlrname);
3289 
3290  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, 0, quiet) );
3291  }
3292 
3293  /* explicitly turn off restarts */
3294  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/maxrestarts", 0, quiet) );
3295 
3296  /* set the maximum number of presolving rounds to zero */
3297  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/maxrounds", 0, quiet) );
3298 
3299  return SCIP_OKAY;
3300 }
3301 
3302 /** reset parameters that may have been changed by other SCIPparamsetSetSeparatingXyz to their default values
3303  *
3304  * @note fixed parameters stay as they are; you need to unfix them first if they should be changed, too
3305  */
3306 static
3308  SCIP_PARAMSET* paramset, /**< parameter set */
3309  SCIP_SET* set, /**< global SCIP settings */
3310  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3311  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3312  )
3313 { /*lint --e{715}*/
3314  SCIP_SEPA** sepas;
3315  SCIP_CONSHDLR** conshdlrs;
3316  char paramname[SCIP_MAXSTRLEN];
3317  int nconshdlrs;
3318  int nsepas;
3319  int i;
3320 
3321  sepas = set->sepas;
3322  nsepas = set->nsepas;
3323 
3324  /* reset separating parameters of all separators */
3325  for( i = 0; i < nsepas; ++i )
3326  {
3327  const char* sepaname;
3328  sepaname = SCIPsepaGetName(sepas[i]);
3329 
3330  /* reset frequency parameter of separator */
3331  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/freq", sepaname);
3332  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
3333 
3334  /* reset maximum number of rounds in root node */
3335  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/maxroundsroot", sepaname);
3336  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
3337 
3338  /* reset maximum number of cuts per separation in root node */
3339  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/maxsepacutsroot", sepaname);
3340  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
3341  }
3342 
3343  conshdlrs = set->conshdlrs;
3344  nconshdlrs = set->nconshdlrs;
3345 
3346  /* reset each individual constraint handler separation settings */
3347  for( i = 0; i < nconshdlrs; ++i )
3348  {
3349  const char* conshdlrname;
3350  conshdlrname = SCIPconshdlrGetName(conshdlrs[i]);
3351 
3352  /* reset separation frequency parameter of constraint handler, if available */
3353  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/sepafreq", conshdlrname);
3354  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
3355 
3356  /* reset maximal separated cuts in root node of constraint handler, if available */
3357  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/maxsepacutsroot", conshdlrname);
3358  if( SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname) != NULL )
3359  {
3360  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
3361  }
3362  }
3363 
3364  /* explicitly reset individual parameters */
3365  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "constraints/linear/separateall") );
3366  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/minorthoroot") );
3367  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/maxroundsrootsubrun") );
3368  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/maxaddrounds") );
3369  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/maxcutsroot") );
3370  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/poolfreq") );
3371  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/aggregation/maxfailsroot") );
3372  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/mcf/maxtestdelta") );
3373  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/mcf/trynegscaling") );
3374  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/aggregation/maxtriesroot") );
3375  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/aggregation/maxaggrsroot") );
3376  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/maxbounddist") );
3377  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/zerohalf/maxslackroot") );
3378  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/zerohalf/maxslack") );
3379  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/zerohalf/maxsepacutsroot") );
3380  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/zerohalf/maxroundsroot") );
3381 
3382  return SCIP_OKAY;
3383 }
3384 
3385 /** sets separating to aggressive */
3386 static
3388  SCIP_PARAMSET* paramset, /**< parameter set */
3389  SCIP_SET* set, /**< global SCIP settings */
3390  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3391  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3392  )
3393 {
3394  SCIP_CONSHDLR** conshdlrs;
3395  SCIP_SEPA** sepas;
3396  SCIP_PARAM* param;
3397  char paramname[SCIP_MAXSTRLEN];
3398  int nconshdlrs;
3399  int nsepas;
3400  int i;
3401 
3402  sepas = set->sepas;
3403  nsepas = set->nsepas;
3404 
3405  /* set all separating parameters to default values */
3406  SCIP_CALL( paramsetSetSeparatingDefault(paramset, set, messagehdlr, quiet) );
3407 
3408  /* set separating parameters of all separators */
3409  for( i = 0; i < nsepas; ++i )
3410  {
3411  const char* sepaname;
3412  sepaname = SCIPsepaGetName(sepas[i]);
3413 
3414  /* intobj and cgmip separators should stay disabled */
3415  if( strcmp(sepaname, "intobj") == 0 || strcmp(sepaname, "cgmip") == 0 )
3416  continue;
3417 
3418  /* get frequency parameter of separator */
3419  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/freq", sepaname);
3420  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
3421 
3422  if( param != NULL )
3423  {
3424  int deffreq;
3425  int newfreq;
3426 
3427  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
3428  deffreq = SCIPparamGetIntDefault(param);
3429 
3430  /* for enabled separators, change frequency to at least every 20th depths and
3431  * enable disabled separators
3432  */
3433  if( deffreq == -1 )
3434  newfreq = 0;
3435  else if( deffreq == 0 )
3436  newfreq = 20;
3437  else
3438  newfreq = MIN(deffreq, 20);
3439 
3440  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, newfreq, quiet) );
3441  }
3442 
3443  /* get maximum number of rounds in root node */
3444  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/maxroundsroot", sepaname);
3445  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
3446 
3447  if( param != NULL )
3448  {
3449  int defrounds;
3450 
3451  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
3452  defrounds = SCIPparamGetIntDefault(param);
3453 
3454  /* increase the maximum number of rounds in the root node by factor of 1.5 */
3455  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, (int) (1.5 * defrounds), quiet) );
3456  }
3457 
3458  /* get maximum number of cuts per separation in root node */
3459  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/maxsepacutsroot", sepaname);
3460  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
3461 
3462  if( param != NULL )
3463  {
3464  int defnumber;
3465 
3466  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
3467  defnumber = SCIPparamGetIntDefault(param);
3468 
3469  /* increase the maximum number of cut per separation rounds in the root node by factor of 2 */
3470  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, 2*defnumber, quiet) );
3471  }
3472  }
3473 
3474  conshdlrs = set->conshdlrs;
3475  nconshdlrs = set->nconshdlrs;
3476 
3477  /* set separating parameters of all constraint handlers */
3478  for( i = 0; i < nconshdlrs; ++i )
3479  {
3480  const char* conshdlrname;
3481  conshdlrname = SCIPconshdlrGetName(conshdlrs[i]);
3482 
3483  /* get separating frequency parameter of constraint handler */
3484  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/sepafreq", conshdlrname);
3485  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
3486 
3487  if( param != NULL )
3488  {
3489  int deffreq;
3490  int newfreq;
3491 
3492  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
3493  deffreq = SCIPparamGetIntDefault(param);
3494 
3495  /* for constraint handlers with enabled separation, change frequency to at least every 10th depths and
3496  * enable disabled separation routines
3497  */
3498  if( deffreq == -1 )
3499  newfreq = 0;
3500  else if( deffreq == 0 )
3501  newfreq = 10;
3502  else
3503  newfreq = MIN(deffreq, 10);
3504 
3505  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, newfreq, quiet) );
3506  }
3507 
3508  /* get maximal separated cuts in root node of constraint handler */
3509  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/maxsepacutsroot", conshdlrname);
3510  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
3511 
3512  if( param != NULL )
3513  {
3514  int defnumber;
3515 
3516  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
3517  defnumber = SCIPparamGetIntDefault(param);
3518 
3519  /* change maximal cuts in root node to at least 500 */
3520  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, MAX(defnumber, 500), quiet) );
3521  }
3522  }
3523 
3524  /* explicitly change general separating parameters */
3525  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "separating/minorthoroot", 0.1, quiet) );
3526  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/maxroundsrootsubrun", 5, quiet) );
3527  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/maxaddrounds", 5, quiet) );
3528  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/maxcutsroot", 5000, quiet) );
3529  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/poolfreq", 10, quiet) );
3530 
3531  /* explicitly change a separating parameter of the linear constraint handler, if included */
3532 #ifndef NDEBUG
3533  if( SCIPsetFindConshdlr(set, "linear") != NULL )
3534 #endif
3535  {
3536  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "constraints/linear/separateall", TRUE, quiet) );
3537  }
3538 
3539  /* explicitly change a separating parameter of cmir separator, if included */
3540 #ifndef NDEBUG
3541  if( SCIPsetFindSepa(set, "aggregation") != NULL )
3542 #endif
3543  {
3544  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/aggregation/maxfailsroot", 200, quiet) );
3545  }
3546 
3547  /* explicitly change separating parameters of mcf separator, if included */
3548 #ifndef NDEBUG
3549  if( SCIPsetFindSepa(set, "mcf") != NULL )
3550 #endif
3551  {
3552  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/mcf/maxtestdelta", -1, quiet) );
3553  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "separating/mcf/trynegscaling", TRUE, quiet) );
3554  }
3555 
3556  return SCIP_OKAY;
3557 }
3558 
3559 /** sets separating to fast */
3560 static
3562  SCIP_PARAMSET* paramset, /**< parameter set */
3563  SCIP_SET* set, /**< global SCIP settings */
3564  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3565  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3566  )
3567 {
3568  /* reset previous changes on separating parameters */
3569  SCIP_CALL( paramsetSetSeparatingDefault(paramset, set, messagehdlr, quiet) );
3570 
3571  /* explicitly decrease maxbounddist */
3572  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "separating/maxbounddist", 0.0, quiet) );
3573 
3574  /* explicitly turn off expensive separators, if included */
3575 #ifndef NDEBUG
3576  if( SCIPsetFindConshdlr(set, "and") != NULL )
3577 #endif
3578  {
3579  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "constraints/and/sepafreq", 0, quiet) );
3580  }
3581 #ifndef NDEBUG
3582  if( SCIPsetFindSepa(set, "aggregation") != NULL )
3583 #endif
3584  {
3585  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/aggregation/maxroundsroot", 5, quiet) );
3586  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/aggregation/maxtriesroot", 100, quiet) );
3587  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/aggregation/maxaggrsroot", 3, quiet) );
3588  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/aggregation/maxsepacutsroot", 200, quiet) );
3589  }
3590 #ifndef NDEBUG
3591  if( SCIPsetFindSepa(set, "zerohalf") != NULL )
3592 #endif
3593  {
3594  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "separating/zerohalf/maxslackroot", 0.0, quiet) );
3595  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "separating/zerohalf/maxslack", 0.0, quiet) );
3596  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/zerohalf/maxsepacutsroot", 200, quiet) );
3597  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/zerohalf/maxroundsroot", 5, quiet) );
3598  }
3599 #ifndef NDEBUG
3600  if( SCIPsetFindSepa(set, "gomory") != NULL )
3601 #endif
3602  {
3603  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/gomory/maxroundsroot", 20, quiet) );
3604  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/gomory/maxsepacutsroot", 200, quiet) );
3605  }
3606 #ifndef NDEBUG
3607  if( SCIPsetFindSepa(set, "mcf") != NULL )
3608 #endif
3609  {
3610  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/mcf/freq", -1, quiet) );
3611  }
3612 #ifndef NDEBUG
3613  if( SCIPsetFindSepa(set, "strongcg") != NULL )
3614 #endif
3615  {
3616  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/strongcg/maxroundsroot", 10, quiet) );
3617  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/strongcg/maxsepacutsroot", 200, quiet) );
3618  }
3619 
3620  return SCIP_OKAY;
3621 }
3622 
3623 /** turns all cuts off */
3624 static
3626  SCIP_PARAMSET* paramset, /**< parameter set */
3627  SCIP_SET* set, /**< global SCIP settings */
3628  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3629  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3630  )
3631 {
3632  SCIP_SEPA** sepas;
3633  SCIP_CONSHDLR** conshdlrs;
3634  char paramname[SCIP_MAXSTRLEN];
3635  int nsepas;
3636  int nconshdlrs;
3637  int i;
3638 
3639  /* reset previous changes on separating parameters */
3640  SCIP_CALL( paramsetSetSeparatingDefault(paramset, set, messagehdlr, quiet) );
3641 
3642  sepas = set->sepas;
3643  nsepas = set->nsepas;
3644 
3645  /* turn each individual separator off */
3646  for( i = 0; i < nsepas; ++i )
3647  {
3648  const char* sepaname;
3649  sepaname = SCIPsepaGetName(sepas[i]);
3650 
3651  /* get frequency parameter of separator */
3652  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/freq", sepaname);
3653  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, -1, quiet) );
3654  }
3655 
3656  conshdlrs = set->conshdlrs;
3657  nconshdlrs = set->nconshdlrs;
3658 
3659  /* turn off separation for each individual constraint handler */
3660  for( i = 0; i < nconshdlrs; ++i )
3661  {
3662  const char* conshdlrname;
3663  conshdlrname = SCIPconshdlrGetName(conshdlrs[i]);
3664 
3665  /* get separation frequency parameter of constraint handler */
3666  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/sepafreq", conshdlrname);
3667  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, -1, quiet) );
3668  }
3669 
3670  return SCIP_OKAY;
3671 }
3672 
3673 /** sets parameters to
3674  *
3675  * - \ref SCIP_PARAMEMPHASIS_DEFAULT to use default values (see also SCIPparamsetSetToDefault())
3676  * - \ref SCIP_PARAMEMPHASIS_COUNTER to get feasible and "fast" counting process
3677  * - \ref SCIP_PARAMEMPHASIS_CPSOLVER to get CP like search (e.g. no LP relaxation)
3678  * - \ref SCIP_PARAMEMPHASIS_EASYCIP to solve easy problems fast
3679  * - \ref SCIP_PARAMEMPHASIS_FEASIBILITY to detect feasibility fast
3680  * - \ref SCIP_PARAMEMPHASIS_HARDLP to be capable to handle hard LPs
3681  * - \ref SCIP_PARAMEMPHASIS_OPTIMALITY to prove optimality fast
3682  * - \ref SCIP_PARAMEMPHASIS_PHASEFEAS to find feasible solutions during a 3 phase solution process
3683  * - \ref SCIP_PARAMEMPHASIS_PHASEIMPROVE to find improved solutions during a 3 phase solution process
3684  * - \ref SCIP_PARAMEMPHASIS_PHASEPROOF to proof optimality during a 3 phase solution process
3685  */
3687  SCIP_PARAMSET* paramset, /**< parameter set */
3688  SCIP_SET* set, /**< global SCIP settings */
3689  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3690  SCIP_PARAMEMPHASIS paramemphasis, /**< parameter emphasis */
3691  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3692  )
3693 {
3694  /* reset all parameter to default */
3695  SCIP_CALL( SCIPparamsetSetToDefaults(paramset, set, messagehdlr) );
3696 
3697  switch( paramemphasis )
3698  {
3700  /* the default values are already set */
3701  break;
3702 
3704  /* TODO: should constraints/linear/detectlowerbound and detectcutoffbound be set to FALSE? */
3705  /* avoid logicor upgrade since the logicor constraint handler does not perform full propagation */
3706  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "constraints/linear/upgrade/logicor", FALSE, quiet) );
3707 
3708  /* set priority for inference branching to highest possible value */
3709  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "branching/inference/priority", INT_MAX/4, quiet) );
3710 
3711  /* set priority for depth first search to highest possible value */
3712  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "nodeselection/dfs/stdpriority", INT_MAX/4, quiet) );
3713 
3714  /* avoid that the ZIMPL reader transforms the problem before the problem is generated */
3715  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "reading/zplreader/usestartsol", FALSE, quiet) );
3716 
3717  /* turn off all heuristics */
3718  SCIP_CALL( paramsetSetHeuristicsOff(paramset, set, messagehdlr, quiet) );
3719 
3720  /* turn off all separation */
3721  SCIP_CALL( paramsetSetSeparatingOff(paramset, set, messagehdlr, quiet) );
3722 
3723  /* turn off restart */
3724  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/maxrestarts", 0, quiet) );
3725 
3726  /* unlimited number of propagation rounds in any branch and bound node */
3727  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "propagating/maxrounds", -1, quiet) );
3728  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "propagating/maxroundsroot", -1, quiet) );
3729 
3730  /* adjust conflict analysis for depth first search */
3731  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "conflict/fuiplevels", 1, quiet) );
3732  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "conflict/dynamic", FALSE, quiet) );
3733 
3734  /* prefer binary variables for branching */
3735  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "branching/preferbinary", TRUE, quiet) );
3736 
3737  /* turn on aggressive constraint aging */
3738  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "constraints/agelimit", 1, quiet) );
3739 
3740  /* turn off components presolver since we are currently not able to handle that in case of counting */
3741 #ifndef NDEBUG
3742  if( SCIPsetFindConshdlr(set, "components") != NULL )
3743 #endif
3744  {
3745  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "constraints/components/maxprerounds", 0, quiet) );
3746  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "constraints/components/propfreq", -1, quiet) );
3747  }
3748  break;
3749 
3751  /* shrink the minimal maximum value for the conflict length */
3752  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "conflict/minmaxvars", 10, quiet) );
3753 
3754  /* use only first unique implication point */
3755  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "conflict/fuiplevels", 1, quiet) );
3756 
3757  /* do not use reconversion conflicts */
3758  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "conflict/reconvlevels", 0, quiet) );
3759 
3760  /* after 250 conflict we force a restart since then the variable statistics are reasonable initialized */
3761  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "conflict/restartnum", 250, quiet) );
3762 
3763  /* increase the number of conflicts which induce a restart */
3764  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "conflict/restartfac", 2.0, quiet) );
3765 
3766  /* weight the variable which made into a conflict */
3767  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "conflict/conflictweight", 1.0, quiet) );
3768 
3769  /* do not check pseudo solution (for performance reasons) */
3770  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "constraints/disableenfops", TRUE, quiet) );
3771 
3772  /* use value based history to detect a reasonable branching point */
3773  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "history/valuebased", TRUE, quiet) );
3774 
3775  /* turn of LP relaxation */
3776  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "lp/solvefreq", -1, quiet) );
3777 
3778  /* prefer the down branch in case the value based history does not suggest something */
3779  SCIP_CALL( paramSetChar(paramset, set, messagehdlr, "nodeselection/childsel", 'd', quiet) );
3780 
3781  /* accept any bound change */
3782  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "numerics/boundstreps", 1e-6, quiet) );
3783 
3784  /* allow for at most 10 restart, after that the value based history should be reliable */
3785  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/maxrestarts", 10, quiet) );
3786 
3787  /* set priority for depth first search to highest possible value */
3788  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "nodeselection/dfs/stdpriority", INT_MAX/4, quiet) );
3789 
3790  break;
3791 
3793  /* set heuristics to fast, to avoid spending to much time for involved heuristics */
3794  SCIP_CALL( paramsetSetHeuristicsFast(paramset, set, messagehdlr, quiet) );
3795 
3796  /* set presolving to fast, to avoid spending to much time for involved presolving */
3797  SCIP_CALL( paramsetSetPresolvingFast(paramset, set, messagehdlr, quiet) );
3798 
3799  /* set separating to fast, to avoid spending to much time for involved separators */
3800  SCIP_CALL( paramsetSetSeparatingFast(paramset, set, messagehdlr, quiet) );
3801 
3802  break;
3803 
3805  /* set heuristics aggressive */
3806  SCIP_CALL( paramsetSetHeuristicsAggressive(paramset, set, messagehdlr, quiet) );
3807 
3808  /* reduce the amount of separation rounds and disable most expensive separators */
3809  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/maxrounds", 1, quiet) );
3810  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/maxroundsroot", 5, quiet) );
3811  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/aggregation/freq", -1, quiet) );
3812  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/mcf/freq", -1, quiet) );
3813 
3814  /* set priority for node selection "restartdfs" to be higher as the current used one */
3815  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "nodeselection/restartdfs/stdpriority", INT_MAX/4, quiet) );
3816  break;
3817 
3819  /* set heuristics to fast, to avoid heuristics which solve also an LP */
3820  SCIP_CALL( paramsetSetHeuristicsFast(paramset, set, messagehdlr, quiet) );
3821 
3822  /* set presolving to fast, to avoid spending to much time for involved presolving */
3823  SCIP_CALL( paramsetSetPresolvingFast(paramset, set, messagehdlr, quiet) );
3824 
3825  /* reduce the amount of strong branching */
3826  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "branching/relpscost/maxreliable", 1.0, quiet) );
3827  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "branching/relpscost/inititer", 10, quiet) );
3828 
3829  /* reduce the amount of separation rounds */
3830  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/maxrounds", 1, quiet) );
3831  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/maxroundsroot", 5, quiet) );
3832 
3833  break;
3834 
3836  /* set cuts aggressive */
3837  SCIP_CALL( paramsetSetSeparatingAggressive(paramset, set, messagehdlr, quiet) );
3838 
3839  /* increase the amount of strong branching */
3840  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "branching/fullstrong/maxdepth", 10, quiet) );
3841  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "branching/fullstrong/priority", INT_MAX / 4, quiet) );
3842  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "branching/fullstrong/maxbounddist", 0.0, quiet) );
3843  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "branching/relpscost/sbiterquot", 1.0, quiet) );
3844  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "branching/relpscost/sbiterofs", 1000000, quiet) );
3845  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "branching/relpscost/maxreliable", 10.0, quiet) );
3846  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "branching/relpscost/usehyptestforreliability",TRUE, quiet) );
3847  break;
3849 
3850  /* enable two phase node selection: UCT will run first, but deactivate itself after a small number of nodes */
3851  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "nodeselection/uct/stdpriority", (INT_MAX / 4) + 1, quiet) );
3852  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "nodeselection/restartdfs/stdpriority", INT_MAX/4, quiet) );
3853 
3854  /* enable inference branching */
3855  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "branching/inference/priority", INT_MAX / 4, quiet) );
3856  break;
3857 
3859  /* use UCT node selection in all subSCIP heuristics that have this parameter */
3860  {
3861  int h;
3862  SCIP_HEUR** heurs = set->heurs;
3863  int nheurs = set->nheurs;
3864 
3865  for( h = 0; h < nheurs; ++h )
3866  {
3867  char paramname[SCIP_MAXSTRLEN];
3868  if( SCIPheurUsesSubscip(heurs[h]) )
3869  {
3870  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/useuct", SCIPheurGetName(heurs[h]));
3871 
3872  if( (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname) != NULL )
3873  {
3874  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, paramname, TRUE, quiet) );
3875  }
3876  }
3877  }
3878  }
3879  break;
3881  /* deactivate primal heuristics */
3882  SCIP_CALL( paramsetSetHeuristicsOff(paramset, set, messagehdlr, quiet) );
3883 
3884  /* make aggressive use of separators, also locally */
3885  SCIP_CALL( paramsetSetSeparatingAggressive(paramset, set, messagehdlr, quiet) );
3886 
3887  /* use depth-first node selection strategy that makes best use of LP warmstarts */
3888  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "nodeselection/dfs/stdpriority", INT_MAX/4, quiet) );
3889 
3890  /* enable dynamic weights for reliability pseudo cost branching */
3891  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "branching/relpscost/dynamicweights", TRUE, quiet) );
3892  break;
3893 
3894  default:
3895  SCIPerrorMessage("the parameter setting <%d> is not allowed for emphasis call\n", paramemphasis);
3896  return SCIP_INVALIDCALL;
3897  }
3898  return SCIP_OKAY;
3899 }
3900 
3901 /** sets parameters to deactivate separators and heuristics that use auxiliary SCIP instances; should be called for
3902  * auxiliary SCIP instances to avoid recursion
3903  */
3905  SCIP_PARAMSET* paramset, /**< parameter set */
3906  SCIP_SET* set, /**< global SCIP settings */
3907  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3908  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3909  )
3910 {
3911  SCIP_HEUR** heurs;
3912  SCIP_SEPA** sepas;
3913 
3914  char paramname[SCIP_MAXSTRLEN];
3915 
3916  int nheurs;
3917  int nsepas;
3918  int i;
3919 
3920  heurs = set->heurs;
3921  nheurs = set->nheurs;
3922 
3923  /* disable all heuristics that use auxiliary SCIP instances */
3924  for( i = 0; i < nheurs; ++i )
3925  {
3926  if( SCIPheurUsesSubscip(heurs[i]) )
3927  {
3928  const char* heurname;
3929  heurname = SCIPheurGetName(heurs[i]);
3930 
3931  /* get frequency parameter of heuristic */
3932  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/freq", heurname);
3933 
3934  /* we have to unfix the parameter if it fixed and not already set to -1 */
3935  if( SCIPparamsetIsFixed(paramset, paramname) )
3936  {
3937  int oldfreq;
3938 
3939  SCIP_CALL( SCIPparamsetGetInt(paramset, paramname, &oldfreq) );
3940 
3941  /* if the frequency is already set to -1, we do not have to unfix it, but must not try to set it, either */
3942  if( oldfreq == -1 )
3943  continue;
3944 
3945  /* unfix parameter */
3946  SCIPmessageFPrintInfo(messagehdlr, NULL, "unfixing parameter %s in order to disable sub-SCIPs in the current (sub-)SCIP instance\n", paramname);
3947  SCIP_CALL( SCIPparamsetFix(paramset, paramname, FALSE) );
3948  }
3949 
3950  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, -1, quiet) );
3951  }
3952  }
3953 
3954  sepas = set->sepas;
3955  nsepas = set->nsepas;
3956 
3957  /* disable all separators that use auxiliary SCIP instances */
3958  for( i = 0; i < nsepas; ++i )
3959  {
3960  if( SCIPsepaUsesSubscip(sepas[i]) )
3961  {
3962  const char* sepaname;
3963  sepaname = SCIPsepaGetName(sepas[i]);
3964 
3965  /* get frequency parameter of separator */
3966  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/freq", sepaname);
3967 
3968  /* we have to unfix the parameter if it fixed and not already set to -1 */
3969  if( SCIPparamsetIsFixed(paramset, paramname) )
3970  {
3971  int oldfreq;
3972 
3973  SCIP_CALL( SCIPparamsetGetInt(paramset, paramname, &oldfreq) );
3974 
3975  /* if the frequency is already set to -1, we do not have to unfix it, but must not try to set it, either */
3976  if( oldfreq == -1 )
3977  continue;
3978 
3979  /* unfix parameter */
3980  SCIPmessageFPrintInfo(messagehdlr, NULL, "unfixing parameter %s in order to disable sub-SCIPs in the current (sub-)SCIP instance\n", paramname);
3981  SCIP_CALL( SCIPparamsetFix(paramset, paramname, FALSE) );
3982  }
3983 
3984  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, -1, quiet) );
3985  }
3986  }
3987 
3988  /* turn off components constraint handler */
3989  #ifndef NDEBUG
3990  if( SCIPsetFindConshdlr(set, "components") != NULL )
3991 #endif
3992  {
3993  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "constraints/components/maxprerounds", 0, quiet) );
3994  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "constraints/components/propfreq", -1, quiet) );
3995  }
3996 
3997  return SCIP_OKAY;
3998 }
3999 
4000 /** sets heuristic parameters values to
4001  * - SCIP_PARAMSETTING_DEFAULT which are the default values of all heuristic parameters
4002  * - SCIP_PARAMSETTING_FAST such that the time spent on heuristics is decreased
4003  * - SCIP_PARAMSETTING_AGGRESSIVE such that the heuristics are called more aggressively
4004  * - SCIP_PARAMSETTING_OFF which turn off all heuristics
4005  */
4007  SCIP_PARAMSET* paramset, /**< parameter set */
4008  SCIP_SET* set, /**< global SCIP settings */
4009  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4010  SCIP_PARAMSETTING paramsetting, /**< parameter settings */
4011  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4012  )
4013 {
4014  switch( paramsetting )
4015  {
4017  SCIP_CALL( paramsetSetHeuristicsDefault(paramset, set, messagehdlr, quiet) );
4018  break;
4019  case SCIP_PARAMSETTING_OFF:
4020  SCIP_CALL( paramsetSetHeuristicsOff(paramset, set, messagehdlr, quiet) );
4021  break;
4023  SCIP_CALL( paramsetSetHeuristicsFast(paramset, set, messagehdlr, quiet) );
4024  break;
4026  SCIP_CALL( paramsetSetHeuristicsAggressive(paramset, set, messagehdlr, quiet) );
4027  break;
4028  default:
4029  SCIPerrorMessage("the parameter setting <%d> is not allowed for heuristics\n", paramsetting);
4030  return SCIP_INVALIDCALL;
4031  }
4032 
4033  return SCIP_OKAY;
4034 }
4035 
4036 /** sets presolving parameters to
4037  * - SCIP_PARAMSETTING_DEFAULT which are the default values of all presolving parameters
4038  * - SCIP_PARAMSETTING_FAST such that the time spent on presolving is decreased
4039  * - SCIP_PARAMSETTING_AGGRESSIVE such that the presolving is more aggressive
4040  * - SCIP_PARAMSETTING_OFF which turn off all presolving
4041  */
4043  SCIP_PARAMSET* paramset, /**< parameter set */
4044  SCIP_SET* set, /**< global SCIP settings */
4045  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4046  SCIP_PARAMSETTING paramsetting, /**< parameter settings */
4047  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4048  )
4049 {
4050  switch( paramsetting )
4051  {
4053  SCIP_CALL( paramsetSetPresolvingDefault(paramset, set, messagehdlr, quiet) );
4054  break;
4055  case SCIP_PARAMSETTING_OFF:
4056  SCIP_CALL( paramsetSetPresolvingOff(paramset, set, messagehdlr, quiet) );
4057  break;
4059  SCIP_CALL( paramsetSetPresolvingFast(paramset, set, messagehdlr, quiet) );
4060  break;
4062  SCIP_CALL( paramsetSetPresolvingAggressive(paramset, set, messagehdlr, quiet) );
4063  break;
4064  default:
4065  SCIPerrorMessage("the parameter setting <%d> is not allowed for presolving\n", paramsetting);
4066  return SCIP_INVALIDCALL;
4067  }
4068 
4069  return SCIP_OKAY;
4070 }
4071 
4072 /** sets separating parameters to
4073  * - SCIP_PARAMSETTING_DEFAULT which are the default values of all separating parameters
4074  * - SCIP_PARAMSETTING_FAST such that the time spent on separating is decreased
4075  * - SCIP_PARAMSETTING_AGGRESSIVE such that separating is more aggressive
4076  * - SCIP_PARAMSETTING_OFF which turn off all separating
4077  */
4079  SCIP_PARAMSET* paramset, /**< parameter set */
4080  SCIP_SET* set, /**< global SCIP settings */
4081  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4082  SCIP_PARAMSETTING paramsetting, /**< parameter settings */
4083  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4084  )
4085 {
4086  switch( paramsetting )
4087  {
4089  SCIP_CALL( paramsetSetSeparatingDefault(paramset, set, messagehdlr, quiet) );
4090  break;
4091  case SCIP_PARAMSETTING_OFF:
4092  SCIP_CALL( paramsetSetSeparatingOff(paramset, set, messagehdlr, quiet) );
4093  break;
4095  SCIP_CALL( paramsetSetSeparatingFast(paramset, set, messagehdlr, quiet) );
4096  break;
4098  SCIP_CALL( paramsetSetSeparatingAggressive(paramset, set, messagehdlr, quiet) );
4099  break;
4100  default:
4101  SCIPerrorMessage("the parameter setting <%d> is not allowed for separating\n", paramsetting);
4102  return SCIP_INVALIDCALL;
4103  }
4104 
4105  return SCIP_OKAY;
4106 }
4107 
4108 /** returns the array of parameters */
4110  SCIP_PARAMSET* paramset /**< parameter set */
4111  )
4112 {
4113  assert(paramset != NULL);
4114 
4115  return paramset->params;
4116 }
4117 
4118 /** returns the number of parameters in the parameter set */
4120  SCIP_PARAMSET* paramset /**< parameter set */
4121  )
4122 {
4123  assert(paramset != NULL);
4124 
4125  return paramset->nparams;
4126 }
4127 
4128 /** copies all parameter values of the source parameter set to the corresponding parameters in the target set
4129  *
4130  * by default reoptimization is disabled after copying the parameters. if you want to use reoptimization, you have
4131  * to enable it explicitly.
4132  */
4134  SCIP_PARAMSET* sourceparamset, /**< source parameter set */
4135  SCIP_PARAMSET* targetparamset, /**< target parameter set */
4136  SCIP_SET* set, /**< global SCIP settings of target SCIP */
4137  SCIP_MESSAGEHDLR* messagehdlr /**< message handler of target SCIP */
4138  )
4139 {
4140  int i;
4141 
4142  assert(sourceparamset != NULL);
4143  assert(targetparamset != NULL);
4144  assert(sourceparamset != targetparamset);
4145  assert(set != NULL);
4146 
4147  assert(sourceparamset->nparams == 0 || sourceparamset->params != NULL);
4148  assert(targetparamset->nparams == 0 || targetparamset->params != NULL);
4149 
4150  for( i = 0; i < sourceparamset->nparams; ++i )
4151  {
4152  SCIP_PARAM* sourceparam;
4153  SCIP_PARAM* targetparam;
4154  const char* paramname;
4155 
4156  sourceparam = sourceparamset->params[i];
4157  assert(sourceparam != NULL);
4158 
4159  /* find parameter of same name in target scip */
4160  paramname = SCIPparamGetName(sourceparam);
4161  targetparam = (SCIP_PARAM*)SCIPhashtableRetrieve(targetparamset->hashtable, (void*)paramname);
4162 
4163  /* if a plugin was not copied, the parameter does not exist in the target SCIP */
4164  if( targetparam == NULL )
4165  continue;
4166 
4167  assert(SCIPparamGetType(sourceparam) == SCIPparamGetType(targetparam));
4168 
4169  /* set value of target parameter to value of source parameter */
4170  switch( SCIPparamGetType(sourceparam) )
4171  {
4172  case SCIP_PARAMTYPE_BOOL:
4173  SCIP_CALL( paramCopyBool(sourceparam, targetparam, set, messagehdlr) );
4174  break;
4175 
4176  case SCIP_PARAMTYPE_INT:
4177  SCIP_CALL( paramCopyInt(sourceparam, targetparam, set, messagehdlr) );
4178  break;
4179 
4181  SCIP_CALL( paramCopyLongint(sourceparam, targetparam, set, messagehdlr) );
4182  break;
4183 
4184  case SCIP_PARAMTYPE_REAL:
4185  SCIP_CALL( paramCopyReal(sourceparam, targetparam, set, messagehdlr) );
4186  break;
4187 
4188  case SCIP_PARAMTYPE_CHAR:
4189  SCIP_CALL( paramCopyChar(sourceparam, targetparam, set, messagehdlr) );
4190  break;
4191 
4192  case SCIP_PARAMTYPE_STRING:
4193  /* the visualization parameters are explicitly not copied to avoid that the visualization file of the original SCIP is overwritten;
4194  * to avoid a hard coded comparison, each parameter could get a Bool flag which tells if the value
4195  * of that parameter can be copied
4196  */
4197  if( strncmp(sourceparam->name, "visual/", 7) != 0 )
4198  {
4199  SCIP_CALL( paramCopyString(sourceparam, targetparam, set, messagehdlr) );
4200  }
4201  break;
4202 
4203  default:
4204  SCIPerrorMessage("unknown parameter type\n");
4205  return SCIP_INVALIDDATA;
4206  }
4207 
4208  /* copy fixing status of parameter */
4209  SCIPparamSetFixed(targetparam, SCIPparamIsFixed(sourceparam));
4210  }
4211 
4212  /* disable reoptimization explicitly */
4213  if( set->reopt_enable )
4214  {
4215  if( SCIPsetIsParamFixed(set, "reoptimization/enable") )
4216  {
4217  SCIP_CALL( SCIPsetChgParamFixed(set, "reoptimization/enable", FALSE) );
4218  }
4219  SCIP_CALL( SCIPparamsetSetBool(targetparamset, set, messagehdlr, "reoptimization/enable", FALSE) );
4220  SCIP_CALL( SCIPsetSetReoptimizationParams(set, messagehdlr) );
4221  }
4222 
4223  return SCIP_OKAY;
4224 }
4225 
4226 /** sets fixing status of given parameter */
4228  SCIP_PARAM* param, /**< parameter */
4229  SCIP_Bool fixed /**< new fixing status of the parameter */
4230  )
4231 {
4232  assert(param != NULL);
4233 
4234  param->isfixed = fixed;
4235 }
4236 
4237 /** checks whether value of bool parameter is valid */
4239  SCIP_PARAM* param, /**< parameter */
4240  SCIP_Bool value /**< value to check */
4241  )
4242 { /*lint --e{715}*/
4243  return ( value == TRUE || value == FALSE );
4244 }
4245 
4246 /** checks whether value of integer parameter is valid */
4248  SCIP_PARAM* param, /**< parameter */
4249  int value /**< value to check */
4250  )
4251 {
4252  assert(param != NULL);
4253 
4254  return ( value >= param->data.intparam.minvalue && value <= param->data.intparam.maxvalue );
4255 }
4256 
4257 /** checks whether value of SCIP_Longint parameter is valid */
4259  SCIP_PARAM* param, /**< parameter */
4260  SCIP_Longint value /**< value to check */
4261  )
4262 {
4263  assert( param != NULL );
4264 
4265  return ( value >= param->data.longintparam.minvalue && value <= param->data.longintparam.maxvalue );
4266 }
4267 
4268 /** checks whether value of SCIP_Real parameter is valid */
4270  SCIP_PARAM* param, /**< parameter */
4271  SCIP_Real value /**< value to check */
4272  )
4273 {
4274  assert( param != NULL );
4275 
4276  return ( value >= param->data.realparam.minvalue && value <= param->data.realparam.maxvalue );
4277 }
4278 
4279 /** checks whether value of char parameter is valid */
4281  SCIP_PARAM* param, /**< parameter */
4282  const char value /**< value to check */
4283  )
4284 {
4285  assert( param != NULL );
4286 
4287  if( value == '\b' || value == '\f' || value == '\n' || value == '\r' || value == '\v' )
4288  return FALSE;
4289 
4290  if( param->data.charparam.allowedvalues != NULL )
4291  {
4292  char* c;
4293 
4294  c = param->data.charparam.allowedvalues;
4295  while( *c != '\0' && *c != value )
4296  c++;
4297 
4298  if( *c != value )
4299  return FALSE;
4300  }
4301 
4302  return TRUE;
4303 }
4304 
4305 /** checks whether value of string parameter is valid */
4307  SCIP_PARAM* param, /**< parameter */
4308  const char* value /**< value to check */
4309  )
4310 { /*lint --e{715}*/
4311  unsigned int i;
4312 
4313  for( i = 0; i < (unsigned int) strlen(value); ++i )
4314  {
4315  if( value[i] == '\b' || value[i] == '\f' || value[i] == '\n' || value[i] == '\r' || value[i] == '\v' )
4316  return FALSE;
4317  }
4318  return TRUE;
4319 }
4320 
4321 /** sets value of SCIP_Bool parameter */
4323  SCIP_PARAM* param, /**< parameter */
4324  SCIP_SET* set, /**< global SCIP settings, or NULL if param change method should not be called */
4325  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4326  SCIP_Bool value, /**< new value of the parameter */
4327  SCIP_Bool initialize, /**< is this the initialization of the parameter? */
4328  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4329  )
4330 {
4331  assert(param != NULL);
4332 
4333  /* check, if value is possible for the parameter and the parameter is not fixed */
4334  SCIP_CALL_QUIET( paramTestBool(param, messagehdlr, value) );
4335 
4336  /* is the value of the parameter changed? */
4337  if( initialize || (param->data.boolparam.valueptr != NULL && *param->data.boolparam.valueptr != value)
4338  || (param->data.boolparam.valueptr == NULL && param->data.boolparam.curvalue != value) )
4339  {
4340  SCIP_CALL_QUIET( paramTestFixed(param, messagehdlr) );
4341 
4342  /* set the parameter's current value */
4343  if( param->data.boolparam.valueptr != NULL )
4344  *param->data.boolparam.valueptr = value;
4345  else
4346  param->data.boolparam.curvalue = value;
4347 
4348  /* call the parameter's change information method */
4349  if( param->paramchgd != NULL && set != NULL )
4350  {
4351  SCIP_CALL( param->paramchgd(set->scip, param) );
4352  }
4353  }
4354 
4355  if( !quiet )
4356  {
4357  SCIP_CALL( paramWrite(param, messagehdlr, NULL, FALSE, TRUE) );
4358  }
4359 
4360  return SCIP_OKAY;
4361 }
4362 
4363 /** sets value of int parameter */
4365  SCIP_PARAM* param, /**< parameter */
4366  SCIP_SET* set, /**< global SCIP settings, or NULL if param change method should not be called */
4367  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4368  int value, /**< new value of the parameter */
4369  SCIP_Bool initialize, /**< is this the initialization of the parameter? */
4370  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4371  )
4372 {
4373  assert(param != NULL);
4374 
4375  /* check, if value is possible for the parameter and the parameter is not fixed */
4376  SCIP_CALL_QUIET( paramTestInt(param, messagehdlr, value) );
4377 
4378  /* is the value of the parameter changed? */
4379  if( initialize || (param->data.intparam.valueptr != NULL && *param->data.intparam.valueptr != value)
4380  || (param->data.intparam.valueptr == NULL && param->data.intparam.curvalue != value) )
4381  {
4382  SCIP_CALL_QUIET( paramTestFixed(param, messagehdlr) );
4383 
4384  /* set the parameter's current value */
4385  if( param->data.intparam.valueptr != NULL )
4386  *param->data.intparam.valueptr = value;
4387  else
4388  param->data.intparam.curvalue = value;
4389 
4390  /* call the parameter's change information method */
4391  if( param->paramchgd != NULL && set != NULL )
4392  {
4393  SCIP_CALL( param->paramchgd(set->scip, param) );
4394  }
4395  }
4396 
4397  if( !quiet )
4398  {
4399  SCIP_CALL( paramWrite(param, messagehdlr, NULL, FALSE, TRUE) );
4400  }
4401 
4402  return SCIP_OKAY;
4403 }
4404 
4405 /** sets value of SCIP_Longint parameter */
4407  SCIP_PARAM* param, /**< parameter */
4408  SCIP_SET* set, /**< global SCIP settings, or NULL if param change method should not be called */
4409  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4410  SCIP_Longint value, /**< new value of the parameter */
4411  SCIP_Bool initialize, /**< is this the initialization of the parameter? */
4412  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4413  )
4414 {
4415  assert(param != NULL);
4416 
4417  /* check, if value is possible for the parameter and the parameter is not fixed */
4418  SCIP_CALL_QUIET( paramTestLongint(param, messagehdlr, value) );
4419 
4420  /* is the value of the parameter changed? */
4421  if( initialize || (param->data.longintparam.valueptr != NULL && *param->data.longintparam.valueptr != value)
4422  || (param->data.longintparam.valueptr == NULL && param->data.longintparam.curvalue != value) )
4423  {
4424  SCIP_CALL_QUIET( paramTestFixed(param, messagehdlr) );
4425 
4426  /* set the parameter's current value */
4427  if( param->data.longintparam.valueptr != NULL )
4428  *param->data.longintparam.valueptr = value;
4429  else
4430  param->data.longintparam.curvalue = value;
4431 
4432  /* call the parameter's change information method */
4433  if( param->paramchgd != NULL && set != NULL )
4434  {
4435  SCIP_CALL( param->paramchgd(set->scip, param) );
4436  }
4437  }
4438 
4439  if( !quiet )
4440  {
4441  SCIP_CALL( paramWrite(param, messagehdlr, NULL, FALSE, TRUE) );
4442  }
4443 
4444  return SCIP_OKAY;
4445 }
4446 
4447 /** sets value of SCIP_Real parameter */
4449  SCIP_PARAM* param, /**< parameter */
4450  SCIP_SET* set, /**< global SCIP settings, or NULL if param change method should not be called */
4451  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4452  SCIP_Real value, /**< new value of the parameter */
4453  SCIP_Bool initialize, /**< is this the initialization of the parameter? */
4454  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4455  )
4456 {
4457  assert(param != NULL);
4458 
4459  /* check, if value is possible for the parameter and the parameter is not fixed */
4460  value = MAX(value, SCIP_REAL_MIN);
4461  value = MIN(value, SCIP_REAL_MAX);
4462  SCIP_CALL_QUIET( paramTestReal(param, messagehdlr, value) );
4463 
4464  /* is the value of the parameter changed? */
4465  if( initialize || (param->data.realparam.valueptr != NULL && *param->data.realparam.valueptr != value) /*lint !e777*/
4466  || (param->data.realparam.valueptr == NULL && param->data.realparam.curvalue != value) ) /*lint !e777*/
4467  {
4468  SCIP_CALL_QUIET( paramTestFixed(param, messagehdlr) );
4469 
4470  /* set the parameter's current value */
4471  if( param->data.realparam.valueptr != NULL )
4472  *param->data.realparam.valueptr = value;
4473  else
4474  param->data.realparam.curvalue = value;
4475 
4476  /* call the parameter's change information method */
4477  if( param->paramchgd != NULL && set != NULL )
4478  {
4479  SCIP_CALL( param->paramchgd(set->scip, param) );
4480  }
4481  }
4482 
4483  if( !quiet )
4484  {
4485  SCIP_CALL( paramWrite(param, messagehdlr, NULL, FALSE, TRUE) );
4486  }
4487 
4488  return SCIP_OKAY;
4489 }
4490 
4491 /** sets value of char parameter */
4493  SCIP_PARAM* param, /**< parameter */
4494  SCIP_SET* set, /**< global SCIP settings, or NULL if param change method should not be called */
4495  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4496  char value, /**< new value of the parameter */
4497  SCIP_Bool initialize, /**< is this the initialization of the parameter? */
4498  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4499  )
4500 {
4501  assert(param != NULL);
4502 
4503  /* check, if value is possible for the parameter and the parameter is not fixed */
4504  SCIP_CALL_QUIET( paramTestChar(param, messagehdlr, value) );
4505 
4506  /* is the value of the parameter changed? */
4507  if( initialize || (param->data.charparam.valueptr != NULL && *param->data.charparam.valueptr != value)
4508  || (param->data.charparam.valueptr == NULL && param->data.charparam.curvalue != value) )
4509  {
4510  SCIP_CALL_QUIET( paramTestFixed(param, messagehdlr) );
4511 
4512  /* set the parameter's current value */
4513  if( param->data.charparam.valueptr != NULL )
4514  *param->data.charparam.valueptr = value;
4515  else
4516  param->data.charparam.curvalue = value;
4517 
4518  /* call the parameter's change information method */
4519  if( param->paramchgd != NULL && set != NULL )
4520  {
4521  SCIP_CALL( param->paramchgd(set->scip, param) );
4522  }
4523  }
4524 
4525  if( !quiet )
4526  {
4527  SCIP_CALL( paramWrite(param, messagehdlr, NULL, FALSE, TRUE) );
4528  }
4529 
4530  return SCIP_OKAY;
4531 }
4532 
4533 /** sets value of string parameter */
4535  SCIP_PARAM* param, /**< parameter */
4536  SCIP_SET* set, /**< global SCIP settings, or NULL if param change method should not be called */
4537  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4538  const char* value, /**< new value of the parameter */
4539  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4540  )
4541 {
4542  assert(param != NULL);
4543 
4544  /* check, if value is possible for the parameter and the parameter is not fixed */
4545  SCIP_CALL_QUIET( paramTestString(param, messagehdlr, value) );
4546  SCIP_CALL_QUIET( paramTestFixed(param, messagehdlr) );
4547 
4548  /* set the parameter's current value */
4549  if( param->data.stringparam.valueptr != NULL )
4550  {
4552  SCIP_ALLOC( BMSduplicateMemoryArray(param->data.stringparam.valueptr, value, strlen(value)+1) );
4553  }
4554  else
4555  {
4557  SCIP_ALLOC( BMSduplicateMemoryArray(&param->data.stringparam.curvalue, value, strlen(value)+1) );
4558  }
4559 
4560  /* call the parameter's change information method */
4561  if( param->paramchgd != NULL && set != NULL )
4562  {
4563  SCIP_CALL( param->paramchgd(set->scip, param) );
4564  }
4565 
4566  if( !quiet )
4567  {
4568  SCIP_CALL( paramWrite(param, messagehdlr, NULL, FALSE, TRUE) );
4569  }
4570 
4571  return SCIP_OKAY;
4572 }
4573 
4574 
4575 /** changes default value of SCIP_Bool parameter */
4577  SCIP_PARAM* param, /**< parameter */
4578  SCIP_Bool defaultvalue /**< new default value */
4579  )
4580 {
4581  assert(param != NULL);
4582  assert(param->paramtype == SCIP_PARAMTYPE_BOOL);
4583 
4584  param->data.boolparam.defaultvalue = defaultvalue;
4585 }
4586 
4587 /** changes default value of int parameter */
4589  SCIP_PARAM* param, /**< parameter */
4590  int defaultvalue /**< new default value */
4591  )
4592 {
4593  assert(param != NULL);
4594  assert(param->paramtype == SCIP_PARAMTYPE_INT);
4595 
4596  assert(param->data.intparam.minvalue <= defaultvalue && param->data.intparam.maxvalue >= defaultvalue);
4597 
4598  param->data.intparam.defaultvalue = defaultvalue;
4599 }
4600 
4601 /** sets the parameter to its default setting */
4603  SCIP_PARAM* param, /**< parameter */
4604  SCIP_SET* set, /**< global SCIP settings */
4605  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
4606  )
4607 {
4608  assert(param != NULL);
4609 
4610  /* do not change the parameter if it is fixed */
4611  if( SCIPparamIsFixed(param) )
4612  {
4613  SCIPsetDebugMsg(set, "parameter <%s> is fixed and is not reset to its default value.\n", param->name);
4614 
4615  return SCIP_OKAY;
4616  }
4617 
4618  switch( param->paramtype )
4619  {
4620  case SCIP_PARAMTYPE_BOOL:
4621  SCIP_CALL( SCIPparamSetBool(param, set, messagehdlr, SCIPparamGetBoolDefault(param), FALSE, TRUE) );
4622  break;
4623 
4624  case SCIP_PARAMTYPE_INT:
4625  SCIP_CALL( SCIPparamSetInt(param, set, messagehdlr, SCIPparamGetIntDefault(param), FALSE, TRUE) );
4626  break;
4627 
4629  SCIP_CALL( SCIPparamSetLongint(param, set, messagehdlr, SCIPparamGetLongintDefault(param), FALSE, TRUE) );
4630  break;
4631 
4632  case SCIP_PARAMTYPE_REAL:
4633  SCIP_CALL( SCIPparamSetReal(param, set, messagehdlr, SCIPparamGetRealDefault(param), FALSE, TRUE) );
4634  break;
4635 
4636  case SCIP_PARAMTYPE_CHAR:
4637  SCIP_CALL( SCIPparamSetChar(param, set, messagehdlr, SCIPparamGetCharDefault(param), FALSE, TRUE) );
4638  break;
4639 
4640  case SCIP_PARAMTYPE_STRING:
4641  SCIP_CALL( SCIPparamSetString(param, set, messagehdlr, SCIPparamGetStringDefault(param), TRUE) );
4642  break;
4643 
4644  default:
4645  SCIPerrorMessage("unknown parameter type\n");
4646  return SCIP_INVALIDDATA;
4647  }
4648 
4649  return SCIP_OKAY;
4650 }
4651 
4652 /** writes a single parameter to a file */
4654  SCIP_PARAM* param, /**< parameter */
4655  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4656  const char* filename, /**< file name, or NULL for stdout */
4657  SCIP_Bool comments, /**< should parameter descriptions be written as comments? */
4658  SCIP_Bool onlychanged /**< should only the parameters been written, that are changed from default? */
4659  )
4660 {
4661  SCIP_RETCODE retcode;
4662  FILE* file;
4663 
4664  assert(param != NULL);
4665 
4666  /* open the file for writing */
4667  if( filename != NULL )
4668  {
4669  file = fopen(filename, "w");
4670  if( file == NULL )
4671  {
4672  SCIPerrorMessage("cannot open file <%s> for writing\n", filename);
4673  SCIPprintSysError(filename);
4674  return SCIP_FILECREATEERROR;
4675  }
4676  }
4677  else
4678  file = NULL;
4679 
4680  /* write the parameter to the file */
4681  retcode = paramWrite(param, messagehdlr, file, comments, onlychanged);
4682 
4683  /* close output file */
4684  if( filename != NULL )
4685  {
4686  assert(file != NULL); /*lint !e449*/
4687  fclose(file);
4688  }
4689 
4690  SCIP_CALL( retcode );
4691 
4692  return SCIP_OKAY;
4693 }
SCIP_INTPARAM intparam
SCIP_RETCODE SCIPparamsetFix(SCIP_PARAMSET *paramset, const char *name, SCIP_Bool fixed)
Definition: paramset.c:1894
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:1594
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:239
SCIP_Bool SCIPparamIsValidInt(SCIP_PARAM *param, int value)
Definition: paramset.c:4247
SCIP_RETCODE SCIPparamsetWrite(SCIP_PARAMSET *paramset, SCIP_MESSAGEHDLR *messagehdlr, const char *filename, SCIP_Bool comments, SCIP_Bool onlychanged)
Definition: paramset.c:2595
static SCIP_RETCODE paramsetSetPresolvingFast(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:3138
#define NEXPENSIVEHEURFREQS
static void paramFree(SCIP_PARAM **param, BMS_BLKMEM *blkmem)
Definition: paramset.c:1178
#define BMSfreeMemoryArrayNull(ptr)
Definition: memory.h:130
SCIP_Longint defaultvalue
static SCIP_RETCODE paramsetParse(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, char *line, SCIP_Bool *foundnormalparam)
Definition: paramset.c:2390
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:4576
static const char * paramtypeGetName(SCIP_PARAMTYPE paramtype)
Definition: paramset.c:1651
#define SCIP_MAXSTRLEN
Definition: def.h:260
SCIP_RETCODE SCIPparamsetSetToDefault(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *paramname)
Definition: paramset.c:2696
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:112
SCIP_RETCODE SCIPparamsetSetSeparating(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: paramset.c:4078
static SCIP_RETCODE paramsetSetPresolvingAggressive(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:3044
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:65
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:10017
#define TRUE
Definition: def.h:64
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:1690
static SCIP_RETCODE paramParseChar(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, char *valuestr)
Definition: paramset.c:1338
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:2678
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:127
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:2014
#define SCIP_REAL_FORMAT
Definition: def.h:153
SCIP_RETCODE SCIPparamSetInt(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, int value, SCIP_Bool initialize, SCIP_Bool quiet)
Definition: paramset.c:4364
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:4492
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:3904
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:1734
const char * SCIPheurGetName(SCIP_HEUR *heur)
Definition: heur.c:1254
#define BMSfreeMemoryArray(ptr)
Definition: memory.h:129
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:2144
static SCIP_RETCODE paramParseReal(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, char *valuestr)
Definition: paramset.c:1309
SCIP_RETCODE SCIPparamSetBool(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool value, SCIP_Bool initialize, SCIP_Bool quiet)
Definition: paramset.c:4322
static SCIP_RETCODE paramParseLongint(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, char *valuestr)
Definition: paramset.c:1280
SCIP_RETCODE SCIPparamsetSetDefaultInt(SCIP_PARAMSET *paramset, const char *name, int defaultvalue)
Definition: paramset.c:2079
SCIP_RETCODE SCIPparamsetGetBool(SCIP_PARAMSET *paramset, const char *name, SCIP_Bool *value)
Definition: paramset.c:1702
unsigned int isadvanced
static SCIP_RETCODE paramsetSetHeuristicsOff(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:2921
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:2959
SCIP_RETCODE SCIPparamSetString(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *value, SCIP_Bool quiet)
Definition: paramset.c:4534
SCIP_Bool * valueptr
SCIP_RETCODE SCIPparamsetGetLongint(SCIP_PARAMSET *paramset, const char *name, SCIP_Longint *value)
Definition: paramset.c:1766
SCIP_RETCODE SCIPparamsetCreate(SCIP_PARAMSET **paramset, BMS_BLKMEM *blkmem)
Definition: paramset.c:1404
#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:3686
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:1534
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:1623
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:4269
internal methods for global SCIP settings
#define SCIP_CALL(x)
Definition: def.h:351
static SCIP_RETCODE paramsetSetSeparatingOff(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:3625
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:4006
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:4406
int SCIPparamsetGetNParams(SCIP_PARAMSET *paramset)
Definition: paramset.c:4119
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:125
#define BMSfreeBlockMemory(mem, ptr)
Definition: memory.h:446
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:2875
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:62
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:2247
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:3561
SCIP_RETCODE SCIPparamsetSetInt(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, int value)
Definition: paramset.c:2045
void SCIPprintSysError(const char *message)
Definition: misc.c:9926
SCIP_RETCODE SCIPparamsetGetReal(SCIP_PARAMSET *paramset, const char *name, SCIP_Real *value)
Definition: paramset.c:1798
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:2014
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:1862
SCIP_RETCODE SCIPparamsetSetBool(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_Bool value)
Definition: paramset.c:1980
#define MIN(x, y)
Definition: def.h:209
#define SCIPsetDebugMsg
Definition: set.h:1940
SCIP_RETCODE SCIPhashtableSafeInsert(SCIP_HASHTABLE *hashtable, void *element)
Definition: misc.c:2297
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:4133
SCIP_Real * valueptr
SCIP_RETCODE SCIPparamsetSetPresolving(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: paramset.c:4042
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:3229
SCIP_Bool SCIPparamGetBool(SCIP_PARAM *param)
Definition: paramset.c:691
void * SCIPhashtableRetrieve(SCIP_HASHTABLE *hashtable, void *key)
Definition: misc.c:2326
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:1504
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:2064
#define SCIP_HASHSIZE_PARAMS
Definition: def.h:269
enum SCIP_ParamEmphasis SCIP_PARAMEMPHASIS
Definition: type_paramset.h:73
#define SCIP_REAL_MAX
Definition: def.h:151
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:2212
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:326
#define SCIP_REAL_MIN
Definition: def.h:152
static SCIP_RETCODE paramsetSetHeuristicsDefault(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:2720
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:142
#define SCIP_VERSION
Definition: def.h:111
SCIP_Bool SCIPparamIsValidChar(SCIP_PARAM *param, const char value)
Definition: paramset.c:4280
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:208
SCIP_Bool SCIPparamIsValidBool(SCIP_PARAM *param, SCIP_Bool value)
Definition: paramset.c:4238
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:1564
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:150
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:1424
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:2545
#define BMSallocMemory(ptr)
Definition: memory.h:101
#define BMSreallocMemoryArray(ptr, num)
Definition: memory.h:109
char * SCIPparamGetStringDefault(SCIP_PARAM *param)
Definition: paramset.c:907
SCIP_RETCODE SCIPparamSetToDefault(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: paramset.c:4602
SCIP_RETCODE SCIPparamsetSetLongint(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_Longint value)
Definition: paramset.c:2110
static SCIP_RETCODE paramsetSetHeuristicsAggressive(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:2768
SCIP_RETCODE SCIPparamsetSetChar(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, char value)
Definition: paramset.c:2178
static SCIP_RETCODE paramsetSetSeparatingAggressive(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:3387
#define SCIP_Longint
Definition: def.h:135
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:1668
SCIP_RETCODE SCIPparamsetGetChar(SCIP_PARAMSET *paramset, const char *name, char *value)
Definition: paramset.c:1830
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:3307
SCIP_PARAM ** SCIPparamsetGetParams(SCIP_PARAMSET *paramset)
Definition: paramset.c:4109
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:433
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:1367
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:1477
SCIP_RETCODE SCIPparamSetReal(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Real value, SCIP_Bool initialize, SCIP_Bool quiet)
Definition: paramset.c:4448
SCIP_RETCODE SCIPparamWrite(SCIP_PARAM *param, SCIP_MESSAGEHDLR *messagehdlr, const char *filename, SCIP_Bool comments, SCIP_Bool onlychanged)
Definition: paramset.c:4653
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:419
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:4588
#define SCIP_ALLOC(x)
Definition: def.h:362
#define SCIPABORT()
Definition: def.h:323
SCIP_Bool SCIPparamIsValidLongint(SCIP_PARAM *param, SCIP_Longint value)
Definition: paramset.c:4258
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:1449
char SCIPparamGetCharDefault(SCIP_PARAM *param)
Definition: paramset.c:882
SCIP_REALPARAM realparam
#define EPSZ(x, eps)
Definition: def.h:180
SCIP_Bool SCIPparamIsValidString(SCIP_PARAM *param, const char *value)
Definition: paramset.c:4306
SCIP_Real SCIPparamGetRealMax(SCIP_PARAM *param)
Definition: paramset.c:835
SCIP callable library.
void SCIPparamSetFixed(SCIP_PARAM *param, SCIP_Bool fixed)
Definition: paramset.c:4227
SCIP_Real minvalue
SCIP_RETCODE SCIPparamsetSet(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, void *value)
Definition: paramset.c:1918