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