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