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