GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
dialog_gcg.c
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the program and library */
4/* GCG --- Generic Column Generation */
5/* a Dantzig-Wolfe decomposition based extension */
6/* of the branch-cut-and-price framework */
7/* SCIP --- Solving Constraint Integer Programs */
8/* */
9/* Copyright (C) 2010-2026 Operations Research, RWTH Aachen University */
10/* Zuse Institute Berlin (ZIB) */
11/* */
12/* Licensed under the Apache License, Version 2.0 (the "License"); */
13/* you may not use this file except in compliance with the License. */
14/* You may obtain a copy of the License at */
15/* */
16/* http://www.apache.org/licenses/LICENSE-2.0 */
17/* */
18/* Unless required by applicable law or agreed to in writing, software */
19/* distributed under the License is distributed on an "AS IS" BASIS, */
20/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
21/* See the License for the specific language governing permissions and */
22/* limitations under the License. */
23/* */
24/* You should have received a copy of the Apache-2.0 license */
25/* along with GCG; see the file LICENSE. If not visit gcg.or.rwth-aachen.de.*/
26/* */
27/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
28
29/**@file dialog_gcg.c
30 * @brief GCG user interface dialog
31 * @author Tobias Achterberg
32 * @author Timo Berthold
33 * @author Gerald Gamrath
34 * @author Martin Bergner
35 * @author Christian Puchert
36 */
37
38/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
39
40#include <sys/stat.h>
41#include <assert.h>
42#include <string.h>
43
44#include "scip/pub_dialog.h"
45#include "scip/type_dialog.h"
46#include "scip/dialog_default.h"
47
48#include "gcg/gcg.h"
49
50#include "gcg/dialog_gcg.h"
51#include "gcg/relax_gcg.h"
52#include "gcg/pricer_gcg.h"
53#include "gcg/cons_decomp.h"
54#include "gcg/pub_gcgheur.h"
55#include "gcg/pub_gcgsepa.h"
56#include "gcg/stat.h"
57#include "gcg/reader_tex.h"
58#include "gcg/reader_gp.h"
59#include "gcg/params_visu.h"
60#include "gcg/dialog_explore.h"
61
62#if defined(_WIN32) || defined(_WIN64)
63#include <direct.h>
64#endif
65
66/** display the reader information
67 */
68static
70 SCIP* scip, /**< SCIP data structure */
71 SCIP_Bool reader, /**< display reader which can read */
72 SCIP_Bool writer /**< display reader which can write */
73 )
74{
75 SCIP_READER** readers;
76 int nreaders;
77 int r;
78
79 assert( scip != NULL );
80
81 readers = SCIPgetReaders(scip);
82 nreaders = SCIPgetNReaders(scip);
83
84 /* display list of readers */
86 SCIPdialogMessage(scip, NULL, " file reader extension description\n");
87 SCIPdialogMessage(scip, NULL, " ----------- --------- -----------\n");
88 for( r = 0; r < nreaders; ++r )
89 {
90 if( (reader && SCIPreaderCanRead(readers[r])) || (writer && SCIPreaderCanWrite(readers[r])) )
91 {
92 SCIPdialogMessage(scip, NULL, " %-20s ", SCIPreaderGetName(readers[r]));
93 if( strlen(SCIPreaderGetName(readers[r])) > 20 )
94 SCIPdialogMessage(scip, NULL, "\n %20s ", "-->");
98 }
99 }
101}
102
103
104/** writes out all decompositions currently known to cons_decomp
105 * @returns SCIP return code */
106static
108 GCG* gcg, /**< GCG data structure */
109 SCIP_DIALOG* dialog, /**< dialog menu */
110 SCIP_DIALOGHDLR* dialoghdlr, /**< dialog handler */
111 SCIP_DIALOG** nextdialog, /**< pointer to store next dialog to execute */
112 SCIP_Bool original, /**< should decomps for original problem be written */
113 SCIP_Bool presolved /**< should decomps for presolved problem be written */
114
115 )
116{
117 char extension[SCIP_MAXSTRLEN];
118 char dirname[SCIP_MAXSTRLEN];
119 char* tmp;
120 SCIP_Bool endoffile;
121 SCIP* scip;
122
124
126 {
127 SCIPdialogMessage(scip, NULL, "No decomposition to write, please read or detect one first.\n");
128 SCIPdialoghdlrClearBuffer(dialoghdlr);
129 *nextdialog = NULL;
130 return SCIP_OKAY;
131 }
132
133 SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter directory: ", &tmp, &endoffile) );
134
135
136 if( endoffile )
137 {
138 *nextdialog = NULL;
139 return SCIP_OKAY;
140 }
141
142 SCIPdebugMessage("dirname: %s\n", tmp);
143
144 snprintf(dirname, sizeof(dirname), "%s", tmp);
145 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, tmp, TRUE) );
146
147 /* if no directory is specified, initialize it with a standard solution */
148 if( dirname[0] == '\0' )
149 {
150 strcpy(dirname, ".");
151 }
152
153 SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter extension: ", &tmp, &endoffile) );
154 snprintf(extension, sizeof(extension), "%s", tmp);
155
156 if( extension[0] != '\0' )
157 {
159
160 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, extension, TRUE) );
161
162 retcode = GCGwriteAllDecomps(gcg, dirname, extension, original, presolved);
163
165 {
166 SCIPdialogMessage(scip, NULL, "error creating files\n");
167 SCIPdialoghdlrClearBuffer(dialoghdlr);
168 }
169 else if( retcode == SCIP_WRITEERROR )
170 {
171 SCIPdialogMessage(scip, NULL, "error writing files\n");
172 SCIPdialoghdlrClearBuffer(dialoghdlr);
173 }
174 else if( retcode == SCIP_PLUGINNOTFOUND )
175 {
176 SCIPdialogMessage(scip, NULL, "The chosen output format (%s) is unknown.\n", extension);
177 SCIPdialogMessage(scip, NULL, "The following readers are available for writing:\n");
179 }
180 else
181 {
182 /* check for unexpected errors */
184
185 /* print result message if writing was successful */
186 SCIPdialogMessage(scip, NULL, "All decompositions were written (directory: %s, format: %s).\n",
187 dirname, extension);
188 }
189 }
190
191 return SCIP_OKAY;
192}
193
194
195/** writes out all decompositions currently known to cons_decomp */
196static
198 GCG* gcg, /**< GCG data structure */
199 SCIP_DIALOG* dialog, /**< dialog menu */
200 SCIP_DIALOGHDLR* dialoghdlr, /**< dialog handler */
201 SCIP_DIALOG** nextdialog /**< pointer to store next dialog to execute */
202 )
203{
204 SCIP* scip;
205 char extension[SCIP_MAXSTRLEN];
206 char dirname[SCIP_MAXSTRLEN];
207 char* tmp;
208 SCIP_Bool endoffile;
209
211
213 {
214 SCIPdialogMessage(scip, NULL, "No decomposition to write, please read or detect one first.\n");
215 SCIPdialoghdlrClearBuffer(dialoghdlr);
216 *nextdialog = NULL;
217 return SCIP_OKAY;
218 }
219
220 SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter directory: ", &tmp, &endoffile) );
221
222 if( endoffile )
223 {
224 *nextdialog = NULL;
225 return SCIP_OKAY;
226 }
227
228 SCIPdebugMessage("dirname: %s\n", tmp);
229
230 snprintf(dirname, sizeof(dirname), "%s", tmp);
231 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, tmp, TRUE) );
232
233 /* if no directory is specified, initialize it with a standard solution */
234 if( dirname[0] == '\0' )
235 {
236 strcpy(dirname, ".");
237 }
238
239 SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter extension: ", &tmp, &endoffile) );
240 snprintf(extension, sizeof(extension), "%s", tmp);
241
242 if( extension[0] != '\0' )
243 {
245
246 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, extension, TRUE) );
247
248 retcode = GCGwriteSelectedDecomps(gcg, dirname, extension);
249
251 {
252 SCIPdialogMessage(scip, NULL, "error creating files\n");
253 SCIPdialoghdlrClearBuffer(dialoghdlr);
254 }
255 else if( retcode == SCIP_WRITEERROR )
256 {
257 SCIPdialogMessage(scip, NULL, "error writing files\n");
258 SCIPdialoghdlrClearBuffer(dialoghdlr);
259 }
260 else if( retcode == SCIP_PLUGINNOTFOUND )
261 {
262 SCIPdialogMessage(scip, NULL, "The chosen output format (%s) is unknown.\n", extension);
263 SCIPdialogMessage(scip, NULL, "The following readers are available for writing:\n");
265 }
266 else
267 {
268 /* check for unexpected errors */
270
271 /* print result message if writing was successful */
272 SCIPdialogMessage(scip, NULL, "All selected decompositions were written (directory: %s, format: %s).\n",
273 dirname, extension);
274 }
275 }
276
277 return SCIP_OKAY;
278}
279
280
281/** writes a block matrix to the location specified by the user
282 * @returns SCIP return code */
283static
285 GCG* gcg, /**< GCG data structure */
286 SCIP_DIALOG* dialog, /**< dialog menu */
287 SCIP_DIALOGHDLR* dialoghdlr, /**< dialog handler */
288 SCIP_DIALOG** nextdialog, /**< pointer to store next dialog to execute */
289 SCIP_Bool originalmatrix /**< should the original (or transformed) matrix be written */
290 )
291{
292 SCIP_Bool endoffile;
294 char* probname;
295 char* tmpstring;
296 const char* extension = "gp";
297 char dirname[SCIP_MAXSTRLEN];
298 char probnamepath[SCIP_MAXSTRLEN];
299 char filename[SCIP_MAXSTRLEN];
300 char outname[SCIP_MAXSTRLEN];
302
303 /* create the file path */
304 SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog,"Enter directory for output (e.g. ../path/to/directory):\n",
305 &tmpstring, &endoffile) );
306 if( endoffile )
307 {
308 *nextdialog = NULL;
309 return SCIP_OKAY;
310 }
311
312 snprintf(dirname, sizeof(dirname), "%s", tmpstring);
313 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, dirname, TRUE) );
314
315 /* if no directory is specified, initialize it with a standard solution */
316 if( dirname[0] == '\0' )
317 {
318 strcpy(dirname, ".");
319 }
320
321 (void) SCIPsnprintf(probnamepath, SCIP_MAXSTRLEN, "%s", SCIPgetProbName(scip));
322 SCIPsplitFilename(probnamepath, NULL, &probname, NULL, NULL);
323 (void) SCIPsnprintf(filename, SCIP_MAXSTRLEN, "matrix-%s", probname);
324
325 /* make sure there are no dots in the pure filename */
326 for(size_t i = 0; i < strlen(filename); i++)
327 {
328 if(filename[i] == '.')
329 filename[i] = '-';
330 }
331
332 (void) SCIPsnprintf(outname, SCIP_MAXSTRLEN, "%s/%s.%s", dirname, filename, extension);
333
334 /* call the creation of the matrix visualization */
335 retcode = GCGWriteGpDecompMatrix(gcg, outname, dirname, originalmatrix );
336
338 {
339 SCIPdialogMessage(scip, NULL, "error creating file\n");
340 SCIPdialoghdlrClearBuffer(dialoghdlr);
341 }
342 else if( retcode == SCIP_WRITEERROR )
343 {
344 SCIPdialogMessage(scip, NULL, "error writing file\n");
345 SCIPdialoghdlrClearBuffer(dialoghdlr);
346 }
347 else
348 {
349 /* check for unexpected errors */
351
352 /* print result message if writing was successful */
354 "Matrix file is written to %s. \n ", outname);
355 }
356
357 return SCIP_OKAY;
358}
359
360
361/** writes out visualizations and statistics of all decompositions currently known to cons_decomp to a PDF file
362 * @returns SCIP return code */
363static
365 GCG* gcg, /**< GCG data structure */
366 SCIP_DIALOG* dialog, /**< dialog menu */
367 SCIP_DIALOGHDLR* dialoghdlr, /**< dialog handler */
368 SCIP_DIALOG** nextdialog /**< pointer to store next dialog to execute */
369 )
370{
371 SCIP* scip;
372 FILE* file;
373 SCIP_Bool endoffile;
374 char* pname;
375 char dirname[SCIP_MAXSTRLEN];
376 char* tmpstring;
377 const char* nameinfix = "report_";
378 const char* extension = "tex";
379 char ppath[SCIP_MAXSTRLEN];
380 char outname[SCIP_MAXSTRLEN];
381 int* decids;
382 int ndecs;
383 int ndecswritten;
384
387 ndecswritten = ndecs;
388
389 if( ndecs == 0 )
390 {
391 SCIPdialogMessage(scip, NULL, "No decomposition to write, please read or detect one first.\n");
392 SCIPdialoghdlrClearBuffer(dialoghdlr);
393 *nextdialog = NULL;
394 return SCIP_OKAY;
395 }
396
397 /* get a directory to write to */
398 SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter a directory: ", &tmpstring, &endoffile) );
399 if( endoffile )
400 {
401 *nextdialog = NULL;
402 return SCIP_OKAY;
403 }
404
405 snprintf(dirname, sizeof(dirname), "%s", tmpstring);
406 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, dirname, TRUE) );
407
408 /* if no directory is specified, initialize it with a standard solution */
409 if( dirname[0] == '\0' )
410 {
411 strcpy(dirname, ".");
412 }
413
414 /* create a name for the new file */
416 SCIPsplitFilename(ppath, NULL, &pname, NULL, NULL);
417
418 (void) SCIPsnprintf(outname, SCIP_MAXSTRLEN, "%s/%s%s.%s", dirname, nameinfix, pname, extension);
419
420 /* create output file and write report */
421 file = fopen(outname, "w");
422 if( file == NULL )
423 {
424 SCIPdialogMessage(scip, NULL, "error creating report file\n");
425 SCIPdialoghdlrClearBuffer(dialoghdlr);
426 }
427 else
428 {
429 /* get finished partial decomps */
430 SCIPallocBlockMemoryArray(scip, &decids, ndecs);
434 fclose(file);
435
436 SCIPfreeBlockMemoryArray(scip, &decids, ndecs);
437
438 /* print result message if writing was successful */
440 "Report on %d decompositions is written to file '%s'.\nFor compilation read the README in the same folder.\n", ndecswritten, outname);
441 }
442 return SCIP_OKAY;
443}
444
445/** dialog execution method for the display statistics command */
446SCIP_DECL_DIALOGEXEC(GCGdialogExecDisplayStatistics)
447{ /*lint --e{715}*/
449 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
450
452
453 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
454
455 return SCIP_OKAY;
456}
457
458
459/** dialog execution method print complete detection information */
460SCIP_DECL_DIALOGEXEC(GCGdialogExecPrintDetectionInformation)
461{ /*lint --e{715}*/
463 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
464
466
467 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
468
469 return SCIP_OKAY;
470}
471
472
473/** dialog execution method for adding block number candidate */
474SCIP_DECL_DIALOGEXEC(GCGdialogExecChangeAddBlocknr)
475{ /*lint --e{715}*/
476 char* blocknrchar;
477 char* token;
478 int blocknr;
479 char tempstr[SCIP_MAXSTRLEN];
480 SCIP_Bool endoffile;
481
482 tempstr[0] = '\0';
483
484 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
485
486 (void) SCIPsnprintf(tempstr, SCIP_MAXSTRLEN, "Please type the block number candidates you want to add (as white space separated list): ");
487 SCIP_CALL( SCIPdialoghdlrGetLine(dialoghdlr, dialog, (char*)tempstr, &blocknrchar, &endoffile) );
488
489 token = strtok(blocknrchar, " ");
490
491 while( token )
492 {
493 blocknr = atoi( token );
494 if ( blocknr == 0 )
495 {
497 "%s is not a compatible number; no new block number candidate added. \n", token);
498 return SCIP_OKAY;
499 }
500
502 token = strtok(NULL, " ");
503 }
504
505 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
506
507 return SCIP_OKAY;
508}
509
510/** dialog execution method for the display decomposition command */
511SCIP_DECL_DIALOGEXEC(GCGdialogExecDisplayDecomposition)
512{ /*lint --e{715}*/
513 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
514
516 SCIPdialogMessage(scip, NULL, "no problem exists\n");
519 else
521
522 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
523
524 return SCIP_OKAY;
525}
526
527/** dialog execution method for the display block number candidates */
528SCIP_DECL_DIALOGEXEC(GCGdialogExecDisplayNBlockcandidates)
529{ /*lint --e{715}*/
531 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
532
534
535 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
536
537 return SCIP_OKAY;
538}
539
540
541/** dialog execution method for the display additionalstatistics command */
542SCIP_DECL_DIALOGEXEC(GCGdialogExecDisplayAdditionalStatistics)
543{ /*lint --e{715}*/
544
545 GCG_DECOMP* bestdecomp;
548
549 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
551 {
553 {
554 SCIPmessageFPrintInfo(SCIPgetMessagehdlr(scip), NULL, "No Dantzig-Wolfe reformulation applied. No decomposition statistics available.\n");
555 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
556 return SCIP_OKAY;
557 }
558
559 SCIPmessageFPrintInfo(SCIPgetMessagehdlr(scip), NULL, "\nAdditional statistics:\n");
560 bestdecomp = GCGgetBestDecomp(gcg, FALSE);
561 if( GCGdecompGetType(bestdecomp) == GCG_DECTYPE_DIAGONAL )
562 {
565
566 }
567 else
568 {
573 }
574 GCGdecompFree(gcg, &bestdecomp);
575 }
576 else
577 {
578 SCIPdialogMessage(scip, NULL, "Problem needs to solved first for additional statistics");
579 }
580 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
581
582 return SCIP_OKAY;
583}
584
585/** dialog execution method for the display detectors command */
586SCIP_DECL_DIALOGEXEC(GCGdialogExecDisplayDetectors)
587{ /*lint --e{715}*/
588 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
589
590 /* display list of detectors */
594
595 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
596
597 return SCIP_OKAY;
598}
599
600/** dialog execution method for the display constraint classifiers command */
601SCIP_DECL_DIALOGEXEC(GCGdialogExecDisplayConsClassifiers)
602{
603 GCG_CONSCLASSIFIER** consclss;
604 int nconsclss;
605 int i;
606 GCG* gcg;
607
608 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
609
613
614 /* display list of consclassifiers */
616 SCIPdialogMessage(scip, NULL, " consclassifier priority enabled description\n");
617 SCIPdialogMessage(scip, NULL, " -------------- -------- ------- -----------\n");
618
619 for( i = 0; i < nconsclss; ++i )
620 {
621 SCIPdialogMessage(scip, NULL, " %-20s ", GCGconsClassifierGetName(consclss[i]));
622 if( strlen(GCGconsClassifierGetName(consclss[i])) > 20 )
623 SCIPdialogMessage(scip, NULL, "\n %20s ", "-->");
625 SCIPdialogMessage(scip, NULL, "%7s ", GCGconsClassifierIsEnabled(consclss[i]) ? "TRUE" : "FALSE");
628 }
630
631 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
632
633 return SCIP_OKAY;
634}
635
636/** dialog execution method for the display variable classifiers command */
637SCIP_DECL_DIALOGEXEC(GCGdialogExecDisplayVarClassifiers)
638{
639 GCG_VARCLASSIFIER** varclss;
640 int nvarclss;
641 int i;
642 GCG* gcg;
643
644 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
645
649
650 /* display list of varclassifiers */
652 SCIPdialogMessage(scip, NULL, " varclassifier priority enabled description\n");
653 SCIPdialogMessage(scip, NULL, " -------------- -------- ------- -----------\n");
654
655 for( i = 0; i < nvarclss; ++i )
656 {
657 SCIPdialogMessage(scip, NULL, " %-20s ", GCGvarClassifierGetName(varclss[i]));
658 if( strlen(GCGvarClassifierGetName(varclss[i])) > 20 )
659 SCIPdialogMessage(scip, NULL, "\n %20s ", "-->");
661 SCIPdialogMessage(scip, NULL, "%7s ", GCGvarClassifierIsEnabled(varclss[i]) ? "TRUE" : "FALSE");
664 }
666
667 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
668
669 return SCIP_OKAY;
670}
671
672/** dialog execution method for the display scores command */
673SCIP_DECL_DIALOGEXEC(GCGdialogExecDisplayScores)
674{
675 GCG* gcg;
676 GCG_SCORE** scores;
677 int nscores;
678 int i;
679
680 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
681
683 scores = GCGgetScores(gcg);
684 nscores = GCGgetNScores(gcg);
685
686 /* display list of scores */
688 SCIPdialogMessage(scip, NULL, " score shortname description\n");
689 SCIPdialogMessage(scip, NULL, " ---------- --------- -----------\n");
690 for( i = 0; i < nscores; ++i )
691 {
692 SCIPdialogMessage(scip, NULL, " %-20s ", GCGscoreGetName(scores[i]));
693 if( strlen(GCGscoreGetName(scores[i])) > 20 )
694 SCIPdialogMessage(scip, NULL, "\n %20s ", "-->");
696 SCIPdialogMessage(scip, NULL, "%s", GCGscoreGetDesc(scores[i]));
698 }
700
701 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
702
703 return SCIP_OKAY;
704}
705
706/** dialog execution method for the display solvers command */
707SCIP_DECL_DIALOGEXEC(GCGdialogExecDisplaySolvers)
708{ /*lint --e{715}*/
710 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
711
714
715 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
716
717 return SCIP_OKAY;
718}
719
720/** dialog execution method for the master command */
721SCIP_DECL_DIALOGEXEC(GCGdialogExecSetMaster)
722{ /*lint --e{715}*/
725 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
726
728 {
729 SCIPverbMessage(scip, SCIP_VERBLEVEL_DIALOG, NULL, "switching to the master problem shell is only possible before the solving process is started\n");
730
731 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
732
733 return SCIP_OKAY;
734 }
735
736 SCIPverbMessage(scip, SCIP_VERBLEVEL_DIALOG, NULL, "switching to the master problem...\n");
738 SCIPverbMessage(scip, SCIP_VERBLEVEL_DIALOG, NULL, "back in the original problem...\n");
739
740 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
741
742 return SCIP_OKAY;
743}
744
745/** dialog execution method for the set loadmaster command */
746SCIP_DECL_DIALOGEXEC(GCGdialogExecSetLoadmaster)
747{ /*lint --e{715}*/
749 char* filename;
750 SCIP_Bool endoffile;
752
755
756 SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter filename: ", &filename, &endoffile) );
757 if( endoffile )
758 {
759 *nextdialog = NULL;
760 return SCIP_OKAY;
761 }
762
763 if( filename[0] != '\0' )
764 {
765 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, filename, TRUE) );
766
767 if( SCIPfileExists(filename) )
768 {
769 SCIP_CALL( SCIPreadParams(masterprob, filename) );
770 SCIPdialogMessage(scip, NULL, "loaded master parameter file <%s>\n", filename);
771 }
772 else
773 {
774 SCIPdialogMessage(scip, NULL, "file <%s> not found\n", filename);
775 SCIPdialoghdlrClearBuffer(dialoghdlr);
776 }
777 }
778
779 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
780
781 return SCIP_OKAY;
782}
783
784/** dialog execution method for the transform command */
785SCIP_DECL_DIALOGEXEC(GCGdialogExecTransform)
786{ /*lint --e{715}*/
788 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
789
791 switch( SCIPgetStage(scip) )
792 {
793 case SCIP_STAGE_INIT:
794 SCIPdialogMessage(scip, NULL, "no problem exists\n");
795 break;
796
799 break;
800
802 SCIPdialogMessage(scip, NULL, "problem is already transformed\n");
803 break;
804
815 case SCIP_STAGE_FREE:
816 default:
817 SCIPerrorMessage("invalid SCIP stage\n");
818 return SCIP_INVALIDCALL;
819 }
821
822 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
823
824 return SCIP_OKAY;
825}
826
827
828/** dialog execution method for the presolve command */
829SCIP_DECL_DIALOGEXEC(GCGdialogExecPresolve)
830{ /*lint --e{715}*/
832 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
833
835 switch( SCIPgetStage(scip) )
836 {
837 case SCIP_STAGE_INIT:
838 SCIPdialogMessage(scip, NULL, "no problem exists\n");
839 break;
840
845 break;
846
849 SCIPdialogMessage(scip, NULL, "problem is already presolved\n");
850 break;
851
853 SCIPdialogMessage(scip, NULL, "problem is already solved\n");
854 break;
855
862 case SCIP_STAGE_FREE:
863 default:
864 SCIPerrorMessage("invalid SCIP stage\n");
865 return SCIP_INVALIDCALL;
866 }
868
869 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
870
871 return SCIP_OKAY;
872}
873
874
875/** dialog execution method for the detect command */
876SCIP_DECL_DIALOGEXEC(GCGdialogExecDetect)
877{ /*lint --e{715}*/
879 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
880
882 switch( SCIPgetStage(scip) )
883 {
884 case SCIP_STAGE_INIT:
885 SCIPdialogMessage(scip, NULL, "no problem exists\n");
886 break;
887
893 break;
894
903 case SCIP_STAGE_FREE:
904 default:
905 SCIPerrorMessage("invalid SCIP stage\n");
906 return SCIP_INVALIDCALL;
907 }
909
910 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
911
912 return SCIP_OKAY;
913}
914
915
916/** dialog execution method for the displaying and selecting decompositions command */
917SCIP_DECL_DIALOGEXEC(GCGdialogExecSelect)
918{ /*lint --e{715}*/
919 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
920
921 SCIP_CALL( GCGdialogExecExplore(GCGorigGetGcg(scip), dialoghdlr, dialog ) );
922
924
925 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
926
927 return SCIP_OKAY;
928}
929
930
931/** dialog execution method for the optimize command */
932SCIP_DECL_DIALOGEXEC(GCGdialogExecOptimize)
933{ /*lint --e{715}*/
935 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
936
938 switch( SCIPgetStage(scip) )
939 {
940 case SCIP_STAGE_INIT:
941 SCIPdialogMessage(scip, NULL, "no problem exists\n");
942 break;
943
950 break;
951
953 SCIPdialogMessage(scip, NULL, "problem is already solved\n");
954 break;
955
962 case SCIP_STAGE_FREE:
963 default:
964 SCIPerrorMessage("invalid SCIP stage\n");
965 return SCIP_INVALIDCALL;
966 }
968
969 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
970
971 return SCIP_OKAY;
972}
973
974
975/** dialog execution method for writing all known decompositions */
976static
977SCIP_DECL_DIALOGEXEC(GCGdialogExecWriteAllDecompositions)
978{
979 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
980
982 {
983 SCIP_CALL( writeAllDecompositions(GCGorigGetGcg(scip), dialog, dialoghdlr, nextdialog, TRUE, TRUE) );
984 }
985 else
986 SCIPdialogMessage(scip, NULL, "no problem available\n");
987
988 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
989
990 return SCIP_OKAY;
991}
992
993
994/** dialog execution method for writing selected decompositions */
995static
996SCIP_DECL_DIALOGEXEC(GCGdialogExecWriteSelectedDecompositions)
997{
998 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
999
1001 {
1002 SCIP_CALL( writeSelectedDecompositions(GCGorigGetGcg(scip), dialog, dialoghdlr, nextdialog ) );
1003 }
1004 else
1005 SCIPdialogMessage(scip, NULL, "no problem available\n");
1006
1007 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1008
1009 return SCIP_OKAY;
1010}
1011
1012
1013/** dialog execution method for writing the original matrix */
1014static
1015SCIP_DECL_DIALOGEXEC(GCGdialogExecWriteOrigMatrix)
1016{
1018 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1019
1021 {
1022 SCIP_CALL( writeMatrix(gcg, dialog, dialoghdlr, nextdialog, TRUE) );
1023 }
1024 else
1025 SCIPdialogMessage(scip, NULL, "No problem available.\n");
1026
1027 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1028
1029 return SCIP_OKAY;
1030}
1031
1032/** dialog execution method for writing the transformed matrix */
1033static
1034SCIP_DECL_DIALOGEXEC(GCGdialogExecWriteTransMatrix)
1035{
1037 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1038
1040 {
1041 SCIP_CALL( writeMatrix(gcg, dialog, dialoghdlr, nextdialog, FALSE) );
1042 }
1043 else
1044 SCIPdialogMessage(scip, NULL, "No transformed problem available.\n");
1045
1046 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1047
1048 return SCIP_OKAY;
1049}
1050
1051
1052
1053/** dialog execution method for reporting all known decompositions in a PDF file */
1054static
1055SCIP_DECL_DIALOGEXEC(GCGdialogExecReportAllDecompositions)
1056{
1057 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1058
1060 {
1061 SCIP_CALL( reportAllDecompositions(GCGorigGetGcg(scip), dialog, dialoghdlr, nextdialog) );
1062 }
1063 else
1064 SCIPdialogMessage(scip, NULL, "no problem available\n");
1065
1066 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1067
1068 return SCIP_OKAY;
1069}
1070
1071/** dialog execution method for writing problem statistics */
1072static
1073SCIP_DECL_DIALOGEXEC(GCGdialogExecWriteStatistics)
1074{
1075 char* filename;
1076 SCIP_Bool endoffile;
1078
1079 SCIPdialogMessage(scip, NULL, "\n");
1080
1081 SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, "enter filename: ", &filename, &endoffile) );
1082 if( endoffile )
1083 {
1084 *nextdialog = NULL;
1085 return SCIP_OKAY;
1086 }
1087 if( filename[0] != '\0' )
1088 {
1089 FILE* file;
1090
1091 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, filename, TRUE) );
1092
1093 file = fopen(filename, "w");
1094 if( file == NULL )
1095 {
1096 SCIPdialogMessage(scip, NULL, "error creating file <%s>\n", filename);
1097 SCIPprintSysError(filename);
1098 SCIPdialoghdlrClearBuffer(dialoghdlr);
1099 }
1100 else
1101 {
1104 if( retcode != SCIP_OKAY )
1105 {
1106 fclose(file);
1107 SCIP_CALL( retcode );
1108 }
1109 else
1110 {
1111 SCIPdialogMessage(scip, NULL, "written statistics to file <%s>\n", filename);
1112 fclose(file);
1113 }
1114 }
1115 }
1116
1117 SCIPdialogMessage(scip, NULL, "\n");
1118
1119 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1120
1121 return SCIP_OKAY;
1122}
1123/** dialog execution method for the set detectors aggressive command */
1124SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetDetectorsAggressive)
1125{ /*lint --e{715}*/
1126 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1127
1128 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1129
1131
1132 return SCIP_OKAY;
1133}
1134
1135/** dialog execution method for the set detectors default command */
1136SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetDetectorsDefault)
1137{ /*lint --e{715}*/
1138 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1139
1140 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1141
1143
1144 return SCIP_OKAY;
1145}
1146
1147/** dialog execution method for the set detectors off command */
1148SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetDetectorsOff)
1149{ /*lint --e{715}*/
1150 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1151
1152 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1153
1155
1156 return SCIP_OKAY;
1157}
1158
1159/** dialog execution method for the set detectors fast command */
1160SCIP_DECL_DIALOGEXEC(SCIPdialogExecSetDetectorsFast)
1161{ /*lint --e{715}*/
1162 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1163
1164 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1165
1167
1168 return SCIP_OKAY;
1169}
1170
1171/** dialog execution method for the set heuristics aggressive command */
1172SCIP_DECL_DIALOGEXEC(GCGdialogExecSetHeuristicsAggressive)
1173{ /*lint --e{715}*/
1174 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1175
1176 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1177
1180
1181 return SCIP_OKAY;
1182}
1183
1184/** dialog execution method for the set heuristics off command */
1185SCIP_DECL_DIALOGEXEC(GCGdialogExecSetHeuristicsOff)
1186{ /*lint --e{715}*/
1187 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1188
1189 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1190
1193
1194 return SCIP_OKAY;
1195}
1196
1197/** dialog execution method for the set heuristics fast command */
1198SCIP_DECL_DIALOGEXEC(GCGdialogExecSetHeuristicsFast)
1199{ /*lint --e{715}*/
1200 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1201
1202 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1203
1206
1207 return SCIP_OKAY;
1208}
1209
1210/** dialog execution method for the set gcg separators default command */
1211SCIP_DECL_DIALOGEXEC(GCGdialogExecSetSeparatorsDefault)
1212{ /*lint --e{715}*/
1213 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1214
1215 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1216
1218
1219 return SCIP_OKAY;
1220}
1221
1222/** dialog execution method for the set gcg separators aggressive command */
1223SCIP_DECL_DIALOGEXEC(GCGdialogExecSetSeparatorsAggressive)
1224{ /*lint --e{715}*/
1225 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1226
1227 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1228
1230
1231 return SCIP_OKAY;
1232}
1233
1234/** dialog execution method for the set gcg separators off command */
1235SCIP_DECL_DIALOGEXEC(GCGdialogExecSetSeparatorsOff)
1236{ /*lint --e{715}*/
1237 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1238
1239 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1240
1242
1243 return SCIP_OKAY;
1244}
1245
1246/** dialog execution method for the set gcg separators fast command */
1247SCIP_DECL_DIALOGEXEC(GCGdialogExecSetSeparatorsFast)
1248{ /*lint --e{715}*/
1249 SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) );
1250
1251 *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
1252
1254
1255 return SCIP_OKAY;
1256}
1257
1258/** creates a root dialog
1259 * @returns SCIP return code */
1260static
1262 SCIP* scip, /**< SCIP data structure */
1263 SCIP_DIALOG** root /**< pointer to store the root dialog */
1264 )
1265{
1266 SCIP_CALL( SCIPincludeDialog(scip, root, NULL, SCIPdialogExecMenuLazy, NULL, NULL,
1267 "GCG", "GCG's main menu", TRUE, NULL) );
1268
1269 SCIP_CALL( SCIPsetRootDialog(scip, *root) );
1271 *root = SCIPgetRootDialog(scip);
1272
1273 return SCIP_OKAY;
1274}
1275
1276/** create an "emphasis" sub menu
1277 * @returns SCIP return code */
1278static
1280 SCIP* scip, /**< SCIP data structure */
1281 SCIP_DIALOG* root, /**< the menu to add the empty sub menu */
1282 SCIP_DIALOG** submenu /**< pointer to store the created emphasis sub menu */
1283 )
1284{
1285 if( !SCIPdialogHasEntry(root, "emphasis") )
1286 {
1288 NULL, SCIPdialogExecMenu, NULL, NULL,
1289 "emphasis", "predefined parameter settings", TRUE, NULL) );
1290 SCIP_CALL( SCIPaddDialogEntry(scip, root, *submenu) );
1291 SCIP_CALL( SCIPreleaseDialog(scip, submenu) );
1292 }
1293 else if( SCIPdialogFindEntry(root, "emphasis", submenu) != 1 )
1294 {
1295 SCIPerrorMessage("emphasis sub menu not found\n");
1296 return SCIP_PLUGINNOTFOUND;
1297 }
1298
1299 assert(*submenu != NULL);
1300
1301 return SCIP_OKAY;
1302}
1303
1304/** includes or updates the GCG dialog menus in SCIP
1305 * @returns SCIP return code */
1307 GCG* gcg /**< GCG data structure */
1308 )
1309{
1310 SCIP_DIALOG* root;
1311 SCIP_DIALOG* submenu;
1312 SCIP_DIALOG* dialog;
1313 SCIP_DIALOG* setmenu;
1314 SCIP_DIALOG* emphasismenu;
1315 SCIP_DIALOG* classimenu;
1316 SCIP_DIALOG* blocknrmenu;
1317 SCIP* origprob;
1318
1320
1321 /* root menu */
1323 if( root == NULL )
1324 {
1326 }
1327
1328 /* display */
1329 if( !SCIPdialogHasEntry(root, "display") )
1330 {
1331 SCIP_CALL( SCIPincludeDialog(origprob, &submenu, NULL, SCIPdialogExecMenu, NULL, NULL,
1332 "display", "display information", TRUE, NULL) );
1333 SCIP_CALL( SCIPaddDialogEntry(origprob, root, submenu) );
1334 SCIP_CALL( SCIPreleaseDialog(origprob, &submenu) );
1335 }
1336 if( SCIPdialogFindEntry(root, "display", &submenu) != 1 )
1337 {
1338 SCIPerrorMessage("display sub menu not found\n");
1339 return SCIP_PLUGINNOTFOUND;
1340 }
1341
1342 /* display statistics */
1343 if( !SCIPdialogHasEntry(submenu, "statistics") )
1344 {
1345 SCIP_CALL( SCIPincludeDialog(origprob, &dialog, NULL, GCGdialogExecDisplayStatistics, NULL, NULL,
1346 "statistics", "display problem and optimization statistics", FALSE, NULL) );
1347 SCIP_CALL( SCIPaddDialogEntry(origprob, submenu, dialog) );
1349 }
1350 /* display statistics */
1351 if( !SCIPdialogHasEntry(submenu, "detectionstatistics") )
1352 {
1353 SCIP_CALL( SCIPincludeDialog(origprob, &dialog, NULL, GCGdialogExecPrintDetectionInformation, NULL, NULL,
1354 "detectionstatistics", "display complete detection information", FALSE, NULL) );
1355 SCIP_CALL( SCIPaddDialogEntry(origprob, submenu, dialog) );
1357 }
1358
1359 /* display decomposition */
1360 if( !SCIPdialogHasEntry(submenu, "decomposition") )
1361 {
1362 SCIP_CALL( SCIPincludeDialog(origprob, &dialog, NULL, GCGdialogExecDisplayDecomposition, NULL, NULL,
1363 "decomposition", "display decomposition", FALSE, NULL) );
1364 SCIP_CALL( SCIPaddDialogEntry(origprob, submenu, dialog) );
1366 }
1367
1368 /* display nblockcandidates */
1369 if( !SCIPdialogHasEntry(submenu, "blocknumbercandidates") )
1370 {
1371 SCIP_CALL( SCIPincludeDialog(origprob, &dialog, NULL, GCGdialogExecDisplayNBlockcandidates, NULL, NULL,
1372 "blocknumbercandidates", "display number of blocks candidates ", FALSE, NULL) );
1373 SCIP_CALL( SCIPaddDialogEntry(origprob, submenu, dialog) );
1375 }
1376
1377 /* display additionalstatistics */
1378 if( !SCIPdialogHasEntry(submenu, "additionalstatistics") )
1379 {
1380 SCIP_CALL( SCIPincludeDialog(origprob, &dialog, NULL, GCGdialogExecDisplayAdditionalStatistics, NULL, NULL,
1381 "additionalstatistics", "display additional solving statistics", FALSE, NULL) );
1382 SCIP_CALL( SCIPaddDialogEntry(origprob, submenu, dialog) );
1384 }
1385
1386 /* display scores */
1387 if( !SCIPdialogHasEntry(submenu, "scores") )
1388 {
1389 SCIP_CALL( SCIPincludeDialog(origprob, &dialog, NULL, GCGdialogExecDisplayScores, NULL, NULL,
1390 "scores", "display scores", FALSE, NULL) );
1391 SCIP_CALL( SCIPaddDialogEntry(origprob, submenu, dialog) );
1393 }
1394
1395 /* display detectors */
1396 if( !SCIPdialogHasEntry(submenu, "detectors") )
1397 {
1398 SCIP_CALL( SCIPincludeDialog(origprob, &dialog, NULL, GCGdialogExecDisplayDetectors, NULL, NULL,
1399 "detectors", "display detectors", FALSE, NULL) );
1400 SCIP_CALL( SCIPaddDialogEntry(origprob, submenu, dialog) );
1402 }
1403
1404 /* display consclassifiers */
1405 if( !SCIPdialogHasEntry(submenu, "consclassifiers") )
1406 {
1407 SCIP_CALL( SCIPincludeDialog(origprob, &dialog, NULL, GCGdialogExecDisplayConsClassifiers, NULL, NULL,
1408 "consclassifiers", "display constraint classifiers", FALSE, NULL) );
1409 SCIP_CALL( SCIPaddDialogEntry(origprob, submenu, dialog) );
1411 }
1412
1413 /* display varclassifiers */
1414 if( !SCIPdialogHasEntry(submenu, "varclassifiers") )
1415 {
1416 SCIP_CALL( SCIPincludeDialog(origprob, &dialog, NULL, GCGdialogExecDisplayVarClassifiers, NULL, NULL,
1417 "varclassifiers", "display variable classifiers", FALSE, NULL) );
1418 SCIP_CALL( SCIPaddDialogEntry(origprob, submenu, dialog) );
1420 }
1421
1422 /* display solvers */
1423 if( !SCIPdialogHasEntry(submenu, "solvers") )
1424 {
1425 SCIP_CALL( SCIPincludeDialog(origprob, &dialog, NULL, GCGdialogExecDisplaySolvers, NULL, NULL,
1426 "solvers", "display available pricing problem solvers", FALSE, NULL) );
1427 SCIP_CALL( SCIPaddDialogEntry(origprob, submenu, dialog) );
1429 }
1430
1431 /* master */
1432 if( !SCIPdialogHasEntry(root, "master") )
1433 {
1434 SCIP_CALL( SCIPincludeDialog(origprob, &dialog, NULL, GCGdialogExecSetMaster, NULL, NULL,
1435 "master", "switch to the interactive shell of the master problem", FALSE, NULL) );
1436 SCIP_CALL( SCIPaddDialogEntry(origprob, root, dialog) );
1438 }
1439
1440 /* transform */
1441 if( !SCIPdialogHasEntry(root, "transform") )
1442 {
1444 NULL,
1445 GCGdialogExecTransform, NULL, NULL,
1446 "transform", "transform the problem", FALSE, NULL) );
1447 SCIP_CALL( SCIPaddDialogEntry(origprob, root, dialog) );
1449 }
1450
1451 /* presolve */
1452 if( !SCIPdialogHasEntry(root, "presolve") )
1453 {
1455 NULL,
1456 GCGdialogExecPresolve, NULL, NULL,
1457 "presolve", "presolve the problem", FALSE, NULL) );
1458 SCIP_CALL( SCIPaddDialogEntry(origprob, root, dialog) );
1460 }
1461
1462 /* optimize */
1463 if( !SCIPdialogHasEntry(root, "optimize") )
1464 {
1466 NULL,
1467 GCGdialogExecOptimize, NULL, NULL,
1468 "optimize", "solve the problem", FALSE, NULL) );
1469 SCIP_CALL( SCIPaddDialogEntry(origprob, root, dialog) );
1471 }
1472
1473 /* explore */
1474 if( !SCIPdialogHasEntry(root, "explore") )
1475 {
1477 NULL,
1478 GCGdialogExecSelect, NULL, NULL,
1479 "explore", "explore decompositions", FALSE, NULL) );
1480 SCIP_CALL( SCIPaddDialogEntry(origprob, root, submenu) );
1481 SCIP_CALL( SCIPreleaseDialog(origprob, &submenu) );
1482 }
1483
1484 /* detect */
1485 if( !SCIPdialogHasEntry(root, "detect") )
1486 {
1487 SCIP_CALL( SCIPincludeDialog(origprob, &dialog, NULL, GCGdialogExecDetect, NULL, NULL,
1488 "detect", "detect structure", FALSE, NULL) );
1489 SCIP_CALL( SCIPaddDialogEntry(origprob, root, dialog) );
1491 }
1492
1493 /* quit */
1494 if( !SCIPdialogHasEntry(root, "quit") )
1495 {
1497 NULL,
1498 SCIPdialogExecQuit, NULL, NULL,
1499 "quit", "leave GCG", FALSE, NULL) );
1500 SCIP_CALL( SCIPaddDialogEntry(origprob, root, dialog) );
1502 }
1503
1504 /* set */
1505 if( !SCIPdialogHasEntry(root, "set") )
1506 {
1508 NULL, SCIPdialogExecMenu, NULL, NULL,
1509 "set", "load/save/change parameters", TRUE, NULL) );
1510 SCIP_CALL( SCIPaddDialogEntry(origprob, root, submenu) );
1511 SCIP_CALL( SCIPreleaseDialog(origprob, &submenu) );
1512 }
1513 if( SCIPdialogFindEntry(root, "set", &setmenu) != 1 )
1514 {
1515 SCIPerrorMessage("set sub menu not found\n");
1516 return SCIP_PLUGINNOTFOUND;
1517 }
1518
1519 /* set loadmaster */
1520 if( !SCIPdialogHasEntry(setmenu, "loadmaster") )
1521 {
1523 NULL,
1524 GCGdialogExecSetLoadmaster, NULL, NULL,
1525 "loadmaster", "load parameter settings for master problem from a file", FALSE, NULL) );
1526 SCIP_CALL( SCIPaddDialogEntry(origprob, setmenu, dialog) );
1528 }
1529
1530 /* set detectors */
1531 if( !SCIPdialogHasEntry(setmenu, "detection") )
1532 {
1534 NULL,
1535 SCIPdialogExecMenu, NULL, NULL,
1536 "detection", "change parameters for detection in general", TRUE, NULL) );
1537 SCIP_CALL( SCIPaddDialogEntry(origprob, setmenu, submenu) );
1538 SCIP_CALL( SCIPreleaseDialog(origprob, &submenu) );
1539 }
1540 if( SCIPdialogFindEntry(setmenu, "detection", &submenu) != 1 )
1541 {
1542 SCIPerrorMessage("detection sub menu not found\n");
1543 return SCIP_PLUGINNOTFOUND;
1544 }
1545
1546 if( !SCIPdialogHasEntry(submenu, "classification") )
1547 {
1548 SCIP_CALL( SCIPincludeDialog(origprob, &classimenu,
1549 NULL, SCIPdialogExecMenu, NULL, NULL,
1550 "classification", "classification settings", TRUE, NULL) );
1551 SCIP_CALL( SCIPaddDialogEntry(origprob, submenu, classimenu) );
1552 SCIP_CALL( SCIPreleaseDialog(origprob, &classimenu) );
1553 }
1554 else if( SCIPdialogFindEntry(submenu, "classification", &classimenu) != 1 )
1555 {
1556 SCIPerrorMessage("classification sub menu not found\n");
1557 return SCIP_PLUGINNOTFOUND;
1558 }
1559
1560 if( !SCIPdialogHasEntry(submenu, "blocknrcandidates") )
1561 {
1562 SCIP_CALL( SCIPincludeDialog(origprob, &blocknrmenu,
1563 NULL, SCIPdialogExecMenu, NULL, NULL,
1564 "blocknrcandidates", "set block number and related parameter", TRUE, NULL) );
1565 SCIP_CALL( SCIPaddDialogEntry(origprob, submenu, blocknrmenu) );
1566 SCIP_CALL( SCIPreleaseDialog(origprob, &blocknrmenu) );
1567 }
1568 else if( SCIPdialogFindEntry(submenu, "blocknrcandidates", &blocknrmenu) != 1 )
1569 {
1570 SCIPerrorMessage("blocknrcandidates sub menu not found\n");
1571 return SCIP_PLUGINNOTFOUND;
1572 }
1573
1574 /* create set detectors emphasis */
1575 SCIP_CALL( createEmphasisSubmenu(origprob, submenu, &emphasismenu) );
1576 assert(emphasismenu != NULL);
1577
1578 /* set detectors emphasis aggressive */
1579 if( !SCIPdialogHasEntry(emphasismenu, "aggressive") )
1580 {
1582 NULL, SCIPdialogExecSetDetectorsAggressive, NULL, NULL,
1583 "aggressive", "sets detection <aggressive>", FALSE, NULL) );
1584 SCIP_CALL( SCIPaddDialogEntry(origprob, emphasismenu, dialog) );
1586 }
1587
1588 /* set detectors emphasis default */
1589 if( !SCIPdialogHasEntry(emphasismenu, "default") )
1590 {
1592 NULL, SCIPdialogExecSetDetectorsDefault, NULL, NULL,
1593 "default", "sets detection <default>", FALSE, NULL) );
1594 SCIP_CALL( SCIPaddDialogEntry(origprob, emphasismenu, dialog) );
1596 }
1597
1598 /* set detectors emphasis fast */
1599 if( !SCIPdialogHasEntry(emphasismenu, "fast") )
1600 {
1602 NULL, SCIPdialogExecSetDetectorsFast, NULL, NULL,
1603 "fast", "sets detection <fast>", FALSE, NULL) );
1604 SCIP_CALL( SCIPaddDialogEntry(origprob, emphasismenu, dialog) );
1606 }
1607
1608 /* set detectors emphasis off */
1609 if( !SCIPdialogHasEntry(emphasismenu, "off") )
1610 {
1612 NULL, SCIPdialogExecSetDetectorsOff, NULL, NULL,
1613 "off", "turns <off> all detectors", FALSE, NULL) );
1614 SCIP_CALL( SCIPaddDialogEntry(origprob, emphasismenu, dialog) );
1616 }
1617
1618 /* set heuristics */
1619 if( !SCIPdialogHasEntry(setmenu, "heuristics") )
1620 {
1622 NULL,
1623 SCIPdialogExecMenu, NULL, NULL,
1624 "heuristics", "change parameters for primal heuristics", TRUE, NULL) );
1625 SCIP_CALL( SCIPaddDialogEntry(origprob, setmenu, submenu) );
1626 SCIP_CALL( SCIPreleaseDialog(origprob, &submenu) );
1627 }
1628 if( SCIPdialogFindEntry(setmenu, "heuristics", &submenu) != 1 )
1629 {
1630 SCIPerrorMessage("heuristics sub menu not found\n");
1631 return SCIP_PLUGINNOTFOUND;
1632 }
1633
1634 /* create set heuristics emphasis */
1635 SCIP_CALL( createEmphasisSubmenu(origprob, submenu, &emphasismenu) );
1636 assert(emphasismenu != NULL);
1637
1638 /* set heuristics emphasis aggressive */
1639 if( !SCIPdialogHasEntry(emphasismenu, "aggressive") )
1640 {
1642 NULL, GCGdialogExecSetHeuristicsAggressive, NULL, NULL,
1643 "aggressive", "sets heuristics <aggressive>", FALSE, NULL) );
1644 SCIP_CALL( SCIPaddDialogEntry(origprob, emphasismenu, dialog) );
1646 }
1647
1648 /* set heuristics emphasis fast */
1649 if( !SCIPdialogHasEntry(emphasismenu, "fast") )
1650 {
1652 NULL, GCGdialogExecSetHeuristicsFast, NULL, NULL,
1653 "fast", "sets heuristics <fast>", FALSE, NULL) );
1654 SCIP_CALL( SCIPaddDialogEntry(origprob, emphasismenu, dialog) );
1656 }
1657
1658 /* set heuristics emphasis off */
1659 if( !SCIPdialogHasEntry(emphasismenu, "off") )
1660 {
1662 NULL, GCGdialogExecSetHeuristicsOff, NULL, NULL,
1663 "off", "turns <off> all heuristics", FALSE, NULL) );
1664 SCIP_CALL( SCIPaddDialogEntry(origprob, emphasismenu, dialog) );
1666 }
1667
1668 /* set heuristics */
1669 if( !SCIPdialogHasEntry(setmenu, "sepa") )
1670 {
1672 NULL,
1673 SCIPdialogExecMenu, NULL, NULL,
1674 "sepa", "change parameters for gcg separators", TRUE, NULL) );
1675 SCIP_CALL( SCIPaddDialogEntry(origprob, setmenu, submenu) );
1676 SCIP_CALL( SCIPreleaseDialog(origprob, &submenu) );
1677 }
1678 if( SCIPdialogFindEntry(setmenu, "sepa", &submenu) != 1 )
1679 {
1680 SCIPerrorMessage("gcg separators sub menu not found\n");
1681 return SCIP_PLUGINNOTFOUND;
1682 }
1683
1684 /* create set separators emphasis */
1685 SCIP_CALL( createEmphasisSubmenu(origprob, submenu, &emphasismenu) );
1686 assert(emphasismenu != NULL);
1687
1688 /* set separators emphasis default */
1689 if( !SCIPdialogHasEntry(emphasismenu, "default") )
1690 {
1692 NULL, GCGdialogExecSetSeparatorsDefault, NULL, NULL,
1693 "default", "sets separators <default>", FALSE, NULL) );
1694 SCIP_CALL( SCIPaddDialogEntry(origprob, emphasismenu, dialog) );
1696 }
1697
1698 /* set separators emphasis aggressive */
1699 if( !SCIPdialogHasEntry(emphasismenu, "aggressive") )
1700 {
1702 NULL, GCGdialogExecSetSeparatorsAggressive, NULL, NULL,
1703 "aggressive", "sets separators <aggressive>", FALSE, NULL) );
1704 SCIP_CALL( SCIPaddDialogEntry(origprob, emphasismenu, dialog) );
1706 }
1707
1708 /* set separators emphasis fast */
1709 if( !SCIPdialogHasEntry(emphasismenu, "fast") )
1710 {
1712 NULL, GCGdialogExecSetSeparatorsFast, NULL, NULL,
1713 "fast", "sets separators <fast>", FALSE, NULL) );
1714 SCIP_CALL( SCIPaddDialogEntry(origprob, emphasismenu, dialog) );
1716 }
1717
1718 /* set separators emphasis off */
1719 if( !SCIPdialogHasEntry(emphasismenu, "off") )
1720 {
1722 NULL, GCGdialogExecSetSeparatorsOff, NULL, NULL,
1723 "off", "turns <off> all separators", FALSE, NULL) );
1724 SCIP_CALL( SCIPaddDialogEntry(origprob, emphasismenu, dialog) );
1726 }
1727
1728 /* write */
1729 if( !SCIPdialogHasEntry(root, "write") )
1730 {
1731 SCIP_CALL( SCIPincludeDialog(origprob, &submenu, NULL, SCIPdialogExecMenu, NULL, NULL,
1732 "write", "write information to file", TRUE, NULL) );
1733 SCIP_CALL( SCIPaddDialogEntry(origprob, root, submenu) );
1734 SCIP_CALL( SCIPreleaseDialog(origprob, &submenu) );
1735 }
1736 if( SCIPdialogFindEntry(root, "write", &submenu) != 1 )
1737 {
1738 SCIPerrorMessage("write sub menu not found\n");
1739 return SCIP_PLUGINNOTFOUND;
1740 }
1741
1742 /* write alldecompositions */
1743 if( !SCIPdialogHasEntry(submenu, "alldecompositions") )
1744 {
1745 SCIP_CALL( SCIPincludeDialog(origprob, &dialog, NULL, GCGdialogExecWriteAllDecompositions, NULL, NULL,
1746 "alldecompositions",
1747 "write all known decompositions to files (format is given by file extension, e.g. {dec,blk,ref,gp,tex})",
1748 FALSE, NULL) );
1749 SCIP_CALL( SCIPaddDialogEntry(origprob, submenu, dialog) );
1751 }
1752
1753 /* write selecteddecompositions */
1754 if( !SCIPdialogHasEntry(submenu, "selected") )
1755 {
1756 SCIP_CALL( SCIPincludeDialog(origprob, &dialog, NULL, GCGdialogExecWriteSelectedDecompositions, NULL, NULL,
1757 "selected",
1758 "write selected (in \"explore\" submenu) decompositions to files (format is given by file extension, e.g. {dec,blk,ref,gp,tex})",
1759 FALSE, NULL) );
1760 SCIP_CALL( SCIPaddDialogEntry(origprob, submenu, dialog) );
1762 }
1763
1764 /* write orig matrix */
1765 if( !SCIPdialogHasEntry(submenu, "matrix") )
1766 {
1767 SCIP_CALL( SCIPincludeDialog(origprob, &dialog, NULL, GCGdialogExecWriteOrigMatrix, NULL, NULL,
1768 "matrix",
1769 "write gnuplot file showing the nonzero structure of the original matrix",
1770 FALSE, NULL) );
1771 SCIP_CALL( SCIPaddDialogEntry(origprob, submenu, dialog) );
1773 }
1774
1775 /* write orig matrix */
1776 if( !SCIPdialogHasEntry(submenu, "transmatrix") )
1777 {
1778 SCIP_CALL( SCIPincludeDialog(origprob, &dialog, NULL, GCGdialogExecWriteTransMatrix, NULL, NULL,
1779 "transmatrix",
1780 "write gnuplot file showing the nonzero structure of the transformed (presolved) matrix",
1781 FALSE, NULL) );
1782 SCIP_CALL( SCIPaddDialogEntry(origprob, submenu, dialog) );
1784 }
1785
1786 /* write reportdecompositions */
1787 if( !SCIPdialogHasEntry(submenu, "report") )
1788 {
1789 SCIP_CALL( SCIPincludeDialog(origprob, &dialog, NULL, GCGdialogExecReportAllDecompositions, NULL, NULL,
1790 "report",
1791 "write report of all finished decompositions to LaTeX format",
1792 FALSE, NULL) );
1793 SCIP_CALL( SCIPaddDialogEntry(origprob, submenu, dialog) );
1795 }
1796
1797 /* write statistics */
1798 if( !SCIPdialogHasEntry(submenu, "statistics") )
1799 {
1800 SCIP_CALL( SCIPincludeDialog(origprob, &dialog, NULL, GCGdialogExecWriteStatistics, NULL, NULL,
1801 "statistics",
1802 "write statistics to file",
1803 FALSE, NULL) );
1804 SCIP_CALL( SCIPaddDialogEntry(origprob, submenu, dialog) );
1806 }
1807
1808 /* change */
1809 if( !SCIPdialogHasEntry(root, "change") )
1810 {
1812 NULL,
1813 SCIPdialogExecMenu, NULL, NULL,
1814 "change", "change the problem", TRUE, NULL) );
1815 SCIP_CALL( SCIPaddDialogEntry(origprob, root, submenu) );
1816 SCIP_CALL( SCIPreleaseDialog(origprob, &submenu) );
1817 }
1818 if( SCIPdialogFindEntry(root, "change", &submenu) != 1 )
1819 {
1820 SCIPerrorMessage("change sub menu not found\n");
1821 return SCIP_PLUGINNOTFOUND;
1822 }
1823
1824 if( SCIPdialogFindEntry(root, "set", &submenu) != 1 )
1825 {
1826 SCIPerrorMessage("set sub menu not found\n");
1827 return SCIP_PLUGINNOTFOUND;
1828 }
1829 if( SCIPdialogFindEntry(submenu, "detection", &submenu) != 1 )
1830 {
1831 SCIPerrorMessage("set/detection sub menu not found\n");
1832 return SCIP_PLUGINNOTFOUND;
1833 }
1834 if( SCIPdialogFindEntry(submenu, "blocknrcandidates", &blocknrmenu) != 1 )
1835 {
1836 SCIPerrorMessage("set/detection/blocknrcandidates sub menu not found\n");
1837 return SCIP_PLUGINNOTFOUND;
1838 }
1839
1840 /* add blocknr candidate*/
1841 if( !SCIPdialogHasEntry(blocknrmenu, "addblocknr") )
1842 {
1844 NULL,
1845 GCGdialogExecChangeAddBlocknr, NULL, NULL,
1846 "addblocknr", "add block number candidates (as white space separated list)", FALSE, NULL) );
1847 SCIP_CALL( SCIPaddDialogEntry(origprob, blocknrmenu, dialog) );
1849 }
1850
1852
1853 return SCIP_OKAY;
1854}
SCIP_Real * r
int GCGconshdlrDecompGetNVarClassifiers(GCG *gcg)
Gets the number of all variable classifiers.
SCIP_RETCODE GCGwriteAllDecomps(GCG *gcg, char *directory, char *extension, SCIP_Bool original, SCIP_Bool presolved)
write out all known decompositions
SCIP_RETCODE GCGconshdlrDecompSetDetection(GCG *gcg, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
sets detector parameters values
SCIP_RETCODE GCGwriteSelectedDecomps(GCG *gcg, char *directory, char *extension)
writes all selected decompositions
GCG_VARCLASSIFIER ** GCGconshdlrDecompGetVarClassifiers(GCG *gcg)
gets an array of all variable classifier
void GCGconshdlrDecompAddUserCandidatesNBlocks(GCG *gcg, int candidate)
adds a candidate for block size given by the user
GCG_CONSCLASSIFIER ** GCGconshdlrDecompGetConsClassifiers(GCG *gcg)
gets an array of all constraint classifier
SCIP_RETCODE GCGconshdlrDecompGetFinishedPartialdecsList(GCG *gcg, int **idlist, int *listlength)
Gets a list of ids of the current partialdecs that are finished.
int GCGconshdlrDecompGetNConsClassifiers(GCG *gcg)
Gets the number of all constraint classifiers.
void GCGprintListOfDetectors(GCG *gcg)
writes out a list of all detectors
int GCGconshdlrDecompGetNDecomps(GCG *gcg)
gets the number of decompositions (= amount of finished partialdecs)
GCG_DECOMP * GCGgetBestDecomp(GCG *gcg, SCIP_Bool printwarnings)
Gets the best known decomposition.
constraint handler for structure detection
SCIP_RETCODE GCGdecompFree(GCG *gcg, GCG_DECOMP **decdecomp)
Definition decomp.c:541
GCG_DECTYPE GCGdecompGetType(GCG_DECOMP *decomp)
Definition decomp.c:703
#define SCIP_MAXSTRLEN
#define SCIP_Bool
dialog menu for exploring decompositions
GCG_EXPORT SCIP_RETCODE GCGdialogExecExplore(GCG *gcg, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog)
method to handle user input for "explore" command
static SCIP_RETCODE writeAllDecompositions(GCG *gcg, SCIP_DIALOG *dialog, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG **nextdialog, SCIP_Bool original, SCIP_Bool presolved)
Definition dialog_gcg.c:107
static SCIP_RETCODE createEmphasisSubmenu(SCIP *scip, SCIP_DIALOG *root, SCIP_DIALOG **submenu)
static SCIP_RETCODE writeMatrix(GCG *gcg, SCIP_DIALOG *dialog, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG **nextdialog, SCIP_Bool originalmatrix)
Definition dialog_gcg.c:284
static SCIP_RETCODE writeSelectedDecompositions(GCG *gcg, SCIP_DIALOG *dialog, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG **nextdialog)
Definition dialog_gcg.c:197
static void displayReaders(SCIP *scip, SCIP_Bool reader, SCIP_Bool writer)
Definition dialog_gcg.c:69
static SCIP_RETCODE createRootDialog(SCIP *scip, SCIP_DIALOG **root)
static SCIP_RETCODE reportAllDecompositions(GCG *gcg, SCIP_DIALOG *dialog, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG **nextdialog)
Definition dialog_gcg.c:364
SCIP_RETCODE GCGincludeDialogGcg(GCG *gcg)
GCG user interface dialog.
#define TRUE
#define FALSE
GCG interface methods.
SCIP_DECL_DIALOGEXEC(SCIPdialogExecCountPresolve)
SCIP_RETCODE SCIPincludeDialogDefaultBasic(SCIP *scip)
SCIP_Bool SCIPfileExists(const char *filename)
void SCIPsplitFilename(char *filename, char **path, char **name, char **extension, char **compression)
void GCGpricerPrintListOfSolvers(GCG *gcg)
void GCGpricerPrintStatistics(GCG *gcg, FILE *file)
GCG * GCGorigGetGcg(SCIP *origprob)
Definition gcg.cpp:165
GCG_EXPORT SCIP_RETCODE GCGtransformProb(GCG *gcg)
Definition relax_gcg.c:5331
SCIP_RETCODE GCGprintStatistics(GCG *gcg, FILE *file)
Definition misc.c:719
GCG_EXPORT SCIP_RETCODE GCGdetect(GCG *gcg)
Definition relax_gcg.c:5421
SCIP_RETCODE GCGprintBlockcandidateInformation(GCG *gcg, FILE *file)
SCIP * GCGgetOrigprob(GCG *gcg)
Definition gcg.cpp:87
SCIP * GCGgetMasterprob(GCG *gcg)
Definition gcg.cpp:99
GCG_EXPORT SCIP_RETCODE GCGsolve(GCG *gcg)
Definition relax_gcg.c:5480
SCIP_RETCODE GCGprintCompleteDetectionStatistics(GCG *gcg, FILE *file)
Definition misc.c:801
GCG_EXPORT SCIP_RETCODE GCGpresolve(GCG *gcg)
Definition relax_gcg.c:5370
SCIP_STAGE SCIPgetStage(SCIP *scip)
const char * SCIPgetProbName(SCIP *scip)
SCIP_RETCODE SCIPwriteOrigProblem(SCIP *scip, const char *filename, const char *extension, SCIP_Bool genericnames)
SCIP_RETCODE SCIPwriteTransProblem(SCIP *scip, const char *filename, const char *extension, SCIP_Bool genericnames)
SCIP_RETCODE GCGsetHeuristics(GCG *gcg, SCIP_PARAMSETTING paramsetting)
Definition gcgheur.c:153
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
SCIP_MESSAGEHDLR * SCIPgetMessagehdlr(SCIP *scip)
void SCIPdialogMessage(SCIP *scip, FILE *file, const char *formatstr,...)
SCIP_RETCODE SCIPsetHeuristics(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
SCIP_RETCODE SCIPreadParams(SCIP *scip, const char *filename)
const char * GCGconsClassifierGetName(GCG_CONSCLASSIFIER *consClassifier)
Definition clscons.c:67
const char * GCGconsClassifierGetDesc(GCG_CONSCLASSIFIER *consClassifier)
Definition clscons.c:97
SCIP_Bool GCGconsClassifierIsEnabled(GCG_CONSCLASSIFIER *consClassifier)
Definition clscons.c:87
int GCGconsClassifierGetPriority(GCG_CONSCLASSIFIER *consClassifier)
Definition clscons.c:77
void SCIPdialoghdlrClearBuffer(SCIP_DIALOGHDLR *dialoghdlr)
SCIP_RETCODE SCIPreleaseDialog(SCIP *scip, SCIP_DIALOG **dialog)
SCIP_DIALOG * SCIPdialoghdlrGetRoot(SCIP_DIALOGHDLR *dialoghdlr)
SCIP_Bool SCIPdialogHasEntry(SCIP_DIALOG *dialog, const char *entryname)
SCIP_RETCODE SCIPdialoghdlrAddHistory(SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, const char *command, SCIP_Bool escapecommand)
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)
SCIP_RETCODE SCIPaddDialogEntry(SCIP *scip, SCIP_DIALOG *dialog, SCIP_DIALOG *subdialog)
SCIP_RETCODE SCIPdialoghdlrGetWord(SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, const char *prompt, char **inputword, SCIP_Bool *endoffile)
SCIP_RETCODE SCIPsetRootDialog(SCIP *scip, SCIP_DIALOG *dialog)
SCIP_RETCODE SCIPstartInteraction(SCIP *scip)
SCIP_DIALOG * SCIPgetRootDialog(SCIP *scip)
int SCIPdialogFindEntry(SCIP_DIALOG *dialog, const char *entryname, SCIP_DIALOG **subdialog)
SCIP_RETCODE SCIPdialoghdlrGetLine(SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, const char *prompt, char **inputline, SCIP_Bool *endoffile)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
const char * SCIPreaderGetExtension(SCIP_READER *reader)
int SCIPgetNReaders(SCIP *scip)
const char * SCIPreaderGetName(SCIP_READER *reader)
SCIP_Bool SCIPreaderCanRead(SCIP_READER *reader)
SCIP_READER ** SCIPgetReaders(SCIP *scip)
SCIP_Bool SCIPreaderCanWrite(SCIP_READER *reader)
const char * SCIPreaderGetDesc(SCIP_READER *reader)
GCG_EXPORT const char * GCGscoreGetName(GCG_SCORE *score)
Definition score.c:145
GCG_EXPORT int GCGgetNScores(GCG *gcg)
Definition score.c:113
GCG_EXPORT GCG_SCORE ** GCGgetScores(GCG *gcg)
Definition score.c:103
GCG_EXPORT const char * GCGscoreGetDesc(GCG_SCORE *score)
Definition score.c:165
GCG_EXPORT const char * GCGscoreGetShortname(GCG_SCORE *score)
Definition score.c:155
const char * GCGvarClassifierGetName(GCG_VARCLASSIFIER *varClassifier)
Definition clsvar.c:67
const char * GCGvarClassifierGetDesc(GCG_VARCLASSIFIER *varClassifier)
Definition clsvar.c:97
int GCGvarClassifierGetPriority(GCG_VARCLASSIFIER *varClassifier)
Definition clsvar.c:77
SCIP_Bool GCGvarClassifierIsEnabled(GCG_VARCLASSIFIER *varClassifier)
Definition clsvar.c:87
SCIP_RETCODE GCGsetSeparators(GCG *gcg, SCIP_PARAMSETTING paramsetting)
Definition gcgsepa.c:187
int SCIPsnprintf(char *t, int len, const char *s,...)
void SCIPprintSysError(const char *message)
static assert(heur !=NULL)
SCIP_CALL(SCIPgetExternBranchCands(origprob, &lpcands, &lpcandssol, NULL, &nlpcands, NULL, NULL, NULL, NULL))
SCIP * origprob
SCIPdebugMessage("feasibility pump finished [%d iterations done].\n", nloops)
SCIP_RETCODE retcode
int i
#define NULL
void SCIPmessageFPrintInfo(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *formatstr,...)
SCIP_Bool GCGreportGetShowTitlepage(GCG *gcg)
SCIP_Bool GCGreportGetShowStatistics(GCG *gcg)
SCIP_Bool GCGgetUseGp(GCG *gcg)
SCIP_Bool GCGreportGetShowToc(GCG *gcg)
GCG variable pricer.
public methods for GCG heuristics
public methods for GCG separators
#define SCIPerrorMessage
SCIP_RETCODE GCGWriteGpDecompMatrix(GCG *gcg, const char *filename, const char *workfolder, SCIP_Bool originalmatrix)
GP file reader writing decompositions to gnuplot files.
SCIP_RETCODE GCGwriteTexReport(GCG *gcg, FILE *file, int *partialdecids, int *npartialdecs, SCIP_Bool titlepage, SCIP_Bool toc, SCIP_Bool statistics, SCIP_Bool usegp)
parameter settings for visualization readers
GCG relaxator.
SCIP_RETCODE GCGwriteVarCreationDetails(GCG *gcg)
Definition stat.c:126
SCIP_RETCODE GCGwriteDecompositionData(GCG *gcg)
Definition stat.c:51
Prints information about the best decomposition.
struct GCG_ConsClassifier GCG_CONSCLASSIFIER
struct GCG_Decomp GCG_DECOMP
Definition type_decomp.h:45
@ GCG_DECTYPE_DIAGONAL
Definition type_decomp.h:53
struct SCIP_Dialog SCIP_DIALOG
struct SCIP_Dialoghdlr SCIP_DIALOGHDLR
struct Gcg GCG
Definition type_gcg.h:44
SCIP_VERBLEVEL_DIALOG
SCIP_PARAMSETTING_OFF
SCIP_PARAMSETTING_AGGRESSIVE
SCIP_PARAMSETTING_DEFAULT
SCIP_PARAMSETTING_FAST
struct SCIP_Reader SCIP_READER
SCIP_FILECREATEERROR
SCIP_PLUGINNOTFOUND
SCIP_WRITEERROR
SCIP_INVALIDCALL
enum SCIP_Retcode SCIP_RETCODE
struct Scip SCIP
struct GCG_Score GCG_SCORE
Definition type_score.h:45
SCIP_STAGE_PROBLEM
SCIP_STAGE_INITPRESOLVE
SCIP_STAGE_SOLVED
SCIP_STAGE_PRESOLVING
SCIP_STAGE_TRANSFORMED
SCIP_STAGE_INITSOLVE
SCIP_STAGE_EXITPRESOLVE
SCIP_STAGE_EXITSOLVE
SCIP_STAGE_INIT
SCIP_STAGE_FREE
SCIP_STAGE_FREETRANS
SCIP_STAGE_SOLVING
SCIP_STAGE_TRANSFORMING
SCIP_STAGE_PRESOLVED
struct GCG_VarClassifier GCG_VARCLASSIFIER