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 email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file paramset.c
17  * @brief methods for handling parameter settings
18  * @author Tobias Achterberg
19  * @author Timo Berthold
20  * @author Stefan Heinz
21  * @author Gerald Gamrath
22  * @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  /* get frequency parameter of heuristic */
2796  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/freq", heurname);
2797  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
2798 
2799  if( param != NULL )
2800  {
2801  int deffreq;
2802  int newfreq;
2803 
2804  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
2805  deffreq = SCIPparamGetIntDefault(param);
2806 
2807  /* change frequency to half of the default value, if it is > 0, otherwise set to 20 */
2808  if( deffreq == -1 || deffreq == 0 )
2809  {
2810  newfreq = 20;
2811  }
2812  else
2813  {
2814  newfreq = (int) SCIPsetCeil(set, deffreq/2.0);
2815  newfreq = MAX(newfreq, 1);
2816  }
2817 
2818  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, newfreq, quiet) );
2819 
2820  /* LP iteration limits only get increased for heuristics which are activated by default */
2821  if( SCIPparamGetIntDefault(param) > -1 )
2822  {
2823  /* construct (possible) parameter name for LP iteration offset */
2824  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxlpiterofs", heurname);
2825  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
2826 
2827  if( param != NULL && SCIPparamGetType(param) == SCIP_PARAMTYPE_INT )
2828  {
2829  /* set LP iteration offset to 1.5 time the current value */
2830  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, (int) (1.5 * SCIPparamGetIntDefault(param)), quiet) );
2831  }
2832 
2833  /* construct (possible) parameter name for LP iteration quotient parameter */
2834  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxlpiterquot", heurname);
2835  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
2836 
2837  if( param != NULL && SCIPparamGetType(param) == SCIP_PARAMTYPE_REAL )
2838  {
2839  /* set LP iteration quotient to 1.5 time the current value */
2840  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, paramname, 1.5 * SCIPparamGetRealDefault(param), quiet) );
2841  }
2842  }
2843  }
2844  }
2845 
2846  /* set specific parameters for RENS heuristic, if the heuristic is included */
2847 #ifndef NDEBUG
2848  if( SCIPsetFindHeur(set, "rens") != NULL )
2849 #endif
2850  {
2851  SCIP_CALL( paramSetLongint(paramset, set, messagehdlr, "heuristics/rens/nodesofs", (SCIP_Longint)2000, quiet) );
2852  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "heuristics/rens/minfixingrate", 0.3, quiet) );
2853  }
2854 
2855  /* set specific parameters for Crossover heuristic, if the heuristic is included */
2856 #ifndef NDEBUG
2857  if( SCIPsetFindHeur(set, "crossover") != NULL )
2858 #endif
2859  {
2860  SCIP_CALL( paramSetLongint(paramset, set, messagehdlr, "heuristics/crossover/nwaitingnodes", (SCIP_Longint)20, quiet) );
2861  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "heuristics/crossover/dontwaitatroot", TRUE, quiet) );
2862  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "heuristics/crossover/nodesquot", 0.15, quiet) );
2863  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "heuristics/crossover/minfixingrate", 0.5, quiet) );
2864  }
2865 
2866  return SCIP_OKAY;
2867 }
2868 
2869 /** sets heuristics to fast */
2870 static
2872  SCIP_PARAMSET* paramset, /**< parameter set */
2873  SCIP_SET* set, /**< global SCIP settings */
2874  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2875  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
2876  )
2877 {
2878  int i;
2879 
2880 #define NEXPENSIVEHEURFREQS 19
2881  static const char* const expensiveheurfreqs[NEXPENSIVEHEURFREQS] = {
2882  "heuristics/coefdiving/freq",
2883  "heuristics/crossover/freq",
2884  "heuristics/distributiondiving/freq",
2885  "heuristics/feaspump/freq",
2886  "heuristics/fracdiving/freq",
2887  "heuristics/gins/freq",
2888  "heuristics/guideddiving/freq",
2889  "heuristics/linesearchdiving/freq",
2890  "heuristics/lpface/freq",
2891  "heuristics/mpec/freq",
2892  "heuristics/nlpdiving/freq",
2893  "heuristics/subnlp/freq",
2894  "heuristics/objpscostdiving/freq",
2895  "heuristics/pscostdiving/freq",
2896  "heuristics/rens/freq",
2897  "heuristics/rins/freq",
2898  "heuristics/rootsoldiving/freq",
2899  "heuristics/undercover/freq",
2900  "heuristics/veclendiving/freq"
2901  };
2902 
2903  SCIP_CALL( paramsetSetHeuristicsDefault(paramset, set, messagehdlr, quiet) );
2904 
2905  /* explicitly turn off expensive heuristics, if included */
2906  for( i = 0; i < NEXPENSIVEHEURFREQS; ++i )
2907  if( SCIPhashtableRetrieve(paramset->hashtable, (void*)expensiveheurfreqs[i]) != NULL )
2908  {
2909  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, expensiveheurfreqs[i], -1, quiet) );
2910  }
2911 
2912  return SCIP_OKAY;
2913 }
2914 
2915 /** turns all heuristics off */
2916 static
2918  SCIP_PARAMSET* paramset, /**< parameter set */
2919  SCIP_SET* set, /**< global SCIP settings */
2920  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2921  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
2922  )
2923 {
2924  SCIP_HEUR** heurs;
2925  char paramname[SCIP_MAXSTRLEN];
2926  int nheurs;
2927  int i;
2928 
2929  heurs = set->heurs;
2930  nheurs = set->nheurs;
2931 
2932  SCIP_CALL( paramsetSetHeuristicsDefault(paramset, set, messagehdlr, quiet) );
2933 
2934  for( i = 0; i < nheurs; ++i )
2935  {
2936  const char* heurname;
2937  heurname = SCIPheurGetName(heurs[i]);
2938 
2939  /* get frequency parameter of heuristic */
2940  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/freq", heurname);
2941 
2942  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, -1, quiet) );
2943  }
2944 
2945  return SCIP_OKAY;
2946 }
2947 
2948 /** resets all parameters that start with "presolving" in their name to their default value; additionally set the
2949  * parameters which might have previously been changed by the methods SCIPparamsetSetToPresolving{Off,Fast,Aggressive}
2950  * to their default value
2951  *
2952  * @note fixed parameters stay as they are; you need to unfix them first if they should be changed, too
2953  */
2954 static
2956  SCIP_PARAMSET* paramset, /**< parameter set */
2957  SCIP_SET* set, /**< global SCIP settings */
2958  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
2959  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
2960  )
2961 { /*lint --e{715}*/
2962  SCIP_PROP** props;
2963  SCIP_CONSHDLR** conshdlrs;
2964  SCIP_PRESOL** presols;
2965  char paramname[SCIP_MAXSTRLEN];
2966  int nprops;
2967  int nconshdlrs;
2968  int npresols;
2969  int i;
2970 
2971  presols = set->presols;
2972  npresols = set->npresols;
2973 
2974  /* reset each individual presolver */
2975  for( i = 0; i < npresols; ++i )
2976  {
2977  const char* presolname;
2978  presolname = SCIPpresolGetName(presols[i]);
2979 
2980  /* reset maxrounds parameter of presolvers */
2981  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "presolving/%s/maxrounds", presolname);
2982 
2983  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
2984  }
2985 
2986  props = set->props;
2987  nprops = set->nprops;
2988 
2989  /* reset presolving for each individual propagator */
2990  for( i = 0; i < nprops; ++i )
2991  {
2992  const char* propname;
2993  propname = SCIPpropGetName(props[i]);
2994 
2995  /* reset maxprerounds parameter of propagator */
2996  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/maxprerounds", propname);
2997  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
2998  }
2999 
3000  conshdlrs = set->conshdlrs;
3001  nconshdlrs = set->nconshdlrs;
3002 
3003  /* reset presolving settings for each individual constraint handler */
3004  for( i = 0; i < nconshdlrs; ++i )
3005  {
3006  const char* conshdlrname;
3007  conshdlrname = SCIPconshdlrGetName(conshdlrs[i]);
3008 
3009  /* reset maxprerounds parameter of constraint handler */
3010  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/maxprerounds", conshdlrname);
3011  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
3012 
3013  /* reset presolpairwise parameter of constraint handler */
3014  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/presolpairwise", conshdlrname);
3015  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
3016  }
3017 
3018  /* explicitly reset parameters of setppc constraint handler, if the constraint handler is included */
3019  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "constraints/setppc/cliquelifting") );
3020 
3021  /* explicitly reset parameters of knapsack constraint handler, if the constraint handler is included */
3022  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "constraints/knapsack/disaggregation") );
3023 
3024  /* explicitly reset restart and maxrounds parameters */
3025  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "presolving/maxrestarts") );
3026  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "presolving/restartfac") );
3027  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "presolving/restartminred") );
3028  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "presolving/maxrounds") );
3029 
3030  /* explicitly reset probing parameters */
3031  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "propagating/probing/maxuseless") );
3032  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "propagating/probing/maxtotaluseless") );
3033  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "propagating/probing/maxprerounds") );
3034 
3035  return SCIP_OKAY;
3036 }
3037 
3038 /** sets presolving to aggressive */
3039 static
3041  SCIP_PARAMSET* paramset, /**< parameter set */
3042  SCIP_SET* set, /**< global SCIP settings */
3043  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3044  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3045  )
3046 {
3047  SCIP_PARAM* param;
3048  char paramname[SCIP_MAXSTRLEN];
3049 
3050  /* reset previous changes on presolving parameters */
3051  SCIP_CALL( paramsetSetPresolvingDefault(paramset, set, messagehdlr, quiet) );
3052 
3053  /* explicitly change restart parameters */
3054  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "presolving/restartfac", 0.03, quiet) );
3055  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "presolving/restartminred", 0.06, quiet) );
3056 
3057  /* explicitly change parameters of setppc constraint handler, if included */
3058 #ifndef NDEBUG
3059  if( SCIPsetFindConshdlr(set, "setppc") != NULL )
3060 #endif
3061  {
3062  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "constraints/setppc/cliquelifting", TRUE, quiet) );
3063  }
3064 
3065  /* explicitly change parameters of presolver boundshift, if included */
3066 #ifndef NDEBUG
3067  if( SCIPsetFindPresol(set, "boundshift") != NULL )
3068 #endif
3069  {
3070  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/boundshift/maxrounds", -1, quiet) );
3071  }
3072 
3073  /* explicitly change parameters of presolver convertinttobin, if included */
3074 #ifndef NDEBUG
3075  if( SCIPsetFindPresol(set, "convertinttobin") != NULL )
3076 #endif
3077  {
3078  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/convertinttobin/maxrounds", 0, quiet) );
3079  }
3080 
3081  /* explicitly change parameters of presolver dualagg, if included */
3082 #ifndef NDEBUG
3083  if( SCIPsetFindPresol(set, "dualagg") != NULL )
3084 #endif
3085  {
3086  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/dualagg/maxrounds", -1, quiet) );
3087  }
3088 
3089  /* explicitly change parameters of presolver tworowbnd, if included */
3090 #ifndef NDEBUG
3091  if( SCIPsetFindPresol(set, "tworowbnd") != NULL )
3092 #endif
3093  {
3094  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/tworowbnd/maxrounds", -1, quiet) );
3095  }
3096 
3097  /* explicitly change parameters of presolver redvub, if included */
3098 #ifndef NDEBUG
3099  if( SCIPsetFindPresol(set, "redvub") != NULL )
3100 #endif
3101  {
3102  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/redvub/maxrounds", -1, quiet) );
3103  }
3104 
3105  /* explicitly change parameters of presolver implfree, if included */
3106 #ifndef NDEBUG
3107  if( SCIPsetFindPresol(set, "implfree") != NULL )
3108 #endif
3109  {
3110  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/implfree/maxrounds", -1, quiet) );
3111  }
3112 
3113  /* explicitly change parameters of probing */
3114  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/probing/maxuseless");
3115  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
3116  if( param != NULL )
3117  {
3118  int defvalue;
3119 
3120  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
3121  defvalue = SCIPparamGetIntDefault(param);
3122 
3123  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, (int) (1.5 * defvalue), quiet) );
3124  }
3125  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/probing/maxtotaluseless");
3126  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
3127  if( param != NULL )
3128  {
3129  int defvalue;
3130 
3131  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
3132  defvalue = SCIPparamGetIntDefault(param);
3133 
3134  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, (int) (1.5 * defvalue), quiet) );
3135  }
3136 
3137  return SCIP_OKAY;
3138 }
3139 
3140 /** sets presolving to fast */
3141 static
3143  SCIP_PARAMSET* paramset, /**< parameter set */
3144  SCIP_SET* set, /**< global SCIP settings */
3145  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3146  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3147  )
3148 {
3149  SCIP_CONSHDLR** conshdlrs;
3150  SCIP_PARAM* param;
3151  char paramname[SCIP_MAXSTRLEN];
3152  int nconshdlrs;
3153  int i;
3154 
3155  /* reset previous changes on presolving parameters */
3156  SCIP_CALL( paramsetSetPresolvingDefault(paramset, set, messagehdlr, quiet) );
3157 
3158  conshdlrs = set->conshdlrs;
3159  nconshdlrs = set->nconshdlrs;
3160 
3161  /* turn off pairwise comparison for each constraint handler that has this feature */
3162  for( i = 0; i < nconshdlrs; ++i )
3163  {
3164  const char* conshdlrname;
3165  conshdlrname = SCIPconshdlrGetName(conshdlrs[i]);
3166 
3167  /* get presolpairwise parameter of constraint handler */
3168  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/presolpairwise", conshdlrname);
3169  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
3170 
3171  if( param != NULL && SCIPparamGetType(param) == SCIP_PARAMTYPE_BOOL )
3172  {
3173  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, paramname, FALSE, quiet) );
3174  }
3175  }
3176 
3177  /* explicitly turn off restarts */
3178  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/maxrestarts", 0, quiet) );
3179 
3180  /* explicitly change parameters of presolver convertinttobin, if included */
3181 #ifndef NDEBUG
3182  if( SCIPsetFindPresol(set, "convertinttobin") != NULL )
3183 #endif
3184  {
3185  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/convertinttobin/maxrounds", 0, quiet) );
3186  }
3187 
3188  /* turn off probing, if included */
3189 #ifndef NDEBUG
3190  if( SCIPsetFindProp(set, "probing") != NULL )
3191 #endif
3192  {
3193  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "propagating/probing/maxprerounds", 0, quiet) );
3194  }
3195 
3196  /* explicitly disable components constraint handler, if included */
3197 #ifndef NDEBUG
3198  if( SCIPsetFindConshdlr(set, "components") != NULL )
3199 #endif
3200  {
3201  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "constraints/components/maxprerounds", 0, quiet) );
3202  }
3203 
3204  /* explicitly disable dominated columns presolver, if included */
3205 #ifndef NDEBUG
3206  if( SCIPsetFindPresol(set, "domcol") != NULL )
3207 #endif
3208  {
3209  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/domcol/maxrounds", 0, quiet) );
3210  }
3211 
3212  /* explicitly disable gate extraction presolver, if included */
3213 #ifndef NDEBUG
3214  if( SCIPsetFindPresol(set, "gateextraction") != NULL )
3215 #endif
3216  {
3217  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/gateextraction/maxrounds", 0, quiet) );
3218  }
3219 
3220  /* explicitly forbid the use of implications in logicor presolving */
3221 #ifndef NDEBUG
3222  if( SCIPsetFindConshdlr(set, "logicor") != NULL )
3223 #endif
3224  {
3225  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "constraints/logicor/implications", 0, quiet) );
3226  }
3227 
3228  return SCIP_OKAY;
3229 }
3230 
3231 /** turns all presolving off */
3232 static
3234  SCIP_PARAMSET* paramset, /**< parameter set */
3235  SCIP_SET* set, /**< global SCIP settings */
3236  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3237  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3238  )
3239 {
3240  SCIP_PRESOL** presols;
3241  SCIP_PROP** props;
3242  SCIP_CONSHDLR** conshdlrs;
3243  char paramname[SCIP_MAXSTRLEN];
3244  int npresols;
3245  int nprops;
3246  int nconshdlrs;
3247  int i;
3248 
3249  /* reset previous changes on presolving parameters */
3250  SCIP_CALL( paramsetSetPresolvingDefault(paramset, set, messagehdlr, quiet) );
3251 
3252  presols = set->presols;
3253  npresols = set->npresols;
3254 
3255  /* turn each individual presolver off */
3256  for( i = 0; i < npresols; ++i )
3257  {
3258  const char* presolname;
3259  presolname = SCIPpresolGetName(presols[i]);
3260 
3261  /* get maxrounds parameter of presolvers */
3262  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "presolving/%s/maxrounds", presolname);
3263 
3264  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, 0, quiet) );
3265  }
3266 
3267  props = set->props;
3268  nprops = set->nprops;
3269 
3270  /* turn off presolving for each individual propagator */
3271  for( i = 0; i < nprops; ++i )
3272  {
3273  const char* propname;
3274  propname = SCIPpropGetName(props[i]);
3275 
3276  /* get maxrounds parameter of propagator */
3277  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/maxprerounds", propname);
3278 
3279  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, 0, quiet) );
3280  }
3281 
3282  conshdlrs = set->conshdlrs;
3283  nconshdlrs = set->nconshdlrs;
3284 
3285  /* turn off presolving for each individual constraint handler */
3286  for( i = 0; i < nconshdlrs; ++i )
3287  {
3288  const char* conshdlrname;
3289  conshdlrname = SCIPconshdlrGetName(conshdlrs[i]);
3290 
3291  /* get maxprerounds parameter of constraint handler */
3292  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/maxprerounds", conshdlrname);
3293 
3294  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, 0, quiet) );
3295  }
3296 
3297  /* explicitly turn off restarts */
3298  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/maxrestarts", 0, quiet) );
3299 
3300  /* set the maximum number of presolving rounds to zero */
3301  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/maxrounds", 0, quiet) );
3302 
3303  return SCIP_OKAY;
3304 }
3305 
3306 /** reset parameters that may have been changed by other SCIPparamsetSetSeparatingXyz to their default values
3307  *
3308  * @note fixed parameters stay as they are; you need to unfix them first if they should be changed, too
3309  */
3310 static
3312  SCIP_PARAMSET* paramset, /**< parameter set */
3313  SCIP_SET* set, /**< global SCIP settings */
3314  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3315  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3316  )
3317 { /*lint --e{715}*/
3318  SCIP_SEPA** sepas;
3319  SCIP_CONSHDLR** conshdlrs;
3320  char paramname[SCIP_MAXSTRLEN];
3321  int nconshdlrs;
3322  int nsepas;
3323  int i;
3324 
3325  sepas = set->sepas;
3326  nsepas = set->nsepas;
3327 
3328  /* reset separating parameters of all separators */
3329  for( i = 0; i < nsepas; ++i )
3330  {
3331  const char* sepaname;
3332  sepaname = SCIPsepaGetName(sepas[i]);
3333 
3334  /* reset frequency parameter of separator */
3335  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/freq", sepaname);
3336  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
3337 
3338  /* reset maximum number of rounds in root node */
3339  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/maxroundsroot", sepaname);
3340  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
3341 
3342  /* reset maximum number of cuts per separation in root node */
3343  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/maxsepacutsroot", sepaname);
3344  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
3345  }
3346 
3347  conshdlrs = set->conshdlrs;
3348  nconshdlrs = set->nconshdlrs;
3349 
3350  /* reset each individual constraint handler separation settings */
3351  for( i = 0; i < nconshdlrs; ++i )
3352  {
3353  const char* conshdlrname;
3354  conshdlrname = SCIPconshdlrGetName(conshdlrs[i]);
3355 
3356  /* reset separation frequency parameter of constraint handler, if available */
3357  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/sepafreq", conshdlrname);
3358  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
3359 
3360  /* reset maximal separated cuts in root node of constraint handler, if available */
3361  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/maxsepacutsroot", conshdlrname);
3362  if( SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname) != NULL )
3363  {
3364  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, paramname) );
3365  }
3366  }
3367 
3368  /* explicitly reset individual parameters */
3369  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "constraints/linear/separateall") );
3370  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/minorthoroot") );
3371  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/maxroundsrootsubrun") );
3372  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/maxaddrounds") );
3373  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/maxcutsroot") );
3374  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/poolfreq") );
3375  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/aggregation/maxfailsroot") );
3376  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/mcf/maxtestdelta") );
3377  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/mcf/trynegscaling") );
3378  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/aggregation/maxtriesroot") );
3379  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/aggregation/maxaggrsroot") );
3380  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/maxbounddist") );
3381  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/zerohalf/maxslackroot") );
3382  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/zerohalf/maxslack") );
3383  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/zerohalf/maxsepacutsroot") );
3384  SCIP_CALL( SCIPparamsetSetToDefault(paramset, set, messagehdlr, "separating/zerohalf/maxroundsroot") );
3385 
3386  return SCIP_OKAY;
3387 }
3388 
3389 /** sets separating to aggressive */
3390 static
3392  SCIP_PARAMSET* paramset, /**< parameter set */
3393  SCIP_SET* set, /**< global SCIP settings */
3394  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3395  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3396  )
3397 {
3398  SCIP_CONSHDLR** conshdlrs;
3399  SCIP_SEPA** sepas;
3400  SCIP_PARAM* param;
3401  char paramname[SCIP_MAXSTRLEN];
3402  int nconshdlrs;
3403  int nsepas;
3404  int i;
3405 
3406  sepas = set->sepas;
3407  nsepas = set->nsepas;
3408 
3409  /* set all separating parameters to default values */
3410  SCIP_CALL( paramsetSetSeparatingDefault(paramset, set, messagehdlr, quiet) );
3411 
3412  /* set separating parameters of all separators */
3413  for( i = 0; i < nsepas; ++i )
3414  {
3415  const char* sepaname;
3416  sepaname = SCIPsepaGetName(sepas[i]);
3417 
3418  /* intobj and cgmip separators should stay disabled */
3419  if( strcmp(sepaname, "intobj") == 0 || strcmp(sepaname, "cgmip") == 0 )
3420  continue;
3421 
3422  /* get frequency parameter of separator */
3423  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/freq", sepaname);
3424  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
3425 
3426  if( param != NULL )
3427  {
3428  int deffreq;
3429  int newfreq;
3430 
3431  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
3432  deffreq = SCIPparamGetIntDefault(param);
3433 
3434  /* for enabled separators, change frequency to at least every 20th depths and
3435  * enable disabled separators
3436  */
3437  if( deffreq == -1 )
3438  newfreq = 0;
3439  else if( deffreq == 0 )
3440  newfreq = 20;
3441  else
3442  newfreq = MIN(deffreq, 20);
3443 
3444  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, newfreq, quiet) );
3445  }
3446 
3447  /* get maximum number of rounds in root node */
3448  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/maxroundsroot", sepaname);
3449  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
3450 
3451  if( param != NULL )
3452  {
3453  int defrounds;
3454 
3455  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
3456  defrounds = SCIPparamGetIntDefault(param);
3457 
3458  /* increase the maximum number of rounds in the root node by factor of 1.5 */
3459  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, (int) (1.5 * defrounds), quiet) );
3460  }
3461 
3462  /* get maximum number of cuts per separation in root node */
3463  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/maxsepacutsroot", sepaname);
3464  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
3465 
3466  if( param != NULL )
3467  {
3468  int defnumber;
3469 
3470  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
3471  defnumber = SCIPparamGetIntDefault(param);
3472 
3473  /* increase the maximum number of cut per separation rounds in the root node by factor of 2 */
3474  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, 2*defnumber, quiet) );
3475  }
3476  }
3477 
3478  conshdlrs = set->conshdlrs;
3479  nconshdlrs = set->nconshdlrs;
3480 
3481  /* set separating parameters of all constraint handlers */
3482  for( i = 0; i < nconshdlrs; ++i )
3483  {
3484  const char* conshdlrname;
3485  conshdlrname = SCIPconshdlrGetName(conshdlrs[i]);
3486 
3487  /* get separating frequency parameter of constraint handler */
3488  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/sepafreq", conshdlrname);
3489  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
3490 
3491  if( param != NULL )
3492  {
3493  int deffreq;
3494  int newfreq;
3495 
3496  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
3497  deffreq = SCIPparamGetIntDefault(param);
3498 
3499  /* for constraint handlers with enabled separation, change frequency to at least every 10th depths and
3500  * enable disabled separation routines
3501  */
3502  if( deffreq == -1 )
3503  newfreq = 0;
3504  else if( deffreq == 0 )
3505  newfreq = 10;
3506  else
3507  newfreq = MIN(deffreq, 10);
3508 
3509  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, newfreq, quiet) );
3510  }
3511 
3512  /* get maximal separated cuts in root node of constraint handler */
3513  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/maxsepacutsroot", conshdlrname);
3514  param = (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname);
3515 
3516  if( param != NULL )
3517  {
3518  int defnumber;
3519 
3520  assert(SCIPparamGetType(param) == SCIP_PARAMTYPE_INT);
3521  defnumber = SCIPparamGetIntDefault(param);
3522 
3523  /* change maximal cuts in root node to at least 500 */
3524  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, MAX(defnumber, 500), quiet) );
3525  }
3526  }
3527 
3528  /* explicitly change general separating parameters */
3529  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "separating/minorthoroot", 0.1, quiet) );
3530  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/maxroundsrootsubrun", 5, quiet) );
3531  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/maxaddrounds", 5, quiet) );
3532  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/maxcutsroot", 5000, quiet) );
3533  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/poolfreq", 10, quiet) );
3534 
3535  /* explicitly change a separating parameter of the linear constraint handler, if included */
3536 #ifndef NDEBUG
3537  if( SCIPsetFindConshdlr(set, "linear") != NULL )
3538 #endif
3539  {
3540  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "constraints/linear/separateall", TRUE, quiet) );
3541  }
3542 
3543  /* explicitly change a separating parameter of cmir separator, if included */
3544 #ifndef NDEBUG
3545  if( SCIPsetFindSepa(set, "aggregation") != NULL )
3546 #endif
3547  {
3548  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/aggregation/maxfailsroot", 200, quiet) );
3549  }
3550 
3551  /* explicitly change separating parameters of mcf separator, if included */
3552 #ifndef NDEBUG
3553  if( SCIPsetFindSepa(set, "mcf") != NULL )
3554 #endif
3555  {
3556  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/mcf/maxtestdelta", -1, quiet) );
3557  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "separating/mcf/trynegscaling", TRUE, quiet) );
3558  }
3559 
3560  return SCIP_OKAY;
3561 }
3562 
3563 /** sets separating to fast */
3564 static
3566  SCIP_PARAMSET* paramset, /**< parameter set */
3567  SCIP_SET* set, /**< global SCIP settings */
3568  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3569  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3570  )
3571 {
3572  /* reset previous changes on separating parameters */
3573  SCIP_CALL( paramsetSetSeparatingDefault(paramset, set, messagehdlr, quiet) );
3574 
3575  /* explicitly decrease maxbounddist */
3576  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "separating/maxbounddist", 0.0, quiet) );
3577 
3578  /* explicitly turn off expensive separators, if included */
3579 #ifndef NDEBUG
3580  if( SCIPsetFindConshdlr(set, "and") != NULL )
3581 #endif
3582  {
3583  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "constraints/and/sepafreq", 0, quiet) );
3584  }
3585 #ifndef NDEBUG
3586  if( SCIPsetFindSepa(set, "aggregation") != NULL )
3587 #endif
3588  {
3589  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/aggregation/maxroundsroot", 5, quiet) );
3590  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/aggregation/maxtriesroot", 100, quiet) );
3591  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/aggregation/maxaggrsroot", 3, quiet) );
3592  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/aggregation/maxsepacutsroot", 200, quiet) );
3593  }
3594 #ifndef NDEBUG
3595  if( SCIPsetFindSepa(set, "zerohalf") != NULL )
3596 #endif
3597  {
3598  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "separating/zerohalf/maxslackroot", 0.0, quiet) );
3599  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "separating/zerohalf/maxslack", 0.0, quiet) );
3600  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/zerohalf/maxsepacutsroot", 200, quiet) );
3601  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/zerohalf/maxroundsroot", 5, quiet) );
3602  }
3603 #ifndef NDEBUG
3604  if( SCIPsetFindSepa(set, "gomory") != NULL )
3605 #endif
3606  {
3607  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/gomory/maxroundsroot", 20, quiet) );
3608  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/gomory/maxsepacutsroot", 200, quiet) );
3609  }
3610 #ifndef NDEBUG
3611  if( SCIPsetFindSepa(set, "mcf") != NULL )
3612 #endif
3613  {
3614  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/mcf/freq", -1, quiet) );
3615  }
3616 #ifndef NDEBUG
3617  if( SCIPsetFindSepa(set, "strongcg") != NULL )
3618 #endif
3619  {
3620  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/strongcg/maxroundsroot", 10, quiet) );
3621  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/strongcg/maxsepacutsroot", 200, quiet) );
3622  }
3623 
3624  return SCIP_OKAY;
3625 }
3626 
3627 /** turns all cuts off */
3628 static
3630  SCIP_PARAMSET* paramset, /**< parameter set */
3631  SCIP_SET* set, /**< global SCIP settings */
3632  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3633  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3634  )
3635 {
3636  SCIP_SEPA** sepas;
3637  SCIP_CONSHDLR** conshdlrs;
3638  char paramname[SCIP_MAXSTRLEN];
3639  int nsepas;
3640  int nconshdlrs;
3641  int i;
3642 
3643  /* reset previous changes on separating parameters */
3644  SCIP_CALL( paramsetSetSeparatingDefault(paramset, set, messagehdlr, quiet) );
3645 
3646  sepas = set->sepas;
3647  nsepas = set->nsepas;
3648 
3649  /* turn each individual separator off */
3650  for( i = 0; i < nsepas; ++i )
3651  {
3652  const char* sepaname;
3653  sepaname = SCIPsepaGetName(sepas[i]);
3654 
3655  /* get frequency parameter of separator */
3656  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/freq", sepaname);
3657  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, -1, quiet) );
3658  }
3659 
3660  conshdlrs = set->conshdlrs;
3661  nconshdlrs = set->nconshdlrs;
3662 
3663  /* turn off separation for each individual constraint handler */
3664  for( i = 0; i < nconshdlrs; ++i )
3665  {
3666  const char* conshdlrname;
3667  conshdlrname = SCIPconshdlrGetName(conshdlrs[i]);
3668 
3669  /* get separation frequency parameter of constraint handler */
3670  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/sepafreq", conshdlrname);
3671  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, -1, quiet) );
3672  }
3673 
3674  return SCIP_OKAY;
3675 }
3676 
3677 /** sets parameters to
3678  *
3679  * - \ref SCIP_PARAMEMPHASIS_DEFAULT to use default values (see also SCIPparamsetSetToDefault())
3680  * - \ref SCIP_PARAMEMPHASIS_COUNTER to get feasible and "fast" counting process
3681  * - \ref SCIP_PARAMEMPHASIS_CPSOLVER to get CP like search (e.g. no LP relaxation)
3682  * - \ref SCIP_PARAMEMPHASIS_EASYCIP to solve easy problems fast
3683  * - \ref SCIP_PARAMEMPHASIS_FEASIBILITY to detect feasibility fast
3684  * - \ref SCIP_PARAMEMPHASIS_HARDLP to be capable to handle hard LPs
3685  * - \ref SCIP_PARAMEMPHASIS_OPTIMALITY to prove optimality fast
3686  * - \ref SCIP_PARAMEMPHASIS_PHASEFEAS to find feasible solutions during a 3 phase solution process
3687  * - \ref SCIP_PARAMEMPHASIS_PHASEIMPROVE to find improved solutions during a 3 phase solution process
3688  * - \ref SCIP_PARAMEMPHASIS_PHASEPROOF to proof optimality during a 3 phase solution process
3689  */
3691  SCIP_PARAMSET* paramset, /**< parameter set */
3692  SCIP_SET* set, /**< global SCIP settings */
3693  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3694  SCIP_PARAMEMPHASIS paramemphasis, /**< parameter emphasis */
3695  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3696  )
3697 {
3698  /* reset all parameter to default */
3699  SCIP_CALL( SCIPparamsetSetToDefaults(paramset, set, messagehdlr) );
3700 
3701  switch( paramemphasis )
3702  {
3704  /* the default values are already set */
3705  break;
3706 
3708  /* TODO: should constraints/linear/detectlowerbound and detectcutoffbound be set to FALSE? */
3709  /* avoid logicor upgrade since the logicor constraint handler does not perform full propagation */
3710  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "constraints/linear/upgrade/logicor", FALSE, quiet) );
3711 
3712  /* set priority for inference branching to highest possible value */
3713  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "branching/inference/priority", INT_MAX/4, quiet) );
3714 
3715  /* set priority for depth first search to highest possible value */
3716  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "nodeselection/dfs/stdpriority", INT_MAX/4, quiet) );
3717 
3718  /* avoid that the ZIMPL reader transforms the problem before the problem is generated */
3719  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "reading/zplreader/usestartsol", FALSE, quiet) );
3720 
3721  /* turn off all heuristics */
3722  SCIP_CALL( paramsetSetHeuristicsOff(paramset, set, messagehdlr, quiet) );
3723 
3724  /* turn off all separation */
3725  SCIP_CALL( paramsetSetSeparatingOff(paramset, set, messagehdlr, quiet) );
3726 
3727  /* turn off restart */
3728  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/maxrestarts", 0, quiet) );
3729 
3730  /* unlimited number of propagation rounds in any branch and bound node */
3731  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "propagating/maxrounds", -1, quiet) );
3732  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "propagating/maxroundsroot", -1, quiet) );
3733 
3734  /* adjust conflict analysis for depth first search */
3735  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "conflict/fuiplevels", 1, quiet) );
3736  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "conflict/dynamic", FALSE, quiet) );
3737 
3738  /* prefer binary variables for branching */
3739  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "branching/preferbinary", TRUE, quiet) );
3740 
3741  /* turn on aggressive constraint aging */
3742  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "constraints/agelimit", 1, quiet) );
3743 
3744  /* turn off components presolver since we are currently not able to handle that in case of counting */
3745 #ifndef NDEBUG
3746  if( SCIPsetFindConshdlr(set, "components") != NULL )
3747 #endif
3748  {
3749  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "constraints/components/maxprerounds", 0, quiet) );
3750  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "constraints/components/propfreq", -1, quiet) );
3751  }
3752  break;
3753 
3755  /* shrink the minimal maximum value for the conflict length */
3756  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "conflict/minmaxvars", 10, quiet) );
3757 
3758  /* use only first unique implication point */
3759  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "conflict/fuiplevels", 1, quiet) );
3760 
3761  /* do not use reconversion conflicts */
3762  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "conflict/reconvlevels", 0, quiet) );
3763 
3764  /* after 250 conflict we force a restart since then the variable statistics are reasonable initialized */
3765  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "conflict/restartnum", 250, quiet) );
3766 
3767  /* increase the number of conflicts which induce a restart */
3768  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "conflict/restartfac", 2.0, quiet) );
3769 
3770  /* weight the variable which made into a conflict */
3771  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "conflict/conflictweight", 1.0, quiet) );
3772 
3773  /* do not check pseudo solution (for performance reasons) */
3774  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "constraints/disableenfops", TRUE, quiet) );
3775 
3776  /* use value based history to detect a reasonable branching point */
3777  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "history/valuebased", TRUE, quiet) );
3778 
3779  /* turn of LP relaxation */
3780  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "lp/solvefreq", -1, quiet) );
3781 
3782  /* prefer the down branch in case the value based history does not suggest something */
3783  SCIP_CALL( paramSetChar(paramset, set, messagehdlr, "nodeselection/childsel", 'd', quiet) );
3784 
3785  /* accept any bound change */
3786  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "numerics/boundstreps", 1e-6, quiet) );
3787 
3788  /* allow for at most 10 restart, after that the value based history should be reliable */
3789  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "presolving/maxrestarts", 10, quiet) );
3790 
3791  /* set priority for depth first search to highest possible value */
3792  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "nodeselection/dfs/stdpriority", INT_MAX/4, quiet) );
3793 
3794  break;
3795 
3797  /* set heuristics to fast, to avoid spending to much time for involved heuristics */
3798  SCIP_CALL( paramsetSetHeuristicsFast(paramset, set, messagehdlr, quiet) );
3799 
3800  /* set presolving to fast, to avoid spending to much time for involved presolving */
3801  SCIP_CALL( paramsetSetPresolvingFast(paramset, set, messagehdlr, quiet) );
3802 
3803  /* set separating to fast, to avoid spending to much time for involved separators */
3804  SCIP_CALL( paramsetSetSeparatingFast(paramset, set, messagehdlr, quiet) );
3805 
3806  break;
3807 
3809  /* set heuristics aggressive */
3810  SCIP_CALL( paramsetSetHeuristicsAggressive(paramset, set, messagehdlr, quiet) );
3811 
3812  /* reduce the amount of separation rounds and disable most expensive separators */
3813  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/maxrounds", 1, quiet) );
3814  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/maxroundsroot", 5, quiet) );
3815  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/aggregation/freq", -1, quiet) );
3816  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/mcf/freq", -1, quiet) );
3817 
3818  /* set priority for node selection "restartdfs" to be higher as the current used one */
3819  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "nodeselection/restartdfs/stdpriority", INT_MAX/4, quiet) );
3820  break;
3821 
3823  /* set heuristics to fast, to avoid heuristics which solve also an LP */
3824  SCIP_CALL( paramsetSetHeuristicsFast(paramset, set, messagehdlr, quiet) );
3825 
3826  /* set presolving to fast, to avoid spending to much time for involved presolving */
3827  SCIP_CALL( paramsetSetPresolvingFast(paramset, set, messagehdlr, quiet) );
3828 
3829  /* reduce the amount of strong branching */
3830  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "branching/relpscost/maxreliable", 1.0, quiet) );
3831  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "branching/relpscost/inititer", 10, quiet) );
3832 
3833  /* reduce the amount of separation rounds */
3834  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/maxrounds", 1, quiet) );
3835  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "separating/maxroundsroot", 5, quiet) );
3836 
3837  break;
3838 
3840  /* set cuts aggressive */
3841  SCIP_CALL( paramsetSetSeparatingAggressive(paramset, set, messagehdlr, quiet) );
3842 
3843  /* increase the amount of strong branching */
3844  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "branching/fullstrong/maxdepth", 10, quiet) );
3845  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "branching/fullstrong/priority", INT_MAX / 4, quiet) );
3846  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "branching/fullstrong/maxbounddist", 0.0, quiet) );
3847  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "branching/relpscost/sbiterquot", 1.0, quiet) );
3848  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "branching/relpscost/sbiterofs", 1000000, quiet) );
3849  SCIP_CALL( paramSetReal(paramset, set, messagehdlr, "branching/relpscost/maxreliable", 10.0, quiet) );
3850  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "branching/relpscost/usehyptestforreliability",TRUE, quiet) );
3851  break;
3853 
3854  /* enable two phase node selection: UCT will run first, but deactivate itself after a small number of nodes */
3855  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "nodeselection/uct/stdpriority", (INT_MAX / 4) + 1, quiet) );
3856  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "nodeselection/restartdfs/stdpriority", INT_MAX/4, quiet) );
3857 
3858  /* enable inference branching */
3859  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "branching/inference/priority", INT_MAX / 4, quiet) );
3860  break;
3861 
3863  /* use UCT node selection in all subSCIP heuristics that have this parameter */
3864  {
3865  int h;
3866  SCIP_HEUR** heurs = set->heurs;
3867  int nheurs = set->nheurs;
3868 
3869  for( h = 0; h < nheurs; ++h )
3870  {
3871  char paramname[SCIP_MAXSTRLEN];
3872  if( SCIPheurUsesSubscip(heurs[h]) )
3873  {
3874  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/useuct", SCIPheurGetName(heurs[h]));
3875 
3876  if( (SCIP_PARAM*)SCIPhashtableRetrieve(paramset->hashtable, (void*)paramname) != NULL )
3877  {
3878  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, paramname, TRUE, quiet) );
3879  }
3880  }
3881  }
3882 
3883  }
3884  break;
3886  /* deactivate primal heuristics */
3887  SCIP_CALL( paramsetSetHeuristicsOff(paramset, set, messagehdlr, quiet) );
3888 
3889  /* make aggressive use of separators, also locally */
3890  SCIP_CALL( paramsetSetSeparatingAggressive(paramset, set, messagehdlr, quiet) );
3891 
3892  /* use depth-first node selection strategy that makes best use of LP warmstarts */
3893  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "nodeselection/dfs/stdpriority", INT_MAX/4, quiet) );
3894 
3895  /* enable dynamic weights for reliability pseudo cost branching */
3896  SCIP_CALL( paramSetBool(paramset, set, messagehdlr, "branching/relpscost/dynamicweights", TRUE, quiet) );
3897  break;
3898 
3899  default:
3900  SCIPerrorMessage("the parameter setting <%d> is not allowed for emphasis call\n", paramemphasis);
3901  return SCIP_INVALIDCALL;
3902  }
3903  return SCIP_OKAY;
3904 }
3905 
3906 /** sets parameters to deactivate separators and heuristics that use auxiliary SCIP instances; should be called for
3907  * auxiliary SCIP instances to avoid recursion
3908  */
3910  SCIP_PARAMSET* paramset, /**< parameter set */
3911  SCIP_SET* set, /**< global SCIP settings */
3912  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
3913  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
3914  )
3915 {
3916  SCIP_HEUR** heurs;
3917  SCIP_SEPA** sepas;
3918 
3919  char paramname[SCIP_MAXSTRLEN];
3920 
3921  int nheurs;
3922  int nsepas;
3923  int i;
3924 
3925  heurs = set->heurs;
3926  nheurs = set->nheurs;
3927 
3928  /* disable all heuristics that use auxiliary SCIP instances */
3929  for( i = 0; i < nheurs; ++i )
3930  {
3931  if( SCIPheurUsesSubscip(heurs[i]) )
3932  {
3933  const char* heurname;
3934  heurname = SCIPheurGetName(heurs[i]);
3935 
3936  /* get frequency parameter of heuristic */
3937  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/freq", heurname);
3938 
3939  /* we have to unfix the parameter if it fixed and not already set to -1 */
3940  if( SCIPparamsetIsFixed(paramset, paramname) )
3941  {
3942  int oldfreq;
3943 
3944  SCIP_CALL( SCIPparamsetGetInt(paramset, paramname, &oldfreq) );
3945 
3946  /* if the frequency is already set to -1, we do not have to unfix it, but must not try to set it, either */
3947  if( oldfreq == -1 )
3948  continue;
3949 
3950  /* unfix parameter */
3951  SCIPmessageFPrintInfo(messagehdlr, NULL, "unfixing parameter %s in order to disable sub-SCIPs in the current (sub-)SCIP instance\n", paramname);
3952  SCIP_CALL( SCIPparamsetFix(paramset, paramname, FALSE) );
3953  }
3954 
3955  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, -1, quiet) );
3956  }
3957  }
3958 
3959  sepas = set->sepas;
3960  nsepas = set->nsepas;
3961 
3962  /* disable all separators that use auxiliary SCIP instances */
3963  for( i = 0; i < nsepas; ++i )
3964  {
3965  if( SCIPsepaUsesSubscip(sepas[i]) )
3966  {
3967  const char* sepaname;
3968  sepaname = SCIPsepaGetName(sepas[i]);
3969 
3970  /* get frequency parameter of separator */
3971  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "separating/%s/freq", sepaname);
3972 
3973  /* we have to unfix the parameter if it fixed and not already set to -1 */
3974  if( SCIPparamsetIsFixed(paramset, paramname) )
3975  {
3976  int oldfreq;
3977 
3978  SCIP_CALL( SCIPparamsetGetInt(paramset, paramname, &oldfreq) );
3979 
3980  /* if the frequency is already set to -1, we do not have to unfix it, but must not try to set it, either */
3981  if( oldfreq == -1 )
3982  continue;
3983 
3984  /* unfix parameter */
3985  SCIPmessageFPrintInfo(messagehdlr, NULL, "unfixing parameter %s in order to disable sub-SCIPs in the current (sub-)SCIP instance\n", paramname);
3986  SCIP_CALL( SCIPparamsetFix(paramset, paramname, FALSE) );
3987  }
3988 
3989  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, paramname, -1, quiet) );
3990  }
3991  }
3992 
3993  /* turn off components constraint handler */
3994  #ifndef NDEBUG
3995  if( SCIPsetFindConshdlr(set, "components") != NULL )
3996 #endif
3997  {
3998  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "constraints/components/maxprerounds", 0, quiet) );
3999  SCIP_CALL( paramSetInt(paramset, set, messagehdlr, "constraints/components/propfreq", -1, quiet) );
4000  }
4001 
4002  return SCIP_OKAY;
4003 }
4004 
4005 /** sets heuristic parameters values to
4006  * - SCIP_PARAMSETTING_DEFAULT which are the default values of all heuristic parameters
4007  * - SCIP_PARAMSETTING_FAST such that the time spent on heuristics is decreased
4008  * - SCIP_PARAMSETTING_AGGRESSIVE such that the heuristics are called more aggressively
4009  * - SCIP_PARAMSETTING_OFF which turn off all heuristics
4010  */
4012  SCIP_PARAMSET* paramset, /**< parameter set */
4013  SCIP_SET* set, /**< global SCIP settings */
4014  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4015  SCIP_PARAMSETTING paramsetting, /**< parameter settings */
4016  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4017  )
4018 {
4019  switch( paramsetting )
4020  {
4022  SCIP_CALL( paramsetSetHeuristicsDefault(paramset, set, messagehdlr, quiet) );
4023  break;
4024  case SCIP_PARAMSETTING_OFF:
4025  SCIP_CALL( paramsetSetHeuristicsOff(paramset, set, messagehdlr, quiet) );
4026  break;
4028  SCIP_CALL( paramsetSetHeuristicsFast(paramset, set, messagehdlr, quiet) );
4029  break;
4031  SCIP_CALL( paramsetSetHeuristicsAggressive(paramset, set, messagehdlr, quiet) );
4032  break;
4033  default:
4034  SCIPerrorMessage("the parameter setting <%d> is not allowed for heuristics\n", paramsetting);
4035  return SCIP_INVALIDCALL;
4036  }
4037 
4038  return SCIP_OKAY;
4039 }
4040 
4041 /** sets presolving parameters to
4042  * - SCIP_PARAMSETTING_DEFAULT which are the default values of all presolving parameters
4043  * - SCIP_PARAMSETTING_FAST such that the time spent on presolving is decreased
4044  * - SCIP_PARAMSETTING_AGGRESSIVE such that the presolving is more aggressive
4045  * - SCIP_PARAMSETTING_OFF which turn off all presolving
4046  */
4048  SCIP_PARAMSET* paramset, /**< parameter set */
4049  SCIP_SET* set, /**< global SCIP settings */
4050  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4051  SCIP_PARAMSETTING paramsetting, /**< parameter settings */
4052  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4053  )
4054 {
4055  switch( paramsetting )
4056  {
4058  SCIP_CALL( paramsetSetPresolvingDefault(paramset, set, messagehdlr, quiet) );
4059  break;
4060  case SCIP_PARAMSETTING_OFF:
4061  SCIP_CALL( paramsetSetPresolvingOff(paramset, set, messagehdlr, quiet) );
4062  break;
4064  SCIP_CALL( paramsetSetPresolvingFast(paramset, set, messagehdlr, quiet) );
4065  break;
4067  SCIP_CALL( paramsetSetPresolvingAggressive(paramset, set, messagehdlr, quiet) );
4068  break;
4069  default:
4070  SCIPerrorMessage("the parameter setting <%d> is not allowed for presolving\n", paramsetting);
4071  return SCIP_INVALIDCALL;
4072  }
4073 
4074  return SCIP_OKAY;
4075 }
4076 
4077 /** sets separating parameters to
4078  * - SCIP_PARAMSETTING_DEFAULT which are the default values of all separating parameters
4079  * - SCIP_PARAMSETTING_FAST such that the time spent on separating is decreased
4080  * - SCIP_PARAMSETTING_AGGRESSIVE such that separating is more aggressive
4081  * - SCIP_PARAMSETTING_OFF which turn off all separating
4082  */
4084  SCIP_PARAMSET* paramset, /**< parameter set */
4085  SCIP_SET* set, /**< global SCIP settings */
4086  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4087  SCIP_PARAMSETTING paramsetting, /**< parameter settings */
4088  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4089  )
4090 {
4091  switch( paramsetting )
4092  {
4094  SCIP_CALL( paramsetSetSeparatingDefault(paramset, set, messagehdlr, quiet) );
4095  break;
4096  case SCIP_PARAMSETTING_OFF:
4097  SCIP_CALL( paramsetSetSeparatingOff(paramset, set, messagehdlr, quiet) );
4098  break;
4100  SCIP_CALL( paramsetSetSeparatingFast(paramset, set, messagehdlr, quiet) );
4101  break;
4103  SCIP_CALL( paramsetSetSeparatingAggressive(paramset, set, messagehdlr, quiet) );
4104  break;
4105  default:
4106  SCIPerrorMessage("the parameter setting <%d> is not allowed for separating\n", paramsetting);
4107  return SCIP_INVALIDCALL;
4108  }
4109 
4110  return SCIP_OKAY;
4111 }
4112 
4113 /** returns the array of parameters */
4115  SCIP_PARAMSET* paramset /**< parameter set */
4116  )
4117 {
4118  assert(paramset != NULL);
4119 
4120  return paramset->params;
4121 }
4122 
4123 /** returns the number of parameters in the parameter set */
4125  SCIP_PARAMSET* paramset /**< parameter set */
4126  )
4127 {
4128  assert(paramset != NULL);
4129 
4130  return paramset->nparams;
4131 }
4132 
4133 /** copies all parameter values of the source parameter set to the corresponding parameters in the target set
4134  *
4135  * by default reoptimization is disabled after copying the parameters. if you want to use reoptimization, you have
4136  * to enable it explicitly.
4137  */
4139  SCIP_PARAMSET* sourceparamset, /**< source parameter set */
4140  SCIP_PARAMSET* targetparamset, /**< target parameter set */
4141  SCIP_SET* set, /**< global SCIP settings of target SCIP */
4142  SCIP_MESSAGEHDLR* messagehdlr /**< message handler of target SCIP */
4143  )
4144 {
4145  int i;
4146 
4147  assert(sourceparamset != NULL);
4148  assert(targetparamset != NULL);
4149  assert(sourceparamset != targetparamset);
4150  assert(set != NULL);
4151 
4152  assert(sourceparamset->nparams == 0 || sourceparamset->params != NULL);
4153  assert(targetparamset->nparams == 0 || targetparamset->params != NULL);
4154 
4155  for( i = 0; i < sourceparamset->nparams; ++i )
4156  {
4157  SCIP_PARAM* sourceparam;
4158  SCIP_PARAM* targetparam;
4159  const char* paramname;
4160 
4161  sourceparam = sourceparamset->params[i];
4162  assert(sourceparam != NULL);
4163 
4164  /* find parameter of same name in target scip */
4165  paramname = SCIPparamGetName(sourceparam);
4166  targetparam = (SCIP_PARAM*)SCIPhashtableRetrieve(targetparamset->hashtable, (void*)paramname);
4167 
4168  /* if a plugin was not copied, the parameter does not exist in the target SCIP */
4169  if( targetparam == NULL )
4170  continue;
4171 
4172  assert(SCIPparamGetType(sourceparam) == SCIPparamGetType(targetparam));
4173 
4174  /* set value of target parameter to value of source parameter */
4175  switch( SCIPparamGetType(sourceparam) )
4176  {
4177  case SCIP_PARAMTYPE_BOOL:
4178  SCIP_CALL( paramCopyBool(sourceparam, targetparam, set, messagehdlr) );
4179  break;
4180 
4181  case SCIP_PARAMTYPE_INT:
4182  SCIP_CALL( paramCopyInt(sourceparam, targetparam, set, messagehdlr) );
4183  break;
4184 
4186  SCIP_CALL( paramCopyLongint(sourceparam, targetparam, set, messagehdlr) );
4187  break;
4188 
4189  case SCIP_PARAMTYPE_REAL:
4190  SCIP_CALL( paramCopyReal(sourceparam, targetparam, set, messagehdlr) );
4191  break;
4192 
4193  case SCIP_PARAMTYPE_CHAR:
4194  SCIP_CALL( paramCopyChar(sourceparam, targetparam, set, messagehdlr) );
4195  break;
4196 
4197  case SCIP_PARAMTYPE_STRING:
4198  /* the visualization parameters are explicitly not copied to avoid that the visualization file of the original SCIP is overwritten;
4199  * to avoid a hard coded comparison, each parameter could get a Bool flag which tells if the value
4200  * of that parameter can be copied
4201  */
4202  if( strncmp(sourceparam->name, "visual/", 7) != 0 )
4203  {
4204  SCIP_CALL( paramCopyString(sourceparam, targetparam, set, messagehdlr) );
4205  }
4206  break;
4207 
4208  default:
4209  SCIPerrorMessage("unknown parameter type\n");
4210  return SCIP_INVALIDDATA;
4211  }
4212 
4213  /* copy fixing status of parameter */
4214  SCIPparamSetFixed(targetparam, SCIPparamIsFixed(sourceparam));
4215  }
4216 
4217  /* disable reoptimization explicitly */
4218  if( set->reopt_enable )
4219  {
4220  if( SCIPsetIsParamFixed(set, "reoptimization/enable") )
4221  {
4222  SCIP_CALL( SCIPsetChgParamFixed(set, "reoptimization/enable", FALSE) );
4223  }
4224  SCIP_CALL( SCIPparamsetSetBool(targetparamset, set, messagehdlr, "reoptimization/enable", FALSE) );
4225  SCIP_CALL( SCIPsetSetReoptimizationParams(set, messagehdlr) );
4226  }
4227 
4228  return SCIP_OKAY;
4229 }
4230 
4231 /** sets fixing status of given parameter */
4233  SCIP_PARAM* param, /**< parameter */
4234  SCIP_Bool fixed /**< new fixing status of the parameter */
4235  )
4236 {
4237  assert(param != NULL);
4238 
4239  param->isfixed = fixed;
4240 }
4241 
4242 /** checks whether value of bool parameter is valid */
4244  SCIP_PARAM* param, /**< parameter */
4245  SCIP_Bool value /**< value to check */
4246  )
4247 { /*lint --e{715}*/
4248  return ( value == TRUE || value == FALSE );
4249 }
4250 
4251 /** checks whether value of integer parameter is valid */
4253  SCIP_PARAM* param, /**< parameter */
4254  int value /**< value to check */
4255  )
4256 {
4257  assert(param != NULL);
4258 
4259  return ( value >= param->data.intparam.minvalue && value <= param->data.intparam.maxvalue );
4260 }
4261 
4262 /** checks whether value of SCIP_Longint parameter is valid */
4264  SCIP_PARAM* param, /**< parameter */
4265  SCIP_Longint value /**< value to check */
4266  )
4267 {
4268  assert( param != NULL );
4269 
4270  return ( value >= param->data.longintparam.minvalue && value <= param->data.longintparam.maxvalue );
4271 }
4272 
4273 /** checks whether value of SCIP_Real parameter is valid */
4275  SCIP_PARAM* param, /**< parameter */
4276  SCIP_Real value /**< value to check */
4277  )
4278 {
4279  assert( param != NULL );
4280 
4281  return ( value >= param->data.realparam.minvalue && value <= param->data.realparam.maxvalue );
4282 }
4283 
4284 /** checks whether value of char parameter is valid */
4286  SCIP_PARAM* param, /**< parameter */
4287  const char value /**< value to check */
4288  )
4289 {
4290  assert( param != NULL );
4291 
4292  if( value == '\b' || value == '\f' || value == '\n' || value == '\r' || value == '\v' )
4293  return FALSE;
4294 
4295  if( param->data.charparam.allowedvalues != NULL )
4296  {
4297  char* c;
4298 
4299  c = param->data.charparam.allowedvalues;
4300  while( *c != '\0' && *c != value )
4301  c++;
4302 
4303  if( *c != value )
4304  return FALSE;
4305  }
4306 
4307  return TRUE;
4308 }
4309 
4310 /** checks whether value of string parameter is valid */
4312  SCIP_PARAM* param, /**< parameter */
4313  const char* value /**< value to check */
4314  )
4315 { /*lint --e{715}*/
4316  unsigned int i;
4317 
4318  for( i = 0; i < (unsigned int) strlen(value); ++i )
4319  {
4320  if( value[i] == '\b' || value[i] == '\f' || value[i] == '\n' || value[i] == '\r' || value[i] == '\v' )
4321  return FALSE;
4322  }
4323  return TRUE;
4324 }
4325 
4326 /** sets value of SCIP_Bool parameter */
4328  SCIP_PARAM* param, /**< parameter */
4329  SCIP_SET* set, /**< global SCIP settings, or NULL if param change method should not be called */
4330  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4331  SCIP_Bool value, /**< new value of the parameter */
4332  SCIP_Bool initialize, /**< is this the initialization of the parameter? */
4333  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4334  )
4335 {
4336  assert(param != NULL);
4337 
4338  /* check, if value is possible for the parameter and the parameter is not fixed */
4339  SCIP_CALL_QUIET( paramTestBool(param, messagehdlr, value) );
4340 
4341  /* is the value of the parameter changed? */
4342  if( initialize || (param->data.boolparam.valueptr != NULL && *param->data.boolparam.valueptr != value)
4343  || (param->data.boolparam.valueptr == NULL && param->data.boolparam.curvalue != value) )
4344  {
4345  SCIP_CALL_QUIET( paramTestFixed(param, messagehdlr) );
4346 
4347  /* set the parameter's current value */
4348  if( param->data.boolparam.valueptr != NULL )
4349  *param->data.boolparam.valueptr = value;
4350  else
4351  param->data.boolparam.curvalue = value;
4352 
4353  /* call the parameter's change information method */
4354  if( param->paramchgd != NULL && set != NULL )
4355  {
4356  SCIP_CALL( param->paramchgd(set->scip, param) );
4357  }
4358  }
4359 
4360  if( !quiet )
4361  {
4362  SCIP_CALL( paramWrite(param, messagehdlr, NULL, FALSE, TRUE) );
4363  }
4364 
4365  return SCIP_OKAY;
4366 }
4367 
4368 /** sets value of int parameter */
4370  SCIP_PARAM* param, /**< parameter */
4371  SCIP_SET* set, /**< global SCIP settings, or NULL if param change method should not be called */
4372  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4373  int value, /**< new value of the parameter */
4374  SCIP_Bool initialize, /**< is this the initialization of the parameter? */
4375  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4376  )
4377 {
4378  assert(param != NULL);
4379 
4380  /* check, if value is possible for the parameter and the parameter is not fixed */
4381  SCIP_CALL_QUIET( paramTestInt(param, messagehdlr, value) );
4382 
4383  /* is the value of the parameter changed? */
4384  if( initialize || (param->data.intparam.valueptr != NULL && *param->data.intparam.valueptr != value)
4385  || (param->data.intparam.valueptr == NULL && param->data.intparam.curvalue != value) )
4386  {
4387  SCIP_CALL_QUIET( paramTestFixed(param, messagehdlr) );
4388 
4389  /* set the parameter's current value */
4390  if( param->data.intparam.valueptr != NULL )
4391  *param->data.intparam.valueptr = value;
4392  else
4393  param->data.intparam.curvalue = value;
4394 
4395  /* call the parameter's change information method */
4396  if( param->paramchgd != NULL && set != NULL )
4397  {
4398  SCIP_CALL( param->paramchgd(set->scip, param) );
4399  }
4400  }
4401 
4402  if( !quiet )
4403  {
4404  SCIP_CALL( paramWrite(param, messagehdlr, NULL, FALSE, TRUE) );
4405  }
4406 
4407  return SCIP_OKAY;
4408 }
4409 
4410 /** sets value of SCIP_Longint parameter */
4412  SCIP_PARAM* param, /**< parameter */
4413  SCIP_SET* set, /**< global SCIP settings, or NULL if param change method should not be called */
4414  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4415  SCIP_Longint value, /**< new value of the parameter */
4416  SCIP_Bool initialize, /**< is this the initialization of the parameter? */
4417  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4418  )
4419 {
4420  assert(param != NULL);
4421 
4422  /* check, if value is possible for the parameter and the parameter is not fixed */
4423  SCIP_CALL_QUIET( paramTestLongint(param, messagehdlr, value) );
4424 
4425  /* is the value of the parameter changed? */
4426  if( initialize || (param->data.longintparam.valueptr != NULL && *param->data.longintparam.valueptr != value)
4427  || (param->data.longintparam.valueptr == NULL && param->data.longintparam.curvalue != value) )
4428  {
4429  SCIP_CALL_QUIET( paramTestFixed(param, messagehdlr) );
4430 
4431  /* set the parameter's current value */
4432  if( param->data.longintparam.valueptr != NULL )
4433  *param->data.longintparam.valueptr = value;
4434  else
4435  param->data.longintparam.curvalue = value;
4436 
4437  /* call the parameter's change information method */
4438  if( param->paramchgd != NULL && set != NULL )
4439  {
4440  SCIP_CALL( param->paramchgd(set->scip, param) );
4441  }
4442  }
4443 
4444  if( !quiet )
4445  {
4446  SCIP_CALL( paramWrite(param, messagehdlr, NULL, FALSE, TRUE) );
4447  }
4448 
4449  return SCIP_OKAY;
4450 }
4451 
4452 /** sets value of SCIP_Real parameter */
4454  SCIP_PARAM* param, /**< parameter */
4455  SCIP_SET* set, /**< global SCIP settings, or NULL if param change method should not be called */
4456  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4457  SCIP_Real value, /**< new value of the parameter */
4458  SCIP_Bool initialize, /**< is this the initialization of the parameter? */
4459  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4460  )
4461 {
4462  assert(param != NULL);
4463 
4464  /* check, if value is possible for the parameter and the parameter is not fixed */
4465  value = MAX(value, SCIP_REAL_MIN);
4466  value = MIN(value, SCIP_REAL_MAX);
4467  SCIP_CALL_QUIET( paramTestReal(param, messagehdlr, value) );
4468 
4469  /* is the value of the parameter changed? */
4470  if( initialize || (param->data.realparam.valueptr != NULL && *param->data.realparam.valueptr != value) /*lint !e777*/
4471  || (param->data.realparam.valueptr == NULL && param->data.realparam.curvalue != value) ) /*lint !e777*/
4472  {
4473  SCIP_CALL_QUIET( paramTestFixed(param, messagehdlr) );
4474 
4475  /* set the parameter's current value */
4476  if( param->data.realparam.valueptr != NULL )
4477  *param->data.realparam.valueptr = value;
4478  else
4479  param->data.realparam.curvalue = value;
4480 
4481  /* call the parameter's change information method */
4482  if( param->paramchgd != NULL && set != NULL )
4483  {
4484  SCIP_CALL( param->paramchgd(set->scip, param) );
4485  }
4486  }
4487 
4488  if( !quiet )
4489  {
4490  SCIP_CALL( paramWrite(param, messagehdlr, NULL, FALSE, TRUE) );
4491  }
4492 
4493  return SCIP_OKAY;
4494 }
4495 
4496 /** sets value of char parameter */
4498  SCIP_PARAM* param, /**< parameter */
4499  SCIP_SET* set, /**< global SCIP settings, or NULL if param change method should not be called */
4500  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4501  char value, /**< new value of the parameter */
4502  SCIP_Bool initialize, /**< is this the initialization of the parameter? */
4503  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4504  )
4505 {
4506  assert(param != NULL);
4507 
4508  /* check, if value is possible for the parameter and the parameter is not fixed */
4509  SCIP_CALL_QUIET( paramTestChar(param, messagehdlr, value) );
4510 
4511  /* is the value of the parameter changed? */
4512  if( initialize || (param->data.charparam.valueptr != NULL && *param->data.charparam.valueptr != value)
4513  || (param->data.charparam.valueptr == NULL && param->data.charparam.curvalue != value) )
4514  {
4515  SCIP_CALL_QUIET( paramTestFixed(param, messagehdlr) );
4516 
4517  /* set the parameter's current value */
4518  if( param->data.charparam.valueptr != NULL )
4519  *param->data.charparam.valueptr = value;
4520  else
4521  param->data.charparam.curvalue = value;
4522 
4523  /* call the parameter's change information method */
4524  if( param->paramchgd != NULL && set != NULL )
4525  {
4526  SCIP_CALL( param->paramchgd(set->scip, param) );
4527  }
4528  }
4529 
4530  if( !quiet )
4531  {
4532  SCIP_CALL( paramWrite(param, messagehdlr, NULL, FALSE, TRUE) );
4533  }
4534 
4535  return SCIP_OKAY;
4536 }
4537 
4538 /** sets value of string parameter */
4540  SCIP_PARAM* param, /**< parameter */
4541  SCIP_SET* set, /**< global SCIP settings, or NULL if param change method should not be called */
4542  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4543  const char* value, /**< new value of the parameter */
4544  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
4545  )
4546 {
4547  assert(param != NULL);
4548 
4549  /* check, if value is possible for the parameter and the parameter is not fixed */
4550  SCIP_CALL_QUIET( paramTestString(param, messagehdlr, value) );
4551  SCIP_CALL_QUIET( paramTestFixed(param, messagehdlr) );
4552 
4553  /* set the parameter's current value */
4554  if( param->data.stringparam.valueptr != NULL )
4555  {
4557  SCIP_ALLOC( BMSduplicateMemoryArray(param->data.stringparam.valueptr, value, strlen(value)+1) );
4558  }
4559  else
4560  {
4562  SCIP_ALLOC( BMSduplicateMemoryArray(&param->data.stringparam.curvalue, value, strlen(value)+1) );
4563  }
4564 
4565  /* call the parameter's change information method */
4566  if( param->paramchgd != NULL && set != NULL )
4567  {
4568  SCIP_CALL( param->paramchgd(set->scip, param) );
4569  }
4570 
4571  if( !quiet )
4572  {
4573  SCIP_CALL( paramWrite(param, messagehdlr, NULL, FALSE, TRUE) );
4574  }
4575 
4576  return SCIP_OKAY;
4577 }
4578 
4579 
4580 /** changes default value of SCIP_Bool parameter */
4582  SCIP_PARAM* param, /**< parameter */
4583  SCIP_Bool defaultvalue /**< new default value */
4584  )
4585 {
4586  assert(param != NULL);
4587  assert(param->paramtype == SCIP_PARAMTYPE_BOOL);
4588 
4589  param->data.boolparam.defaultvalue = defaultvalue;
4590 }
4591 
4592 /** changes default value of int parameter */
4594  SCIP_PARAM* param, /**< parameter */
4595  int defaultvalue /**< new default value */
4596  )
4597 {
4598  assert(param != NULL);
4599  assert(param->paramtype == SCIP_PARAMTYPE_INT);
4600 
4601  assert(param->data.intparam.minvalue <= defaultvalue && param->data.intparam.maxvalue >= defaultvalue);
4602 
4603  param->data.intparam.defaultvalue = defaultvalue;
4604 }
4605 
4606 /** sets the parameter to its default setting */
4608  SCIP_PARAM* param, /**< parameter */
4609  SCIP_SET* set, /**< global SCIP settings */
4610  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
4611  )
4612 {
4613  assert(param != NULL);
4614 
4615  /* do not change the parameter if it is fixed */
4616  if( SCIPparamIsFixed(param) )
4617  {
4618  SCIPsetDebugMsg(set, "parameter <%s> is fixed and is not reset to its default value.\n", param->name);
4619 
4620  return SCIP_OKAY;
4621  }
4622 
4623  switch( param->paramtype )
4624  {
4625  case SCIP_PARAMTYPE_BOOL:
4626  SCIP_CALL( SCIPparamSetBool(param, set, messagehdlr, SCIPparamGetBoolDefault(param), FALSE, TRUE) );
4627  break;
4628 
4629  case SCIP_PARAMTYPE_INT:
4630  SCIP_CALL( SCIPparamSetInt(param, set, messagehdlr, SCIPparamGetIntDefault(param), FALSE, TRUE) );
4631  break;
4632 
4634  SCIP_CALL( SCIPparamSetLongint(param, set, messagehdlr, SCIPparamGetLongintDefault(param), FALSE, TRUE) );
4635  break;
4636 
4637  case SCIP_PARAMTYPE_REAL:
4638  SCIP_CALL( SCIPparamSetReal(param, set, messagehdlr, SCIPparamGetRealDefault(param), FALSE, TRUE) );
4639  break;
4640 
4641  case SCIP_PARAMTYPE_CHAR:
4642  SCIP_CALL( SCIPparamSetChar(param, set, messagehdlr, SCIPparamGetCharDefault(param), FALSE, TRUE) );
4643  break;
4644 
4645  case SCIP_PARAMTYPE_STRING:
4646  SCIP_CALL( SCIPparamSetString(param, set, messagehdlr, SCIPparamGetStringDefault(param), TRUE) );
4647  break;
4648 
4649  default:
4650  SCIPerrorMessage("unknown parameter type\n");
4651  return SCIP_INVALIDDATA;
4652  }
4653 
4654  return SCIP_OKAY;
4655 }
4656 
4657 /** writes a single parameter to a file */
4659  SCIP_PARAM* param, /**< parameter */
4660  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
4661  const char* filename, /**< file name, or NULL for stdout */
4662  SCIP_Bool comments, /**< should parameter descriptions be written as comments? */
4663  SCIP_Bool onlychanged /**< should only the parameters been written, that are changed from default? */
4664  )
4665 {
4666  SCIP_RETCODE retcode;
4667  FILE* file;
4668 
4669  assert(param != NULL);
4670 
4671  /* open the file for writing */
4672  if( filename != NULL )
4673  {
4674  file = fopen(filename, "w");
4675  if( file == NULL )
4676  {
4677  SCIPerrorMessage("cannot open file <%s> for writing\n", filename);
4678  SCIPprintSysError(filename);
4679  return SCIP_FILECREATEERROR;
4680  }
4681  }
4682  else
4683  file = NULL;
4684 
4685  /* write the parameter to the file */
4686  retcode = paramWrite(param, messagehdlr, file, comments, onlychanged);
4687 
4688  /* close output file */
4689  if( filename != NULL )
4690  {
4691  assert(file != NULL); /*lint !e449*/
4692  fclose(file);
4693  }
4694 
4695  SCIP_CALL( retcode );
4696 
4697  return SCIP_OKAY;
4698 }
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
SCIP_Bool SCIPparamIsValidInt(SCIP_PARAM *param, int value)
Definition: paramset.c:4252
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:3142
#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:4581
static const char * paramtypeGetName(SCIP_PARAMTYPE paramtype)
Definition: paramset.c:1651
#define SCIP_MAXSTRLEN
Definition: def.h:259
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:721
SCIP_BOOLPARAM boolparam
SCIP_Longint minvalue
#define SCIP_SUBVERSION
Definition: def.h:111
SCIP_RETCODE SCIPparamsetSetSeparating(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: paramset.c:4083
static SCIP_RETCODE paramsetSetPresolvingAggressive(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:3040
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:64
SCIP_PROP * SCIPsetFindProp(SCIP_SET *set, const char *name)
Definition: set.c:4085
SCIP_Longint curvalue
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:10011
#define TRUE
Definition: def.h:63
const char * SCIPsepaGetName(SCIP_SEPA *sepa)
Definition: sepa.c:646
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_PRESOL * SCIPsetFindPresol(SCIP_SET *set, const char *name)
Definition: set.c:3860
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:1249
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:5974
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:152
SCIP_RETCODE SCIPparamSetInt(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, int value, SCIP_Bool initialize, SCIP_Bool quiet)
Definition: paramset.c:4369
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:4497
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:3909
SCIP_CONSHDLR * SCIPsetFindConshdlr(SCIP_SET *set, const char *name)
Definition: set.c:3743
SCIP_Bool SCIPsetIsParamFixed(SCIP_SET *set, const char *name)
Definition: set.c:2930
SCIP_RETCODE SCIPparamsetGetInt(SCIP_PARAMSET *paramset, const char *name, int *value)
Definition: paramset.c:1734
const char * SCIPheurGetName(SCIP_HEUR *heur)
Definition: heur.c:1198
#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:4113
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:4327
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:2917
SCIP_RETCODE SCIPsetSetSeparating(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: set.c:3454
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:2955
SCIP_RETCODE SCIPparamSetString(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *value, SCIP_Bool quiet)
Definition: paramset.c:4539
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:3690
SCIP_RETCODE SCIPparamsetAddLongint(SCIP_PARAMSET *paramset, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, SCIP_Longint *valueptr, SCIP_Bool isadvanced, SCIP_Longint defaultvalue, SCIP_Longint minvalue, SCIP_Longint maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: paramset.c: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:4008
SCIP_Bool SCIPparamIsValidReal(SCIP_PARAM *param, SCIP_Real value)
Definition: paramset.c:4274
internal methods for global SCIP settings
#define SCIP_CALL(x)
Definition: def.h:350
static SCIP_RETCODE paramsetSetSeparatingOff(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:3629
SCIP_RETCODE SCIPsetSetReoptimizationParams(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: set.c:759
SCIP_Real maxvalue
SCIP_RETCODE SCIPparamsetSetHeuristics(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: paramset.c:4011
SCIP_RETCODE SCIPsetSetPresolving(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: set.c:3436
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:4411
int SCIPparamsetGetNParams(SCIP_PARAMSET *paramset)
Definition: paramset.c:4124
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:2871
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:3418
#define SCIP_Bool
Definition: def.h:61
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:3565
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:9920
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
#define MAX(x, y)
Definition: tclique_def.h:75
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 SCIPsetDebugMsg
Definition: set.h:1913
SCIP_RETCODE SCIPhashtableSafeInsert(SCIP_HASHTABLE *hashtable, void *element)
Definition: misc.c:2297
const char * SCIPpresolGetName(SCIP_PRESOL *presol)
Definition: presol.c:553
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:4138
SCIP_Real * valueptr
SCIP_RETCODE SCIPparamsetSetPresolving(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: paramset.c:4047
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:4305
static SCIP_RETCODE paramsetSetPresolvingOff(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: paramset.c:3233
SCIP_Bool SCIPparamGetBool(SCIP_PARAM *param)
Definition: paramset.c:691
void * SCIPhashtableRetrieve(SCIP_HASHTABLE *hashtable, void *key)
Definition: misc.c: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:887
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:268
enum SCIP_ParamEmphasis SCIP_PARAMEMPHASIS
Definition: type_paramset.h:73
#define SCIP_REAL_MAX
Definition: def.h:150
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:325
#define SCIP_REAL_MIN
Definition: def.h:151
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_VERSION
Definition: def.h:110
SCIP_Bool SCIPparamIsValidChar(SCIP_PARAM *param, const char value)
Definition: paramset.c:4285
static SCIP_RETCODE paramParseInt(SCIP_PARAM *param, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, char *valuestr)
Definition: paramset.c:1251
SCIP_Bool SCIPparamIsValidBool(SCIP_PARAM *param, SCIP_Bool value)
Definition: paramset.c:4243
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:3036
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:149
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:4607
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:3391
#define SCIP_Longint
Definition: def.h:134
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:3311
SCIP_PARAM ** SCIPparamsetGetParams(SCIP_PARAMSET *paramset)
Definition: paramset.c:4114
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:4453
SCIP_RETCODE SCIPparamWrite(SCIP_PARAM *param, SCIP_MESSAGEHDLR *messagehdlr, const char *filename, SCIP_Bool comments, SCIP_Bool onlychanged)
Definition: paramset.c:4658
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:4593
#define SCIP_ALLOC(x)
Definition: def.h:361
#define SCIPABORT()
Definition: def.h:322
SCIP_Bool SCIPparamIsValidLongint(SCIP_PARAM *param, SCIP_Longint value)
Definition: paramset.c:4263
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:179
SCIP_Bool SCIPparamIsValidString(SCIP_PARAM *param, const char *value)
Definition: paramset.c:4311
SCIP_Real SCIPparamGetRealMax(SCIP_PARAM *param)
Definition: paramset.c:835
SCIP callable library.
void SCIPparamSetFixed(SCIP_PARAM *param, SCIP_Bool fixed)
Definition: paramset.c:4232
SCIP_Real minvalue
SCIP_RETCODE SCIPparamsetSet(SCIP_PARAMSET *paramset, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, void *value)
Definition: paramset.c:1918