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