Scippy

SCIP

Solving Constraint Integer Programs

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