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