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