Scippy

SCIP

Solving Constraint Integer Programs

dialog_default.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-2014 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file dialog_default.c
17  * @brief default user interface dialog
18  * @author Tobias Achterberg
19  * @author Timo Berthold
20  * @author Gerald Gamrath
21  */
22 
23 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
24 
25 #include <assert.h>
26 #include <string.h>
27 
28 #include "scip/dialog_default.h"
29 #include "nlpi/nlpi.h"
30 
31 
32 
33 /** executes a menu dialog */
34 static
36  SCIP* scip, /**< SCIP data structure */
37  SCIP_DIALOG* dialog, /**< dialog menu */
38  SCIP_DIALOGHDLR* dialoghdlr, /**< dialog handler */
39  SCIP_DIALOG** nextdialog /**< pointer to store next dialog to execute */
40  )
41 {
42  char* command;
43  SCIP_Bool again;
44  SCIP_Bool endoffile;
45  int nfound;
46 
47  do
48  {
49  again = FALSE;
50 
51  /* get the next word of the command string */
52  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, NULL, &command, &endoffile) );
53  if( endoffile )
54  {
55  *nextdialog = NULL;
56  return SCIP_OKAY;
57  }
58 
59  /* exit to the root dialog, if command is empty */
60  if( command[0] == '\0' )
61  {
62  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
63  return SCIP_OKAY;
64  }
65  else if( strcmp(command, "..") == 0 )
66  {
67  *nextdialog = SCIPdialogGetParent(dialog);
68  if( *nextdialog == NULL )
69  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
70  return SCIP_OKAY;
71  }
72 
73  /* find command in dialog */
74  nfound = SCIPdialogFindEntry(dialog, command, nextdialog);
75 
76  /* check result */
77  if( nfound == 0 )
78  {
79  SCIPdialogMessage(scip, NULL, "command <%s> not available\n", command);
80  SCIPdialoghdlrClearBuffer(dialoghdlr);
81  *nextdialog = dialog;
82  }
83  else if( nfound >= 2 )
84  {
85  SCIPdialogMessage(scip, NULL, "\npossible completions:\n");
86  SCIP_CALL( SCIPdialogDisplayCompletions(dialog, scip, command) );
87  SCIPdialogMessage(scip, NULL, "\n");
88  SCIPdialoghdlrClearBuffer(dialoghdlr);
89  again = TRUE;
90  }
91  }
92  while( again );
93 
94  return SCIP_OKAY;
95 }
96 
97 
98 /* parse the given string to detect a Boolean value and returns it */
99 static
101  SCIP* scip, /**< SCIP data structure */
102  const char* valuestr, /**< string to parse */
103  SCIP_Bool* error /**< pointer to store the error result */
104  )
105 {
106  assert( scip != NULL );
107  assert( valuestr != NULL );
108  assert( error != NULL );
109 
110  *error = FALSE;
111 
112  switch( valuestr[0] )
113  {
114  case 'f':
115  case 'F':
116  case '0':
117  case 'n':
118  case 'N':
119  return FALSE;
120  case 't':
121  case 'T':
122  case '1':
123  case 'y':
124  case 'Y':
125  return TRUE;
126  default:
127  SCIPdialogMessage(scip, NULL, "\ninvalid parameter value <%s>\n\n", valuestr);
128  *error = TRUE;
129  break;
130  }
131 
132  return FALSE;
133 }
134 
135 
136 /* display the reader information */
137 static
139  SCIP* scip, /**< SCIP data structure */
140  SCIP_Bool reader, /**< display reader which can read */
141  SCIP_Bool writer /**< display reader which can write */
142  )
143 {
144  SCIP_READER** readers;
145  int nreaders;
146  int r;
147 
148  assert( scip != NULL );
149 
150  readers = SCIPgetReaders(scip);
151  nreaders = SCIPgetNReaders(scip);
152 
153  /* display list of readers */
154  SCIPdialogMessage(scip, NULL, "\n");
155  SCIPdialogMessage(scip, NULL, " file reader extension description\n");
156  SCIPdialogMessage(scip, NULL, " ----------- --------- -----------\n");
157  for( r = 0; r < nreaders; ++r )
158  {
159  if( (reader && SCIPreaderCanRead(readers[r])) || (writer && SCIPreaderCanWrite(readers[r])) )
160  {
161  SCIPdialogMessage(scip, NULL, " %-20s ", SCIPreaderGetName(readers[r]));
162  if( strlen(SCIPreaderGetName(readers[r])) > 20 )
163  SCIPdialogMessage(scip, NULL, "\n %20s ", "-->");
164  SCIPdialogMessage(scip, NULL, "%9s ", SCIPreaderGetExtension(readers[r]));
165  SCIPdialogMessage(scip, NULL, "%s", SCIPreaderGetDesc(readers[r]));
166  SCIPdialogMessage(scip, NULL, "\n");
167  }
168  }
169  SCIPdialogMessage(scip, NULL, "\n");
170 }
171 
172 
173 /* writes problem to file */
174 static
176  SCIP* scip, /**< SCIP data structure */
177  SCIP_DIALOG* dialog, /**< dialog menu */
178  SCIP_DIALOGHDLR* dialoghdlr, /**< dialog handler */
179  SCIP_DIALOG** nextdialog, /**< pointer to store next dialog to execute */
180  SCIP_Bool transformed, /**< output the transformed problem? */
181  SCIP_Bool genericnames /**< using generic variable and constraint names? */
182  )
183 {
184  char* filename;
185  SCIP_Bool endoffile;
186  SCIP_RETCODE retcode;
187 
188  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter filename: ", &filename, &endoffile) );
189  if( endoffile )
190  {
191  *nextdialog = NULL;
192  return SCIP_OKAY;
193  }
194 
195  if( filename[0] != '\0' )
196  {
197  char* tmpfilename;
198  char* extension;
199 
200  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, filename, TRUE) );
201 
202  /* copy filename */
203  SCIP_CALL( SCIPduplicateBufferArray(scip, &tmpfilename, filename, (int)strlen(filename)+1) );
204  extension = NULL;
205 
206  do
207  {
208  if( transformed )
209  retcode = SCIPwriteTransProblem(scip, tmpfilename, extension, genericnames);
210  else
211  retcode = SCIPwriteOrigProblem(scip, tmpfilename, extension, genericnames);
212 
213  if( retcode == SCIP_FILECREATEERROR )
214  {
215  SCIPdialogMessage(scip, NULL, "error creating the file <%s>\n", filename);
216  SCIPdialoghdlrClearBuffer(dialoghdlr);
217  break;
218  }
219  else if(retcode == SCIP_WRITEERROR )
220  {
221  SCIPdialogMessage(scip, NULL, "error writing file <%s>\n", filename);
222  SCIPdialoghdlrClearBuffer(dialoghdlr);
223  break;
224  }
225  else if( retcode == SCIP_PLUGINNOTFOUND )
226  {
227  /* ask user once for a suitable reader */
228  if( extension == NULL )
229  {
230  SCIPdialogMessage(scip, NULL, "no reader for requested output format\n");
231 
232  SCIPdialogMessage(scip, NULL, "following readers are avaliable for writing:\n");
233  displayReaders(scip, FALSE, TRUE);
234 
235  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog,
236  "select a suitable reader by extension (or return): ", &extension, &endoffile) );
237 
238  if( extension[0] == '\0' )
239  break;
240  }
241  else
242  {
243  SCIPdialogMessage(scip, NULL, "no reader for output in <%s> format\n", extension);
244  extension = NULL;
245  }
246  }
247  else
248  {
249  /* check for unexpected errors */
250  SCIP_CALL( retcode );
251 
252  /* print result message if writing was successful */
253  if( transformed )
254  SCIPdialogMessage(scip, NULL, "written transformed problem to file <%s>\n", tmpfilename);
255  else
256  SCIPdialogMessage(scip, NULL, "written original problem to file <%s>\n", tmpfilename);
257  break;
258  }
259  }
260  while( extension != NULL );
261 
262  SCIPfreeBufferArray(scip, &tmpfilename);
263  }
264 
265  return SCIP_OKAY;
266 }
267 
268 /** copy method for dialog plugins (called when SCIP copies plugins) */
269 static
270 SCIP_DECL_DIALOGCOPY(dialogCopyDefault)
271 { /*lint --e{715}*/
272  assert(scip != NULL);
273  assert(dialog != NULL);
274 
275  /* call inclusion method of dialog */
277 
278  return SCIP_OKAY;
279 }
280 
281 /** standard menu dialog execution method, that displays it's help screen if the remaining command line is empty */
282 SCIP_DECL_DIALOGEXEC(SCIPdialogExecMenu)
283 { /*lint --e{715}*/
284  /* if remaining command string is empty, display menu of available options */
285  if( SCIPdialoghdlrIsBufferEmpty(dialoghdlr) )
286  {
287  SCIPdialogMessage(scip, NULL, "\n");
288  SCIP_CALL( SCIPdialogDisplayMenu(dialog, scip) );
289  SCIPdialogMessage(scip, NULL, "\n");
290  }
291 
292  SCIP_CALL( dialogExecMenu(scip, dialog, dialoghdlr, nextdialog) );
293 
294  return SCIP_OKAY;
295 }
296 
297 /** standard menu dialog execution method, that doesn't display it's help screen */
298 SCIP_DECL_DIALOGEXEC(SCIPdialogExecMenuLazy)
299 { /*lint --e{715}*/
300  SCIP_CALL( dialogExecMenu(scip, dialog, dialoghdlr, nextdialog) );
301 
302  return SCIP_OKAY;
303 }
304 
305 /** dialog execution method for the change add constraint */
306 SCIP_DECL_DIALOGEXEC(SCIPdialogExecChangeAddCons)
307 { /*lint --e{715}*/
308 
309  if( SCIPgetStage(scip) > SCIP_STAGE_PROBLEM )
310  SCIPdialogMessage(scip, NULL, "cannot call method after problem was transformed\n");
311  else if( SCIPgetStage(scip) < SCIP_STAGE_PROBLEM )
312  SCIPdialogMessage(scip, NULL, "cannot call method before problem was created\n");
313  else
314  {
315  SCIP_CONS* cons;
316  SCIP_Bool endoffile;
317  char* str;
318 
319  cons = NULL;
320 
321  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "write constraint in <cip> format\n", &str, &endoffile) );
322 
323  if( str[0] != '\0' )
324  {
325  SCIP_Bool success;
326 
327  printf("<%s>\n", str);
328 
329  SCIP_CALL( SCIPparseCons(scip, &cons, str, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, &success) );
330 
331  if( success )
332  {
333  char consstr[SCIP_MAXSTRLEN];
334 
335  /* add and release constraint */
336  SCIP_CALL( SCIPaddCons(scip, cons) );
337  SCIP_CALL( SCIPreleaseCons(scip, &cons) );
338 
339  SCIPdialogMessage(scip, NULL, "successfully added constraint\n");
340  SCIPescapeString(consstr, SCIP_MAXSTRLEN, str);
341 
342  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, consstr, FALSE) );
343  }
344  else
345  {
346  SCIPdialogMessage(scip, NULL, "constraint was not recognizable\n");
347  }
348  }
349  }
350 
351  /* set root dialog as next dialog */
352  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
353 
354  return SCIP_OKAY;
355 }
356 
357 /** dialog execution method for the change bounds command */
358 SCIP_DECL_DIALOGEXEC(SCIPdialogExecChangeBounds)
359 { /*lint --e{715}*/
360 
361  if( SCIPgetStage(scip) > SCIP_STAGE_PROBLEM )
362  SCIPdialogMessage(scip, NULL, "cannot call method after problem was transformed\n");
363  else if( SCIPgetStage(scip) < SCIP_STAGE_PROBLEM )
364  SCIPdialogMessage(scip, NULL, "cannot call method before problem was created\n");
365  else
366  {
367  SCIP_VAR* var;
368  SCIP_Bool endoffile;
369  char* varname;
370 
371  var = NULL;
372 
373  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
374 
375  do
376  {
377  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter variable name: ", &varname, &endoffile) );
378 
379  /* if we get a return or we reached the end of the file, then we stop */
380  if( varname[0] == '\0' || endoffile )
381  break;
382 
383  var = SCIPfindVar(scip, varname);
384 
385  if( var == NULL )
386  SCIPdialogMessage(scip, NULL, "variable <%s> does not exist\n", varname);
387  }
388  while( var == NULL );
389 
390  if( var != NULL )
391  {
392  do
393  {
394  char* boundstr;
395  char message[SCIP_MAXSTRLEN];
396  SCIP_Real bound;
397 
398  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, varname, FALSE) );
399 
400  (void)SCIPsnprintf(message, SCIP_MAXSTRLEN, "current lower bound <%.15g> (Return to skip): ", SCIPvarGetLbGlobal(var));
401  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, message, &boundstr, &endoffile) );
402 
403  /* if we reached the end of the file, then we stop */
404  if( endoffile )
405  break;
406 
407  if( boundstr[0] != '\0' )
408  {
409  char* endptr;
410 
411  bound = strtod(boundstr, &endptr);
412  if( endptr == boundstr || *endptr != '\0' )
413  {
414  printf("<%s> <%s>\n", endptr, boundstr);
415  SCIPdialogMessage(scip, NULL, "ignore none value string\n");
416  }
417  else if( SCIPisGT(scip, bound, SCIPvarGetUbGlobal(var)) )
418  {
419  SCIPdialogMessage(scip, NULL, "ignore lower bound <%.15g> since it is larger than the current upper bound <%.15g>\n",
420  bound, SCIPvarGetUbGlobal(var));
421  }
422  else
423  {
424  SCIP_CALL( SCIPchgVarLbGlobal(scip, var, bound) );
425  }
426  }
427 
428  (void)SCIPsnprintf(message, SCIP_MAXSTRLEN, "current upper bound <%.15g> (Return to skip): ", SCIPvarGetUbGlobal(var));
429  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, message, &boundstr, &endoffile) );
430 
431  /* if we reached the end of the file, then we stop */
432  if( endoffile )
433  break;
434 
435  if( boundstr[0] != '\0' )
436  {
437  char* endptr;
438 
439  bound = strtod(boundstr, &endptr);
440  if( endptr == boundstr || *endptr != '\0' )
441  {
442  SCIPdialogMessage(scip, NULL, "ignore none value string\n");
443  }
444  else if( SCIPisLT(scip, bound, SCIPvarGetLbGlobal(var)) )
445  {
446  SCIPdialogMessage(scip, NULL, "ignore new upper bound <%.15g> since it is smaller than the current lower bound <%.15g>\n",
447  bound, SCIPvarGetLbGlobal(var));
448  }
449  else
450  {
451  SCIP_CALL( SCIPchgVarUbGlobal(scip, var, bound) );
452  }
453  }
454  }
455  while( FALSE);
456 
457  SCIPdialogMessage(scip, NULL, "variable <%s> global bounds [%.15g,%.15g]\n", SCIPvarGetName(var), SCIPvarGetLbGlobal(var), SCIPvarGetUbGlobal(var));
458  }
459  }
460 
461  /* set root dialog as next dialog */
462  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
463 
464  return SCIP_OKAY;
465 }
466 
467 /** dialog execution method for the freetransproblem command */
468 SCIP_DECL_DIALOGEXEC(SCIPdialogExecChangeFreetransproblem)
469 { /*lint --e{715}*/
470  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
471 
472  /* free transformed problem */
473  SCIP_CALL( SCIPfreeTransform(scip) );
474 
475  /* set root dialog as next dialog */
476  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
477 
478  return SCIP_OKAY;
479 }
480 
481 /** dialog execution method for the changing the objective sense */
482 SCIP_DECL_DIALOGEXEC(SCIPdialogExecChangeObjSense)
483 { /*lint --e{715}*/
484  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
485 
486  if( SCIPgetStage(scip) > SCIP_STAGE_PROBLEM )
487  SCIPdialogMessage(scip, NULL, "cannot call method after problem was transformed\n");
488  else if( SCIPgetStage(scip) < SCIP_STAGE_PROBLEM )
489  SCIPdialogMessage(scip, NULL, "cannot call method before problem was created\n");
490  else
491  {
492  SCIP_Bool endoffile;
493  char* objsense;
494 
495  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "new objective sense {min,max}: ", &objsense, &endoffile) );
496 
497  /* if we get a return or we reached the end of the file, then we stop */
498  if( objsense[0] != '\0' && !endoffile )
499  {
500  if( strncmp(objsense, "max", 3) == 0 )
501  {
503  }
504  else if( strncmp(objsense , "min", 3) == 0 )
505  {
507  }
508  else
509  {
510  SCIPdialogMessage(scip, NULL, "invalid argument <%s>\n", objsense);
511  }
512  }
513  }
514 
515  /* set root dialog as next dialog */
516  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
517 
518  return SCIP_OKAY;
519 }
520 
521 /** dialog execution method for the checksol command */
522 SCIP_DECL_DIALOGEXEC(SCIPdialogExecChecksol)
523 { /*lint --e{715}*/
524  SCIP_SOL* sol;
525  SCIP_Bool feasible;
526 
527  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
528 
529  SCIPdialogMessage(scip, NULL, "\n");
530  if( SCIPgetStage(scip) >= SCIP_STAGE_TRANSFORMED )
531  sol = SCIPgetBestSol(scip);
532  else
533  sol = NULL;
534 
535  if( sol == NULL )
536  SCIPdialogMessage(scip, NULL, "no feasible solution available\n");
537  else
538  {
539  SCIPinfoMessage(scip, NULL, "check best solution\n");
540  SCIP_CALL( SCIPcheckSolOrig(scip, sol, &feasible, TRUE, FALSE) );
541 
542  if( feasible )
543  SCIPdialogMessage(scip, NULL, "solution is feasible in original problem\n");
544  }
545  SCIPdialogMessage(scip, NULL, "\n");
546 
547  *nextdialog = SCIPdialogGetParent(dialog);
548 
549  return SCIP_OKAY;
550 }
551 
552 /** dialog execution method for the conflictgraph command */
553 SCIP_DECL_DIALOGEXEC(SCIPdialogExecConflictgraph)
554 { /*lint --e{715}*/
555  SCIP_RETCODE retcode;
556  SCIP_Bool endoffile;
557  char* filename;
558 
559  assert(nextdialog != NULL);
560 
561  *nextdialog = NULL;
562 
563  if( !SCIPisTransformed(scip) )
564  {
565  SCIPdialogMessage(scip, NULL, "cannot call method before problem was transformed\n");
566  SCIPdialoghdlrClearBuffer(dialoghdlr);
567  }
568  else
569  {
570  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter filename: ", &filename, &endoffile) );
571  if( endoffile )
572  {
573  *nextdialog = NULL;
574  return SCIP_OKAY;
575  }
576 
577  if( filename[0] != '\0' )
578  {
579  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, filename, TRUE) );
580 
581  retcode = SCIPwriteImplicationConflictGraph(scip, filename);
582  if( retcode == SCIP_FILECREATEERROR )
583  SCIPdialogMessage(scip, NULL, "error creating file <%s>\n", filename);
584  else
585  {
586  SCIP_CALL( retcode );
587  }
588  }
589  }
590 
591  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
592 
593  return SCIP_OKAY;
594 }
595 
596 /** dialog execution method for the cliquegraph command */
597 SCIP_DECL_DIALOGEXEC(SCIPdialogExecCliquegraph)
598 { /*lint --e{715}*/
599  SCIP_RETCODE retcode;
600  SCIP_Bool endoffile;
601  char* filename;
602 
603  assert(nextdialog != NULL);
604 
605  *nextdialog = NULL;
606 
607  if( !SCIPisTransformed(scip) )
608  {
609  SCIPdialogMessage(scip, NULL, "cannot call method before problem was transformed\n");
610  SCIPdialoghdlrClearBuffer(dialoghdlr);
611  }
612  else
613  {
614  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter filename: ", &filename, &endoffile) );
615  if( endoffile )
616  {
617  *nextdialog = NULL;
618  return SCIP_OKAY;
619  }
620 
621  if( filename[0] != '\0' )
622  {
623  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, filename, TRUE) );
624 
625  retcode = SCIPwriteCliqueGraph(scip, filename, TRUE, FALSE);
626  if( retcode == SCIP_FILECREATEERROR )
627  SCIPdialogMessage(scip, NULL, "error creating file <%s>\n", filename);
628  else
629  {
630  SCIP_CALL( retcode );
631  }
632  }
633  }
634 
635  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
636 
637  return SCIP_OKAY;
638 }
639 
640 /** dialog execution method for the display branching command */
641 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayBranching)
642 { /*lint --e{715}*/
643  SCIP_BRANCHRULE** branchrules;
644  SCIP_BRANCHRULE** sorted;
645  int nbranchrules;
646  int i;
647 
648  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
649 
650  branchrules = SCIPgetBranchrules(scip);
651  nbranchrules = SCIPgetNBranchrules(scip);
652 
653  /* copy branchrules array into temporary memory for sorting */
654  SCIP_CALL( SCIPduplicateBufferArray(scip, &sorted, branchrules, nbranchrules) );
655 
656  /* sort the branching rules */
657  SCIPsortPtr((void**)sorted, SCIPbranchruleComp, nbranchrules);
658 
659  /* display sorted list of branching rules */
660  SCIPdialogMessage(scip, NULL, "\n");
661  SCIPdialogMessage(scip, NULL, " branching rule priority maxdepth maxbddist description\n");
662  SCIPdialogMessage(scip, NULL, " -------------- -------- -------- --------- -----------\n");
663  for( i = 0; i < nbranchrules; ++i )
664  {
665  SCIPdialogMessage(scip, NULL, " %-20s ", SCIPbranchruleGetName(sorted[i]));
666  if( strlen(SCIPbranchruleGetName(sorted[i])) > 20 )
667  SCIPdialogMessage(scip, NULL, "\n %20s ", "-->");
668  SCIPdialogMessage(scip, NULL, "%8d %8d %8.1f%% ", SCIPbranchruleGetPriority(sorted[i]),
669  SCIPbranchruleGetMaxdepth(sorted[i]), 100.0 * SCIPbranchruleGetMaxbounddist(sorted[i]));
670  SCIPdialogMessage(scip, NULL, "%s", SCIPbranchruleGetDesc(sorted[i]));
671  SCIPdialogMessage(scip, NULL, "\n");
672  }
673  SCIPdialogMessage(scip, NULL, "\n");
674 
675  /* free temporary memory */
676  SCIPfreeBufferArray(scip, &sorted);
677 
678  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
679 
680  return SCIP_OKAY;
681 }
682 
683 /** dialog execution method for the display relaxators command */
684 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayRelaxators)
685 { /*lint --e{715}*/
686  SCIP_RELAX** relaxs;
687  SCIP_RELAX** sorted;
688  int nrelaxs;
689  int i;
690 
691  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
692 
693  relaxs = SCIPgetRelaxs(scip);
694  nrelaxs = SCIPgetNRelaxs(scip);
695 
696  /* copy relaxs array into temporary memory for sorting */
697  if( nrelaxs != 0 )
698  {
699  SCIP_CALL( SCIPduplicateBufferArray(scip, &sorted, relaxs, nrelaxs) );
700  }
701  else
702  sorted = NULL;
703 
704  /* sort the relaxators */
705  SCIPsortPtr((void**)sorted, SCIPrelaxComp, nrelaxs);
706 
707  /* display sorted list of relaxators */
708  SCIPdialogMessage(scip, NULL, "\n");
709  SCIPdialogMessage(scip, NULL, " relaxator priority freq description\n");
710  SCIPdialogMessage(scip, NULL, " -------------- -------- ---- -----------\n");
711  for( i = 0; i < nrelaxs; ++i )
712  {
713  assert(sorted != NULL); /* for flexelint */
714  SCIPdialogMessage(scip, NULL, " %-20s ", SCIPrelaxGetName(sorted[i]));
715  if( strlen(SCIPrelaxGetName(sorted[i])) > 20 )
716  SCIPdialogMessage(scip, NULL, "\n %20s ", "-->");
717  SCIPdialogMessage(scip, NULL, "%8d %4d ", SCIPrelaxGetPriority(sorted[i]),
718  SCIPrelaxGetFreq(sorted[i]));
719  SCIPdialogMessage(scip, NULL, "%s", SCIPrelaxGetDesc(sorted[i]));
720  SCIPdialogMessage(scip, NULL, "\n");
721  }
722  SCIPdialogMessage(scip, NULL, "\n");
723 
724  /* free temporary memory */
725  SCIPfreeBufferArrayNull(scip, &sorted);
726 
727  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
728 
729  return SCIP_OKAY;
730 }
731 
732 /** dialog execution method for the display conflict command */
733 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayConflict)
734 { /*lint --e{715}*/
735  SCIP_CONFLICTHDLR** conflicthdlrs;
736  SCIP_CONFLICTHDLR** sorted;
737  int nconflicthdlrs;
738  int i;
739 
740  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
741 
742  conflicthdlrs = SCIPgetConflicthdlrs(scip);
743  nconflicthdlrs = SCIPgetNConflicthdlrs(scip);
744 
745  /* copy conflicthdlrs array into temporary memory for sorting */
746  SCIP_CALL( SCIPduplicateBufferArray(scip, &sorted, conflicthdlrs, nconflicthdlrs) );
747 
748  /* sort the conflict handlers */
749  SCIPsortPtr((void**)sorted, SCIPconflicthdlrComp, nconflicthdlrs);
750 
751  /* display sorted list of conflict handlers */
752  SCIPdialogMessage(scip, NULL, "\n");
753  SCIPdialogMessage(scip, NULL, " conflict handler priority description\n");
754  SCIPdialogMessage(scip, NULL, " ---------------- -------- -----------\n");
755  for( i = 0; i < nconflicthdlrs; ++i )
756  {
757  SCIPdialogMessage(scip, NULL, " %-20s ", SCIPconflicthdlrGetName(sorted[i]));
758  if( strlen(SCIPconflicthdlrGetName(sorted[i])) > 20 )
759  SCIPdialogMessage(scip, NULL, "\n %20s ", "-->");
760  SCIPdialogMessage(scip, NULL, "%8d ", SCIPconflicthdlrGetPriority(sorted[i]));
761  SCIPdialogMessage(scip, NULL, "%s", SCIPconflicthdlrGetDesc(sorted[i]));
762  SCIPdialogMessage(scip, NULL, "\n");
763  }
764  SCIPdialogMessage(scip, NULL, "\n");
765 
766  /* free temporary memory */
767  SCIPfreeBufferArray(scip, &sorted);
768 
769  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
770 
771  return SCIP_OKAY;
772 }
773 
774 /** dialog execution method for the display conshdlrs command */
775 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayConshdlrs)
776 { /*lint --e{715}*/
777  SCIP_CONSHDLR** conshdlrs;
778  int nconshdlrs;
779  int i;
780 
781  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
782 
783  conshdlrs = SCIPgetConshdlrs(scip);
784  nconshdlrs = SCIPgetNConshdlrs(scip);
785 
786  /* display list of constraint handlers */
787  SCIPdialogMessage(scip, NULL, "\n");
788  SCIPdialogMessage(scip, NULL, " constraint handler chckprio enfoprio sepaprio sepaf propf eager description\n");
789  SCIPdialogMessage(scip, NULL, " ------------------ -------- -------- -------- ----- ----- ----- -----------\n");
790  for( i = 0; i < nconshdlrs; ++i )
791  {
792  SCIPdialogMessage(scip, NULL, " %-20s ", SCIPconshdlrGetName(conshdlrs[i]));
793  if( strlen(SCIPconshdlrGetName(conshdlrs[i])) > 20 )
794  SCIPdialogMessage(scip, NULL, "\n %20s ", "-->");
795  SCIPdialogMessage(scip, NULL, "%8d %8d %8d %5d %5d %5d ",
796  SCIPconshdlrGetCheckPriority(conshdlrs[i]),
797  SCIPconshdlrGetEnfoPriority(conshdlrs[i]),
798  SCIPconshdlrGetSepaPriority(conshdlrs[i]),
799  SCIPconshdlrGetSepaFreq(conshdlrs[i]),
800  SCIPconshdlrGetPropFreq(conshdlrs[i]),
801  SCIPconshdlrGetEagerFreq(conshdlrs[i]));
802  SCIPdialogMessage(scip, NULL, "%s", SCIPconshdlrGetDesc(conshdlrs[i]));
803  SCIPdialogMessage(scip, NULL, "\n");
804  }
805  SCIPdialogMessage(scip, NULL, "\n");
806 
807  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
808 
809  return SCIP_OKAY;
810 }
811 
812 /** dialog execution method for the display displaycols command */
813 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayDisplaycols)
814 { /*lint --e{715}*/
815  SCIP_DISP** disps;
816  int ndisps;
817  int i;
818 
819  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
820 
821  disps = SCIPgetDisps(scip);
822  ndisps = SCIPgetNDisps(scip);
823 
824  /* display list of display columns */
825  SCIPdialogMessage(scip, NULL, "\n");
826  SCIPdialogMessage(scip, NULL, " display column header position width priority status description\n");
827  SCIPdialogMessage(scip, NULL, " -------------- ------ -------- ----- -------- ------ -----------\n");
828  for( i = 0; i < ndisps; ++i )
829  {
830  SCIPdialogMessage(scip, NULL, " %-20s ", SCIPdispGetName(disps[i]));
831  if( strlen(SCIPdispGetName(disps[i])) > 20 )
832  SCIPdialogMessage(scip, NULL, "\n %20s ", "-->");
833  SCIPdialogMessage(scip, NULL, "%-16s ", SCIPdispGetHeader(disps[i]));
834  if( strlen(SCIPdispGetHeader(disps[i])) > 16 )
835  SCIPdialogMessage(scip, NULL, "\n %20s %16s ", "", "-->");
836  SCIPdialogMessage(scip, NULL, "%8d ", SCIPdispGetPosition(disps[i]));
837  SCIPdialogMessage(scip, NULL, "%5d ", SCIPdispGetWidth(disps[i]));
838  SCIPdialogMessage(scip, NULL, "%8d ", SCIPdispGetPriority(disps[i]));
839  switch( SCIPdispGetStatus(disps[i]) )
840  {
841  case SCIP_DISPSTATUS_OFF:
842  SCIPdialogMessage(scip, NULL, "%6s ", "off");
843  break;
845  SCIPdialogMessage(scip, NULL, "%6s ", "auto");
846  break;
847  case SCIP_DISPSTATUS_ON:
848  SCIPdialogMessage(scip, NULL, "%6s ", "on");
849  break;
850  default:
851  SCIPdialogMessage(scip, NULL, "%6s ", "?");
852  break;
853  }
854  SCIPdialogMessage(scip, NULL, "%s", SCIPdispGetDesc(disps[i]));
855  SCIPdialogMessage(scip, NULL, "\n");
856  }
857  SCIPdialogMessage(scip, NULL, "\n");
858 
859  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
860 
861  return SCIP_OKAY;
862 }
863 
864 /** dialog execution method for the display heuristics command */
865 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayHeuristics)
866 { /*lint --e{715}*/
867  SCIP_HEUR** heurs;
868  int nheurs;
869  int i;
870 
871  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
872 
873  heurs = SCIPgetHeurs(scip);
874  nheurs = SCIPgetNHeurs(scip);
875 
876  /* display list of primal heuristics */
877  SCIPdialogMessage(scip, NULL, "\n");
878  SCIPdialogMessage(scip, NULL, " primal heuristic c priority freq ofs description\n");
879  SCIPdialogMessage(scip, NULL, " ---------------- - -------- ---- --- -----------\n");
880  for( i = 0; i < nheurs; ++i )
881  {
882  SCIPdialogMessage(scip, NULL, " %-20s ", SCIPheurGetName(heurs[i]));
883  if( strlen(SCIPheurGetName(heurs[i])) > 20 )
884  SCIPdialogMessage(scip, NULL, "\n %20s ", "-->");
885  SCIPdialogMessage(scip, NULL, "%c ", SCIPheurGetDispchar(heurs[i]));
886  SCIPdialogMessage(scip, NULL, "%8d ", SCIPheurGetPriority(heurs[i]));
887  SCIPdialogMessage(scip, NULL, "%4d ", SCIPheurGetFreq(heurs[i]));
888  SCIPdialogMessage(scip, NULL, "%3d ", SCIPheurGetFreqofs(heurs[i]));
889  SCIPdialogMessage(scip, NULL, "%s", SCIPheurGetDesc(heurs[i]));
890  SCIPdialogMessage(scip, NULL, "\n");
891  }
892  SCIPdialogMessage(scip, NULL, "\n");
893 
894  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
895 
896  return SCIP_OKAY;
897 }
898 
899 /** dialog execution method for the display memory command */
900 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayMemory)
901 { /*lint --e{715}*/
902  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
903 
904  SCIPdialogMessage(scip, NULL, "\n");
906  SCIPdialogMessage(scip, NULL, "\n");
907 
908  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
909 
910  return SCIP_OKAY;
911 }
912 
913 /** dialog execution method for the display nlpi command */
914 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayNlpi)
915 { /*lint --e{715}*/
916  SCIP_NLPI** nlpis;
917  SCIP_NLPI** sorted;
918  int nnlpis;
919  int i;
920 
921  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
922 
923  nlpis = SCIPgetNlpis(scip);
924  nnlpis = SCIPgetNNlpis(scip);
925 
926  /* copy nlpis array into temporary memory for sorting */
927  if( nnlpis != 0 )
928  {
929  SCIP_CALL( SCIPduplicateBufferArray(scip, &sorted, nlpis, nnlpis) );
930  }
931  else
932  sorted = NULL;
933 
934  /* sort the branching rules */
935  SCIPsortPtr((void**)sorted, SCIPnlpiComp, nnlpis);
936 
937  /* display sorted list of branching rules */
938  SCIPdialogMessage(scip, NULL, "\n");
939  SCIPdialogMessage(scip, NULL, " NLP interface priority description\n");
940  SCIPdialogMessage(scip, NULL, " ------------- -------- -----------\n");
941  for( i = 0; i < nnlpis; ++i )
942  {
943  assert(sorted != NULL);
944  SCIPdialogMessage(scip, NULL, " %-20s ", SCIPnlpiGetName(sorted[i]));
945  if( strlen(SCIPnlpiGetName(sorted[i])) > 20 )
946  SCIPdialogMessage(scip, NULL, "\n %20s ", "-->");
947  SCIPdialogMessage(scip, NULL, "%8d ", SCIPnlpiGetPriority(sorted[i]));
948  SCIPdialogMessage(scip, NULL, "%s", SCIPnlpiGetDesc(sorted[i]));
949  SCIPdialogMessage(scip, NULL, "\n");
950  }
951  SCIPdialogMessage(scip, NULL, "\n");
952 
953  /* free temporary memory */
954  if( nnlpis != 0 )
955  {
956  SCIPfreeBufferArray(scip, &sorted);
957  }
958 
959  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
960 
961  return SCIP_OKAY;
962 }
963 
964 /** dialog execution method for the display nodeselectors command */
965 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayNodeselectors)
966 { /*lint --e{715}*/
967  SCIP_NODESEL** nodesels;
968  int nnodesels;
969  int i;
970 
971  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
972 
973  nodesels = SCIPgetNodesels(scip);
974  nnodesels = SCIPgetNNodesels(scip);
975 
976  /* display list of node selectors */
977  SCIPdialogMessage(scip, NULL, "\n");
978  SCIPdialogMessage(scip, NULL, " node selector std priority memsave prio description\n");
979  SCIPdialogMessage(scip, NULL, " ------------- ------------ ------------ -----------\n");
980  for( i = 0; i < nnodesels; ++i )
981  {
982  SCIPdialogMessage(scip, NULL, " %-20s ", SCIPnodeselGetName(nodesels[i]));
983  if( strlen(SCIPnodeselGetName(nodesels[i])) > 20 )
984  SCIPdialogMessage(scip, NULL, "\n %20s ", "-->");
985  SCIPdialogMessage(scip, NULL, "%12d ", SCIPnodeselGetStdPriority(nodesels[i]));
986  SCIPdialogMessage(scip, NULL, "%12d ", SCIPnodeselGetMemsavePriority(nodesels[i]));
987  SCIPdialogMessage(scip, NULL, "%s", SCIPnodeselGetDesc(nodesels[i]));
988  SCIPdialogMessage(scip, NULL, "\n");
989  }
990  SCIPdialogMessage(scip, NULL, "\n");
991 
992  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
993 
994  return SCIP_OKAY;
995 }
996 
997 /** dialog execution method for the display parameters command */
998 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayParameters)
999 { /*lint --e{715}*/
1000  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1001 
1002  SCIPdialogMessage(scip, NULL, "\n");
1003  SCIPdialogMessage(scip, NULL, "number of parameters = %d\n", SCIPgetNParams(scip));
1004  SCIPdialogMessage(scip, NULL, "non-default parameter settings:\n");
1005  SCIP_CALL( SCIPwriteParams(scip, NULL, FALSE, TRUE) );
1006  SCIPdialogMessage(scip, NULL, "\n");
1007 
1008  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1009 
1010  return SCIP_OKAY;
1011 }
1012 
1013 /** dialog execution method for the display presolvers command */
1014 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayPresolvers)
1015 { /*lint --e{715}*/
1016  SCIP_PRESOL** presols;
1017  int npresols;
1018  int i;
1019 
1020  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1021 
1022  presols = SCIPgetPresols(scip);
1023  npresols = SCIPgetNPresols(scip);
1024 
1025  /* display list of presolvers */
1026  SCIPdialogMessage(scip, NULL, "\n");
1027  SCIPdialogMessage(scip, NULL, " presolver priority description\n");
1028  SCIPdialogMessage(scip, NULL, " --------- -------- -----------\n");
1029  for( i = 0; i < npresols; ++i )
1030  {
1031  SCIPdialogMessage(scip, NULL, " %-20s ", SCIPpresolGetName(presols[i]));
1032  if( strlen(SCIPpresolGetName(presols[i])) > 20 )
1033  SCIPdialogMessage(scip, NULL, "\n %20s ", "-->");
1034  SCIPdialogMessage(scip, NULL, "%8d%c ", SCIPpresolGetPriority(presols[i]),
1035  SCIPpresolIsDelayed(presols[i]) ? 'd' : ' ');
1036  SCIPdialogMessage(scip, NULL, "%s", SCIPpresolGetDesc(presols[i]));
1037  SCIPdialogMessage(scip, NULL, "\n");
1038  }
1039  SCIPdialogMessage(scip, NULL, "\n");
1040 
1041  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1042 
1043  return SCIP_OKAY;
1044 }
1045 
1046 /** dialog execution method for the display pricer command */
1047 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayPricers)
1048 { /*lint --e{715}*/
1049  SCIP_PRICER** pricers;
1050  int npricers;
1051  int i;
1052 
1053  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1054 
1055  pricers = SCIPgetPricers(scip);
1056  npricers = SCIPgetNPricers(scip);
1057 
1058  /* display list of pricers */
1059  SCIPdialogMessage(scip, NULL, "\n");
1060  SCIPdialogMessage(scip, NULL, " pricer priority description\n");
1061  SCIPdialogMessage(scip, NULL, " ---------- -------- -----------\n");
1062  for( i = 0; i < npricers; ++i )
1063  {
1064  SCIPdialogMessage(scip, NULL, " %-20s ", SCIPpricerGetName(pricers[i]));
1065  if( strlen(SCIPpricerGetName(pricers[i])) > 20 )
1066  SCIPdialogMessage(scip, NULL, "\n %20s ", "-->");
1067  SCIPdialogMessage(scip, NULL, "%8d%c ", SCIPpricerGetPriority(pricers[i]), SCIPpricerIsDelayed(pricers[i]) ? 'd' : ' ');
1068  SCIPdialogMessage(scip, NULL, "%s", SCIPpricerGetDesc(pricers[i]));
1069  SCIPdialogMessage(scip, NULL, "\n");
1070  }
1071  SCIPdialogMessage(scip, NULL, "\n");
1072 
1073  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1074 
1075  return SCIP_OKAY;
1076 }
1077 
1078 /** dialog execution method for the display problem command */
1079 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayProblem)
1080 { /*lint --e{715}*/
1081  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1082 
1083  SCIPdialogMessage(scip, NULL, "\n");
1084 
1085  if( SCIPgetStage(scip) >= SCIP_STAGE_PROBLEM )
1086  {
1087  SCIP_CALL( SCIPprintOrigProblem(scip, NULL, "cip", FALSE) );
1088  }
1089  else
1090  SCIPdialogMessage(scip, NULL, "no problem available\n");
1091 
1092  SCIPdialogMessage(scip, NULL, "\n");
1093 
1094  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1095 
1096  return SCIP_OKAY;
1097 }
1098 
1099 /** dialog execution method for the display propagators command */
1100 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayPropagators)
1101 { /*lint --e{715}*/
1102  SCIP_PROP** props;
1103  int nprops;
1104  int i;
1105 
1106  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1107 
1108  props = SCIPgetProps(scip);
1109  nprops = SCIPgetNProps(scip);
1110 
1111  /* display list of propagators */
1112  SCIPdialogMessage(scip, NULL, "\n");
1113  SCIPdialogMessage(scip, NULL, " propagator propprio freq presprio description\n");
1114  SCIPdialogMessage(scip, NULL, " ---------- -------- ---- -------- -----------\n");
1115  for( i = 0; i < nprops; ++i )
1116  {
1117  SCIPdialogMessage(scip, NULL, " %-20s ", SCIPpropGetName(props[i]));
1118  if( strlen(SCIPpropGetName(props[i])) > 20 )
1119  SCIPdialogMessage(scip, NULL, "\n %20s ", "-->");
1120  SCIPdialogMessage(scip, NULL, "%8d%c ", SCIPpropGetPriority(props[i]), SCIPpropIsDelayed(props[i]) ? 'd' : ' ');
1121  SCIPdialogMessage(scip, NULL, "%4d ", SCIPpropGetFreq(props[i]));
1122  SCIPdialogMessage(scip, NULL, "%8d%c ", SCIPpropGetPresolPriority(props[i]), SCIPpropIsPresolDelayed(props[i]) ? 'd' : ' ');
1123  SCIPdialogMessage(scip, NULL, "%s", SCIPpropGetDesc(props[i]));
1124  SCIPdialogMessage(scip, NULL, "\n");
1125  }
1126  SCIPdialogMessage(scip, NULL, "\n");
1127 
1128  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1129 
1130  return SCIP_OKAY;
1131 }
1132 
1133 /** dialog execution method for the display readers command */
1134 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayReaders)
1135 { /*lint --e{715}*/
1136  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1137 
1138  /* print reader information */
1139  displayReaders(scip, TRUE, TRUE);
1140 
1141  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1142 
1143  return SCIP_OKAY;
1144 }
1145 
1146 /** dialog execution method for the display separators command */
1147 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplaySeparators)
1148 { /*lint --e{715}*/
1149  SCIP_SEPA** sepas;
1150  int nsepas;
1151  int i;
1152 
1153  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1154 
1155  sepas = SCIPgetSepas(scip);
1156  nsepas = SCIPgetNSepas(scip);
1157 
1158  /* display list of separators */
1159  SCIPdialogMessage(scip, NULL, "\n");
1160  SCIPdialogMessage(scip, NULL, " separator priority freq bddist description\n");
1161  SCIPdialogMessage(scip, NULL, " --------- -------- ---- ------ -----------\n");
1162  for( i = 0; i < nsepas; ++i )
1163  {
1164  SCIPdialogMessage(scip, NULL, " %-20s ", SCIPsepaGetName(sepas[i]));
1165  if( strlen(SCIPsepaGetName(sepas[i])) > 20 )
1166  SCIPdialogMessage(scip, NULL, "\n %20s ", "-->");
1167  SCIPdialogMessage(scip, NULL, "%8d%c ", SCIPsepaGetPriority(sepas[i]), SCIPsepaIsDelayed(sepas[i]) ? 'd' : ' ');
1168  SCIPdialogMessage(scip, NULL, "%4d ", SCIPsepaGetFreq(sepas[i]));
1169  SCIPdialogMessage(scip, NULL, "%6.2f ", SCIPsepaGetMaxbounddist(sepas[i]));
1170  SCIPdialogMessage(scip, NULL, "%s", SCIPsepaGetDesc(sepas[i]));
1171  SCIPdialogMessage(scip, NULL, "\n");
1172  }
1173  SCIPdialogMessage(scip, NULL, "\n");
1174 
1175  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1176 
1177  return SCIP_OKAY;
1178 }
1179 
1180 /** dialog execution method for the display solution command */
1181 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplaySolution)
1182 { /*lint --e{715}*/
1183  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1184 
1185  SCIPdialogMessage(scip, NULL, "\n");
1186  SCIP_CALL( SCIPprintBestSol(scip, NULL, FALSE) );
1187  SCIPdialogMessage(scip, NULL, "\n");
1188 
1189  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1190 
1191  return SCIP_OKAY;
1192 }
1193 
1194 /** dialog execution method for the display dual solution command */
1195 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayDualSolution)
1196 { /*lint --e{715}*/
1197  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1198 
1199  SCIPdialogMessage(scip, NULL, "\n");
1200  SCIP_CALL( SCIPprintDualSol(scip, NULL, FALSE) );
1201  SCIPdialogMessage(scip, NULL, "\n");
1202 
1203  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1204 
1205  return SCIP_OKAY;
1206 }
1207 
1208 
1209 /** dialog execution method for the display of solutions in the pool command */
1210 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplaySolutionPool)
1211 { /*lint --e{715}*/
1212  char prompt[SCIP_MAXSTRLEN];
1213  SCIP_Bool endoffile;
1214  SCIP_SOL** sols;
1215  char* idxstr;
1216  char* endstr;
1217  int nsols;
1218  int idx;
1219 
1220  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1221  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1222  SCIPdialogMessage(scip, NULL, "\n");
1223 
1224  if ( SCIPgetStage(scip) < SCIP_STAGE_PROBLEM )
1225  {
1226  SCIPdialogMessage(scip, NULL, "No solution available.\n\n");
1227  return SCIP_OKAY;
1228  }
1229 
1230  nsols = SCIPgetNSols(scip);
1231  if ( nsols == 0 )
1232  {
1233  SCIPdialogMessage(scip, NULL, "No solution available.\n\n");
1234  return SCIP_OKAY;
1235  }
1236 
1237  /* parse solution number */
1238  (void) SCIPsnprintf(prompt, SCIP_MAXSTRLEN-1, "index of solution [0-%d]: ", nsols-1);
1239 
1240  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, prompt, &idxstr, &endoffile) );
1241 
1242  if( endoffile )
1243  {
1244  *nextdialog = NULL;
1245  return SCIP_OKAY;
1246  }
1247 
1248  if ( SCIPstrToIntValue(idxstr, &idx, &endstr) )
1249  {
1250  if ( idx < 0 || idx >= nsols )
1251  {
1252  SCIPdialogMessage(scip, NULL, "Solution index out of bounds [0-%d].\n", nsols-1);
1253  return SCIP_OKAY;
1254  }
1255 
1256  sols = SCIPgetSols(scip);
1257  assert( sols[idx] != NULL );
1258  SCIP_CALL( SCIPprintSol(scip, sols[idx], NULL, FALSE) );
1259  }
1260  SCIPdialogMessage(scip, NULL, "\n");
1261 
1262  return SCIP_OKAY;
1263 }
1264 
1265 /** dialog execution method for the display statistics command */
1266 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayStatistics)
1267 { /*lint --e{715}*/
1268  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1269 
1270  SCIPdialogMessage(scip, NULL, "\n");
1272  SCIPdialogMessage(scip, NULL, "\n");
1273 
1274  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1275 
1276  return SCIP_OKAY;
1277 }
1278 
1279 /** dialog execution method for the display transproblem command */
1280 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayTransproblem)
1281 { /*lint --e{715}*/
1282  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1283 
1284  SCIPdialogMessage(scip, NULL, "\n");
1286  {
1287  SCIP_CALL( SCIPprintTransProblem(scip, NULL, "cip", FALSE) );
1288  }
1289  else
1290  SCIPdialogMessage(scip, NULL, "no transformed problem available\n");
1291 
1292  SCIPdialogMessage(scip, NULL, "\n");
1293 
1294  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1295 
1296  return SCIP_OKAY;
1297 }
1298 
1299 /** dialog execution method for the display value command */
1300 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayValue)
1301 { /*lint --e{715}*/
1302  SCIP_SOL* sol;
1303  SCIP_VAR* var;
1304  char* varname;
1305  SCIP_Real solval;
1306  SCIP_Bool endoffile;
1307 
1308  SCIPdialogMessage(scip, NULL, "\n");
1309 
1310  if( SCIPgetStage(scip) >= SCIP_STAGE_TRANSFORMED )
1311  sol = SCIPgetBestSol(scip);
1312  else
1313  sol = NULL;
1314 
1315  if( sol == NULL )
1316  {
1317  SCIPdialogMessage(scip, NULL, "no feasible solution available\n");
1318  SCIPdialoghdlrClearBuffer(dialoghdlr);
1319  }
1320  else
1321  {
1322  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter variable name: ", &varname, &endoffile) );
1323  if( endoffile )
1324  {
1325  *nextdialog = NULL;
1326  return SCIP_OKAY;
1327  }
1328 
1329  if( varname[0] != '\0' )
1330  {
1331  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, varname, TRUE) );
1332 
1333  var = SCIPfindVar(scip, varname);
1334  if( var == NULL )
1335  SCIPdialogMessage(scip, NULL, "variable <%s> not found\n", varname);
1336  else
1337  {
1338  solval = SCIPgetSolVal(scip, sol, var);
1339  SCIPdialogMessage(scip, NULL, "%-32s", SCIPvarGetName(var));
1340  if( SCIPisInfinity(scip, solval) )
1341  SCIPdialogMessage(scip, NULL, " +infinity");
1342  else if( SCIPisInfinity(scip, -solval) )
1343  SCIPdialogMessage(scip, NULL, " -infinity");
1344  else
1345  SCIPdialogMessage(scip, NULL, " %20.15g", solval);
1346  SCIPdialogMessage(scip, NULL, " \t(obj:%.15g)\n", SCIPvarGetObj(var));
1347  }
1348  }
1349  }
1350  SCIPdialogMessage(scip, NULL, "\n");
1351 
1352  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1353 
1354  return SCIP_OKAY;
1355 }
1356 
1357 /** dialog execution method for the display varbranchstatistics command */
1358 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayVarbranchstatistics)
1359 { /*lint --e{715}*/
1360  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1361 
1362  SCIPdialogMessage(scip, NULL, "\n");
1364  SCIPdialogMessage(scip, NULL, "\n");
1365 
1366  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1367 
1368  return SCIP_OKAY;
1369 }
1370 
1371 /** dialog execution method for the display LP solution quality command */
1372 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayLPSolutionQuality)
1373 { /*lint --e{715}*/
1374  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1375 
1376  SCIPdialogMessage(scip, NULL, "\n");
1378  SCIPdialogMessage(scip, NULL, "\n");
1379 
1380  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1381 
1382  return SCIP_OKAY;
1383 }
1384 
1385 /** dialog execution method for the help command */
1386 SCIP_DECL_DIALOGEXEC(SCIPdialogExecHelp)
1387 { /*lint --e{715}*/
1388  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1389 
1390  SCIPdialogMessage(scip, NULL, "\n");
1392  SCIPdialogMessage(scip, NULL, "\n");
1393 
1394  *nextdialog = SCIPdialogGetParent(dialog);
1395 
1396  return SCIP_OKAY;
1397 }
1398 
1399 /** dialog execution method for the display transsolution command */
1400 SCIP_DECL_DIALOGEXEC(SCIPdialogExecDisplayTranssolution)
1401 { /*lint --e{715}*/
1402  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1403 
1404  SCIPdialogMessage(scip, NULL, "\n");
1405  if( SCIPgetStage(scip) >= SCIP_STAGE_TRANSFORMED )
1406  {
1407  if( SCIPsolIsOriginal(SCIPgetBestSol(scip)) )
1408  {
1409  SCIPdialogMessage(scip, NULL, "best solution exists only in original problem space\n");
1410  }
1411  else
1412  {
1414  }
1415  }
1416  else
1417  SCIPdialogMessage(scip, NULL, "no solution available\n");
1418  SCIPdialogMessage(scip, NULL, "\n");
1419 
1420  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1421 
1422  return SCIP_OKAY;
1423 }
1424 
1425 /** dialog execution method for the free command */
1426 SCIP_DECL_DIALOGEXEC(SCIPdialogExecFree)
1427 { /*lint --e{715}*/
1428  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1429 
1430  SCIP_CALL( SCIPfreeProb(scip) );
1431 
1432  *nextdialog = SCIPdialogGetParent(dialog);
1433 
1434  return SCIP_OKAY;
1435 }
1436 
1437 /** dialog execution method for the newstart command */
1438 SCIP_DECL_DIALOGEXEC(SCIPdialogExecNewstart)
1439 { /*lint --e{715}*/
1440  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1441 
1442  SCIP_CALL( SCIPfreeSolve(scip, TRUE) );
1443 
1444  *nextdialog = SCIPdialogGetParent(dialog);
1445 
1446  return SCIP_OKAY;
1447 }
1448 
1449 /** dialog execution method for the optimize command */
1450 SCIP_DECL_DIALOGEXEC(SCIPdialogExecOptimize)
1451 { /*lint --e{715}*/
1452  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1453 
1454  SCIPdialogMessage(scip, NULL, "\n");
1455  switch( SCIPgetStage(scip) )
1456  {
1457  case SCIP_STAGE_INIT:
1458  SCIPdialogMessage(scip, NULL, "no problem exists\n");
1459  break;
1460 
1461  case SCIP_STAGE_PROBLEM:
1463  case SCIP_STAGE_PRESOLVING:
1464  case SCIP_STAGE_PRESOLVED:
1465  case SCIP_STAGE_SOLVING:
1466  SCIP_CALL( SCIPsolve(scip) );
1467  break;
1468 
1469  case SCIP_STAGE_SOLVED:
1470  SCIPdialogMessage(scip, NULL, "problem is already solved\n");
1471  break;
1472 
1476  case SCIP_STAGE_INITSOLVE:
1477  case SCIP_STAGE_EXITSOLVE:
1478  case SCIP_STAGE_FREETRANS:
1479  case SCIP_STAGE_FREE:
1480  default:
1481  SCIPerrorMessage("invalid SCIP stage\n");
1482  return SCIP_INVALIDCALL;
1483  }
1484  SCIPdialogMessage(scip, NULL, "\n");
1485 
1486  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1487 
1488  return SCIP_OKAY;
1489 }
1490 
1491 /** dialog execution method for the presolve command */
1492 SCIP_DECL_DIALOGEXEC(SCIPdialogExecPresolve)
1493 { /*lint --e{715}*/
1494  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1495 
1496  SCIPdialogMessage(scip, NULL, "\n");
1497  switch( SCIPgetStage(scip) )
1498  {
1499  case SCIP_STAGE_INIT:
1500  SCIPdialogMessage(scip, NULL, "no problem exists\n");
1501  break;
1502 
1503  case SCIP_STAGE_PROBLEM:
1505  case SCIP_STAGE_PRESOLVING:
1506  SCIP_CALL( SCIPpresolve(scip) );
1507  break;
1508 
1509  case SCIP_STAGE_PRESOLVED:
1510  case SCIP_STAGE_SOLVING:
1511  SCIPdialogMessage(scip, NULL, "problem is already presolved\n");
1512  break;
1513 
1514  case SCIP_STAGE_SOLVED:
1515  SCIPdialogMessage(scip, NULL, "problem is already solved\n");
1516  break;
1517 
1521  case SCIP_STAGE_INITSOLVE:
1522  case SCIP_STAGE_EXITSOLVE:
1523  case SCIP_STAGE_FREETRANS:
1524  case SCIP_STAGE_FREE:
1525  default:
1526  SCIPerrorMessage("invalid SCIP stage\n");
1527  return SCIP_INVALIDCALL;
1528  }
1529  SCIPdialogMessage(scip, NULL, "\n");
1530 
1531  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1532 
1533  return SCIP_OKAY;
1534 }
1535 
1536 /** dialog execution method for the quit command */
1537 SCIP_DECL_DIALOGEXEC(SCIPdialogExecQuit)
1538 { /*lint --e{715}*/
1539  SCIPdialogMessage(scip, NULL, "\n");
1540 
1541  *nextdialog = NULL;
1542 
1543  return SCIP_OKAY;
1544 }
1545 
1546 /** dialog execution method for the read command */
1547 SCIP_DECL_DIALOGEXEC(SCIPdialogExecRead)
1548 { /*lint --e{715}*/
1549  SCIP_RETCODE retcode;
1550  char* filename;
1551  SCIP_Bool endoffile;
1552 
1553  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter filename: ", &filename, &endoffile) );
1554  if( endoffile )
1555  {
1556  *nextdialog = NULL;
1557  return SCIP_OKAY;
1558  }
1559 
1560  if( filename[0] != '\0' )
1561  {
1562  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, filename, TRUE) );
1563 
1564  if( SCIPfileExists(filename) )
1565  {
1566  char* tmpfilename;
1567  char* extension;
1568 
1569  /* copy filename */
1570  SCIP_CALL( SCIPduplicateBufferArray(scip, &tmpfilename, filename, (int)strlen(filename)+1) );
1571  extension = NULL;
1572 
1573  SCIPinfoMessage(scip, NULL, "\n");
1574  SCIPinfoMessage(scip, NULL, "read problem <%s>\n", filename);
1575  SCIPinfoMessage(scip, NULL, "============\n");
1576  SCIPinfoMessage(scip, NULL, "\n");
1577 
1578  do
1579  {
1580  retcode = SCIPreadProb(scip, tmpfilename, extension);
1581  if( retcode == SCIP_READERROR || retcode == SCIP_NOFILE )
1582  {
1583  if( extension == NULL )
1584  SCIPdialogMessage(scip, NULL, "error reading file <%s>\n", tmpfilename);
1585  else
1586  SCIPdialogMessage(scip, NULL, "error reading file <%s> using <%s> file format\n",
1587  tmpfilename, extension);
1588 
1589  SCIP_CALL( SCIPfreeProb(scip) );
1590  break;
1591  }
1592  else if( retcode == SCIP_PLUGINNOTFOUND )
1593  {
1594  /* ask user once for a suitable reader */
1595  if( extension == NULL )
1596  {
1597  SCIPdialogMessage(scip, NULL, "no reader for input file <%s> available\n", tmpfilename);
1598 
1599  SCIPdialogMessage(scip, NULL, "following readers are avaliable for reading:\n");
1600  displayReaders(scip, TRUE, FALSE);
1601 
1602  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog,
1603  "select a suitable reader by extension (or return): ", &extension, &endoffile) );
1604 
1605  if( extension[0] == '\0' )
1606  break;
1607  }
1608  else
1609  {
1610  SCIPdialogMessage(scip, NULL, "no reader for file extension <%s> available\n", extension);
1611  extension = NULL;
1612  }
1613  }
1614  else
1615  {
1616  /* check if an unexpected error occurred during the reading process */
1617  SCIP_CALL( retcode );
1618  break;
1619  }
1620  }
1621  while( extension != NULL );
1622 
1623  /* free buffer array */
1624  SCIPfreeBufferArray(scip, &tmpfilename);
1625  }
1626  else
1627  {
1628  SCIPdialogMessage(scip, NULL, "file <%s> not found\n", filename);
1629  SCIPdialoghdlrClearBuffer(dialoghdlr);
1630  }
1631  }
1632 
1633  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1634 
1635  return SCIP_OKAY;
1636 }
1637 
1638 /** dialog execution method for the set default command */
1639 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetDefault)
1640 { /*lint --e{715}*/
1641  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1642 
1643  SCIP_CALL( SCIPresetParams(scip) );
1644  SCIPdialogMessage(scip, NULL, "reset parameters to their default values\n");
1645 
1646  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1647 
1648  return SCIP_OKAY;
1649 }
1650 
1651 /** dialog execution method for the set load command */
1652 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetLoad)
1653 { /*lint --e{715}*/
1654  char* filename;
1655  SCIP_Bool endoffile;
1656 
1657  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter filename: ", &filename, &endoffile) );
1658  if( endoffile )
1659  {
1660  *nextdialog = NULL;
1661  return SCIP_OKAY;
1662  }
1663 
1664  if( filename[0] != '\0' )
1665  {
1666  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, filename, TRUE) );
1667 
1668  if( SCIPfileExists(filename) )
1669  {
1670  SCIP_CALL( SCIPreadParams(scip, filename) );
1671  SCIPdialogMessage(scip, NULL, "loaded parameter file <%s>\n", filename);
1672  }
1673  else
1674  {
1675  SCIPdialogMessage(scip, NULL, "file <%s> not found\n", filename);
1676  SCIPdialoghdlrClearBuffer(dialoghdlr);
1677  }
1678  }
1679 
1680  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1681 
1682  return SCIP_OKAY;
1683 }
1684 
1685 /** dialog execution method for the set save command */
1686 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetSave)
1687 { /*lint --e{715}*/
1688  char* filename;
1689  SCIP_Bool endoffile;
1690 
1691  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter filename: ", &filename, &endoffile) );
1692  if( endoffile )
1693  {
1694  *nextdialog = NULL;
1695  return SCIP_OKAY;
1696  }
1697 
1698  if( filename[0] != '\0' )
1699  {
1700  SCIP_RETCODE retcode;
1701 
1702  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, filename, TRUE) );
1703 
1704  retcode = SCIPwriteParams(scip, filename, TRUE, FALSE);
1705 
1706  if( retcode == SCIP_FILECREATEERROR )
1707  {
1708  SCIPdialogMessage(scip, NULL, "error creating file <%s>\n", filename);
1709  }
1710  else
1711  {
1712  SCIP_CALL( retcode );
1713  SCIPdialogMessage(scip, NULL, "saved parameter file <%s>\n", filename);
1714  }
1715  }
1716 
1717  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1718 
1719  return SCIP_OKAY;
1720 }
1721 
1722 /** dialog execution method for the set diffsave command */
1723 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetDiffsave)
1724 { /*lint --e{715}*/
1725  char* filename;
1726  SCIP_Bool endoffile;
1727 
1728  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter filename: ", &filename, &endoffile) );
1729  if( endoffile )
1730  {
1731  *nextdialog = NULL;
1732  return SCIP_OKAY;
1733  }
1734 
1735  if( filename[0] != '\0' )
1736  {
1737  SCIP_RETCODE retcode;
1738 
1739  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, filename, TRUE) );
1740 
1741  retcode = SCIPwriteParams(scip, filename, TRUE, TRUE);
1742 
1743  if( retcode == SCIP_FILECREATEERROR )
1744  {
1745  SCIPdialogMessage(scip, NULL, "error creating file <%s>\n", filename);
1746  }
1747  else
1748  {
1749  SCIP_CALL( retcode );
1750  SCIPdialogMessage(scip, NULL, "saved non-default parameter settings to file <%s>\n", filename);
1751  }
1752  }
1753 
1754  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1755 
1756  return SCIP_OKAY;
1757 }
1758 
1759 /** dialog execution method for the set parameter command */
1760 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetParam)
1761 { /*lint --e{715}*/
1762  SCIP_RETCODE retcode;
1763  SCIP_PARAM* param;
1764  char prompt[SCIP_MAXSTRLEN];
1765  char* valuestr;
1766  SCIP_Bool boolval;
1767  int intval;
1768  SCIP_Longint longintval;
1769  SCIP_Real realval;
1770  char charval;
1771  SCIP_Bool endoffile;
1772  SCIP_Bool error;
1773 
1774  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1775 
1776  /* get the parameter to set */
1777  param = (SCIP_PARAM*)SCIPdialogGetData(dialog);
1778 
1779  /* depending on the parameter type, request a user input */
1780  switch( SCIPparamGetType(param) )
1781  {
1782  case SCIP_PARAMTYPE_BOOL:
1783  (void) SCIPsnprintf(prompt, SCIP_MAXSTRLEN, "current value: %s, new value (TRUE/FALSE): ",
1784  SCIPparamGetBool(param) ? "TRUE" : "FALSE");
1785  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, prompt, &valuestr, &endoffile) );
1786  if( endoffile )
1787  {
1788  *nextdialog = NULL;
1789  return SCIP_OKAY;
1790  }
1791  if( valuestr[0] == '\0' )
1792  return SCIP_OKAY;
1793 
1794  boolval = parseBoolValue(scip, valuestr, &error);
1795 
1796  if( !error )
1797  {
1798  retcode = SCIPchgBoolParam(scip, param, boolval);
1799  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, boolval ? "TRUE" : "FALSE", TRUE) );
1800  if( retcode != SCIP_PARAMETERWRONGVAL )
1801  {
1802  SCIPdialogMessage(scip, NULL, "%s = %s\n", SCIPparamGetName(param), boolval ? "TRUE" : "FALSE");
1803 
1804  SCIP_CALL( retcode );
1805  }
1806  }
1807 
1808  break;
1809 
1810  case SCIP_PARAMTYPE_INT:
1811  (void) SCIPsnprintf(prompt, SCIP_MAXSTRLEN, "current value: %d, new value [%d,%d]: ",
1812  SCIPparamGetInt(param), SCIPparamGetIntMin(param), SCIPparamGetIntMax(param));
1813  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, prompt, &valuestr, &endoffile) );
1814  if( endoffile )
1815  {
1816  *nextdialog = NULL;
1817  return SCIP_OKAY;
1818  }
1819  if( valuestr[0] == '\0' )
1820  return SCIP_OKAY;
1821 
1822  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, valuestr, TRUE) );
1823 
1824  if( sscanf(valuestr, "%d", &intval) != 1 )
1825  {
1826  SCIPdialogMessage(scip, NULL, "\ninvalid input <%s>\n\n", valuestr);
1827  return SCIP_OKAY;
1828  }
1829  retcode = SCIPchgIntParam(scip, param, intval);
1830  if( retcode != SCIP_PARAMETERWRONGVAL )
1831  {
1832  SCIPdialogMessage(scip, NULL, "%s = %d\n", SCIPparamGetName(param), intval);
1833 
1834  SCIP_CALL( retcode );
1835  }
1836 
1837  break;
1838 
1840  (void) SCIPsnprintf(prompt, SCIP_MAXSTRLEN, "current value: %"SCIP_LONGINT_FORMAT", new value [%"SCIP_LONGINT_FORMAT",%"SCIP_LONGINT_FORMAT"]: ",
1842  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, prompt, &valuestr, &endoffile) );
1843  if( endoffile )
1844  {
1845  *nextdialog = NULL;
1846  return SCIP_OKAY;
1847  }
1848  if( valuestr[0] == '\0' )
1849  return SCIP_OKAY;
1850 
1851  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, valuestr, TRUE) );
1852 
1853  if( sscanf(valuestr, "%"SCIP_LONGINT_FORMAT, &longintval) != 1 )
1854  {
1855  SCIPdialogMessage(scip, NULL, "\ninvalid input <%s>\n\n", valuestr);
1856  return SCIP_OKAY;
1857  }
1858  retcode = SCIPchgLongintParam(scip, param, longintval);
1859  if( retcode != SCIP_PARAMETERWRONGVAL )
1860  {
1861  SCIPdialogMessage(scip, NULL, "%s = %"SCIP_LONGINT_FORMAT"\n", SCIPparamGetName(param), longintval);
1862 
1863  SCIP_CALL( retcode );
1864  }
1865  break;
1866 
1867  case SCIP_PARAMTYPE_REAL:
1868  (void) SCIPsnprintf(prompt, SCIP_MAXSTRLEN, "current value: %.15g, new value [%.15g,%.15g]: ",
1870  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, prompt, &valuestr, &endoffile) );
1871  if( endoffile )
1872  {
1873  *nextdialog = NULL;
1874  return SCIP_OKAY;
1875  }
1876  if( valuestr[0] == '\0' )
1877  return SCIP_OKAY;
1878 
1879  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, valuestr, TRUE) );
1880 
1881  if( sscanf(valuestr, "%"SCIP_REAL_FORMAT, &realval) != 1 )
1882  {
1883  SCIPdialogMessage(scip, NULL, "\ninvalid input <%s>\n\n", valuestr);
1884  return SCIP_OKAY;
1885  }
1886  retcode = SCIPchgRealParam(scip, param, realval);
1887  if( retcode != SCIP_PARAMETERWRONGVAL )
1888  {
1889  SCIPdialogMessage(scip, NULL, "%s = %.15g\n", SCIPparamGetName(param), realval);
1890 
1891  SCIP_CALL( retcode );
1892  }
1893  break;
1894 
1895  case SCIP_PARAMTYPE_CHAR:
1896  (void) SCIPsnprintf(prompt, SCIP_MAXSTRLEN, "current value: <%c>, new value: ", SCIPparamGetChar(param));
1897  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, prompt, &valuestr, &endoffile) );
1898  if( endoffile )
1899  {
1900  *nextdialog = NULL;
1901  return SCIP_OKAY;
1902  }
1903  if( valuestr[0] == '\0' )
1904  return SCIP_OKAY;
1905 
1906  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, valuestr, TRUE) );
1907 
1908  if( sscanf(valuestr, "%c", &charval) != 1 )
1909  {
1910  SCIPdialogMessage(scip, NULL, "\ninvalid input <%s>\n\n", valuestr);
1911  return SCIP_OKAY;
1912  }
1913  retcode = SCIPchgCharParam(scip, param, charval);
1914  if( retcode != SCIP_PARAMETERWRONGVAL )
1915  {
1916  SCIPdialogMessage(scip, NULL, "%s = %c\n", SCIPparamGetName(param), charval);
1917 
1918  SCIP_CALL( retcode );
1919  }
1920  break;
1921 
1922  case SCIP_PARAMTYPE_STRING:
1923  (void) SCIPsnprintf(prompt, SCIP_MAXSTRLEN, "current value: <%s>, new value: ", SCIPparamGetString(param));
1924  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, prompt, &valuestr, &endoffile) );
1925  if( endoffile )
1926  {
1927  *nextdialog = NULL;
1928  return SCIP_OKAY;
1929  }
1930  if( valuestr[0] == '\0' )
1931  return SCIP_OKAY;
1932 
1933  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, valuestr, TRUE) );
1934 
1935  retcode = SCIPchgStringParam(scip, param, valuestr);
1936  if( retcode != SCIP_PARAMETERWRONGVAL )
1937  {
1938  SCIPdialogMessage(scip, NULL, "%s = %s\n", SCIPparamGetName(param), valuestr);
1939 
1940  SCIP_CALL( retcode );
1941  }
1942  break;
1943 
1944  default:
1945  SCIPerrorMessage("invalid parameter type\n");
1946  return SCIP_INVALIDDATA;
1947  }
1948 
1949  return SCIP_OKAY;
1950 }
1951 
1952 /** dialog description method for the set parameter command */
1953 SCIP_DECL_DIALOGDESC(SCIPdialogDescSetParam)
1954 { /*lint --e{715}*/
1955  SCIP_PARAM* param;
1956  char valuestr[SCIP_MAXSTRLEN];
1957 
1958  /* get the parameter to set */
1959  param = (SCIP_PARAM*)SCIPdialogGetData(dialog);
1960 
1961  /* retrieve parameter's current value */
1962  switch( SCIPparamGetType(param) )
1963  {
1964  case SCIP_PARAMTYPE_BOOL:
1965  if( SCIPparamGetBool(param) )
1966  (void) SCIPsnprintf(valuestr, SCIP_MAXSTRLEN, "TRUE");
1967  else
1968  (void) SCIPsnprintf(valuestr, SCIP_MAXSTRLEN, "FALSE");
1969  break;
1970 
1971  case SCIP_PARAMTYPE_INT:
1972  (void) SCIPsnprintf(valuestr, SCIP_MAXSTRLEN, "%d", SCIPparamGetInt(param));
1973  break;
1974 
1976  (void) SCIPsnprintf(valuestr, SCIP_MAXSTRLEN, "%"SCIP_LONGINT_FORMAT, SCIPparamGetLongint(param));
1977  break;
1978 
1979  case SCIP_PARAMTYPE_REAL:
1980  (void) SCIPsnprintf(valuestr, SCIP_MAXSTRLEN, "%.15g", SCIPparamGetReal(param));
1981  if( strchr(valuestr, '.') == NULL && strchr(valuestr, 'e') == NULL )
1982  (void) SCIPsnprintf(valuestr, SCIP_MAXSTRLEN, "%.1f", SCIPparamGetReal(param));
1983  break;
1984 
1985  case SCIP_PARAMTYPE_CHAR:
1986  (void) SCIPsnprintf(valuestr, SCIP_MAXSTRLEN, "%c", SCIPparamGetChar(param));
1987  break;
1988 
1989  case SCIP_PARAMTYPE_STRING:
1990  (void) SCIPsnprintf(valuestr, SCIP_MAXSTRLEN, "%s", SCIPparamGetString(param));
1991  break;
1992 
1993  default:
1994  SCIPerrorMessage("invalid parameter type\n");
1995  return SCIP_INVALIDDATA;
1996  }
1997  valuestr[SCIP_MAXSTRLEN-1] = '\0';
1998 
1999  /* display parameter's description */
2000  SCIPdialogMessage(scip, NULL, "%s", SCIPparamGetDesc(param));
2001 
2002  /* display parameter's current value */
2003  SCIPdialogMessage(scip, NULL, " [%s]", valuestr);
2004 
2005  return SCIP_OKAY;
2006 }
2007 
2008 /** dialog execution method for the fix parameter command */
2009 SCIP_DECL_DIALOGEXEC(SCIPdialogExecFixParam)
2010 { /*lint --e{715}*/
2011  SCIP_PARAM* param;
2012  char prompt[SCIP_MAXSTRLEN];
2013  char* valuestr;
2014  SCIP_Bool fix;
2015  SCIP_Bool endoffile;
2016  SCIP_Bool error;
2017 
2018  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2019 
2020  /* get the parameter to fix */
2021  param = (SCIP_PARAM*)SCIPdialogGetData(dialog);
2022 
2023  (void) SCIPsnprintf(prompt, SCIP_MAXSTRLEN, "current fixing status: %s, new value (TRUE/FALSE): ",
2024  SCIPparamIsFixed(param) ? "TRUE" : "FALSE");
2025  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, prompt, &valuestr, &endoffile) );
2026  if( endoffile )
2027  {
2028  *nextdialog = NULL;
2029  return SCIP_OKAY;
2030  }
2031  if( valuestr[0] == '\0' )
2032  return SCIP_OKAY;
2033 
2034  fix = parseBoolValue(scip, valuestr, &error);
2035 
2036  if( !error )
2037  {
2038  SCIPparamSetFixed(param, fix);
2039  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, (fix ? "TRUE" : "FALSE"), TRUE) );
2040  SCIPdialogMessage(scip, NULL, "<%s> %s\n", SCIPparamGetName(param), (fix ? "fixed" : "unfixed"));
2041  }
2042 
2043  return SCIP_OKAY;
2044 }
2045 
2046 /** dialog description method for the fix parameter command */
2047 SCIP_DECL_DIALOGDESC(SCIPdialogDescFixParam)
2048 { /*lint --e{715}*/
2049  SCIP_PARAM* param;
2050 
2051  /* get the parameter to set */
2052  param = (SCIP_PARAM*)SCIPdialogGetData(dialog);
2053 
2054  /* display parameter's description */
2055  SCIPdialogMessage(scip, NULL, "%s", SCIPparamGetDesc(param));
2056 
2057  /* display parameter's current fixing status */
2058  if( SCIPparamIsFixed(param) )
2059  SCIPdialogMessage(scip, NULL, " [fixed]");
2060  else
2061  SCIPdialogMessage(scip, NULL, " [not fixed]");
2062 
2063  return SCIP_OKAY;
2064 }
2065 
2066 /** dialog execution method for the set branching direction command */
2067 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetBranchingDirection)
2068 { /*lint --e{715}*/
2069  SCIP_VAR* var;
2070  char prompt[SCIP_MAXSTRLEN];
2071  char* valuestr;
2072  int direction;
2073  SCIP_Bool endoffile;
2074 
2075  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2076 
2077  /* branching priorities cannot be set, if no problem was created */
2078  if( SCIPgetStage(scip) == SCIP_STAGE_INIT )
2079  {
2080  SCIPdialogMessage(scip, NULL, "cannot set branching directions before problem was created\n");
2081  return SCIP_OKAY;
2082  }
2083 
2084  /* get variable name from user */
2085  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "variable name: ", &valuestr, &endoffile) );
2086  if( endoffile )
2087  {
2088  *nextdialog = NULL;
2089  return SCIP_OKAY;
2090  }
2091  if( valuestr[0] == '\0' )
2092  return SCIP_OKAY;
2093 
2094  /* find variable */
2095  var = SCIPfindVar(scip, valuestr);
2096  if( var == NULL )
2097  {
2098  SCIPdialogMessage(scip, NULL, "variable <%s> does not exist in problem\n", valuestr);
2099  return SCIP_OKAY;
2100  }
2101 
2102  /* get new branching direction from user */
2103  switch( SCIPvarGetBranchDirection(var) )
2104  {
2106  direction = -1;
2107  break;
2108  case SCIP_BRANCHDIR_AUTO:
2109  direction = 0;
2110  break;
2112  direction = +1;
2113  break;
2114  case SCIP_BRANCHDIR_FIXED:
2115  default:
2116  SCIPerrorMessage("invalid preferred branching direction <%d> of variable <%s>\n",
2118  return SCIP_INVALIDDATA;
2119  }
2120  (void) SCIPsnprintf(prompt, SCIP_MAXSTRLEN, "current value: %d, new value: ", direction);
2121  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, prompt, &valuestr, &endoffile) );
2122  if( endoffile )
2123  {
2124  *nextdialog = NULL;
2125  return SCIP_OKAY;
2126  }
2128  (void) SCIPsnprintf(prompt, SCIP_MAXSTRLEN, "%s %s", prompt, valuestr);
2129  if( valuestr[0] == '\0' )
2130  return SCIP_OKAY;
2131 
2132  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, prompt, FALSE) );
2133 
2134  if( sscanf(valuestr, "%d", &direction) != 1 )
2135  {
2136  SCIPdialogMessage(scip, NULL, "\ninvalid input <%s>\n\n", valuestr);
2137  return SCIP_OKAY;
2138  }
2139  if( direction < -1 || direction > +1 )
2140  {
2141  SCIPdialogMessage(scip, NULL, "\ninvalid input <%d>: direction must be -1, 0, or +1\n\n", direction);
2142  return SCIP_OKAY;
2143  }
2144 
2145  /* set new branching direction */
2146  if( direction == -1 )
2148  else if( direction == 0 )
2150  else
2152 
2153  SCIPdialogMessage(scip, NULL, "branching direction of variable <%s> set to %d\n", SCIPvarGetName(var), direction);
2154 
2155  return SCIP_OKAY;
2156 }
2157 
2158 /** dialog execution method for the set branching priority command */
2159 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetBranchingPriority)
2160 { /*lint --e{715}*/
2161  SCIP_VAR* var;
2162  char prompt[SCIP_MAXSTRLEN];
2163  char* valuestr;
2164  int priority;
2165  SCIP_Bool endoffile;
2166 
2167  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2168 
2169  /* branching priorities cannot be set, if no problem was created */
2170  if( SCIPgetStage(scip) == SCIP_STAGE_INIT )
2171  {
2172  SCIPdialogMessage(scip, NULL, "cannot set branching priorities before problem was created\n");
2173  return SCIP_OKAY;
2174  }
2175 
2176  /* get variable name from user */
2177  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "variable name: ", &valuestr, &endoffile) );
2178  if( endoffile )
2179  {
2180  *nextdialog = NULL;
2181  return SCIP_OKAY;
2182  }
2183  if( valuestr[0] == '\0' )
2184  return SCIP_OKAY;
2185 
2186  /* find variable */
2187  var = SCIPfindVar(scip, valuestr);
2188  if( var == NULL )
2189  {
2190  SCIPdialogMessage(scip, NULL, "variable <%s> does not exist in problem\n", valuestr);
2191  return SCIP_OKAY;
2192  }
2193 
2194  /* get new branching priority from user */
2195  (void) SCIPsnprintf(prompt, SCIP_MAXSTRLEN, "current value: %d, new value: ", SCIPvarGetBranchPriority(var));
2196  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, prompt, &valuestr, &endoffile) );
2197  if( endoffile )
2198  {
2199  *nextdialog = NULL;
2200  return SCIP_OKAY;
2201  }
2203  (void) SCIPsnprintf(prompt, SCIP_MAXSTRLEN, "%s %s", prompt, valuestr);
2204  if( valuestr[0] == '\0' )
2205  return SCIP_OKAY;
2206 
2207  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, prompt, FALSE) );
2208 
2209  if( sscanf(valuestr, "%d", &priority) != 1 )
2210  {
2211  SCIPdialogMessage(scip, NULL, "\ninvalid input <%s>\n\n", valuestr);
2212  return SCIP_OKAY;
2213  }
2214 
2215  /* set new branching priority */
2216  SCIP_CALL( SCIPchgVarBranchPriority(scip, var, priority) );
2217  SCIPdialogMessage(scip, NULL, "branching priority of variable <%s> set to %d\n", SCIPvarGetName(var), SCIPvarGetBranchPriority(var));
2218 
2219  return SCIP_OKAY;
2220 }
2221 
2222 /** dialog execution method for the set heuristics aggressive command */
2223 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetHeuristicsAggressive)
2224 { /*lint --e{715}*/
2225  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
2226 
2227  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2228 
2230 
2231  return SCIP_OKAY;
2232 }
2233 
2234 /** dialog execution method for the set heuristics fast command */
2235 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetHeuristicsFast)
2236 { /*lint --e{715}*/
2237  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
2238 
2239  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2240 
2242 
2243  return SCIP_OKAY;
2244 }
2245 
2246 /** dialog execution method for the set heuristics off command */
2247 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetHeuristicsOff)
2248 { /*lint --e{715}*/
2249  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
2250 
2251  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2252 
2254 
2255  return SCIP_OKAY;
2256 }
2257 
2258 /** dialog execution method for the set heuristics aggressive command */
2259 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetPresolvingAggressive)
2260 { /*lint --e{715}*/
2261  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
2262 
2263  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2264 
2266 
2267  return SCIP_OKAY;
2268 }
2269 
2270 /** dialog execution method for the set heuristics fast command */
2271 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetPresolvingFast)
2272 { /*lint --e{715}*/
2273  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
2274 
2275  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2276 
2278 
2279  return SCIP_OKAY;
2280 }
2281 
2282 /** dialog execution method for the set heuristics off command */
2283 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetPresolvingOff)
2284 { /*lint --e{715}*/
2285  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
2286 
2287  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2288 
2290 
2291  return SCIP_OKAY;
2292 }
2293 
2294 /** dialog execution method for the set heuristics aggressive command */
2295 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetSeparatingAggressive)
2296 { /*lint --e{715}*/
2297  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
2298 
2299  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2300 
2302 
2303  return SCIP_OKAY;
2304 }
2305 
2306 /** dialog execution method for the set heuristics fast command */
2307 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetSeparatingFast)
2308 { /*lint --e{715}*/
2309  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
2310 
2311  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2312 
2314 
2315  return SCIP_OKAY;
2316 }
2317 
2318 /** dialog execution method for the set heuristics off command */
2319 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetSeparatingOff)
2320 { /*lint --e{715}*/
2321  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
2322 
2323  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2324 
2326 
2327  return SCIP_OKAY;
2328 }
2329 
2330 /** dialog execution method for the set emphasis counter command */
2331 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetEmphasisCounter)
2332 { /*lint --e{715}*/
2333  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
2334 
2335  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2336 
2337  /* reset SCIP parameters */
2338  SCIP_CALL( SCIPresetParams(scip) );
2339 
2340  /* set parameters for counting problems */
2342 
2343  return SCIP_OKAY;
2344 }
2345 
2346 /** dialog execution method for the set emphasis cpsolver command */
2347 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetEmphasisCpsolver)
2348 { /*lint --e{715}*/
2349  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
2350 
2351  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2352 
2353  /* reset SCIP parameters */
2354  SCIP_CALL( SCIPresetParams(scip) );
2355 
2356  /* set parameters for CP like search problems */
2358 
2359  return SCIP_OKAY;
2360 }
2361 
2362 /** dialog execution method for the set emphasis easy CIP command */
2363 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetEmphasisEasycip)
2364 { /*lint --e{715}*/
2365  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
2366 
2367  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2368 
2369  /* reset SCIP parameters */
2370  SCIP_CALL( SCIPresetParams(scip) );
2371 
2372  /* set parameters for easy CIP problems */
2374 
2375  return SCIP_OKAY;
2376 }
2377 
2378 /** dialog execution method for the set emphasis feasibility command */
2379 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetEmphasisFeasibility)
2380 { /*lint --e{715}*/
2381  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
2382 
2383  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2384 
2385  /* reset SCIP parameters */
2386  SCIP_CALL( SCIPresetParams(scip) );
2387 
2388  /* set parameters for feasibility problems */
2390 
2391  return SCIP_OKAY;
2392 }
2393 
2394 /** dialog execution method for the set emphasis hard LP command */
2395 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetEmphasisHardlp)
2396 { /*lint --e{715}*/
2397  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
2398 
2399  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2400 
2401  /* reset SCIP parameters */
2402  SCIP_CALL( SCIPresetParams(scip) );
2403 
2404  /* set parameters for problems with hard LP */
2406 
2407  return SCIP_OKAY;
2408 }
2409 
2410 /** dialog execution method for the set emphasis optimality command */
2411 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetEmphasisOptimality)
2412 { /*lint --e{715}*/
2413  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
2414 
2415  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2416 
2417  /* reset SCIP parameters */
2418  SCIP_CALL( SCIPresetParams(scip) );
2419 
2420  /* set parameters for problems to prove optimality fast */
2422 
2423  return SCIP_OKAY;
2424 }
2425 
2426 /** dialog execution method for the set limits objective command */
2427 SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetLimitsObjective)
2428 { /*lint --e{715}*/
2429  char prompt[SCIP_MAXSTRLEN];
2430  char* valuestr;
2431  SCIP_Real objlim;
2432  SCIP_Bool endoffile;
2433 
2434  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2435 
2436  /* objective limit cannot be set, if no problem was created */
2437  if( SCIPgetStage(scip) == SCIP_STAGE_INIT )
2438  {
2439  SCIPdialogMessage(scip, NULL, "cannot set objective limit before problem was created\n");
2440  return SCIP_OKAY;
2441  }
2442 
2443  /* get new objective limit from user */
2444  (void) SCIPsnprintf(prompt, SCIP_MAXSTRLEN, "current value: %.15g, new value: ", SCIPgetObjlimit(scip));
2445  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, prompt, &valuestr, &endoffile) );
2446  if( endoffile )
2447  {
2448  *nextdialog = NULL;
2449  return SCIP_OKAY;
2450  }
2451  if( valuestr[0] == '\0' )
2452  return SCIP_OKAY;
2453 
2454  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, valuestr, TRUE) );
2455 
2456  if( sscanf(valuestr, "%"SCIP_REAL_FORMAT, &objlim) != 1 )
2457  {
2458  SCIPdialogMessage(scip, NULL, "\ninvalid input <%s>\n\n", valuestr);
2459  return SCIP_OKAY;
2460  }
2461 
2462  /* check, if new objective limit is valid */
2463  if( SCIPgetStage(scip) > SCIP_STAGE_PROBLEM
2464  && SCIPtransformObj(scip, objlim) > SCIPtransformObj(scip, SCIPgetObjlimit(scip)) )
2465  {
2466  SCIPdialogMessage(scip, NULL, "\ncannot relax objective limit from %.15g to %.15g after problem was transformed\n\n",
2467  SCIPgetObjlimit(scip), objlim);
2468  return SCIP_OKAY;
2469  }
2470 
2471  /* set new objective limit */
2472  SCIP_CALL( SCIPsetObjlimit(scip, objlim) );
2473  SCIPdialogMessage(scip, NULL, "objective value limit set to %.15g\n", SCIPgetObjlimit(scip));
2474 
2475  return SCIP_OKAY;
2476 }
2477 
2478 /** dialog execution method for the write LP command */
2479 static
2480 SCIP_DECL_DIALOGEXEC(SCIPdialogExecWriteLp)
2481 { /*lint --e{715}*/
2482  char* filename;
2483  SCIP_Bool endoffile;
2484 
2485  SCIPdialogMessage(scip, NULL, "\n");
2486 
2487  /* node relaxations only exist in solving & solved stage */
2488  if( SCIPgetStage(scip) < SCIP_STAGE_SOLVING )
2489  {
2490  SCIPdialogMessage(scip, NULL, "There is no node LP relaxation before solving starts\n");
2491  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2492  return SCIP_OKAY;
2493  }
2494  if( SCIPgetStage(scip) >= SCIP_STAGE_SOLVED )
2495  {
2496  SCIPdialogMessage(scip, NULL, "There is no node LP relaxation after problem was solved\n");
2497  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2498  return SCIP_OKAY;
2499  }
2500 
2501  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter filename: ", &filename, &endoffile) );
2502  if( endoffile )
2503  {
2504  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2505  return SCIP_OKAY;
2506  }
2507  if( filename[0] != '\0' )
2508  {
2509  SCIP_RETCODE retcode;
2510 
2511  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, filename, TRUE) );
2512  retcode = SCIPwriteLP(scip, filename);
2513 
2514  if( retcode == SCIP_FILECREATEERROR )
2515  {
2516  SCIPdialogMessage(scip, NULL, "error not creating file <%s>\n", filename);
2517  }
2518  else
2519  {
2520  SCIP_CALL( retcode );
2521 
2522  SCIPdialogMessage(scip, NULL, "written node LP relaxation to file <%s>\n", filename);
2523  }
2524  }
2525 
2526  SCIPdialogMessage(scip, NULL, "\n");
2527 
2528  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2529 
2530  return SCIP_OKAY;
2531 }
2532 
2533 /** dialog execution method for the write MIP command */
2534 static
2535 SCIP_DECL_DIALOGEXEC(SCIPdialogExecWriteMip)
2536 { /*lint --e{715}*/
2537  char command[SCIP_MAXSTRLEN];
2538  char filename[SCIP_MAXSTRLEN];
2539  SCIP_Bool endoffile;
2540  char* valuestr;
2541  SCIP_Bool offset;
2542  SCIP_Bool generic;
2543  SCIP_Bool lazyconss;
2544  SCIP_Bool error;
2545 
2546  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2547 
2548  /* node relaxations only exist in solving & solved stage */
2549  if( SCIPgetStage(scip) < SCIP_STAGE_SOLVING )
2550  {
2551  SCIPdialogMessage(scip, NULL, "There is no node MIP relaxation before solving starts\n");
2552  return SCIP_OKAY;
2553  }
2554  if( SCIPgetStage(scip) >= SCIP_STAGE_SOLVED )
2555  {
2556  SCIPdialogMessage(scip, NULL, "There is no node MIP relaxation after problem was solved\n");
2557  return SCIP_OKAY;
2558  }
2559 
2560  /* first get file name */
2561  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter filename: ", &valuestr, &endoffile) );
2562  if( endoffile )
2563  {
2564  *nextdialog = NULL;
2565  return SCIP_OKAY;
2566  }
2567  if( valuestr[0] == '\0' )
2568  return SCIP_OKAY;
2569 
2570  (void)strncpy(filename, valuestr, SCIP_MAXSTRLEN-1);
2571 
2572  /* second ask for generic variable and row names */
2573  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog,
2574  "using generic variable and row names (TRUE/FALSE): ",
2575  &valuestr, &endoffile) );
2576 
2577  if( endoffile )
2578  {
2579  *nextdialog = NULL;
2580  return SCIP_OKAY;
2581  }
2582  if( valuestr[0] == '\0' )
2583  return SCIP_OKAY;
2584 
2585  generic = parseBoolValue(scip, valuestr, &error);
2586 
2587  if( error )
2588  return SCIP_OKAY;
2589 
2590  /* adjust command and add to the history */
2591  SCIPescapeString(command, SCIP_MAXSTRLEN, filename);
2592  (void) SCIPsnprintf(command, SCIP_MAXSTRLEN, "%s %s", command, generic ? "TRUE" : "FALSE");
2593 
2594  /* third ask if for adjusting the objective offset */
2595  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog,
2596  "using original objective function (TRUE/FALSE): ",
2597  &valuestr, &endoffile) );
2598 
2599  if( endoffile )
2600  {
2601  *nextdialog = NULL;
2602  return SCIP_OKAY;
2603  }
2604  if( valuestr[0] == '\0' )
2605  return SCIP_OKAY;
2606 
2607  offset = parseBoolValue(scip, valuestr, &error);
2608 
2609  if( error )
2610  return SCIP_OKAY;
2611 
2612  (void) SCIPsnprintf(command, SCIP_MAXSTRLEN, "%s %s", command, offset ? "TRUE" : "FALSE");
2613  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, command, FALSE) );
2614 
2615  /* fourth ask for lazy constraints */
2616  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog,
2617  "output removable rows as lazy constraints (TRUE/FALSE): ",
2618  &valuestr, &endoffile) );
2619 
2620  if( endoffile )
2621  {
2622  *nextdialog = NULL;
2623  return SCIP_OKAY;
2624  }
2625  if( valuestr[0] == '\0' )
2626  return SCIP_OKAY;
2627 
2628  lazyconss = parseBoolValue(scip, valuestr, &error);
2629 
2630  if( error )
2631  return SCIP_OKAY;
2632 
2633  /* adjust command and add to the history */
2634  SCIPescapeString(command, SCIP_MAXSTRLEN, filename);
2635  (void) SCIPsnprintf(command, SCIP_MAXSTRLEN, "%s %s", command, lazyconss ? "TRUE" : "FALSE");
2636 
2637  /* execute command */
2638  SCIP_CALL( SCIPwriteMIP(scip, filename, generic, offset, lazyconss) );
2639  SCIPdialogMessage(scip, NULL, "written node MIP relaxation to file <%s>\n", filename);
2640 
2641  SCIPdialogMessage(scip, NULL, "\n");
2642 
2643  return SCIP_OKAY;
2644 }
2645 
2646 
2647 /** dialog execution method for the write NLP command */
2648 static
2649 SCIP_DECL_DIALOGEXEC(SCIPdialogExecWriteNlp)
2650 { /*lint --e{715}*/
2651  char* filename;
2652  SCIP_Bool endoffile;
2653 
2654  SCIPdialogMessage(scip, NULL, "\n");
2655 
2656  /* node relaxations only exist in solving & solved stage */
2657  if( SCIPgetStage(scip) < SCIP_STAGE_SOLVING )
2658  {
2659  SCIPdialogMessage(scip, NULL, "There is no node NLP relaxation before solving starts\n");
2660  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2661  return SCIP_OKAY;
2662  }
2663  if( SCIPgetStage(scip) >= SCIP_STAGE_SOLVED )
2664  {
2665  SCIPdialogMessage(scip, NULL, "There is no node NLP relaxation after problem was solved\n");
2666  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2667  return SCIP_OKAY;
2668  }
2669  if( !SCIPisNLPConstructed(scip) )
2670  {
2671  SCIPdialogMessage(scip, NULL, "There has been no node NLP relaxation constructed\n");
2672  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2673  return SCIP_OKAY;
2674  }
2675 
2676  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter filename: ", &filename, &endoffile) );
2677  if( endoffile )
2678  {
2679  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2680  return SCIP_OKAY;
2681  }
2682  if( filename[0] != '\0' )
2683  {
2684  SCIP_RETCODE retcode;
2685 
2686  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, filename, TRUE) );
2687  retcode = SCIPwriteNLP(scip, filename);
2688 
2689  if( retcode == SCIP_FILECREATEERROR )
2690  {
2691  SCIPdialogMessage(scip, NULL, "error not creating file <%s>\n", filename);
2692  }
2693  else
2694  {
2695  SCIP_CALL( retcode );
2696 
2697  SCIPdialogMessage(scip, NULL, "written node NLP relaxation to file <%s>\n", filename);
2698  }
2699  }
2700 
2701  SCIPdialogMessage(scip, NULL, "\n");
2702 
2703  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2704 
2705  return SCIP_OKAY;
2706 }
2707 
2708 /** dialog execution method for the write problem command */
2709 static
2710 SCIP_DECL_DIALOGEXEC(SCIPdialogExecWriteProblem)
2711 { /*lint --e{715}*/
2712  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
2713 
2714  if( SCIPgetStage(scip) >= SCIP_STAGE_PROBLEM )
2715  {
2716  SCIP_CALL( writeProblem(scip, dialog, dialoghdlr, nextdialog, FALSE, FALSE) );
2717  }
2718  else
2719  SCIPdialogMessage(scip, NULL, "no problem available\n");
2720 
2721  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2722 
2723  return SCIP_OKAY;
2724 }
2725 
2726 /** dialog execution method for the write generic problem command */
2727 static
2728 SCIP_DECL_DIALOGEXEC(SCIPdialogExecWriteGenProblem)
2729 { /*lint --e{715}*/
2730  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
2731 
2732  if( SCIPgetStage(scip) >= SCIP_STAGE_PROBLEM )
2733  {
2734  SCIP_CALL( writeProblem(scip, dialog, dialoghdlr, nextdialog, FALSE, TRUE) );
2735  }
2736  else
2737  SCIPdialogMessage(scip, NULL, "no problem available\n");
2738 
2739  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2740 
2741  return SCIP_OKAY;
2742 }
2743 
2744 /** dialog execution method for the write solution command */
2745 static
2746 SCIP_DECL_DIALOGEXEC(SCIPdialogExecWriteSolution)
2747 { /*lint --e{715}*/
2748  char* filename;
2749  SCIP_Bool endoffile;
2750 
2751  SCIPdialogMessage(scip, NULL, "\n");
2752 
2753  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter filename: ", &filename, &endoffile) );
2754  if( endoffile )
2755  {
2756  *nextdialog = NULL;
2757  return SCIP_OKAY;
2758  }
2759  if( filename[0] != '\0' )
2760  {
2761  FILE* file;
2762 
2763  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, filename, TRUE) );
2764 
2765  file = fopen(filename, "w");
2766  if( file == NULL )
2767  {
2768  SCIPdialogMessage(scip, NULL, "error creating file <%s>\n", filename);
2769  SCIPdialoghdlrClearBuffer(dialoghdlr);
2770  }
2771  else
2772  {
2773  SCIP_RETCODE retcode;
2774  SCIPinfoMessage(scip, file, "solution status: ");
2775  retcode = SCIPprintStatus(scip, file);
2776  if( retcode != SCIP_OKAY )
2777  {
2778  fclose(file);
2779  SCIP_CALL( retcode );
2780  }
2781  else
2782  {
2783  SCIPinfoMessage(scip, file, "\n");
2784  retcode = SCIPprintBestSol(scip, file, FALSE);
2785  if( retcode != SCIP_OKAY )
2786  {
2787  fclose(file);
2788  SCIP_CALL( retcode );
2789  }
2790  else
2791  {
2792  SCIPdialogMessage(scip, NULL, "written solution information to file <%s>\n", filename);
2793  fclose(file);
2794  }
2795  }
2796  }
2797  }
2798 
2799  SCIPdialogMessage(scip, NULL, "\n");
2800 
2801  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2802 
2803  return SCIP_OKAY;
2804 }
2805 
2806 /** dialog execution method for the write statistics command */
2807 static
2808 SCIP_DECL_DIALOGEXEC(SCIPdialogExecWriteStatistics)
2809 { /*lint --e{715}*/
2810  char* filename;
2811  SCIP_Bool endoffile;
2812 
2813  SCIPdialogMessage(scip, NULL, "\n");
2814 
2815  SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter filename: ", &filename, &endoffile) );
2816  if( endoffile )
2817  {
2818  *nextdialog = NULL;
2819  return SCIP_OKAY;
2820  }
2821  if( filename[0] != '\0' )
2822  {
2823  FILE* file;
2824 
2825  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, filename, TRUE) );
2826 
2827  file = fopen(filename, "w");
2828  if( file == NULL )
2829  {
2830  SCIPdialogMessage(scip, NULL, "error creating file <%s>\n", filename);
2831  SCIPprintSysError(filename);
2832  SCIPdialoghdlrClearBuffer(dialoghdlr);
2833  }
2834  else
2835  {
2836  SCIP_RETCODE retcode;
2837  retcode = SCIPprintStatistics(scip, file);
2838  if( retcode != SCIP_OKAY )
2839  {
2840  fclose(file);
2841  SCIP_CALL( retcode );
2842  }
2843  else
2844  {
2845  SCIPdialogMessage(scip, NULL, "written statistics to file <%s>\n", filename);
2846  fclose(file);
2847  }
2848  }
2849  }
2850 
2851  SCIPdialogMessage(scip, NULL, "\n");
2852 
2853  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2854 
2855  return SCIP_OKAY;
2856 }
2857 
2858 /** dialog execution method for the write transproblem command */
2859 static
2860 SCIP_DECL_DIALOGEXEC(SCIPdialogExecWriteTransproblem)
2861 { /*lint --e{715}*/
2862  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
2863 
2864  if( SCIPgetStage(scip) >= SCIP_STAGE_TRANSFORMED )
2865  {
2866  SCIP_CALL( writeProblem(scip, dialog, dialoghdlr, nextdialog, TRUE, FALSE) );
2867  }
2868  else
2869  SCIPdialogMessage(scip, NULL, "no transformed problem available\n");
2870 
2871  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2872 
2873  return SCIP_OKAY;
2874 }
2875 
2876 /** dialog execution method for the write generic transproblem command */
2877 static
2878 SCIP_DECL_DIALOGEXEC(SCIPdialogExecWriteGenTransproblem)
2879 { /*lint --e{715}*/
2880  SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
2881 
2882  if( SCIPgetStage(scip) >= SCIP_STAGE_TRANSFORMED )
2883  {
2884  SCIP_CALL( writeProblem(scip, dialog, dialoghdlr, nextdialog, TRUE, TRUE) );
2885  }
2886  else
2887  SCIPdialogMessage(scip, NULL, "no transformed problem available\n");
2888 
2889  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
2890 
2891  return SCIP_OKAY;
2892 }
2893 
2894 /** creates a root dialog */
2896  SCIP* scip, /**< SCIP data structure */
2897  SCIP_DIALOG** root /**< pointer to store the root dialog */
2898  )
2899 {
2900  SCIP_CALL( SCIPincludeDialog(scip, root,
2901  dialogCopyDefault,
2902  SCIPdialogExecMenuLazy, NULL, NULL,
2903  "SCIP", "SCIP's main menu", TRUE, NULL) );
2904 
2905  SCIP_CALL( SCIPsetRootDialog(scip, *root) );
2906  SCIP_CALL( SCIPreleaseDialog(scip, root) );
2907  *root = SCIPgetRootDialog(scip);
2908 
2909  return SCIP_OKAY;
2910 }
2911 
2912 
2913 /** includes or updates the default dialog menus in SCIP */
2915  SCIP* scip /**< SCIP data structure */
2916  )
2917 {
2918  SCIP_DIALOG* root;
2919  SCIP_DIALOG* submenu;
2920  SCIP_DIALOG* dialog;
2921 
2922  /* root menu */
2923  root = SCIPgetRootDialog(scip);
2924  if( root == NULL )
2925  {
2926  SCIP_CALL( SCIPcreateRootDialog(scip, &root) );
2927  }
2928 
2929  /* change */
2930  if( !SCIPdialogHasEntry(root, "change") )
2931  {
2932  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
2933  NULL,
2934  SCIPdialogExecMenu, NULL, NULL,
2935  "change", "change the problem", TRUE, NULL) );
2936  SCIP_CALL( SCIPaddDialogEntry(scip, root, submenu) );
2937  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
2938  }
2939  if( SCIPdialogFindEntry(root, "change", &submenu) != 1 )
2940  {
2941  SCIPerrorMessage("change sub menu not found\n");
2942  return SCIP_PLUGINNOTFOUND;
2943  }
2944 
2945  /* change add */
2946  if( !SCIPdialogHasEntry(submenu, "add") )
2947  {
2948  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
2949  NULL,
2950  SCIPdialogExecChangeAddCons, NULL, NULL,
2951  "add", "add constraint", FALSE, NULL) );
2952  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
2953  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
2954  }
2955 
2956  /* change bounds */
2957  if( !SCIPdialogHasEntry(submenu, "bounds") )
2958  {
2959  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
2960  NULL,
2961  SCIPdialogExecChangeBounds, NULL, NULL,
2962  "bounds", "change bounds of a variable", FALSE, NULL) );
2963  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
2964  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
2965  }
2966 
2967  /* free transformed problem */
2968  if( !SCIPdialogHasEntry(submenu, "freetransproblem") )
2969  {
2970  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
2971  NULL,
2972  SCIPdialogExecChangeFreetransproblem, NULL, NULL,
2973  "freetransproblem", "free transformed problem", FALSE, NULL) );
2974  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
2975  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
2976  }
2977 
2978  /* change objective sense */
2979  if( !SCIPdialogHasEntry(submenu, "objsense") )
2980  {
2981  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
2982  NULL,
2983  SCIPdialogExecChangeObjSense, NULL, NULL,
2984  "objsense", "change objective sense", FALSE, NULL) );
2985  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
2986  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
2987  }
2988 
2989  /* checksol */
2990  if( !SCIPdialogHasEntry(root, "checksol") )
2991  {
2992  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
2993  NULL,
2994  SCIPdialogExecChecksol, NULL, NULL,
2995  "checksol", "double checks best solution w.r.t. original problem", FALSE, NULL) );
2996  SCIP_CALL( SCIPaddDialogEntry(scip, root, dialog) );
2997  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
2998  }
2999 
3000  /* display */
3001  if( !SCIPdialogHasEntry(root, "display") )
3002  {
3003  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
3004  NULL,
3005  SCIPdialogExecMenu, NULL, NULL,
3006  "display", "display information", TRUE, NULL) );
3007  SCIP_CALL( SCIPaddDialogEntry(scip, root, submenu) );
3008  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
3009  }
3010  if( SCIPdialogFindEntry(root, "display", &submenu) != 1 )
3011  {
3012  SCIPerrorMessage("display sub menu not found\n");
3013  return SCIP_PLUGINNOTFOUND;
3014  }
3015 
3016  /* display branching */
3017  if( !SCIPdialogHasEntry(submenu, "branching") )
3018  {
3019  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3020  NULL,
3021  SCIPdialogExecDisplayBranching, NULL, NULL,
3022  "branching", "display branching rules", FALSE, NULL) );
3023  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3024  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3025  }
3026 
3027  /* display conflict */
3028  if( !SCIPdialogHasEntry(submenu, "conflict") )
3029  {
3030  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3031  NULL,
3032  SCIPdialogExecDisplayConflict, NULL, NULL,
3033  "conflict", "display conflict handlers", FALSE, NULL) );
3034  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3035  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3036  }
3037 
3038  /* display conshdlrs */
3039  if( !SCIPdialogHasEntry(submenu, "conshdlrs") )
3040  {
3041  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3042  NULL,
3043  SCIPdialogExecDisplayConshdlrs, NULL, NULL,
3044  "conshdlrs", "display constraint handlers", FALSE, NULL) );
3045  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3046  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3047  }
3048 
3049  /* display displaycols */
3050  if( !SCIPdialogHasEntry(submenu, "displaycols") )
3051  {
3052  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3053  NULL,
3054  SCIPdialogExecDisplayDisplaycols, NULL, NULL,
3055  "displaycols", "display display columns", FALSE, NULL) );
3056  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3057  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3058  }
3059 
3060  /* display heuristics */
3061  if( !SCIPdialogHasEntry(submenu, "heuristics") )
3062  {
3063  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3064  NULL,
3065  SCIPdialogExecDisplayHeuristics, NULL, NULL,
3066  "heuristics", "display primal heuristics", FALSE, NULL) );
3067  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3068  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3069  }
3070 
3071  /* display memory */
3072  if( !SCIPdialogHasEntry(submenu, "memory") )
3073  {
3074  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3075  NULL,
3076  SCIPdialogExecDisplayMemory, NULL, NULL,
3077  "memory", "display memory diagnostics", FALSE, NULL) );
3078  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3079  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3080  }
3081 
3082  /* display nlpi */
3083  if( !SCIPdialogHasEntry(submenu, "nlpis") )
3084  {
3085  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3086  NULL,
3087  SCIPdialogExecDisplayNlpi, NULL, NULL,
3088  "nlpis", "display NLP solver interfaces", FALSE, NULL) );
3089  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3090  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3091  }
3092 
3093  /* display nodeselectors */
3094  if( !SCIPdialogHasEntry(submenu, "nodeselectors") )
3095  {
3096  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3097  NULL,
3098  SCIPdialogExecDisplayNodeselectors, NULL, NULL,
3099  "nodeselectors", "display node selectors", FALSE, NULL) );
3100  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3101  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3102  }
3103 
3104  /* display parameters */
3105  if( !SCIPdialogHasEntry(submenu, "parameters") )
3106  {
3107  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3108  NULL,
3109  SCIPdialogExecDisplayParameters, NULL, NULL,
3110  "parameters", "display non-default parameter settings", FALSE, NULL) );
3111  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3112  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3113  }
3114 
3115  /* display presolvers */
3116  if( !SCIPdialogHasEntry(submenu, "presolvers") )
3117  {
3118  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3119  NULL,
3120  SCIPdialogExecDisplayPresolvers, NULL, NULL,
3121  "presolvers", "display presolvers", FALSE, NULL) );
3122  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3123  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3124  }
3125 
3126  /* display pricers */
3127  if( !SCIPdialogHasEntry(submenu, "pricers") )
3128  {
3129  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3130  NULL,
3131  SCIPdialogExecDisplayPricers, NULL, NULL,
3132  "pricers", "display pricers", FALSE, NULL) );
3133  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3134  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3135  }
3136 
3137  /* display problem */
3138  if( !SCIPdialogHasEntry(submenu, "problem") )
3139  {
3140  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3141  NULL,
3142  SCIPdialogExecDisplayProblem, NULL, NULL,
3143  "problem", "display original problem", FALSE, NULL) );
3144  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3145  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3146  }
3147 
3148  /* display propagators */
3149  if( !SCIPdialogHasEntry(submenu, "propagators") )
3150  {
3151  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3152  NULL,
3153  SCIPdialogExecDisplayPropagators, NULL, NULL,
3154  "propagators", "display propagators", FALSE, NULL) );
3155  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3156  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3157  }
3158 
3159  /* display readers */
3160  if( !SCIPdialogHasEntry(submenu, "readers") )
3161  {
3162  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3163  NULL,
3164  SCIPdialogExecDisplayReaders, NULL, NULL,
3165  "readers", "display file readers", FALSE, NULL) );
3166  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3167  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3168  }
3169 
3170  /* display relaxing */
3171  if( !SCIPdialogHasEntry(submenu, "relaxators") )
3172  {
3173  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3174  NULL,
3175  SCIPdialogExecDisplayRelaxators, NULL, NULL,
3176  "relaxators", "display relaxators", FALSE, NULL) );
3177  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3178  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3179  }
3180 
3181  /* display separators */
3182  if( !SCIPdialogHasEntry(submenu, "separators") )
3183  {
3184  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3185  NULL,
3186  SCIPdialogExecDisplaySeparators, NULL, NULL,
3187  "separators", "display cut separators", FALSE, NULL) );
3188  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3189  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3190  }
3191 
3192  /* display solution */
3193  if( !SCIPdialogHasEntry(submenu, "solution") )
3194  {
3195  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3196  NULL,
3197  SCIPdialogExecDisplaySolution, NULL, NULL,
3198  "solution", "display best primal solution", FALSE, NULL) );
3199  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3200  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3201  }
3202 
3203  /* display solution */
3204  if( !SCIPdialogHasEntry(submenu, "dualsolution") )
3205  {
3206  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3207  NULL,
3208  SCIPdialogExecDisplayDualSolution, NULL, NULL,
3209  "dualsolution", "display dual solution vector (LP only, without presolving)", FALSE, NULL) );
3210  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3211  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3212  }
3213 
3214  /* display solution */
3215  if( !SCIPdialogHasEntry(submenu, "sols") )
3216  {
3217  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3218  NULL,
3219  SCIPdialogExecDisplaySolutionPool, NULL, NULL,
3220  "sols", "display solutions from pool", FALSE, NULL) );
3221  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3222  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3223  }
3224 
3225  /* display statistics */
3226  if( !SCIPdialogHasEntry(submenu, "statistics") )
3227  {
3228  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3229  NULL,
3230  SCIPdialogExecDisplayStatistics, NULL, NULL,
3231  "statistics", "display problem and optimization statistics", FALSE, NULL) );
3232  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3233  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3234  }
3235 
3236  /* display transproblem */
3237  if( !SCIPdialogHasEntry(submenu, "transproblem") )
3238  {
3239  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3240  NULL,
3241  SCIPdialogExecDisplayTransproblem, NULL, NULL,
3242  "transproblem", "display current node transformed problem", FALSE, NULL) );
3243  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3244  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3245  }
3246 
3247  /* display value */
3248  if( !SCIPdialogHasEntry(submenu, "value") )
3249  {
3250  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3251  NULL,
3252  SCIPdialogExecDisplayValue, NULL, NULL,
3253  "value", "display value of single variable in best primal solution", FALSE, NULL) );
3254  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3255  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3256  }
3257 
3258  /* display varbranchstatistics */
3259  if( !SCIPdialogHasEntry(submenu, "varbranchstatistics") )
3260  {
3261  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3262  NULL,
3263  SCIPdialogExecDisplayVarbranchstatistics, NULL, NULL,
3264  "varbranchstatistics", "display statistics for branching on variables", FALSE, NULL) );
3265  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3266  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3267  }
3268 
3269  /* display varbranchstatistics */
3270  if( !SCIPdialogHasEntry(submenu, "lpsolquality") )
3271  {
3272  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3273  NULL,
3274  SCIPdialogExecDisplayLPSolutionQuality, NULL, NULL,
3275  "lpsolquality", "display quality of the current LP solution, if available", FALSE, NULL) );
3276  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3277  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3278  }
3279 
3280  /* display transsolution */
3281  if( !SCIPdialogHasEntry(submenu, "transsolution") )
3282  {
3283  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3284  NULL,
3285  SCIPdialogExecDisplayTranssolution, NULL, NULL,
3286  "transsolution", "display best primal solution in transformed variables", FALSE, NULL) );
3287  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3288  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3289  }
3290 
3291  /* free */
3292  if( !SCIPdialogHasEntry(root, "free") )
3293  {
3294  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3295  NULL,
3296  SCIPdialogExecFree, NULL, NULL,
3297  "free", "free current problem from memory", FALSE, NULL) );
3298  SCIP_CALL( SCIPaddDialogEntry(scip, root, dialog) );
3299  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3300  }
3301 
3302  /* help */
3303  if( !SCIPdialogHasEntry(root, "help") )
3304  {
3305  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3306  NULL,
3307  SCIPdialogExecHelp, NULL, NULL,
3308  "help", "display this help", FALSE, NULL) );
3309  SCIP_CALL( SCIPaddDialogEntry(scip, root, dialog) );
3310  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3311  }
3312 
3313  /* newstart */
3314  if( !SCIPdialogHasEntry(root, "newstart") )
3315  {
3316  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3317  NULL,
3318  SCIPdialogExecNewstart, NULL, NULL,
3319  "newstart", "reset branch and bound tree to start again from root", FALSE, NULL) );
3320  SCIP_CALL( SCIPaddDialogEntry(scip, root, dialog) );
3321  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3322  }
3323 
3324  /* optimize */
3325  if( !SCIPdialogHasEntry(root, "optimize") )
3326  {
3327  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3328  NULL,
3329  SCIPdialogExecOptimize, NULL, NULL,
3330  "optimize", "solve the problem", FALSE, NULL) );
3331  SCIP_CALL( SCIPaddDialogEntry(scip, root, dialog) );
3332  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3333  }
3334 
3335  /* presolve */
3336  if( !SCIPdialogHasEntry(root, "presolve") )
3337  {
3338  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3339  NULL,
3340  SCIPdialogExecPresolve, NULL, NULL,
3341  "presolve", "solve the problem, but stop after presolving stage", FALSE, NULL) );
3342  SCIP_CALL( SCIPaddDialogEntry(scip, root, dialog) );
3343  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3344  }
3345 
3346  /* quit */
3347  if( !SCIPdialogHasEntry(root, "quit") )
3348  {
3349  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3350  NULL,
3351  SCIPdialogExecQuit, NULL, NULL,
3352  "quit", "leave SCIP", FALSE, NULL) );
3353  SCIP_CALL( SCIPaddDialogEntry(scip, root, dialog) );
3354  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3355  }
3356 
3357  /* read */
3358  if( !SCIPdialogHasEntry(root, "read") )
3359  {
3360  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3361  NULL,
3362  SCIPdialogExecRead, NULL, NULL,
3363  "read", "read a problem", FALSE, NULL) );
3364  SCIP_CALL( SCIPaddDialogEntry(scip, root, dialog) );
3365  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3366  }
3367 
3368  /* set */
3370 
3371  /* fix */
3373 
3374  /* write */
3375  if( !SCIPdialogHasEntry(root, "write") )
3376  {
3377  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
3378  NULL,
3379  SCIPdialogExecMenu, NULL, NULL,
3380  "write", "write information to file", TRUE, NULL) );
3381  SCIP_CALL( SCIPaddDialogEntry(scip, root, submenu) );
3382  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
3383  }
3384  if( SCIPdialogFindEntry(root, "write", &submenu) != 1 )
3385  {
3386  SCIPerrorMessage("write sub menu not found\n");
3387  return SCIP_PLUGINNOTFOUND;
3388  }
3389 
3390  /* write LP */
3391  if( !SCIPdialogHasEntry(submenu, "lp") )
3392  {
3393  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3394  NULL,
3395  SCIPdialogExecWriteLp, NULL, NULL,
3396  "lp", "write current node LP relaxation in LP format to file", FALSE, NULL) );
3397  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3398  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3399  }
3400 
3401  /* write MIP */
3402  if( !SCIPdialogHasEntry(submenu, "mip") )
3403  {
3404  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3405  NULL,
3406  SCIPdialogExecWriteMip, NULL, NULL,
3407  "mip", "write current node MIP relaxation in LP format to file", FALSE, NULL) );
3408  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3409  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3410  }
3411 
3412  /* write NLP */
3413  if( !SCIPdialogHasEntry(submenu, "nlp") )
3414  {
3415  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3416  NULL,
3417  SCIPdialogExecWriteNlp, NULL, NULL,
3418  "nlp", "write current node NLP relaxation to file", FALSE, NULL) );
3419  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3420  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3421  }
3422 
3423  /* write problem */
3424  if( !SCIPdialogHasEntry(submenu, "problem") )
3425  {
3426  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3427  NULL,
3428  SCIPdialogExecWriteProblem, NULL, NULL,
3429  "problem",
3430  "write original problem to file (format is given by file extension, e.g., orig.{lp,rlp,cip,mps})",
3431  FALSE, NULL) );
3432  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3433  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3434  }
3435 
3436  /* write generic problem */
3437  if( !SCIPdialogHasEntry(submenu, "genproblem") )
3438  {
3439  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3440  NULL,
3441  SCIPdialogExecWriteGenProblem, NULL, NULL,
3442  "genproblem",
3443  "write original problem with generic names to file (format is given by file extension, e.g., orig.{lp,rlp,cip,mps})",
3444  FALSE, NULL) );
3445  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3446  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3447  }
3448 
3449  /* write solution */
3450  if( !SCIPdialogHasEntry(submenu, "solution") )
3451  {
3452  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3453  NULL,
3454  SCIPdialogExecWriteSolution, NULL, NULL,
3455  "solution", "write best primal solution to file", FALSE, NULL) );
3456  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3457  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3458  }
3459 
3460  /* write statistics */
3461  if( !SCIPdialogHasEntry(submenu, "statistics") )
3462  {
3463  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3464  NULL,
3465  SCIPdialogExecWriteStatistics, NULL, NULL,
3466  "statistics", "write statistics to file", FALSE, NULL) );
3467  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3468  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3469  }
3470 
3471  /* write transproblem */
3472  if( !SCIPdialogHasEntry(submenu, "transproblem") )
3473  {
3474  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3475  NULL,
3476  SCIPdialogExecWriteTransproblem, NULL, NULL,
3477  "transproblem",
3478  "write current node transformed problem to file (format is given by file extension, e.g., trans.{lp,rlp,cip,mps})",
3479  FALSE, NULL) );
3480  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3481  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3482  }
3483 
3484  /* write transproblem */
3485  if( !SCIPdialogHasEntry(submenu, "gentransproblem") )
3486  {
3487  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3488  NULL,
3489  SCIPdialogExecWriteGenTransproblem, NULL, NULL,
3490  "gentransproblem",
3491  "write current node transformed problem with generic names to file (format is given by file extension, e.g., trans.{lp,rlp,cip,mps})",
3492  FALSE, NULL) );
3493  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3494  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3495  }
3496 
3497  /* write conflictgraph */
3498  if( !SCIPdialogHasEntry(submenu, "conflictgraph") )
3499  {
3500  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3501  NULL,
3502  SCIPdialogExecConflictgraph, NULL, NULL,
3503  "conflictgraph",
3504  "write binary variable implications of transformed problem as conflict graph to file",
3505  FALSE, NULL) );
3506  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3507  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3508  }
3509 
3510  /* write cliquegraph */
3511  if( !SCIPdialogHasEntry(submenu, "cliquegraph") )
3512  {
3513  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3514  NULL,
3515  SCIPdialogExecCliquegraph, NULL, NULL,
3516  "cliquegraph",
3517  "write graph of cliques and implications of binary variables to GML file (better call after presolving)",
3518  FALSE, NULL) );
3519  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3520  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3521  }
3522 
3523  return SCIP_OKAY;
3524 }
3525 
3526 /** if a '/' occurs in the parameter's name, adds a sub menu dialog to the given menu and inserts the parameter dialog
3527  * recursively in the sub menu; if no '/' occurs in the name, adds a parameter change dialog into the given dialog menu
3528  */
3529 static
3531  SCIP* scip, /**< SCIP data structure */
3532  SCIP_DIALOG* menu, /**< dialog menu to insert the parameter into */
3533  SCIP_PARAM* param, /**< parameter to add a dialog for */
3534  char* paramname /**< parameter name to parse */
3535  )
3536 {
3537  char* slash;
3538  char* dirname;
3539 
3540  assert(paramname != NULL);
3541 
3542  /* check for a '/' */
3543  slash = strchr(paramname, '/');
3544 
3545  if( slash == NULL )
3546  {
3547  /* check, if the corresponding dialog already exists */
3548  if( !SCIPdialogHasEntry(menu, paramname) )
3549  {
3550  SCIP_DIALOG* paramdialog;
3551 
3552  if( SCIPparamIsAdvanced(param) )
3553  {
3554  SCIP_DIALOG* advmenu;
3555 
3556  if( !SCIPdialogHasEntry(menu, "advanced") )
3557  {
3558  /* if not yet existing, create an advanced sub menu */
3559  char desc[SCIP_MAXSTRLEN];
3560 
3561  (void) SCIPsnprintf(desc, SCIP_MAXSTRLEN, "advanced parameters");
3562  SCIP_CALL( SCIPincludeDialog(scip, &advmenu,
3563  NULL,
3564  SCIPdialogExecMenu, NULL, NULL, "advanced", desc, TRUE, NULL) );
3565  SCIP_CALL( SCIPaddDialogEntry(scip, menu, advmenu) );
3566  SCIP_CALL( SCIPreleaseDialog(scip, &advmenu) );
3567  }
3568 
3569  /* find the corresponding sub menu */
3570  (void)SCIPdialogFindEntry(menu, "advanced", &advmenu);
3571  if( advmenu == NULL )
3572  {
3573  SCIPerrorMessage("dialog sub menu not found\n");
3574  return SCIP_PLUGINNOTFOUND;
3575  }
3576 
3577  if( !SCIPdialogHasEntry(advmenu, paramname) )
3578  {
3579  /* create a parameter change dialog */
3580  SCIP_CALL( SCIPincludeDialog(scip, &paramdialog,
3581  NULL,
3582  SCIPdialogExecSetParam, SCIPdialogDescSetParam, NULL,
3583  paramname, SCIPparamGetDesc(param), FALSE, (SCIP_DIALOGDATA*)param) );
3584  SCIP_CALL( SCIPaddDialogEntry(scip, advmenu, paramdialog) );
3585  SCIP_CALL( SCIPreleaseDialog(scip, &paramdialog) );
3586  }
3587  }
3588  else
3589  {
3590  /* create a parameter change dialog */
3591  SCIP_CALL( SCIPincludeDialog(scip, &paramdialog,
3592  NULL,
3593  SCIPdialogExecSetParam, SCIPdialogDescSetParam, NULL,
3594  paramname, SCIPparamGetDesc(param), FALSE, (SCIP_DIALOGDATA*)param) );
3595  SCIP_CALL( SCIPaddDialogEntry(scip, menu, paramdialog) );
3596  SCIP_CALL( SCIPreleaseDialog(scip, &paramdialog) );
3597  }
3598  }
3599  }
3600  else
3601  {
3602  SCIP_DIALOG* submenu;
3603 
3604  /* split the parameter name into dirname and parameter name */
3605  dirname = paramname;
3606  paramname = slash+1;
3607  *slash = '\0';
3608 
3609  /* if not yet existing, create a corresponding sub menu */
3610  if( !SCIPdialogHasEntry(menu, dirname) )
3611  {
3612  char desc[SCIP_MAXSTRLEN];
3613 
3614  (void) SCIPsnprintf(desc, SCIP_MAXSTRLEN, "parameters for <%s>", dirname);
3615  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
3616  NULL,
3617  SCIPdialogExecMenu, NULL, NULL, dirname, desc, TRUE, NULL) );
3618  SCIP_CALL( SCIPaddDialogEntry(scip, menu, submenu) );
3619  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
3620  }
3621 
3622  /* find the corresponding sub menu */
3623  (void)SCIPdialogFindEntry(menu, dirname, &submenu);
3624  if( submenu == NULL )
3625  {
3626  SCIPerrorMessage("dialog sub menu not found\n");
3627  return SCIP_PLUGINNOTFOUND;
3628  }
3629 
3630  /* recursively call add parameter method */
3631  SCIP_CALL( addSetParamDialog(scip, submenu, param, paramname) );
3632  }
3633 
3634  return SCIP_OKAY;
3635 }
3636 
3637 /** if a '/' occurs in the parameter's name, adds a sub menu dialog to the given menu and inserts the parameter dialog
3638  * recursively in the sub menu; if no '/' occurs in the name, adds a fix parameter dialog into the given dialog menu
3639  */
3640 static
3642  SCIP* scip, /**< SCIP data structure */
3643  SCIP_DIALOG* menu, /**< dialog menu to insert the parameter into */
3644  SCIP_PARAM* param, /**< parameter to add a dialog for */
3645  char* paramname /**< parameter name to parse */
3646  )
3647 {
3648  char* slash;
3649  char* dirname;
3650 
3651  assert(paramname != NULL);
3652 
3653  /* check for a '/' */
3654  slash = strchr(paramname, '/');
3655 
3656  if( slash == NULL )
3657  {
3658  /* check, if the corresponding dialog already exists */
3659  if( !SCIPdialogHasEntry(menu, paramname) )
3660  {
3661  SCIP_DIALOG* paramdialog;
3662 
3663  if( SCIPparamIsAdvanced(param) )
3664  {
3665  SCIP_DIALOG* advmenu;
3666 
3667  if( !SCIPdialogHasEntry(menu, "advanced") )
3668  {
3669  /* if not yet existing, create an advanced sub menu */
3670  char desc[SCIP_MAXSTRLEN];
3671 
3672  (void) SCIPsnprintf(desc, SCIP_MAXSTRLEN, "advanced parameters");
3673  SCIP_CALL( SCIPincludeDialog(scip, &advmenu,
3674  NULL,
3675  SCIPdialogExecMenu, NULL, NULL, "advanced", desc, TRUE, NULL) );
3676  SCIP_CALL( SCIPaddDialogEntry(scip, menu, advmenu) );
3677  SCIP_CALL( SCIPreleaseDialog(scip, &advmenu) );
3678  }
3679 
3680  /* find the corresponding sub menu */
3681  (void)SCIPdialogFindEntry(menu, "advanced", &advmenu);
3682  if( advmenu == NULL )
3683  {
3684  SCIPerrorMessage("dialog sub menu not found\n");
3685  return SCIP_PLUGINNOTFOUND;
3686  }
3687 
3688  if( !SCIPdialogHasEntry(advmenu, paramname) )
3689  {
3690  /* create a fix parameter dialog */
3691  SCIP_CALL( SCIPincludeDialog(scip, &paramdialog,
3692  NULL,
3693  SCIPdialogExecFixParam, SCIPdialogDescFixParam, NULL,
3694  paramname, SCIPparamGetDesc(param), FALSE, (SCIP_DIALOGDATA*)param) );
3695  SCIP_CALL( SCIPaddDialogEntry(scip, advmenu, paramdialog) );
3696  SCIP_CALL( SCIPreleaseDialog(scip, &paramdialog) );
3697  }
3698  }
3699  else
3700  {
3701  /* create a fix parameter dialog */
3702  SCIP_CALL( SCIPincludeDialog(scip, &paramdialog,
3703  NULL,
3704  SCIPdialogExecFixParam, SCIPdialogDescFixParam, NULL,
3705  paramname, SCIPparamGetDesc(param), FALSE, (SCIP_DIALOGDATA*)param) );
3706  SCIP_CALL( SCIPaddDialogEntry(scip, menu, paramdialog) );
3707  SCIP_CALL( SCIPreleaseDialog(scip, &paramdialog) );
3708  }
3709  }
3710  }
3711  else
3712  {
3713  SCIP_DIALOG* submenu;
3714 
3715  /* split the parameter name into dirname and parameter name */
3716  dirname = paramname;
3717  paramname = slash+1;
3718  *slash = '\0';
3719 
3720  /* if not yet existing, create a corresponding sub menu */
3721  if( !SCIPdialogHasEntry(menu, dirname) )
3722  {
3723  char desc[SCIP_MAXSTRLEN];
3724 
3725  (void) SCIPsnprintf(desc, SCIP_MAXSTRLEN, "parameters for <%s>", dirname);
3726  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
3727  NULL,
3728  SCIPdialogExecMenu, NULL, NULL, dirname, desc, TRUE, NULL) );
3729  SCIP_CALL( SCIPaddDialogEntry(scip, menu, submenu) );
3730  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
3731  }
3732 
3733  /* find the corresponding sub menu */
3734  (void)SCIPdialogFindEntry(menu, dirname, &submenu);
3735  if( submenu == NULL )
3736  {
3737  SCIPerrorMessage("dialog sub menu not found\n");
3738  return SCIP_PLUGINNOTFOUND;
3739  }
3740 
3741  /* recursively call add parameter method */
3742  SCIP_CALL( addFixParamDialog(scip, submenu, param, paramname) );
3743  }
3744 
3745  return SCIP_OKAY;
3746 }
3747 
3748 /** create a "emphasis" sub menu */
3749 static
3751  SCIP* scip, /**< SCIP data structure */
3752  SCIP_DIALOG* root, /**< the menu to add the empty sub menu */
3753  SCIP_DIALOG** submenu /**< pointer to store the created emphasis sub menu */
3754  )
3755 {
3756  if( !SCIPdialogHasEntry(root, "emphasis") )
3757  {
3758  SCIP_CALL( SCIPincludeDialog(scip, submenu,
3759  NULL, SCIPdialogExecMenu, NULL, NULL,
3760  "emphasis", "predefined parameter settings", TRUE, NULL) );
3761  SCIP_CALL( SCIPaddDialogEntry(scip, root, *submenu) );
3762  SCIP_CALL( SCIPreleaseDialog(scip, submenu) );
3763  }
3764  else if( SCIPdialogFindEntry(root, "emphasis", submenu) != 1 )
3765  {
3766  SCIPerrorMessage("emphasis sub menu not found\n");
3767  return SCIP_PLUGINNOTFOUND;
3768  }
3769 
3770  assert(*submenu != NULL);
3771 
3772  return SCIP_OKAY;
3773 }
3774 
3775 
3776 /** includes or updates the "set" menu for each available parameter setting */
3778  SCIP* scip /**< SCIP data structure */
3779  )
3780 {
3781  SCIP_DIALOG* root;
3782  SCIP_DIALOG* setmenu;
3783  SCIP_DIALOG* emphasismenu;
3784  SCIP_DIALOG* submenu;
3785  SCIP_DIALOG* dialog;
3786  SCIP_PARAM** params;
3787  char* paramname;
3788  int nparams;
3789  int i;
3790 
3791  SCIP_BRANCHRULE** branchrules;
3792  SCIP_CONFLICTHDLR** conflicthdlrs;
3793  SCIP_CONSHDLR** conshdlrs;
3794  SCIP_DISP** disps;
3795  SCIP_HEUR** heurs;
3796  SCIP_NLPI** nlpis;
3797  SCIP_NODESEL** nodesels;
3798  SCIP_PRESOL** presols;
3799  SCIP_PRICER** pricers;
3800  SCIP_READER** readers;
3801  SCIP_SEPA** sepas;
3802  int nbranchrules;
3803  int nconflicthdlrs;
3804  int nconshdlrs;
3805  int ndisps;
3806  int nheurs;
3807  int nnlpis;
3808  int nnodesels;
3809  int npresols;
3810  int npricers;
3811  int nreaders;
3812  int nsepas;
3813 
3814  /* get root dialog */
3815  root = SCIPgetRootDialog(scip);
3816  if( root == NULL )
3817  {
3818  SCIPerrorMessage("root dialog not found\n");
3819  return SCIP_PLUGINNOTFOUND;
3820  }
3821 
3822  /* find (or create) the "set" menu of the root dialog */
3823  if( !SCIPdialogHasEntry(root, "set") )
3824  {
3825  SCIP_CALL( SCIPincludeDialog(scip, &setmenu,
3826  NULL, SCIPdialogExecMenu, NULL, NULL,
3827  "set", "load/save/change parameters", TRUE, NULL) );
3828  SCIP_CALL( SCIPaddDialogEntry(scip, root, setmenu) );
3829  SCIP_CALL( SCIPreleaseDialog(scip, &setmenu) );
3830  }
3831  if( SCIPdialogFindEntry(root, "set", &setmenu) != 1 )
3832  {
3833  SCIPerrorMessage("set sub menu not found\n");
3834  return SCIP_PLUGINNOTFOUND;
3835  }
3836 
3837  /* set default */
3838  if( !SCIPdialogHasEntry(setmenu, "default") )
3839  {
3840  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3841  NULL,
3842  SCIPdialogExecSetDefault, NULL, NULL,
3843  "default", "reset parameter settings to their default values", FALSE, NULL) );
3844  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, dialog) );
3845  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3846  }
3847 
3848  /* set load */
3849  if( !SCIPdialogHasEntry(setmenu, "load") )
3850  {
3851  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3852  NULL,
3853  SCIPdialogExecSetLoad, NULL, NULL,
3854  "load", "load parameter settings from a file", FALSE, NULL) );
3855  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, dialog) );
3856  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3857  }
3858 
3859  /* set save */
3860  if( !SCIPdialogHasEntry(setmenu, "save") )
3861  {
3862  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3863  NULL,
3864  SCIPdialogExecSetSave, NULL, NULL,
3865  "save", "save parameter settings to a file", FALSE, NULL) );
3866  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, dialog) );
3867  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3868  }
3869 
3870  /* set diffsave */
3871  if( !SCIPdialogHasEntry(setmenu, "diffsave") )
3872  {
3873  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3874  NULL,
3875  SCIPdialogExecSetDiffsave, NULL, NULL,
3876  "diffsave", "save non-default parameter settings to a file", FALSE, NULL) );
3877  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, dialog) );
3878  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3879  }
3880 
3881  /* set branching */
3882  if( !SCIPdialogHasEntry(setmenu, "branching") )
3883  {
3884  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
3885  NULL,
3886  SCIPdialogExecMenu, NULL, NULL,
3887  "branching", "change parameters for branching rules", TRUE, NULL) );
3888  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
3889  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
3890  }
3891  if( SCIPdialogFindEntry(setmenu, "branching", &submenu) != 1 )
3892  {
3893  SCIPerrorMessage("branching sub menu not found\n");
3894  return SCIP_PLUGINNOTFOUND;
3895  }
3896 
3897  nbranchrules = SCIPgetNBranchrules(scip);
3898  branchrules = SCIPgetBranchrules(scip);
3899 
3900  for( i = 0; i < nbranchrules; ++i )
3901  {
3902  if( !SCIPdialogHasEntry(submenu, SCIPbranchruleGetName(branchrules[i])) )
3903  {
3904  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3905  NULL,
3906  SCIPdialogExecMenu, NULL, NULL,
3907  SCIPbranchruleGetName(branchrules[i]), SCIPbranchruleGetDesc(branchrules[i]), TRUE, NULL) );
3908  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3909  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3910  }
3911  }
3912 
3913  /* set branching priority */
3914  if( !SCIPdialogHasEntry(submenu, "priority") )
3915  {
3916  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3917  NULL,
3918  SCIPdialogExecSetBranchingPriority, NULL, NULL,
3919  "priority", "change branching priority of a single variable", FALSE, NULL) );
3920  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3921  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3922  }
3923 
3924  /* set branching direction */
3925  if( !SCIPdialogHasEntry(submenu, "direction") )
3926  {
3927  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3928  NULL,
3929  SCIPdialogExecSetBranchingDirection, NULL, NULL,
3930  "direction", "change preferred branching direction of a single variable (-1:down, 0:auto, +1:up)",
3931  FALSE, NULL) );
3932  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3933  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3934  }
3935 
3936  /* set conflict */
3937  if( !SCIPdialogHasEntry(setmenu, "conflict") )
3938  {
3939  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
3940  NULL,
3941  SCIPdialogExecMenu, NULL, NULL,
3942  "conflict", "change parameters for conflict handlers", TRUE, NULL) );
3943  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
3944  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
3945  }
3946  if( SCIPdialogFindEntry(setmenu, "conflict", &submenu) != 1 )
3947  {
3948  SCIPerrorMessage("conflict sub menu not found\n");
3949  return SCIP_PLUGINNOTFOUND;
3950  }
3951 
3952  nconflicthdlrs = SCIPgetNConflicthdlrs(scip);
3953  conflicthdlrs = SCIPgetConflicthdlrs(scip);
3954 
3955  for( i = 0; i < nconflicthdlrs; ++i )
3956  {
3957  if( !SCIPdialogHasEntry(submenu, SCIPconflicthdlrGetName(conflicthdlrs[i])) )
3958  {
3959  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3960  NULL,
3961  SCIPdialogExecMenu, NULL, NULL,
3962  SCIPconflicthdlrGetName(conflicthdlrs[i]), SCIPconflicthdlrGetDesc(conflicthdlrs[i]), TRUE, NULL) );
3963  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3964  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3965  }
3966  }
3967 
3968  /* set constraints */
3969  if( !SCIPdialogHasEntry(setmenu, "constraints") )
3970  {
3971  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
3972  NULL,
3973  SCIPdialogExecMenu, NULL, NULL,
3974  "constraints", "change parameters for constraint handlers", TRUE, NULL) );
3975  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
3976  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
3977  }
3978  if( SCIPdialogFindEntry(setmenu, "constraints", &submenu) != 1 )
3979  {
3980  SCIPerrorMessage("constraints sub menu not found\n");
3981  return SCIP_PLUGINNOTFOUND;
3982  }
3983 
3984  nconshdlrs = SCIPgetNConshdlrs(scip);
3985  conshdlrs = SCIPgetConshdlrs(scip);
3986 
3987  for( i = 0; i < nconshdlrs; ++i )
3988  {
3989  if( !SCIPdialogHasEntry(submenu, SCIPconshdlrGetName(conshdlrs[i])) )
3990  {
3991  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
3992  NULL,
3993  SCIPdialogExecMenu, NULL, NULL,
3994  SCIPconshdlrGetName(conshdlrs[i]), SCIPconshdlrGetDesc(conshdlrs[i]), TRUE, NULL) );
3995  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
3996  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
3997  }
3998  }
3999 
4000  /* set display */
4001  if( !SCIPdialogHasEntry(setmenu, "display") )
4002  {
4003  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4004  NULL,
4005  SCIPdialogExecMenu, NULL, NULL,
4006  "display", "change parameters for display columns", TRUE, NULL) );
4007  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
4008  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4009  }
4010  if( SCIPdialogFindEntry(setmenu, "display", &submenu) != 1 )
4011  {
4012  SCIPerrorMessage("display sub menu not found\n");
4013  return SCIP_PLUGINNOTFOUND;
4014  }
4015 
4016  ndisps = SCIPgetNDisps(scip);
4017  disps = SCIPgetDisps(scip);
4018 
4019  for( i = 0; i < ndisps; ++i )
4020  {
4021  if( !SCIPdialogHasEntry(submenu, SCIPdispGetName(disps[i])) )
4022  {
4023  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4024  NULL,
4025  SCIPdialogExecMenu, NULL, NULL,
4026  SCIPdispGetName(disps[i]), SCIPdispGetDesc(disps[i]), TRUE, NULL) );
4027  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4028  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4029  }
4030  }
4031 
4032  /* set heuristics */
4033  if( !SCIPdialogHasEntry(setmenu, "heuristics") )
4034  {
4035  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4036  NULL,
4037  SCIPdialogExecMenu, NULL, NULL,
4038  "heuristics", "change parameters for primal heuristics", TRUE, NULL) );
4039  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
4040  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4041  }
4042  if( SCIPdialogFindEntry(setmenu, "heuristics", &submenu) != 1 )
4043  {
4044  SCIPerrorMessage("heuristics sub menu not found\n");
4045  return SCIP_PLUGINNOTFOUND;
4046  }
4047 
4048  nheurs = SCIPgetNHeurs(scip);
4049  heurs = SCIPgetHeurs(scip);
4050 
4051  for( i = 0; i < nheurs; ++i )
4052  {
4053  if( !SCIPdialogHasEntry(submenu, SCIPheurGetName(heurs[i])) )
4054  {
4055  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4056  NULL,
4057  SCIPdialogExecMenu, NULL, NULL,
4058  SCIPheurGetName(heurs[i]), SCIPheurGetDesc(heurs[i]), TRUE, NULL) );
4059  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4060  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4061  }
4062  }
4063 
4064  /* create set heuristics emphasis */
4065  SCIP_CALL( createEmphasisSubmenu(scip, submenu, &emphasismenu) );
4066  assert(emphasismenu != NULL);
4067 
4068  /* set heuristics emphasis aggressive */
4069  if( !SCIPdialogHasEntry(emphasismenu, "aggressive") )
4070  {
4071  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4072  NULL, SCIPdialogExecSetHeuristicsAggressive, NULL, NULL,
4073  "aggressive", "sets heuristics <aggressive>", FALSE, NULL) );
4074  SCIP_CALL( SCIPaddDialogEntry(scip, emphasismenu, dialog) );
4075  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4076  }
4077 
4078  /* set heuristics emphasis fast */
4079  if( !SCIPdialogHasEntry(emphasismenu, "fast") )
4080  {
4081  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4082  NULL, SCIPdialogExecSetHeuristicsFast, NULL, NULL,
4083  "fast", "sets heuristics <fast>", FALSE, NULL) );
4084  SCIP_CALL( SCIPaddDialogEntry(scip, emphasismenu, dialog) );
4085  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4086  }
4087 
4088  /* set heuristics emphasis off */
4089  if( !SCIPdialogHasEntry(emphasismenu, "off") )
4090  {
4091  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4092  NULL, SCIPdialogExecSetHeuristicsOff, NULL, NULL,
4093  "off", "turns <off> all heuristics", FALSE, NULL) );
4094  SCIP_CALL( SCIPaddDialogEntry(scip, emphasismenu, dialog) );
4095  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4096  }
4097 
4098  /* set limits */
4099  if( !SCIPdialogHasEntry(setmenu, "limits") )
4100  {
4101  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4102  NULL,
4103  SCIPdialogExecMenu, NULL, NULL,
4104  "limits", "change parameters for time, memory, objective value, and other limits", TRUE, NULL) );
4105  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
4106 
4107  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4108  NULL,
4109  SCIPdialogExecSetLimitsObjective, NULL, NULL,
4110  "objective", "set limit on objective function, such that only solutions better than this limit are accepted", FALSE, NULL) );
4111  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4112  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4113 
4114  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4115  }
4116 
4117  /* set LP */
4118  if( !SCIPdialogHasEntry(setmenu, "lp") )
4119  {
4120  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4121  NULL,
4122  SCIPdialogExecMenu, NULL, NULL,
4123  "lp", "change parameters for linear programming relaxations", TRUE, NULL) );
4124  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
4125  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4126  }
4127 
4128  /* set NLP */
4129  if( !SCIPdialogHasEntry(setmenu, "nlp") )
4130  {
4131  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4132  NULL,
4133  SCIPdialogExecMenu, NULL, NULL,
4134  "nlp", "change parameters for nonlinear programming relaxations", TRUE, NULL) );
4135  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
4136  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4137  }
4138 
4139  /* set memory */
4140  if( !SCIPdialogHasEntry(setmenu, "memory") )
4141  {
4142  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4143  NULL,
4144  SCIPdialogExecMenu, NULL, NULL,
4145  "memory", "change parameters for memory management", TRUE, NULL) );
4146  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
4147  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4148  }
4149 
4150  /* set misc */
4151  if( !SCIPdialogHasEntry(setmenu, "misc") )
4152  {
4153  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4154  NULL,
4155  SCIPdialogExecMenu, NULL, NULL,
4156  "misc", "change parameters for miscellaneous stuff", TRUE, NULL) );
4157  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
4158  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4159  }
4160 
4161  /* set nlpi */
4162  if( !SCIPdialogHasEntry(setmenu, "nlpi") )
4163  {
4164  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4165  NULL,
4166  SCIPdialogExecMenu, NULL, NULL,
4167  "nlpi", "change parameters for NLP solver interfaces", TRUE, NULL) );
4168  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
4169  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4170  }
4171  if( SCIPdialogFindEntry(setmenu, "nlpi", &submenu) != 1 )
4172  {
4173  SCIPerrorMessage("nlpi sub menu not found\n");
4174  return SCIP_PLUGINNOTFOUND;
4175  }
4176 
4177  nnlpis = SCIPgetNNlpis(scip);
4178  nlpis = SCIPgetNlpis(scip);
4179 
4180  for( i = 0; i < nnlpis; ++i )
4181  {
4182  if( !SCIPdialogHasEntry(submenu, SCIPnlpiGetName(nlpis[i])) )
4183  {
4184  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4185  NULL,
4186  SCIPdialogExecMenu, NULL, NULL,
4187  SCIPnlpiGetName(nlpis[i]), SCIPnlpiGetDesc(nlpis[i]), TRUE, NULL) );
4188  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4189  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4190  }
4191  }
4192 
4193  /* set nodeselection */
4194  if( !SCIPdialogHasEntry(setmenu, "nodeselection") )
4195  {
4196  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4197  NULL,
4198  SCIPdialogExecMenu, NULL, NULL,
4199  "nodeselection", "change parameters for node selectors", TRUE, NULL) );
4200  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
4201  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4202  }
4203  if( SCIPdialogFindEntry(setmenu, "nodeselection", &submenu) != 1 )
4204  {
4205  SCIPerrorMessage("nodeselection sub menu not found\n");
4206  return SCIP_PLUGINNOTFOUND;
4207  }
4208 
4209  nnodesels = SCIPgetNNodesels(scip);
4210  nodesels = SCIPgetNodesels(scip);
4211 
4212  for( i = 0; i < nnodesels; ++i )
4213  {
4214  if( !SCIPdialogHasEntry(submenu, SCIPnodeselGetName(nodesels[i])) )
4215  {
4216  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4217  NULL,
4218  SCIPdialogExecMenu, NULL, NULL,
4219  SCIPnodeselGetName(nodesels[i]), SCIPnodeselGetDesc(nodesels[i]), TRUE, NULL) );
4220  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4221  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4222  }
4223  }
4224 
4225  /* set numerics */
4226  if( !SCIPdialogHasEntry(setmenu, "numerics") )
4227  {
4228  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4229  NULL,
4230  SCIPdialogExecMenu, NULL, NULL,
4231  "numerics", "change parameters for numerical values", TRUE, NULL) );
4232  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
4233  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4234  }
4235 
4236  /* set presolving */
4237  if( !SCIPdialogHasEntry(setmenu, "presolving") )
4238  {
4239  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4240  NULL,
4241  SCIPdialogExecMenu, NULL, NULL,
4242  "presolving", "change parameters for presolving", TRUE, NULL) );
4243  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
4244  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4245  }
4246  if( SCIPdialogFindEntry(setmenu, "presolving", &submenu) != 1 )
4247  {
4248  SCIPerrorMessage("presolving sub menu not found\n");
4249  return SCIP_PLUGINNOTFOUND;
4250  }
4251 
4252  npresols = SCIPgetNPresols(scip);
4253  presols = SCIPgetPresols(scip);
4254 
4255  for( i = 0; i < npresols; ++i )
4256  {
4257  if( !SCIPdialogHasEntry(submenu, SCIPpresolGetName(presols[i])) )
4258  {
4259  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4260  NULL, SCIPdialogExecMenu, NULL, NULL,
4261  SCIPpresolGetName(presols[i]), SCIPpresolGetDesc(presols[i]), TRUE, NULL) );
4262  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4263  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4264  }
4265  }
4266 
4267  /* create set presolving emphasis */
4268  SCIP_CALL( createEmphasisSubmenu(scip, submenu, &emphasismenu) );
4269  assert(emphasismenu != NULL);
4270 
4271  /* set presolving emphasis aggressive */
4272  if( !SCIPdialogHasEntry(emphasismenu, "aggressive") )
4273  {
4274  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4275  NULL, SCIPdialogExecSetPresolvingAggressive, NULL, NULL,
4276  "aggressive", "sets presolving <aggressive>", FALSE, NULL) );
4277  SCIP_CALL( SCIPaddDialogEntry(scip, emphasismenu, dialog) );
4278  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4279  }
4280 
4281  /* set presolving emphasis fast */
4282  if( !SCIPdialogHasEntry(emphasismenu, "fast") )
4283  {
4284  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4285  NULL, SCIPdialogExecSetPresolvingFast, NULL, NULL,
4286  "fast", "sets presolving <fast>", FALSE, NULL) );
4287  SCIP_CALL( SCIPaddDialogEntry(scip, emphasismenu, dialog) );
4288  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4289  }
4290 
4291  /* set presolving emphasis off */
4292  if( !SCIPdialogHasEntry(emphasismenu, "off") )
4293  {
4294  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4295  NULL, SCIPdialogExecSetPresolvingOff, NULL, NULL,
4296  "off", "turns <off> all presolving", FALSE, NULL) );
4297  SCIP_CALL( SCIPaddDialogEntry(scip, emphasismenu, dialog) );
4298  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4299  }
4300 
4301  /* set pricing */
4302  if( !SCIPdialogHasEntry(setmenu, "pricing") )
4303  {
4304  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4305  NULL,
4306  SCIPdialogExecMenu, NULL, NULL,
4307  "pricing", "change parameters for pricing variables", TRUE, NULL) );
4308  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
4309  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4310  }
4311  if( SCIPdialogFindEntry(setmenu, "pricing", &submenu) != 1 )
4312  {
4313  SCIPerrorMessage("pricing sub menu not found\n");
4314  return SCIP_PLUGINNOTFOUND;
4315  }
4316 
4317  npricers = SCIPgetNPricers(scip);
4318  pricers = SCIPgetPricers(scip);
4319 
4320  for( i = 0; i < npricers; ++i )
4321  {
4322  if( !SCIPdialogHasEntry(submenu, SCIPpricerGetName(pricers[i])) )
4323  {
4324  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4325  NULL,
4326  SCIPdialogExecMenu, NULL, NULL,
4327  SCIPpricerGetName(pricers[i]), SCIPpricerGetDesc(pricers[i]), TRUE, NULL) );
4328  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4329  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4330  }
4331  }
4332 
4333  /* set propagation */
4334  if( !SCIPdialogHasEntry(setmenu, "propagating") )
4335  {
4336  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4337  NULL,
4338  SCIPdialogExecMenu, NULL, NULL,
4339  "propagating", "change parameters for constraint propagation", TRUE, NULL) );
4340  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
4341  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4342  }
4343 
4344  /* set reading */
4345  if( !SCIPdialogHasEntry(setmenu, "reading") )
4346  {
4347  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4348  NULL,
4349  SCIPdialogExecMenu, NULL, NULL,
4350  "reading", "change parameters for problem file readers", TRUE, NULL) );
4351  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
4352  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4353  }
4354  if( SCIPdialogFindEntry(setmenu, "reading", &submenu) != 1 )
4355  {
4356  SCIPerrorMessage("reading sub menu not found\n");
4357  return SCIP_PLUGINNOTFOUND;
4358  }
4359 
4360  nreaders = SCIPgetNReaders(scip);
4361  readers = SCIPgetReaders(scip);
4362 
4363  for( i = 0; i < nreaders; ++i )
4364  {
4365  if( !SCIPdialogHasEntry(submenu, SCIPreaderGetName(readers[i])) )
4366  {
4367  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4368  NULL,
4369  SCIPdialogExecMenu, NULL, NULL,
4370  SCIPreaderGetName(readers[i]), SCIPreaderGetDesc(readers[i]), TRUE, NULL) );
4371  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4372  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4373  }
4374  }
4375 
4376  /* set separating */
4377  if( !SCIPdialogHasEntry(setmenu, "separating") )
4378  {
4379  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4380  NULL, SCIPdialogExecMenu, NULL, NULL,
4381  "separating", "change parameters for cut separators", TRUE, NULL) );
4382  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
4383  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4384  }
4385  if( SCIPdialogFindEntry(setmenu, "separating", &submenu) != 1 )
4386  {
4387  SCIPerrorMessage("separating sub menu not found\n");
4388  return SCIP_PLUGINNOTFOUND;
4389  }
4390 
4391  nsepas = SCIPgetNSepas(scip);
4392  sepas = SCIPgetSepas(scip);
4393 
4394  for( i = 0; i < nsepas; ++i )
4395  {
4396  if( !SCIPdialogHasEntry(submenu, SCIPsepaGetName(sepas[i])) )
4397  {
4398  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4399  NULL, SCIPdialogExecMenu, NULL, NULL,
4400  SCIPsepaGetName(sepas[i]), SCIPsepaGetDesc(sepas[i]), TRUE, NULL) );
4401  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4402  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4403  }
4404  }
4405 
4406  /* create set separating emphasis */
4407  SCIP_CALL( createEmphasisSubmenu(scip, submenu, &emphasismenu) );
4408  assert(emphasismenu != NULL);
4409 
4410  /* set separating emphasis aggressive */
4411  if( !SCIPdialogHasEntry(emphasismenu, "aggressive") )
4412  {
4413  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4414  NULL, SCIPdialogExecSetSeparatingAggressive, NULL, NULL,
4415  "aggressive", "sets separating <aggressive>", FALSE, NULL) );
4416  SCIP_CALL( SCIPaddDialogEntry(scip, emphasismenu, dialog) );
4417  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4418  }
4419 
4420  /* set separating emphasis fast */
4421  if( !SCIPdialogHasEntry(emphasismenu, "fast") )
4422  {
4423  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4424  NULL, SCIPdialogExecSetSeparatingFast, NULL, NULL,
4425  "fast", "sets separating <fast>", FALSE, NULL) );
4426  SCIP_CALL( SCIPaddDialogEntry(scip, emphasismenu, dialog) );
4427  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4428  }
4429 
4430  /* set separating emphasis off */
4431  if( !SCIPdialogHasEntry(emphasismenu, "off") )
4432  {
4433  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4434  NULL, SCIPdialogExecSetSeparatingOff, NULL, NULL,
4435  "off", "turns <off> all separation", FALSE, NULL) );
4436  SCIP_CALL( SCIPaddDialogEntry(scip, emphasismenu, dialog) );
4437  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4438  }
4439 
4440  /* set timing */
4441  if( !SCIPdialogHasEntry(setmenu, "timing") )
4442  {
4443  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4444  NULL, SCIPdialogExecMenu, NULL, NULL,
4445  "timing", "change parameters for timing issues", TRUE, NULL) );
4446  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
4447  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4448  }
4449 
4450  /* set vbc */
4451  if( !SCIPdialogHasEntry(setmenu, "vbc") )
4452  {
4453  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4454  NULL,
4455  SCIPdialogExecMenu, NULL, NULL,
4456  "vbc", "change parameters for VBC tool output", TRUE, NULL) );
4457  SCIP_CALL( SCIPaddDialogEntry(scip, setmenu, submenu) );
4458  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4459  }
4460 
4461  /* set emphasis */
4462  SCIP_CALL( createEmphasisSubmenu(scip, setmenu, &submenu) );
4463 
4464  /* get SCIP's parameters */
4465  params = SCIPgetParams(scip);
4466  nparams = SCIPgetNParams(scip);
4467 
4468  /* insert each parameter into the set menu */
4469  for( i = 0; i < nparams; ++i )
4470  {
4471  const char* pname;
4472 
4473  pname = SCIPparamGetName(params[i]);
4474  SCIP_ALLOC( BMSduplicateMemoryArray(&paramname, pname, strlen(pname)+1) );
4475  SCIP_CALL( addSetParamDialog(scip, setmenu, params[i], paramname) );
4476  BMSfreeMemoryArray(&paramname);
4477  }
4478 
4479  /* set emphasis feasibility */
4480  /* add "counter" dialog to "set/emphasis" sub menu */
4481  if( !SCIPdialogHasEntry(submenu, "counter") )
4482  {
4483  SCIP_CALL( SCIPincludeDialog(scip, &dialog, NULL, SCIPdialogExecSetEmphasisCounter, NULL, NULL,
4484  "counter", "predefined parameter settings for a \"feasible\" and \"fast\" counting process", FALSE, NULL) );
4485  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4486  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4487  }
4488 
4489  /* add "cpsolver" dialog to "set/emphasis" sub menu */
4490  if( !SCIPdialogHasEntry(submenu, "cpsolver") )
4491  {
4492  SCIP_CALL( SCIPincludeDialog(scip, &dialog, NULL, SCIPdialogExecSetEmphasisCpsolver, NULL, NULL,
4493  "cpsolver", "predefined parameter settings for CP like search", FALSE, NULL) );
4494  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4495  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4496  }
4497 
4498  /* add "easycip" dialog to "set/emphasis" sub menu */
4499  if( !SCIPdialogHasEntry(submenu, "easycip") )
4500  {
4501  SCIP_CALL( SCIPincludeDialog(scip, &dialog, NULL, SCIPdialogExecSetEmphasisEasycip, NULL, NULL,
4502  "easycip", "predefined parameter settings for easy problems", FALSE, NULL) );
4503  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4504  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4505  }
4506 
4507  /* add "feasibility" dialog to "set/emphasis" sub menu */
4508  if( !SCIPdialogHasEntry(submenu, "feasibility") )
4509  {
4510  SCIP_CALL( SCIPincludeDialog(scip, &dialog, NULL, SCIPdialogExecSetEmphasisFeasibility, NULL, NULL,
4511  "feasibility", "predefined parameter settings for feasibility problems", FALSE, NULL) );
4512  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4513  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4514  }
4515 
4516  /* add "hardlp" dialog to "set/emphasis" sub menu */
4517  if( !SCIPdialogHasEntry(submenu, "hardlp") )
4518  {
4519  SCIP_CALL( SCIPincludeDialog(scip, &dialog, NULL, SCIPdialogExecSetEmphasisHardlp, NULL, NULL,
4520  "hardlp", "predefined parameter settings for problems with a hard LP", FALSE, NULL) );
4521  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4522  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4523  }
4524 
4525  /* add "optimality" dialog to "set/emphasis" sub menu */
4526  if( !SCIPdialogHasEntry(submenu, "optimality") )
4527  {
4528  SCIP_CALL( SCIPincludeDialog(scip, &dialog, NULL, SCIPdialogExecSetEmphasisOptimality, NULL, NULL,
4529  "optimality", "predefined parameter settings for proving optimality fast", FALSE, NULL) );
4530  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4531  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4532  }
4533 
4534  return SCIP_OKAY;
4535 }
4536 
4537 /** includes or updates the "fix" menu for each available parameter setting */
4539  SCIP* scip /**< SCIP data structure */
4540  )
4541 {
4542  SCIP_DIALOG* root;
4543  SCIP_DIALOG* fixmenu;
4544  SCIP_DIALOG* submenu;
4545  SCIP_DIALOG* dialog;
4546  SCIP_PARAM** params;
4547  char* paramname;
4548  int nparams;
4549  int i;
4550 
4551  SCIP_BRANCHRULE** branchrules;
4552  SCIP_CONFLICTHDLR** conflicthdlrs;
4553  SCIP_CONSHDLR** conshdlrs;
4554  SCIP_DISP** disps;
4555  SCIP_HEUR** heurs;
4556  SCIP_NLPI** nlpis;
4557  SCIP_NODESEL** nodesels;
4558  SCIP_PRESOL** presols;
4559  SCIP_PRICER** pricers;
4560  SCIP_READER** readers;
4561  SCIP_SEPA** sepas;
4562  int nbranchrules;
4563  int nconflicthdlrs;
4564  int nconshdlrs;
4565  int ndisps;
4566  int nheurs;
4567  int nnlpis;
4568  int nnodesels;
4569  int npresols;
4570  int npricers;
4571  int nreaders;
4572  int nsepas;
4573 
4574  /* get root dialog */
4575  root = SCIPgetRootDialog(scip);
4576  if( root == NULL )
4577  {
4578  SCIPerrorMessage("root dialog not found\n");
4579  return SCIP_PLUGINNOTFOUND;
4580  }
4581 
4582  /* find (or create) the "fix" menu of the root dialog */
4583  if( !SCIPdialogHasEntry(root, "fix") )
4584  {
4585  SCIP_CALL( SCIPincludeDialog(scip, &fixmenu,
4586  NULL, SCIPdialogExecMenu, NULL, NULL,
4587  "fix", "fix/unfix parameters", TRUE, NULL) );
4588  SCIP_CALL( SCIPaddDialogEntry(scip, root, fixmenu) );
4589  SCIP_CALL( SCIPreleaseDialog(scip, &fixmenu) );
4590  }
4591  if( SCIPdialogFindEntry(root, "fix", &fixmenu) != 1 )
4592  {
4593  SCIPerrorMessage("fix sub menu not found\n");
4594  return SCIP_PLUGINNOTFOUND;
4595  }
4596 
4597  /* fix branching */
4598  if( !SCIPdialogHasEntry(fixmenu, "branching") )
4599  {
4600  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4601  NULL,
4602  SCIPdialogExecMenu, NULL, NULL,
4603  "branching", "fix parameters for branching rules", TRUE, NULL) );
4604  SCIP_CALL( SCIPaddDialogEntry(scip, fixmenu, submenu) );
4605  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4606  }
4607  if( SCIPdialogFindEntry(fixmenu, "branching", &submenu) != 1 )
4608  {
4609  SCIPerrorMessage("branching sub menu not found\n");
4610  return SCIP_PLUGINNOTFOUND;
4611  }
4612 
4613  nbranchrules = SCIPgetNBranchrules(scip);
4614  branchrules = SCIPgetBranchrules(scip);
4615 
4616  for( i = 0; i < nbranchrules; ++i )
4617  {
4618  if( !SCIPdialogHasEntry(submenu, SCIPbranchruleGetName(branchrules[i])) )
4619  {
4620  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4621  NULL,
4622  SCIPdialogExecMenu, NULL, NULL,
4623  SCIPbranchruleGetName(branchrules[i]), SCIPbranchruleGetDesc(branchrules[i]), TRUE, NULL) );
4624  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4625  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4626  }
4627  }
4628 
4629  /* fix conflict */
4630  if( !SCIPdialogHasEntry(fixmenu, "conflict") )
4631  {
4632  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4633  NULL,
4634  SCIPdialogExecMenu, NULL, NULL,
4635  "conflict", "fix parameters for conflict handlers", TRUE, NULL) );
4636  SCIP_CALL( SCIPaddDialogEntry(scip, fixmenu, submenu) );
4637  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4638  }
4639  if( SCIPdialogFindEntry(fixmenu, "conflict", &submenu) != 1 )
4640  {
4641  SCIPerrorMessage("conflict sub menu not found\n");
4642  return SCIP_PLUGINNOTFOUND;
4643  }
4644 
4645  nconflicthdlrs = SCIPgetNConflicthdlrs(scip);
4646  conflicthdlrs = SCIPgetConflicthdlrs(scip);
4647 
4648  for( i = 0; i < nconflicthdlrs; ++i )
4649  {
4650  if( !SCIPdialogHasEntry(submenu, SCIPconflicthdlrGetName(conflicthdlrs[i])) )
4651  {
4652  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4653  NULL,
4654  SCIPdialogExecMenu, NULL, NULL,
4655  SCIPconflicthdlrGetName(conflicthdlrs[i]), SCIPconflicthdlrGetDesc(conflicthdlrs[i]), TRUE, NULL) );
4656  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4657  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4658  }
4659  }
4660 
4661  /* fix constraints */
4662  if( !SCIPdialogHasEntry(fixmenu, "constraints") )
4663  {
4664  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4665  NULL,
4666  SCIPdialogExecMenu, NULL, NULL,
4667  "constraints", "fix parameters for constraint handlers", TRUE, NULL) );
4668  SCIP_CALL( SCIPaddDialogEntry(scip, fixmenu, submenu) );
4669  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4670  }
4671  if( SCIPdialogFindEntry(fixmenu, "constraints", &submenu) != 1 )
4672  {
4673  SCIPerrorMessage("constraints sub menu not found\n");
4674  return SCIP_PLUGINNOTFOUND;
4675  }
4676 
4677  nconshdlrs = SCIPgetNConshdlrs(scip);
4678  conshdlrs = SCIPgetConshdlrs(scip);
4679 
4680  for( i = 0; i < nconshdlrs; ++i )
4681  {
4682  if( !SCIPdialogHasEntry(submenu, SCIPconshdlrGetName(conshdlrs[i])) )
4683  {
4684  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4685  NULL,
4686  SCIPdialogExecMenu, NULL, NULL,
4687  SCIPconshdlrGetName(conshdlrs[i]), SCIPconshdlrGetDesc(conshdlrs[i]), TRUE, NULL) );
4688  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4689  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4690  }
4691  }
4692 
4693  /* fix display */
4694  if( !SCIPdialogHasEntry(fixmenu, "display") )
4695  {
4696  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4697  NULL,
4698  SCIPdialogExecMenu, NULL, NULL,
4699  "display", "fix parameters for display columns", TRUE, NULL) );
4700  SCIP_CALL( SCIPaddDialogEntry(scip, fixmenu, submenu) );
4701  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4702  }
4703  if( SCIPdialogFindEntry(fixmenu, "display", &submenu) != 1 )
4704  {
4705  SCIPerrorMessage("display sub menu not found\n");
4706  return SCIP_PLUGINNOTFOUND;
4707  }
4708 
4709  ndisps = SCIPgetNDisps(scip);
4710  disps = SCIPgetDisps(scip);
4711 
4712  for( i = 0; i < ndisps; ++i )
4713  {
4714  if( !SCIPdialogHasEntry(submenu, SCIPdispGetName(disps[i])) )
4715  {
4716  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4717  NULL,
4718  SCIPdialogExecMenu, NULL, NULL,
4719  SCIPdispGetName(disps[i]), SCIPdispGetDesc(disps[i]), TRUE, NULL) );
4720  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4721  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4722  }
4723  }
4724 
4725  /* fix heuristics */
4726  if( !SCIPdialogHasEntry(fixmenu, "heuristics") )
4727  {
4728  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4729  NULL,
4730  SCIPdialogExecMenu, NULL, NULL,
4731  "heuristics", "fix parameters for primal heuristics", TRUE, NULL) );
4732  SCIP_CALL( SCIPaddDialogEntry(scip, fixmenu, submenu) );
4733  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4734  }
4735  if( SCIPdialogFindEntry(fixmenu, "heuristics", &submenu) != 1 )
4736  {
4737  SCIPerrorMessage("heuristics sub menu not found\n");
4738  return SCIP_PLUGINNOTFOUND;
4739  }
4740 
4741  nheurs = SCIPgetNHeurs(scip);
4742  heurs = SCIPgetHeurs(scip);
4743 
4744  for( i = 0; i < nheurs; ++i )
4745  {
4746  if( !SCIPdialogHasEntry(submenu, SCIPheurGetName(heurs[i])) )
4747  {
4748  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4749  NULL,
4750  SCIPdialogExecMenu, NULL, NULL,
4751  SCIPheurGetName(heurs[i]), SCIPheurGetDesc(heurs[i]), TRUE, NULL) );
4752  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4753  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4754  }
4755  }
4756 
4757  /* fix limits */
4758  if( !SCIPdialogHasEntry(fixmenu, "limits") )
4759  {
4760  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4761  NULL,
4762  SCIPdialogExecMenu, NULL, NULL,
4763  "limits", "fix parameters for time, memory, objective value, and other limits", TRUE, NULL) );
4764  SCIP_CALL( SCIPaddDialogEntry(scip, fixmenu, submenu) );
4765 
4766  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4767  }
4768 
4769  /* fix LP */
4770  if( !SCIPdialogHasEntry(fixmenu, "lp") )
4771  {
4772  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4773  NULL,
4774  SCIPdialogExecMenu, NULL, NULL,
4775  "lp", "fix parameters for linear programming relaxations", TRUE, NULL) );
4776  SCIP_CALL( SCIPaddDialogEntry(scip, fixmenu, submenu) );
4777  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4778  }
4779 
4780  /* fix NLP */
4781  if( !SCIPdialogHasEntry(fixmenu, "nlp") )
4782  {
4783  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4784  NULL,
4785  SCIPdialogExecMenu, NULL, NULL,
4786  "nlp", "fix parameters for nonlinear programming relaxations", TRUE, NULL) );
4787  SCIP_CALL( SCIPaddDialogEntry(scip, fixmenu, submenu) );
4788  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4789  }
4790 
4791  /* fix memory */
4792  if( !SCIPdialogHasEntry(fixmenu, "memory") )
4793  {
4794  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4795  NULL,
4796  SCIPdialogExecMenu, NULL, NULL,
4797  "memory", "fix parameters for memory management", TRUE, NULL) );
4798  SCIP_CALL( SCIPaddDialogEntry(scip, fixmenu, submenu) );
4799  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4800  }
4801 
4802  /* fix misc */
4803  if( !SCIPdialogHasEntry(fixmenu, "misc") )
4804  {
4805  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4806  NULL,
4807  SCIPdialogExecMenu, NULL, NULL,
4808  "misc", "fix parameters for miscellaneous stuff", TRUE, NULL) );
4809  SCIP_CALL( SCIPaddDialogEntry(scip, fixmenu, submenu) );
4810  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4811  }
4812 
4813  /* fix nlpi */
4814  if( !SCIPdialogHasEntry(fixmenu, "nlpi") )
4815  {
4816  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4817  NULL,
4818  SCIPdialogExecMenu, NULL, NULL,
4819  "nlpi", "fix parameters for NLP solver interfaces", TRUE, NULL) );
4820  SCIP_CALL( SCIPaddDialogEntry(scip, fixmenu, submenu) );
4821  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4822  }
4823  if( SCIPdialogFindEntry(fixmenu, "nlpi", &submenu) != 1 )
4824  {
4825  SCIPerrorMessage("nlpi sub menu not found\n");
4826  return SCIP_PLUGINNOTFOUND;
4827  }
4828 
4829  nnlpis = SCIPgetNNlpis(scip);
4830  nlpis = SCIPgetNlpis(scip);
4831 
4832  for( i = 0; i < nnlpis; ++i )
4833  {
4834  if( !SCIPdialogHasEntry(submenu, SCIPnlpiGetName(nlpis[i])) )
4835  {
4836  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4837  NULL,
4838  SCIPdialogExecMenu, NULL, NULL,
4839  SCIPnlpiGetName(nlpis[i]), SCIPnlpiGetDesc(nlpis[i]), TRUE, NULL) );
4840  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4841  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4842  }
4843  }
4844 
4845  /* fix nodeselection */
4846  if( !SCIPdialogHasEntry(fixmenu, "nodeselection") )
4847  {
4848  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4849  NULL,
4850  SCIPdialogExecMenu, NULL, NULL,
4851  "nodeselection", "fix parameters for node selectors", TRUE, NULL) );
4852  SCIP_CALL( SCIPaddDialogEntry(scip, fixmenu, submenu) );
4853  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4854  }
4855  if( SCIPdialogFindEntry(fixmenu, "nodeselection", &submenu) != 1 )
4856  {
4857  SCIPerrorMessage("nodeselection sub menu not found\n");
4858  return SCIP_PLUGINNOTFOUND;
4859  }
4860 
4861  nnodesels = SCIPgetNNodesels(scip);
4862  nodesels = SCIPgetNodesels(scip);
4863 
4864  for( i = 0; i < nnodesels; ++i )
4865  {
4866  if( !SCIPdialogHasEntry(submenu, SCIPnodeselGetName(nodesels[i])) )
4867  {
4868  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4869  NULL,
4870  SCIPdialogExecMenu, NULL, NULL,
4871  SCIPnodeselGetName(nodesels[i]), SCIPnodeselGetDesc(nodesels[i]), TRUE, NULL) );
4872  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4873  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4874  }
4875  }
4876 
4877  /* fix numerics */
4878  if( !SCIPdialogHasEntry(fixmenu, "numerics") )
4879  {
4880  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4881  NULL,
4882  SCIPdialogExecMenu, NULL, NULL,
4883  "numerics", "fix parameters for numerical values", TRUE, NULL) );
4884  SCIP_CALL( SCIPaddDialogEntry(scip, fixmenu, submenu) );
4885  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4886  }
4887 
4888  /* fix presolving */
4889  if( !SCIPdialogHasEntry(fixmenu, "presolving") )
4890  {
4891  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4892  NULL,
4893  SCIPdialogExecMenu, NULL, NULL,
4894  "presolving", "fix parameters for presolving", TRUE, NULL) );
4895  SCIP_CALL( SCIPaddDialogEntry(scip, fixmenu, submenu) );
4896  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4897  }
4898  if( SCIPdialogFindEntry(fixmenu, "presolving", &submenu) != 1 )
4899  {
4900  SCIPerrorMessage("presolving sub menu not found\n");
4901  return SCIP_PLUGINNOTFOUND;
4902  }
4903 
4904  npresols = SCIPgetNPresols(scip);
4905  presols = SCIPgetPresols(scip);
4906 
4907  for( i = 0; i < npresols; ++i )
4908  {
4909  if( !SCIPdialogHasEntry(submenu, SCIPpresolGetName(presols[i])) )
4910  {
4911  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4912  NULL, SCIPdialogExecMenu, NULL, NULL,
4913  SCIPpresolGetName(presols[i]), SCIPpresolGetDesc(presols[i]), TRUE, NULL) );
4914  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4915  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4916  }
4917  }
4918 
4919  /* fix pricing */
4920  if( !SCIPdialogHasEntry(fixmenu, "pricing") )
4921  {
4922  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4923  NULL,
4924  SCIPdialogExecMenu, NULL, NULL,
4925  "pricing", "fix parameters for pricing variables", TRUE, NULL) );
4926  SCIP_CALL( SCIPaddDialogEntry(scip, fixmenu, submenu) );
4927  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4928  }
4929  if( SCIPdialogFindEntry(fixmenu, "pricing", &submenu) != 1 )
4930  {
4931  SCIPerrorMessage("pricing sub menu not found\n");
4932  return SCIP_PLUGINNOTFOUND;
4933  }
4934 
4935  npricers = SCIPgetNPricers(scip);
4936  pricers = SCIPgetPricers(scip);
4937 
4938  for( i = 0; i < npricers; ++i )
4939  {
4940  if( !SCIPdialogHasEntry(submenu, SCIPpricerGetName(pricers[i])) )
4941  {
4942  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4943  NULL,
4944  SCIPdialogExecMenu, NULL, NULL,
4945  SCIPpricerGetName(pricers[i]), SCIPpricerGetDesc(pricers[i]), TRUE, NULL) );
4946  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4947  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4948  }
4949  }
4950 
4951  /* fix propagation */
4952  if( !SCIPdialogHasEntry(fixmenu, "propagating") )
4953  {
4954  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4955  NULL,
4956  SCIPdialogExecMenu, NULL, NULL,
4957  "propagating", "fix parameters for constraint propagation", TRUE, NULL) );
4958  SCIP_CALL( SCIPaddDialogEntry(scip, fixmenu, submenu) );
4959  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4960  }
4961 
4962  /* fix reading */
4963  if( !SCIPdialogHasEntry(fixmenu, "reading") )
4964  {
4965  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4966  NULL,
4967  SCIPdialogExecMenu, NULL, NULL,
4968  "reading", "fix parameters for problem file readers", TRUE, NULL) );
4969  SCIP_CALL( SCIPaddDialogEntry(scip, fixmenu, submenu) );
4970  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
4971  }
4972  if( SCIPdialogFindEntry(fixmenu, "reading", &submenu) != 1 )
4973  {
4974  SCIPerrorMessage("reading sub menu not found\n");
4975  return SCIP_PLUGINNOTFOUND;
4976  }
4977 
4978  nreaders = SCIPgetNReaders(scip);
4979  readers = SCIPgetReaders(scip);
4980 
4981  for( i = 0; i < nreaders; ++i )
4982  {
4983  if( !SCIPdialogHasEntry(submenu, SCIPreaderGetName(readers[i])) )
4984  {
4985  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
4986  NULL,
4987  SCIPdialogExecMenu, NULL, NULL,
4988  SCIPreaderGetName(readers[i]), SCIPreaderGetDesc(readers[i]), TRUE, NULL) );
4989  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
4990  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
4991  }
4992  }
4993 
4994  /* fix separating */
4995  if( !SCIPdialogHasEntry(fixmenu, "separating") )
4996  {
4997  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
4998  NULL, SCIPdialogExecMenu, NULL, NULL,
4999  "separating", "fix parameters for cut separators", TRUE, NULL) );
5000  SCIP_CALL( SCIPaddDialogEntry(scip, fixmenu, submenu) );
5001  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
5002  }
5003  if( SCIPdialogFindEntry(fixmenu, "separating", &submenu) != 1 )
5004  {
5005  SCIPerrorMessage("separating sub menu not found\n");
5006  return SCIP_PLUGINNOTFOUND;
5007  }
5008 
5009  nsepas = SCIPgetNSepas(scip);
5010  sepas = SCIPgetSepas(scip);
5011 
5012  for( i = 0; i < nsepas; ++i )
5013  {
5014  if( !SCIPdialogHasEntry(submenu, SCIPsepaGetName(sepas[i])) )
5015  {
5016  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
5017  NULL, SCIPdialogExecMenu, NULL, NULL,
5018  SCIPsepaGetName(sepas[i]), SCIPsepaGetDesc(sepas[i]), TRUE, NULL) );
5019  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
5020  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
5021  }
5022  }
5023 
5024  /* fix timing */
5025  if( !SCIPdialogHasEntry(fixmenu, "timing") )
5026  {
5027  SCIP_CALL( SCIPincludeDialog(scip, &submenu,
5028  NULL, SCIPdialogExecMenu, NULL, NULL,
5029  "timing", "fix parameters for timing issues", TRUE, NULL) );
5030  SCIP_CALL( SCIPaddDialogEntry(scip, fixmenu, submenu) );
5031  SCIP_CALL( SCIPreleaseDialog(scip, &submenu) );
5032  }
5033 
5034  /* get SCIP's parameters */
5035  params = SCIPgetParams(scip);
5036  nparams = SCIPgetNParams(scip);
5037 
5038  /* insert each parameter into the fix menu */
5039  for( i = 0; i < nparams; ++i )
5040  {
5041  const char* pname;
5042 
5043  pname = SCIPparamGetName(params[i]);
5044  SCIP_ALLOC( BMSduplicateMemoryArray(&paramname, pname, strlen(pname)+1) );
5045  SCIP_CALL( addFixParamDialog(scip, fixmenu, params[i], paramname) );
5046  BMSfreeMemoryArray(&paramname);
5047  }
5048 
5049  return SCIP_OKAY;
5050 }
5051