GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
dialog_explore.cpp
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_explore.cpp
30 * @brief dialog menu for exploring decompositions
31 * @author Michael Bastubbe
32 * @author Hanna Franzen
33 * @author Erik Muehmer
34 *
35 * This file contains all dialog calls to build and use the explore menu.
36 * The explore menu gives the user detailed information about all decompositions and a possibility to edit such.
37 */
38
39/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
40
41#include <cassert>
42#include <cstddef>
43#include <cstdlib>
44
45#include <string>
46#include <iostream>
47#include <regex>
48#include <map>
49#include <sstream>
50#include <iomanip>
51#include <functional>
52
54#include "gcg/cons_decomp.h"
55#include "gcg/cons_decomp.hpp"
56#include "gcg/score.h"
57
58/* column headers */
59#define DEFAULT_COLUMN_MIN_WIDTH 4 /**< min width of a column in the menu table */
60#define DEFAULT_SORT_HEADER "score"
61
62#define DEFAULT_MENULENGTH 10 /**< initial number of entries in menu */
63
64/**< default column headers */
65const char* DEFAULT_COLUMNS[] {"nr", "id", "nbloc", "nmacon", "nlivar", "nmavar", "nstlva", "score", "history", "pre", "nopcon", "nopvar", "sel"};
66
67namespace gcg
68{
69
70/** RETTYPE is used to store the return type of a callback function */
72{
73 UNKNOWN, /**< dummy default */
74 INTEGER, /**< integer */
75 REAL, /**< SCIP_Real */
76 BOOLEAN, /**< Boolean */
77 STRING /**< char* */
78};
79
80/** storage for column information */
82{
83public:
84 AbstractColumn(const char* columnHeader, const char* columnDesc, RETTYPE columnType) :
85 header(columnHeader), desc(columnDesc), type(columnType) {}
86
87 virtual ~AbstractColumn() = default;
88
89 virtual int compareValues(PARTIALDECOMP* firstdec, PARTIALDECOMP* seconddec) = 0;
90
91 virtual std::string getValueAsString(PARTIALDECOMP* partialdec) = 0;
92
93 RETTYPE getReturnType() const { return type; }
94
95 std::string header; /**< table header of the column */
96 std::string desc; /**< description of the column entries used in the menu help */
97
98private:
99 RETTYPE type; /**< return type of the getter */
100};
101
102template <class T>
104{
105public:
106 Column(const char* columnHeader, const char* columnDesc, std::function<T(PARTIALDECOMP&)>&& columnCallback, RETTYPE columnType) :
107 AbstractColumn(columnHeader, columnDesc, columnType), callback(columnCallback) {}
108
109 ~Column() override = default;
110
111 T getValue(PARTIALDECOMP* partialdec) { return callback(*partialdec); }
112
113 std::string getValueAsString(PARTIALDECOMP* partialdec) override
114 {
115 std::ostringstream sstream;
116 sstream << std::fixed << std::setprecision(2) << getValue(partialdec);
117 return sstream.str();
118 }
119
120 int compareValues(PARTIALDECOMP* firstdec, PARTIALDECOMP* seconddec) override
121 {
122 if( getReturnType() == UNKNOWN )
123 {
124 return 0;
125 }
126 else
127 {
128 T val1 = getValue(firstdec);
129 T val2 = getValue(seconddec);
130 if( val1 == val2 )
131 return 0;
132 else if( val1 < val2 )
133 return -1;
134 else
135 return 1;
136 }
137 }
138
139private:
140 std::function<T(PARTIALDECOMP&)> callback;
141};
142
144 GCG* gcg,
145 std::vector<PARTIALDECOMP*>& partialdeclist,
146 unsigned int& npartialdecs,
147 bool includeopenpartialdecs
148 )
149{
150 unsigned int newnpartialdecs = GCGconshdlrDecompGetNPartialdecs(gcg);
151 if( newnpartialdecs != npartialdecs || (includeopenpartialdecs != (npartialdecs == partialdeclist.size())) )
152 {
153 std::vector<PARTIALDECOMP*>* partialdecs = GCGconshdlrDecompGetPartialdecs(gcg);
154
155 npartialdecs = newnpartialdecs;
156 partialdeclist.clear();
157 partialdeclist.reserve(npartialdecs);
158
159 for( PARTIALDECOMP* partialdec: *partialdecs )
160 {
161 if( includeopenpartialdecs || partialdec->isComplete() )
162 {
163 partialdeclist.push_back(partialdec);
164 }
165 }
166 return true;
167 }
168 return false;
169}
170
171/** @brief local sorting function for partialdec id vectors
172 *
173 * avoids redundant sorting calls,
174 * sorts by score in given order
175 */
176static
178 std::vector<PARTIALDECOMP*>& partialdeclist, /**< current list of partialdecs */
179 std::string& header, /**< header of column to sort by */
180 std::vector<AbstractColumn*>& columns, /**< vector of pointers to columns */
181 bool asc /**< whether to sort ascending or descending */
182 )
183{
184 /* find the column infos for the given header */
185 for( auto column : columns )
186 {
187 if( column->header.find(header) == 0 )
188 {
189 /* sort the id list according to given order using the callback getter of the column */
190 if( column->getReturnType() != UNKNOWN )
191 {
192 /* the callback has to be parsed to expect an int output */
193 if( asc )
194 std::stable_sort(partialdeclist.begin(), partialdeclist.end(), [&](PARTIALDECOMP* const a, PARTIALDECOMP* const b) { return column->compareValues(a, b) < 0; });
195 else
196 std::stable_sort(partialdeclist.begin(), partialdeclist.end(), [&](PARTIALDECOMP* const a, PARTIALDECOMP* const b) { return column->compareValues(b, a) < 0; });
197 }
198 break;
199 }
200 }
201}
202
203
204/** modifies menulength according to input and updates menu accordingly
205 * @returns SCIP return code */
206static
208 GCG* gcg, /**< GCG data structure */
209 SCIP_DIALOGHDLR* dialoghdlr, /**< dialog handler for user input management */
210 SCIP_DIALOG* dialog, /**< dialog for user input management */
211 int listlength, /**< length of partialdec id list */
212 int& menulength /**< current menu length to be modified */
213 )
214{
215 SCIP* scip;
216 char* ntovisualize;
217 SCIP_Bool endoffile;
218 int newlength;
219 int commandlen;
220
222
223 SCIPdialogMessage(scip, NULL, "Please specify the amount of entries to be shown in this menu:\n");
224 SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, " ", &ntovisualize, &endoffile) );
225 commandlen = (int) strlen(ntovisualize);
226
227 newlength = -1;
228 if( commandlen != 0 )
229 newlength = atoi(ntovisualize);
230
231 /* check whether there are decompositions,
232 * (preventing "Why doesn't it show anything? Maybe the entry number is 0") */
234 {
235 SCIPinfoMessage(scip, NULL, "No decompositions available. Please detect first.\n");
236 return SCIP_OKAY;
237 }
238
239 /* check for invalid input */
240 if( commandlen == 0 || newlength < 1 )
241 {
242 SCIPdialogMessage( scip, NULL, "The input was not a valid number." );
243 return SCIP_OKAY;
244 }
245
246 /* set new length (max listlength) */
247 if( newlength < listlength )
248 menulength = newlength;
249 else
250 menulength = listlength;
251
252 return SCIP_OKAY;
253}
254
255
256/** sets the used score according to user input
257 *
258 * @returns SCIP return code
259 */
260static
262 GCG* gcg, /**< GCG data structure */
263 SCIP_DIALOGHDLR* dialoghdlr, /**< dialog handler for user input management */
264 SCIP_DIALOG* dialog /**< dialog for user input management */
265 )
266{
267 SCIP* scip;
268 char* getscore;
269 SCIP_Bool endoffile;
270 int commandlen;
271
273
274 SCIPdialogMessage(scip, NULL, "\nPlease specify the new score:\n");
275 for( int i = 0; i < GCGconshdlrDecompGetNScores(gcg); i++)
276 {
278
279 SCIPdialogMessage(scip, NULL, "%d: %s\n", i, GCGscoreGetName(score));
280 }
281 SCIPdialogMessage(scip, NULL, "Note: Sets the detection/scores/selected parameter to the score\'s shortname.\n");
282
283 /* get input */
284 SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, " ", &getscore, &endoffile) );
285 commandlen = (int) strlen(getscore);
286 if( commandlen != 0 )
287 {
288 /* convert to int (if value is invalid, this results in 0) */
289 int scorenr = atoi(getscore);
290
291 /* check if the value is in valid range */
292 if( scorenr >= 0 && scorenr <= GCGconshdlrDecompGetNScores(gcg) - 1 )
293 {
294 /* set score */
295 GCG_SCORE* score = GCGconshdlrDecompGetScores(gcg)[scorenr];
296
297 SCIP_CALL( SCIPsetStringParam(scip, "detection/scores/selected", GCGscoreGetShortname(score)) );
298 SCIPdialogMessage(scip, NULL, "Score set to %s.\n", GCGscoreGetName(score));
299 }
300 }
301
302 return SCIP_OKAY;
303}
304
305
306/**
307 * Outputs the given char x times as SCIPdialogMessage
308 * @returns SCIP status
309 */
310static
312 SCIP* scip, /**< SCIP data structure */
313 const char letter, /**< char to write */
314 int x /**< write char x times */
315 )
316{
317 for(int i = 0; i < x; i++)
318 SCIPdialogMessage(scip, NULL, "%c", letter);
319
320 return SCIP_OKAY;
321}
322
323/** @brief show current menu containing partialdec information
324 *
325 * Update partialdec list in case it changed since the last command
326 * and show the table of partialdecs.
327 * @returns SCIP status
328 */
329static
331 GCG* gcg, /**< GCG data structure */
332 std::vector<AbstractColumn*>& columns, /**< vector of pointers to columns */
333 unsigned int& npartialdecs, /**< max number of partialdecs */
334 const int startindex, /**< index (in partialdec list) of uppermost partialdec in extract */
335 int menulength, /**< number of menu entries */
336 std::vector<PARTIALDECOMP*>& partialdeclist, /**< current list of partialdecs */
337 bool sortasc, /**< true iff sorting should be ascending */
338 std::string sortby, /**< table header of column to sort by */
339 bool listopenpartialdecs /**< open partialdecs will be listed iff set to true*/
340 )
341{
342 SCIP* scip;
343 assert(gcg != NULL);
344
346
347 /* update partialdec list in case it changed (in which case the amount of partialdecs should have changed)*/
348 updatePartialdecList(gcg, partialdeclist, npartialdecs, listopenpartialdecs);
349
350 /* sort partialdec ids by score, descending (in case score was changed or id list was updated)*/
351 sortPartialdecList(partialdeclist, sortby, columns, sortasc);
352
353 /* count corresponding partialdecs for overview statistics */
354 int ndetectedpresolved = 0;
355 int ndetectedunpresolved = 0;
356
357 for(PARTIALDECOMP* partialdec : partialdeclist)
358 {
359 if(partialdec->isComplete())
360 {
361 /* from presolved problem */
362 if(partialdec->isAssignedToOrigProb())
363 {
364 ++ndetectedunpresolved;
365 }
366 /* from original problem */
367 else
368 {
369 ++ndetectedpresolved;
370 }
371 }
372 }
373
374 /* count width of menu table by summing width of column headers,
375 * make header line, and border line for header (will be beneath the column headers) as follows:
376 * a border line of the length of the column width as '-' for each column and a space between the columns,
377 * e.g. header line " nr id nbloc nmacon sel ",
378 * e.g. underscores " ---- ---- ----- ------ ---- " */
379 std::string headerline;
380 std::string borderline;
381 std::map<std::string, int> columnlength;
382 int linelength = 0;
383
384 /* line starts with a space */
385 headerline = " ";
386 borderline = " ";
387
388 /* add each column header */
389 for( auto column : columns )
390 {
391 /* "score" is a wildcard for the current score, relace it with actual scoretype */
392 std::string header = column->header;
393 std::string newheader;
394 if( header != "score" )
395 newheader = header;
396 else
398
399 /* make sure the header name is unique and add a length for header */
400 assert(columnlength.find(header) == columnlength.end());
401 columnlength.insert(std::pair<std::string,int>(header, 0));
402 /* if header is smaller than min column width, add spaces to header first */
403 if( newheader.size() < DEFAULT_COLUMN_MIN_WIDTH )
404 {
405 for( int i = 0; i < (DEFAULT_COLUMN_MIN_WIDTH - (int) newheader.size()); i++ )
406 {
407 headerline += " ";
408 borderline += "-";
409 columnlength.at(header)++;
410 }
411 }
412 /* add header to headerline and add #chars of header as '-' to borderline*/
413 headerline += newheader;
414 for( int i = 0; i < (int) newheader.size(); i++ )
415 borderline += "-";
416 columnlength.at(header) += (int) newheader.size();
417 /* add space to both lines as column border */
418 headerline += " ";
419 borderline += " ";
420 /* add columnlength (+1 for border space) to overall linelength */
421 linelength += columnlength.at(header) + 1;
422 }
423
424 /* display overview statistics */
426 outputCharXTimes(scip, '=', linelength);
427 SCIPdialogMessage(scip, NULL, " \n");
428 SCIPdialogMessage(scip, NULL, "Summary presolved original \n");
429 SCIPdialogMessage(scip, NULL, " --------- -------- \n");
430 SCIPdialogMessage(scip, NULL, "detected ");
431 SCIPdialogMessage(scip, NULL, "%9d ", ndetectedpresolved );
432 SCIPdialogMessage(scip, NULL, "%8d\n", ndetectedunpresolved );
433 outputCharXTimes(scip, '=', linelength);
434 SCIPdialogMessage(scip, NULL, " \n");
435 /* display header of table */
436 SCIPdialogMessage(scip, NULL, "%s\n", headerline.c_str());
437 SCIPdialogMessage(scip, NULL, "%s\n", borderline.c_str());
438
439 /* go through all partialdecs that should currently be displayed,
440 * so from startindex on menulength many entries if there are that much left in the list */
441 for( int i = startindex; i < startindex + menulength && i < (int) partialdeclist.size(); ++i )
442 {
443 /* get current partialdec id */
444 PARTIALDECOMP* partialdec = partialdeclist.at(i);
445
446 /* each line starts with a space */
448
449 /* go through the columns and write the entry for each one */
450 for( auto column : columns )
451 {
452 std::ostringstream sstream;
453 std::string header = column->header;
454
455 /* write spaces to fill out the columnwidth */
456 sstream << std::setw(columnlength.at(header));
457
458 /* call the getter of the column depending on the given return type */
459 if( header == "nr" )
460 {
461 sstream << i;
462 }
463 else
464 {
465 sstream << column->getValueAsString(partialdec);
466 }
467 SCIPdialogMessage(scip, NULL, "%s ", sstream.str().c_str());
468 }
469
470 /* continue to next line */
472 }
473
474 /* at the end of the table add a line */
475 outputCharXTimes(scip, '=', linelength);
477
478 return SCIP_OKAY;
479}
480
481
482/** Shows information about the explore screen and its abbreviations
483 *
484 * @returns SCIP status */
485static
487 GCG* gcg, /**< GCG data structure */
488 std::vector<AbstractColumn*>& columns /**< vector of pointers to columns */
489 )
490{
491 SCIP* scip;
492 assert(gcg != NULL);
493 GCG_DETECTOR** detectors;
494
496
497 /* print header for detector list */
498 SCIPdialogMessage(scip, NULL, "List of included detectors for decompositions histories: \n");
499
500 SCIPdialogMessage(scip, NULL, "\n%30s %4s\n", "detector" , "char");
501 SCIPdialogMessage(scip, NULL, "%30s %4s\n", "--------" , "----");
502
503 /* get and print char of each detector */
505
506 for( int det = 0; det < GCGconshdlrDecompGetNDetectors(gcg); ++det )
507 {
508 GCG_DETECTOR* detector;
509 detector = detectors[det];
510
511 SCIPdialogMessage(scip, NULL, "%30s %4c\n", GCGdetectorGetName(detector), GCGdetectorGetChar(detector));
512 }
513 /* print usergiven as part of detector chars */
514 SCIPdialogMessage(scip, NULL, "%30s %4s\n", "given by user" , "U");
515 SCIPdialogMessage(scip, NULL, "\n" );
516
517 SCIPdialogMessage(scip, NULL, "=================================================================================================== \n");
518
519 SCIPdialogMessage(scip, NULL, "\n" );
520
521 /* print header of abbreviation table */
522 SCIPdialogMessage(scip, NULL, "List of abbreviations of decomposition table \n" );
523 SCIPdialogMessage(scip, NULL, "\n" );
524 SCIPdialogMessage(scip, NULL, "%30s %s\n", "abbreviation", "description");
525 SCIPdialogMessage(scip, NULL, "%30s %s\n", "------------", "-----------");
526
527 /* add legend entry for each header abbreviation */
528 for( auto column : columns )
529 {
530 /* get table header */
531 std::string& header = column->header;
532
533 /* print the header with the description */
534 if( header != "score" )
535 {
536 SCIPdialogMessage(scip, NULL, "%30s %s\n", header.c_str(), column->desc.c_str());
537 }
538 /* if the header is "score" replace with shortname of the current score */
539 else
540 {
542 SCIPdialogMessage(scip, NULL, "%30s %s\n", GCGscoreGetShortname(score), GCGscoreGetDesc(score));
543 }
544
545 }
546 SCIPdialogMessage(scip, NULL, "\n=================================================================================================== \n");
547
548 return SCIP_OKAY;
549}
550
551/** @brief Shows help section of explore menu
552 *
553 * Outputs al ist of commands and a description of their function
554 * @returns SCIP status */
555static
557 GCG* gcg /**< GCG data structure */
558 )
559{
560 SCIP* scip;
561 assert(gcg != NULL);
562
564
565 SCIPdialogMessage(scip, NULL, "=================================================================================================== \n");
566 SCIPdialogMessage(scip, NULL, "\n" );
567 SCIPdialogMessage(scip, NULL, "List of selection commands \n" );
568 SCIPdialogMessage(scip, NULL, "\n" );
569 SCIPdialogMessage(scip, NULL, "%30s %s\n", "command", "description");
570 SCIPdialogMessage(scip, NULL, "%30s %s\n", "-------", "-----------");
571 SCIPdialogMessage(scip, NULL, "%30s %s\n", "help", "displays this help");
572 SCIPdialogMessage(scip, NULL, "%30s %s\n", "legend", "displays the legend for table header and history abbreviations");
573 SCIPdialogMessage(scip, NULL, "%30s %s\n", "select", "selects/unselects decomposition with given nr");
574 SCIPdialogMessage(scip, NULL, "%30s %s\n", "previous", "displays the preceding decompositions (if there are any)");
575 SCIPdialogMessage(scip, NULL, "%30s %s\n", "next", "displays the subsequent decompositions (if there are any)");
576 SCIPdialogMessage(scip, NULL, "%30s %s\n", "top", "displays the first decompositions");
577 SCIPdialogMessage(scip, NULL, "%30s %s\n", "end", "displays the last decompositions");
578 SCIPdialogMessage(scip, NULL, "%30s %s\n", "entries", "modifies the number of decompositions to display per page");
579 SCIPdialogMessage(scip, NULL, "%30s %s\n", "export", "generates visualization of the specified decomposition in gnuplot format");
580 SCIPdialogMessage(scip, NULL, "%30s %s\n", "visualize", "generates visualization and opens it (requires gnuplot)");
581 SCIPdialogMessage(scip, NULL, "%30s %s\n", "inspect", "displays detailed information for the specified decomposition");
582 SCIPdialogMessage(scip, NULL, "%30s %s\n", "score", "sets the score by which the quality of decompositions is evaluated");
583 SCIPdialogMessage(scip, NULL, "%30s %s\n", "sort", "sets the column by which the decompositions are sorted (default: by score)");
584 SCIPdialogMessage(scip, NULL, "%30s %s\n", "ascending", "sort decompositions in ascending (true) or descending (false) order");
585 SCIPdialogMessage(scip, NULL, "%30s %s\n", "list", "specify whether all decompositions should be listed");
586 SCIPdialogMessage(scip, NULL, "%30s %s\n", "quit", "return to main menu");
587
588 SCIPdialogMessage(scip, NULL, "\n=================================================================================================== \n");
589
590 return SCIP_OKAY;
591}
592
593
594/** Shows a visualization of the partialdec specified by the user via the dialog
595 *
596 * @returns SCIP status */
597static
599 GCG* gcg, /**< GCG data structure */
600 SCIP_DIALOGHDLR* dialoghdlr, /**< dialog handler for user input management */
601 SCIP_DIALOG* dialog, /**< dialog for user input management */
602 std::vector<PARTIALDECOMP*>& partialdeclist, /**< current list of partialdecs */
603 SCIP_Bool open /**< compile and open gnuplot file? */
604 )
605{
606 SCIP* scip;
607 char* ntovisualize;
608 SCIP_Bool endoffile;
609 int idtovisu;
610 int commandlen;
611
612 assert(gcg != NULL);
613
615
616 SCIPdialogMessage(scip, NULL, "Please specify the nr of the decomposition to be visualized:\n");
617 SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, " ", &ntovisualize, &endoffile) );
618 commandlen = (int) strlen(ntovisualize);
619
620 idtovisu = -1;
621 if( commandlen != 0 )
622 idtovisu = atoi(ntovisualize);
623
624 /* check whether the partialdec exists */
625 if( commandlen == 0 || idtovisu < 0 || idtovisu >= (int) partialdeclist.size() )
626 {
627 SCIPdialogMessage( scip, NULL, "This nr is out of range." );
628 return SCIP_OKAY;
629 }
630
631 /* get and show partialdec */
632 PARTIALDECOMP* partialdec = partialdeclist.at(idtovisu);
633 if( open )
634 partialdec->showVisualization();
635 else
636 partialdec->exportVisualization();
637
638 return SCIP_OKAY;
639}
640
641
642/**
643 * Displays information about a partialdec that is chosen by the user in a dialog.
644 *
645 * @returns SCIP status
646 */
647static
649 GCG* gcg, /**< GCG data structure */
650 SCIP_DIALOGHDLR* dialoghdlr, /**< dialog handler for user input management */
651 SCIP_DIALOG* dialog, /**< dialog for user input management */
652 std::vector<PARTIALDECOMP*>& partialdeclist /**< current list of partialdecs */
653 )
654{
655 SCIP* scip;
656 char* ntoinspect;
657 char* ndetaillevel;
658 SCIP_Bool endoffile;
659 int idtoinspect;
660 int detaillevel;
661
662 int commandlen;
663
664 assert( gcg != NULL );
665
667
668 /* read the id of the decomposition to be inspected */
669 SCIPdialogMessage( scip, NULL, "Please specify the nr of the decomposition to be inspected:\n");
670 SCIP_CALL( SCIPdialoghdlrGetWord( dialoghdlr, dialog, " ", &ntoinspect, &endoffile ) );
671 commandlen = (int) strlen( ntoinspect );
672
673 idtoinspect = -1;
674 if( commandlen != 0 )
675 idtoinspect = atoi( ntoinspect );
676
677 if(idtoinspect < 0 || idtoinspect >= (int) partialdeclist.size()){
678 SCIPdialogMessage( scip, NULL, "This nr is out of range." );
679 return SCIP_OKAY;
680 }
681
682 /* check whether ID is in valid range */
683 PARTIALDECOMP* partialdec = partialdeclist.at(idtoinspect);
684
685 /* read the desired detail level; for wrong input, it is set to 1 by default */
687 "Please specify the detail level:\n 0 - brief overview\n 1 - block and detector info (default)\n 2 - cons and var assignments\n" );
688 SCIP_CALL( SCIPdialoghdlrGetWord( dialoghdlr, dialog, " ", &ndetaillevel, &endoffile ) );
689 commandlen = (int) strlen( ndetaillevel );
690
691 detaillevel = 1;
692 if( commandlen != 0 )
693 {
694 std::stringstream convert( ndetaillevel );
695 convert >> detaillevel;
696
697 if( detaillevel < 0 || ( detaillevel == 0 && ndetaillevel[0] != '0' ) )
698 {
699 detaillevel = 1;
700 }
701 }
702
703 /* call displayInfo method according to chosen parameters */
704 partialdec->displayInfo( detaillevel );
705
706 return SCIP_OKAY;
707}
708
709
710/** Lets the user select decompositions from the explore menu
711 *
712 * @returns SCIP status */
713static
715 GCG* gcg, /**< GCG data structure */
716 SCIP_DIALOGHDLR* dialoghdlr, /**< dialog handler for user input management */
717 SCIP_DIALOG* dialog, /**< dialog for user input management */
718 std::vector<PARTIALDECOMP*>& partialdeclist /**< current list of partialdecs */
719 )
720{
721 SCIP* scip;
722 char* ntovisualize;
723 SCIP_Bool endoffile;
724 int idtovisu;
725
726 int commandlen;
727
728 assert(gcg != NULL);
729
731
732 /* get input */
733 SCIPdialogMessage(scip, NULL, "\nPlease specify the nr of the decomposition to be selected:\n");
734 SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, " ", &ntovisualize, &endoffile) );
735 commandlen = (int) strlen(ntovisualize);
736
737 idtovisu = -1;
738 if( commandlen != 0)
739 idtovisu = atoi(ntovisualize);
740
741 /* check if the input is a valid number */
742 if( commandlen == 0 || idtovisu < 0 || idtovisu >= (int) partialdeclist.size() )
743 {
744 SCIPdialogMessage( scip, NULL, "This nr is out of range, nothing was selected." );
745 return SCIP_OKAY;
746 }
747
748 /* get partialdec from id*/
749 PARTIALDECOMP* partialdec = partialdeclist.at(idtovisu);
750
751 /* reverse selection (deselects if partialdec was previously selected) */
752 partialdec->setSelected(!partialdec->isSelected() );
753
754 return SCIP_OKAY;
755}
756
757/** Set whether order in menu should be ascending/descending
758 *
759 * @returns SCIP return code */
760static
762 GCG* gcg, /**< GCG data structure */
763 SCIP_DIALOGHDLR* dialoghdlr, /**< dialog handler for user input management */
764 SCIP_DIALOG* dialog, /**< dialog for user input management */
765 bool& asc /**< true iff sorting should be ascending */
766 )
767{
768 SCIP* scip;
769 char* ascen;
770 SCIP_Bool endoffile;
771 int commandlen;
772
773 assert(gcg != NULL);
774
776
777 /* get input */
778 SCIPdialogMessage(scip, NULL, "\nPlease enter \"true\"/\"1\" for ascending or \"false\"/\"0\" for descending order:\n");
779 SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, " ", &ascen, &endoffile) );
780 commandlen = (int) strlen(ascen);
781
782 std::string input = ascen;
783 if( commandlen != 0)
784 {
785 /* check if input if is true, set ascending */
786 if(input == "true" || input == "1")
787 asc = true;
788 /* check if input if is false, set descending */
789 else if(input == "false" || input == "0")
790 asc = false;
791 /* all other inputs are considered invalid and do nothing */
792 }
793
794 return SCIP_OKAY;
795}
796
797
798/** Checks whether the given header is valid
799 * @returns true iff header is valid
800 */
801static
803 std::string& header, /**< header to check */
804 std::vector<AbstractColumn*>& columns /**< vector of pointers to columns */
805 )
806{
807 /* check if the given header is a (prefix of a) registered table header */
808 for( auto column : columns )
809 {
810 if(column->header.find(header) == 0 )
811 return true;
812 }
813 /* else return false */
814 return false;
815}
816
817
818/** Set whether order in menu should be ascending/descending
819 *
820 * @returns SCIP return code */
821static
823 GCG* gcg, /**< GCG data structure */
824 SCIP_DIALOGHDLR* dialoghdlr, /**< dialog handler for user input management */
825 SCIP_DIALOG* dialog, /**< dialog for user input management */
826 std::vector<AbstractColumn*>& columns, /**< vector of pointers to columns */
827 std::string& sortby /**< table header, identifies by which column to sort by */
828 )
829{
830 SCIP* scip;
831 char* newsort;
832 SCIP_Bool endoffile;
833 int commandlen;
834
835 assert(gcg != NULL);
836
838
839 /* get input */
840 SCIPdialogMessage(scip, NULL, "\nPlease enter the table header of the column by which you would like to sort:\n");
841 SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, " ", &newsort, &endoffile) );
842 commandlen = (int) strlen(newsort);
843
844 /* if the input is a valid table header, change sortby */
845 std::string input = newsort;
846 if( commandlen != 0 )
847 {
848 /* all headers (including the "score" wildcard) are valid */
849 if( isHeader(input, columns) )
850 sortby = input;
851 /* if the score abbreviation is entered, the header would not be in the column info */
852 else if( input == GCGscoreGetShortname(GCGgetCurrentScore(gcg)) )
853 sortby = "score";
854 }
855 return SCIP_OKAY;
856}
857
858
859/** Set whether order in menu should be ascending/descending
860 *
861 * @returns SCIP return code */
862static
864 GCG* gcg, /**< GCG data structure */
865 SCIP_DIALOGHDLR* dialoghdlr, /**< dialog handler for user input management */
866 SCIP_DIALOG* dialog, /**< dialog for user input management */
867 bool& listopenpartialdecs /** will be updated */
868 )
869{
870 SCIP* scip;
871 char* input;
872 SCIP_Bool endoffile;
873 int commandlen;
874
875 assert(gcg != NULL);
876
878
879 /* get input */
880 SCIPdialogMessage(scip, NULL, "\nShould incomplete decompositions be listed? Please enter \"true\" or \"false\":\n");
881 SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog, " ", &input, &endoffile) );
882 commandlen = (int) strlen(input);
883
884 if( commandlen != 0)
885 {
886 /* check if input if is true, set ascending */
887 if( strncmp(input, "true", commandlen) == 0 || strncmp(input, "1", commandlen) == 0 )
888 listopenpartialdecs = true;
889 /* check if input if is false, set descending */
890 else if( strncmp(input, "false", commandlen) == 0 || strncmp(input, "0", commandlen) == 0 )
891 listopenpartialdecs = false;
892 /* all other inputs are considered invalid and do nothing */
893 }
894 return SCIP_OKAY;
895}
896
897
898static
900 GCG* gcg, /**< GCG data structure */
901 SCIP_DIALOGHDLR* dialoghdlr, /**< dialog handler for user input management */
902 SCIP_DIALOG* dialog, /**< dialog for user input management */
903 std::vector<AbstractColumn*>& columns, /**< vector of pointers to columns */
904 char* command, /**< the command that was entered */
905 int& startindex, /**< number of partialdec there the menu extract starts */
906 int& menulength, /**< current menu length to be modified */
907 bool& finished, /**< whether to quit the menu */
908 std::vector<PARTIALDECOMP*>& partialdeclist, /**< current list of partialdec ids */
909 bool& sortasc, /**< true iff sorting should be ascending */
910 std::string& sortby, /**< name of table header to identify sorting column */
911 bool& listopenpartialdecs /** whether open patialdecs should be listed*/
912 )
913{
914 int commandlen = (int) strlen(command);
915
916 if( strncmp( command, "previous", commandlen) == 0 )
917 {
918 startindex = startindex - menulength;
919 if(startindex < 0 )
920 startindex = 0;
921 }
922 else if( strncmp( command, "next", commandlen) == 0 )
923 {
924 startindex = startindex + menulength;
925 if( startindex > (int) partialdeclist.size() - menulength )
926 startindex = (int) partialdeclist.size() - menulength;
927 }
928 else if( strncmp( command, "top", commandlen) == 0 )
929 {
930 startindex = 0;
931 }
932 else if( strncmp( command, "end", commandlen) == 0 )
933 {
934 startindex = (int) partialdeclist.size() - menulength;
935 if (startindex < 0)
936 startindex = 0;
937 }
938
939 else if( strncmp( command, "quit", commandlen) == 0 || strncmp( command, "..", commandlen) == 0 )
940 {
941 finished = TRUE;
942 }
943
944 else if( strncmp( command, "legend", commandlen) == 0 )
945 {
946 SCIP_CALL( GCGdialogShowLegend(gcg, columns) );
947 }
948
949 else if( strncmp( command, "help", commandlen) == 0 )
950 {
952 }
953
954 else if( strncmp( command, "entries", commandlen) == 0 )
955 {
956 SCIP_CALL( GCGdialogSetNEntires(gcg, dialoghdlr, dialog, (int) partialdeclist.size(), menulength) );
957 }
958
959 else if( strncmp( command, "visualize", commandlen) == 0 )
960 {
961 SCIP_CALL( GCGdialogSelectVisualize(gcg, dialoghdlr, dialog, partialdeclist, TRUE) );
962 }
963
964 else if( strncmp( command, "export", commandlen) == 0 )
965 {
966 SCIP_CALL( GCGdialogSelectVisualize(gcg, dialoghdlr, dialog, partialdeclist, FALSE) );
967 }
968
969 else if( strncmp( command, "inspect", commandlen) == 0 )
970 {
971 SCIP_CALL( GCGdialogInspectPartialdec(gcg, dialoghdlr, dialog, partialdeclist) );
972 }
973
974 else if( strncmp( command, "select", commandlen) == 0 )
975 {
976 SCIP_CALL( GCGdialogSelect(gcg, dialoghdlr, dialog, partialdeclist) );
977 }
978
979 else if( strncmp( command, "score", commandlen) == 0 )
980 {
981 SCIP_CALL( GCGdialogChangeScore(gcg, dialoghdlr, dialog) );
982 }
983
984 else if( strncmp( command, "ascending", commandlen) == 0 )
985 {
986 SCIP_CALL( GCGdialogSortAsc(gcg, dialoghdlr, dialog, sortasc) );
987 }
988 else if( strncmp( command, "sort", commandlen) == 0 )
989 {
990 SCIP_CALL( GCGdialogSortBy(gcg, dialoghdlr, dialog, columns, sortby) );
991 }
992 else if( strncmp( command, "list", commandlen) == 0 )
993 {
994 SCIP_CALL( GCGdialogChangeListMode(gcg, dialoghdlr, dialog, listopenpartialdecs) );
995 }
996
997 return SCIP_OKAY;
998}
999
1000extern "C" {
1001
1003 GCG* gcg,
1004 SCIP_DIALOGHDLR* dialoghdlr,
1005 SCIP_DIALOG* dialog
1006 )
1007{
1008 /* set navigation defaults */
1009 int startindex = 0; /**< number of partialdec there the menu extract starts */
1010 int menulength = DEFAULT_MENULENGTH; /**< number of entries shown in menu */
1011 bool sortasc = false; /**< whether to show entries in ascending order (score) */
1012 std::string sortby = DEFAULT_SORT_HEADER; /**< table header, identifies by which column to sort by */
1013 bool listopenpartialdecs = false;
1014
1015 /* check for available partialdecs */
1016 unsigned int npartialdecs = 0; /**< stores the last known number of partialdecs, is handed down to check for changes in partialdec number */
1017 std::vector<PARTIALDECOMP*> partialdeclist;
1018 updatePartialdecList(gcg, partialdeclist, npartialdecs, listopenpartialdecs);
1019
1020 if(npartialdecs == 0)
1021 {
1022 SCIPdialogMessage(GCGgetOrigprob(gcg), NULL, "There are no decompositions to explore yet, please detect first.\n");
1023 return SCIP_OKAY;
1024 }
1025
1026 /* set initial columns */
1027 /* the column information has the header, a getter for the column info and the return type of the getter */
1028 std::vector<AbstractColumn*> columns;
1029 /* go through each column header and determine its getter */
1030 for( auto columnname : DEFAULT_COLUMNS )
1031 {
1032 /**@note devs: if you want to add new headers, please specify their getters here! */
1033 AbstractColumn* column;
1034
1035 if( strcmp(columnname, "nr") == 0 )
1036 {
1037 /* special case: "nr" represents the position in the menu table and is determined by the menu */
1038 column = new Column<int>(
1039 columnname,
1040 "number of the decomposition (use this number for selecting the decomposition)",
1041 NULL,
1042 UNKNOWN);
1043 }
1044 else if( strcmp(columnname, "id") == 0 )
1045 {
1046 /* "id" is the partialdec id, the list of ids is known to the menu */
1047 column = new Column<int>(
1048 columnname,
1049 "id of the decomposition (identifies the decomposition in reports/statistics/visualizations/etc.)",
1051 INTEGER);
1052 }
1053 else if( strcmp(columnname, "nbloc") == 0 )
1054 {
1055 column = new Column<int>(
1056 columnname,
1057 "number of blocks",
1059 INTEGER);
1060 }
1061 else if( strcmp(columnname, "nmacon") == 0 )
1062 {
1063 column = new Column<int>(
1064 columnname,
1065 "number of master constraints",
1067 INTEGER);
1068 }
1069 else if( strcmp(columnname, "nmavar") == 0 )
1070 {
1071 column = new Column<int>(
1072 columnname,
1073 "number of \"master only\" variables (also called \"static\", do not occur in blocks)",
1075 INTEGER);
1076 }
1077 else if( strcmp(columnname, "nlivar") == 0 )
1078 {
1079 column = new Column<int>(
1080 columnname,
1081 "number of linking variables",
1083 INTEGER);
1084 }
1085 else if( strcmp(columnname, "nstlva") == 0 )
1086 {
1087 column = new Column<int>(
1088 columnname,
1089 "number of stair linking variables",
1091 INTEGER);
1092 }
1093 else if( strcmp(columnname, "score") == 0 )
1094 {
1095 column = new Column<SCIP_Real>(
1096 columnname,
1097 " ",
1098 static_cast<SCIP_Real(PARTIALDECOMP::*)()>(&PARTIALDECOMP::getScore),
1099 REAL);
1100 }
1101 else if( strcmp(columnname, "history") == 0 )
1102 {
1103 column = new Column<std::string>(
1104 columnname,
1105 "list of detectors (their chars) which worked on this decomposition",
1106 static_cast<std::string(PARTIALDECOMP::*)()>(&PARTIALDECOMP::buildDecChainString),
1107 STRING);
1108 }
1109 else if( strcmp(columnname, "pre") == 0 )
1110 {
1111 column = new Column<bool>(
1112 columnname,
1113 "is this decomposition for the presolved problem?",
1115 BOOLEAN);
1116 }
1117 else if( strcmp(columnname, "nopcon") == 0 )
1118 {
1119 column = new Column<int>(
1120 columnname,
1121 "number of open (=unassigned) constraints",
1123 INTEGER);
1124 }
1125 else if( strcmp(columnname, "nopvar") == 0 )
1126 {
1127 column = new Column<int>(
1128 columnname,
1129 "number of open (=unassigned) variables",
1131 INTEGER);
1132 }
1133 else if( strcmp(columnname, "sel") == 0 )
1134 {
1135 column = new Column<bool>(
1136 columnname,
1137 "is this decomposition selected?",
1139 BOOLEAN);
1140 }
1141
1142 columns.push_back(column);
1143 }
1144
1145 /* check that the given default sorting header is valid */
1146 assert(isHeader(sortby, columns));
1147
1148 /* sort by default, descending */
1149 sortPartialdecList(partialdeclist, sortby, columns, sortasc);
1150
1151 /* while user has not aborted: show current list extract and catch commands */
1152 bool finished = false;
1153 char* command;
1154 SCIP_Bool endoffile;
1155 while( !finished )
1156 {
1157 GCGdialogShowMenu(gcg, columns, npartialdecs, startindex, menulength, partialdeclist, sortasc, sortby, listopenpartialdecs);
1158
1159 SCIP_CALL( SCIPdialoghdlrGetWord(dialoghdlr, dialog,
1160 "Please enter command (or \"h\" for help) : \nGCG/explore> ", &command, &endoffile) );
1161
1162 GCGdialogExecCommand(gcg, dialoghdlr, dialog, columns, command, startindex, menulength, finished, partialdeclist, sortasc, sortby, listopenpartialdecs);
1163 }
1164
1165 for( auto column : columns )
1166 delete column;
1167
1168 return SCIP_OKAY;
1169}
1170
1171} // extern "C"
1172
1173} // namespace gcg
SCIP_VAR * a
SCIP_VAR ** b
SCIP_VAR ** x
class storing (potentially incomplete) decompositions
AbstractColumn(const char *columnHeader, const char *columnDesc, RETTYPE columnType)
virtual ~AbstractColumn()=default
virtual int compareValues(PARTIALDECOMP *firstdec, PARTIALDECOMP *seconddec)=0
RETTYPE getReturnType() const
virtual std::string getValueAsString(PARTIALDECOMP *partialdec)=0
int compareValues(PARTIALDECOMP *firstdec, PARTIALDECOMP *seconddec) override
Column(const char *columnHeader, const char *columnDesc, std::function< T(PARTIALDECOMP &)> &&columnCallback, RETTYPE columnType)
T getValue(PARTIALDECOMP *partialdec)
~Column() override=default
std::string getValueAsString(PARTIALDECOMP *partialdec) override
class to manage partial decompositions
GCG_EXPORT int getNMasterconss()
Gets size of the vector containing master conss.
GCG_EXPORT SCIP_Real getScore(GCG_SCORE *score)
returns the score of the partialdec
GCG_EXPORT void setSelected(bool selected)
set the selection status of this partialdecs
GCG_EXPORT void exportVisualization()
generates a gp visualization of the partialdec without compilation or opening
GCG_EXPORT bool isAssignedToPresolvedProb()
Gets whether the partialdec is from the presolved problem.
GCG_EXPORT int getNOpenvars()
Gets size of vector containing variables not assigned yet.
GCG_EXPORT void displayInfo(int detailLevel)
displays the relevant information of the partialdec
GCG_EXPORT void buildDecChainString(char *buffer)
creates a detector chain short string for this partialdec, is built from detector chain
GCG_EXPORT int getNOpenconss()
Gets size of vector containing constraints not assigned yet.
GCG_EXPORT int getNLinkingvars()
Gets size of the vector containing linking vars.
GCG_EXPORT bool isSelected()
GCG_EXPORT int getNTotalStairlinkingvars()
Gets total number of stairlinking vars.
GCG_EXPORT int getNMastervars()
Gets size of the vector containing master vars.
GCG_EXPORT void showVisualization()
generates and opens a gp visualization of the partialdec
GCG_EXPORT int getID()
returns the unique id of the partialdec
GCG_EXPORT int getNBlocks()
Gets the number of blocks.
std::vector< PARTIALDECOMP * > * GCGconshdlrDecompGetPartialdecs(GCG *gcg)
gets vector of all partialdecs
const char * GCGdetectorGetName(GCG_DETECTOR *detector)
returns the name of the provided detector
GCG_SCORE ** GCGconshdlrDecompGetScores(GCG *gcg)
Gets an array of all scores.
int GCGconshdlrDecompGetNDetectors(GCG *gcg)
Gets the number of all detectors.
GCG_SCORE * GCGgetCurrentScore(GCG *gcg)
Gets the currently enabled score.
char GCGdetectorGetChar(GCG_DETECTOR *detector)
Gets the character of the detector.
int GCGconshdlrDecompGetNScores(GCG *gcg)
Gets the number of all scores.
GCG_DETECTOR ** GCGconshdlrDecompGetDetectors(GCG *gcg)
Gets an array of all detectors.
unsigned int GCGconshdlrDecompGetNPartialdecs(GCG *gcg)
Gets the number of all partialdecs.
constraint handler for structure detection
C++ interface of cons_decomp.
#define SCIP_Bool
#define SCIP_Real
#define DEFAULT_MENULENGTH
#define DEFAULT_COLUMN_MIN_WIDTH
#define DEFAULT_SORT_HEADER
const char * DEFAULT_COLUMNS[]
#define TRUE
#define FALSE
SCIP * GCGgetOrigprob(GCG *gcg)
Definition gcg.cpp:87
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
void SCIPdialogMessage(SCIP *scip, FILE *file, const char *formatstr,...)
SCIP_RETCODE SCIPsetStringParam(SCIP *scip, const char *name, const char *value)
SCIP_RETCODE SCIPdialoghdlrGetWord(SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, const char *prompt, char **inputword, SCIP_Bool *endoffile)
GCG_EXPORT const char * GCGscoreGetName(GCG_SCORE *score)
Definition score.c:145
GCG_EXPORT const char * GCGscoreGetDesc(GCG_SCORE *score)
Definition score.c:165
GCG_EXPORT const char * GCGscoreGetShortname(GCG_SCORE *score)
Definition score.c:155
static assert(heur !=NULL)
SCIP_CALL(SCIPgetExternBranchCands(origprob, &lpcands, &lpcandssol, NULL, &nlpcands, NULL, NULL, NULL, NULL))
int i
#define NULL
bool updatePartialdecList(GCG *gcg, std::vector< PARTIALDECOMP * > &partialdeclist, unsigned int &npartialdecs, bool includeopenpartialdecs)
static SCIP_RETCODE GCGdialogChangeListMode(GCG *gcg, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, bool &listopenpartialdecs)
static SCIP_RETCODE GCGdialogInspectPartialdec(GCG *gcg, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, std::vector< PARTIALDECOMP * > &partialdeclist)
static SCIP_RETCODE GCGdialogChangeScore(GCG *gcg, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog)
SCIP_RETCODE GCGdialogExecExplore(GCG *gcg, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog)
static SCIP_RETCODE GCGdialogSortBy(GCG *gcg, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, std::vector< AbstractColumn * > &columns, std::string &sortby)
static SCIP_RETCODE outputCharXTimes(SCIP *scip, const char letter, int x)
static SCIP_RETCODE GCGdialogSortAsc(GCG *gcg, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, bool &asc)
static bool isHeader(std::string &header, std::vector< AbstractColumn * > &columns)
static SCIP_RETCODE GCGdialogShowLegend(GCG *gcg, std::vector< AbstractColumn * > &columns)
static SCIP_RETCODE GCGdialogExecCommand(GCG *gcg, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, std::vector< AbstractColumn * > &columns, char *command, int &startindex, int &menulength, bool &finished, std::vector< PARTIALDECOMP * > &partialdeclist, bool &sortasc, std::string &sortby, bool &listopenpartialdecs)
static SCIP_RETCODE GCGdialogShowMenu(GCG *gcg, std::vector< AbstractColumn * > &columns, unsigned int &npartialdecs, const int startindex, int menulength, std::vector< PARTIALDECOMP * > &partialdeclist, bool sortasc, std::string sortby, bool listopenpartialdecs)
show current menu containing partialdec information
static SCIP_RETCODE GCGdialogSelectVisualize(GCG *gcg, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, std::vector< PARTIALDECOMP * > &partialdeclist, SCIP_Bool open)
static void sortPartialdecList(std::vector< PARTIALDECOMP * > &partialdeclist, std::string &header, std::vector< AbstractColumn * > &columns, bool asc)
local sorting function for partialdec id vectors
static SCIP_RETCODE GCGdialogShowHelp(GCG *gcg)
Shows help section of explore menu.
static SCIP_RETCODE GCGdialogSelect(GCG *gcg, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, std::vector< PARTIALDECOMP * > &partialdeclist)
static SCIP_RETCODE GCGdialogSetNEntires(GCG *gcg, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, int listlength, int &menulength)
internal methods for scores
struct GCG_Detector GCG_DETECTOR
struct SCIP_Dialog SCIP_DIALOG
struct SCIP_Dialoghdlr SCIP_DIALOGHDLR
struct Gcg GCG
Definition type_gcg.h:44
enum SCIP_Retcode SCIP_RETCODE
struct Scip SCIP
struct GCG_Score GCG_SCORE
Definition type_score.h:45