GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
params_visu.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 params_visu.c
30 * @brief parameter settings for visualization readers
31 * @author Hanna Franzen
32 * @author Michael Bastubbe
33 */
34
35/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
36
37#include "gcg/params_visu.h"
38#include "gcg/type_decomp.h"
39#include "gcg/cons_decomp.h"
40
41#include "gcg/relax_gcg.h"
42
43#include "scip/scip.h"
44
45#include <limits.h>
46#include <string.h>
47
48#define PARAM_NAME "paramsvisu"
49#define PARAM_DESC "parameters for visualization"
50
51/* color defaults to build default color layout with */
52#define COLOR_WHITE "#FFFFFF" /**< standard white */
53#define COLOR_BLUE1 "#ACBCE9" /**< very light blue */
54#define COLOR_BLUE2 "#718CDB" /**< light blue */
55#define COLOR_BLUE3 "#3C64DD" /**< middle blue */
56#define COLOR_BLUE4 "#1340C7" /**< dark blue */
57#define COLOR_BLUE5 "#1F377D" /**< very dark blue */
58#define COLOR_ORANGE1 "#FFD88F" /**< very light orange */
59#define COLOR_ORANGE2 "#FFCB69" /**< light orange */
60#define COLOR_ORANGE3 "#FFB72D" /**< orange */
61#define COLOR_BROWN1 "#B38208" /**< light brown */
62#define COLOR_BROWN2 "#886100" /**< brown */
63#define COLOR_BROWN3 "#443000" /**< dark brown */
64#define COLOR_BLACK "#000000" /**< standard black */
65
66/* default colors (use defines above for changes) */
67#define DEFAULT_COLOR_MASTERVARS COLOR_BLUE4 /**< for mastervars (in block area) */
68#define DEFAULT_COLOR_MASTERCONSS COLOR_BLUE4 /**< for masterconss */
69#define DEFAULT_COLOR_LINKING COLOR_ORANGE3 /**< for linking areas */
70#define DEFAULT_COLOR_STAIRLINKING COLOR_BROWN2 /**< for stairlinking areas */
71#define DEFAULT_COLOR_BLOCK COLOR_BLUE2 /**< for finished blocks */
72#define DEFAULT_COLOR_OPEN COLOR_ORANGE1 /**< for open (not assigned) elements */
73#define DEFAULT_COLOR_NONZERO COLOR_BLACK /**< for nonzero dots */
74#define DEFAULT_COLOR_LINE COLOR_BLACK /**< for outlines of blocks */
75
76/* 8 shades of grey */
77#define GREY_COLOR_MASTERVARS "#323232" /**< for mastervars (in block area) */
78#define GREY_COLOR_MASTERCONS "#666666" /**< for masterconss */
79#define GREY_COLOR_LINKING "#4C4C4C" /**< for linking areas */
80#define GREY_COLOR_STAIRLINKING "#191919" /**< for stairlinking areas */
81#define GREY_COLOR_BLOCK "#d3d3d3" /**< for finished blocks */
82#define GREY_COLOR_OPEN "#7F7F7F" /**< for open (not assigned) elements */
83#define GREY_COLOR_NONZERO COLOR_BLACK /**< for nonzero dots */
84#define GREY_COLOR_LINE COLOR_BLACK /**< for outlines of blocks */
85
86/* visualization imaging defaults */
87#define DEFAULT_VISU_DRAFTMODE FALSE /**< if true no nonzeros are shown in visualizations */
88#define DEFAULT_VISU_COLORSCHEME COLORSCHEME_DEFAULT /**< is of type VISU_COLORSCHEME */
89#define DEFAULT_VISU_RADIUS 2 /**< possible scale: 1-10 */
90#define DEFAULT_VISU_USEGP FALSE /**< if true gnuplot is used for visualizations,
91 * otherwise LaTeX/Tikz */
92
93/* pdf reader default */
94/**< name of pdf reader, must be callable by system */
95#if defined(__linux__)
96#define DEFAULT_PDFREADER "xdg-open"
97#elif defined(__APPLE__)
98#define DEFAULT_PDFREADER "open"
99#elif defined(_WIN32) || defined(_WIN64)
100#define DEFAULT_PDFREADER "start"
101#else
102#define DEFAULT_PDFREADER "evince"
103#endif
104
105/* report parameter defaults */
106#define DEFAULT_REPORT_MAXNDECOMPS 20 /**< maximum number of decomps to be shown in report */
107#define DEFAULT_REPORT_SHOWTYPE 0 /**< what type of decomps to show
108 * (GCG_DECTYPE, but 0 corresponds to 'show all') */
109#define DEFAULT_REPORT_SHOWTITLEPAGE TRUE /**< if true a titlepage is included */
110#define DEFAULT_REPORT_SHOWTOC TRUE /**< if true a table of contents is included */
111#define DEFAULT_REPORT_SHOWSTATISTICS TRUE /**< if true statistics are included for each decomp */
112
113/** data structure for visualization parameters */
115{
116 SCIP_Bool visudraftmode; /**< true if no nonzeros should be shown */
117 VISU_COLORSCHEME visucolorscheme; /**< stores the current color scheme */
118 int visuradius; /**< radius for nonzeros */
119 SCIP_Bool visuusegp; /**< if true gnuplot is used for visualizations, otherwise LaTeX/Tikz */
120
121 char* mancolormastervars; /**< manual color for master variables */
122 char* mancolormasterconss; /**< manual color for master constraints */
123 char* mancolorlinking; /**< manual color for linking */
124 char* mancolorstairlinking; /**< manual color for stairlinking */
125 char* mancolorblock; /**< manual color for blocks */
126 char* mancoloropen; /**< manual color for nonassigned areas */
127 char* mancolornonzero; /**< manual color for nonzeros */
128 char* mancolorline; /**< manual color for lines */
129
130 char* greycolormastervars; /**< black and white color for master variables */
131 char* greycolormasterconss; /**< black and white color for master constraints */
132 char* greycolorlinking; /**< black and white color for linking */
133 char* greycolorstairlinking; /**< black and white color for stairlinking */
134 char* greycolorblock; /**< black and white color for blocks */
135 char* greycoloropen; /**< black and white color for nonassigned areas */
136 char* greycolornonzero; /**< black and white color for nonzeros */
137 char* greycolorline; /**< black and white color for lines */
138
139 char* pdfreader; /**< name of pdfreader to open files with */
140
141 int rep_maxndecomps; /**< maximum number of decomps to be shown in report */
142 SCIP_Bool rep_showtitle; /**< if true a titlepage is included */
143 SCIP_Bool rep_showtoc; /**< if true a table of contents is included */
144 SCIP_Bool rep_statistics; /**< if true statistics are included for each decomp */
145
146 int nmaxdecompstowrite; /**< maximum number of decompositions to write */
147};
148
149
150/* getter & setter */
151
152
153/* gets if draftmode is on
154 * draftmode lets visualizations omit nonzeros
155 * @returns true if draftmode is on */
157 GCG* gcg /**< GCG data structure */
158 )
159{
160 GCG_PARAMDATA* paramdata;
161 SCIP_Bool draftmode;
162
163 paramdata = GCGgetParamsVisu(gcg);
164 assert(paramdata != NULL);
165
166 draftmode = paramdata->visudraftmode;
167 return draftmode;
168}
169
170
171/* sets draftmode
172 * draftmode lets visualizations omit nonzeros */
174 GCG* gcg, /**< GCG data structure */
175 SCIP_Bool setmode /**< true iff draftmode should be on */
176 )
177{
178 GCG_PARAMDATA* paramdata;
179
180 paramdata = GCGgetParamsVisu(gcg);
181 assert(paramdata != NULL);
182
183 paramdata->visudraftmode = setmode;
184}
185
186/** gets the colorscheme for visualizations
187 * @returns current colorscheme */
189 GCG* gcg /**< GCG data structure */
190 )
191{
192 GCG_PARAMDATA* paramdata;
193 VISU_COLORSCHEME curscheme;
194
195 paramdata = GCGgetParamsVisu(gcg);
196 assert(paramdata != NULL);
197
198 curscheme = paramdata->visucolorscheme;
199 return curscheme;
200}
201
202
203/* sets colorscheme for visualizations */
205 GCG* gcg, /**< GCG data structure */
206 VISU_COLORSCHEME newscheme /**< new colorscheme */
207 )
208{
209 GCG_PARAMDATA* paramdata;
210
211 paramdata = GCGgetParamsVisu(gcg);
212 assert(paramdata != NULL);
213
214 paramdata->visucolorscheme = newscheme;
215}
216
217
218/* gets color for mastercon block in current color scheme
219 * @returns mastercons color */
221 GCG* gcg /**< GCG data structure */
222 )
223{
224 GCG_PARAMDATA* paramdata;
225 const char* color;
226
227 paramdata = GCGgetParamsVisu(gcg);
228 assert(paramdata != NULL);
229
231 {
232 case COLORSCHEME_GREY:
233 color = paramdata->greycolormasterconss;
234 break;
236 color = paramdata->mancolormasterconss;
237 break;
238 default:
240 }
241 return color;
242}
243
244
245/* gets color for mastervar block in current color scheme
246 * @returns mastervars color */
248 GCG* gcg /**< GCG data structure */
249 )
250{
251 GCG_PARAMDATA* paramdata;
252 const char* color;
253
254 paramdata = GCGgetParamsVisu(gcg);
255 assert(paramdata != NULL);
256
258 {
259 case COLORSCHEME_GREY:
260 color = paramdata->greycolormastervars;
261 break;
263 color = paramdata->mancolormastervars;
264 break;
265 default:
267 }
268 return color;
269}
270
271
272/* gets color for linking blocks in current color scheme
273 * @returns linking color */
275 GCG* gcg /**< GCG data structure */
276 )
277{
278 GCG_PARAMDATA* paramdata;
279 const char* color;
280
281 paramdata = GCGgetParamsVisu(gcg);
282 assert(paramdata != NULL);
283
285 {
286 case COLORSCHEME_GREY:
287 color = paramdata->greycolorlinking;
288 break;
290 color = paramdata->mancolorlinking;
291 break;
292 default:
293 color = DEFAULT_COLOR_LINKING;
294 }
295 return color;
296}
297
298
299/* gets color for stairlinking blocks in current color scheme
300 * @returns stairlinking color */
302 GCG* gcg /**< GCG data structure */
303 )
304{
305 GCG_PARAMDATA* paramdata;
306 const char* color;
307
308 paramdata = GCGgetParamsVisu(gcg);
309 assert(paramdata != NULL);
310
312 {
313 case COLORSCHEME_GREY:
314 color = paramdata->greycolorstairlinking;
315 break;
317 color = paramdata->mancolorstairlinking;
318 break;
319 default:
321 }
322 return color;
323}
324
325
326/* gets color for normal decomp blocks in current color scheme
327 * @returns block color */
329 GCG* gcg /**< GCG data structure */
330 )
331{
332 GCG_PARAMDATA* paramdata;
333 const char* color;
334
335 paramdata = GCGgetParamsVisu(gcg);
336 assert(paramdata != NULL);
337
339 {
340 case COLORSCHEME_GREY:
341 color = paramdata->greycolorblock;
342 break;
344 color = paramdata->mancolorblock;
345 break;
346 default:
347 color = DEFAULT_COLOR_BLOCK;
348 }
349 return color;
350}
351
352
353/* gets color for open blocks in current color scheme
354 * @returns open color */
356 GCG* gcg /**< GCG data structure */
357 )
358{
359 GCG_PARAMDATA* paramdata;
360 const char* color;
361
362 paramdata = GCGgetParamsVisu(gcg);
363 assert(paramdata != NULL);
364
366 {
367 case COLORSCHEME_GREY:
368 color = paramdata->greycoloropen;
369 break;
371 color = paramdata->mancoloropen;
372 break;
373 default:
374 color = DEFAULT_COLOR_OPEN;
375 }
376 return color;
377}
378
379
380/* gets color for non-zero points in current color scheme
381 * @returns non-zero color */
383 GCG* gcg /**< GCG data structure */
384 )
385{
386 GCG_PARAMDATA* paramdata;
387 const char* color;
388
389 paramdata = GCGgetParamsVisu(gcg);
390 assert(paramdata != NULL);
391
393 {
394 case COLORSCHEME_GREY:
395 color = paramdata->greycolornonzero;
396 break;
398 color = paramdata->mancolornonzero;
399 break;
400 default:
401 color = DEFAULT_COLOR_NONZERO;
402 }
403 return color;
404}
405
406
407/* gets color for lines in current color scheme
408 * @returns line color */
410 GCG* gcg /**< GCG data structure */
411 )
412{
413 GCG_PARAMDATA* paramdata;
414 const char* color;
415
416 paramdata = GCGgetParamsVisu(gcg);
417 assert(paramdata != NULL);
418
420 {
421 case COLORSCHEME_GREY:
422 color = paramdata->greycolorline;
423 break;
425 color = paramdata->mancolorline;
426 break;
427 default:
428 color = DEFAULT_COLOR_LINE;
429 }
430 return color;
431}
432
433
434/* sets color for mastercon block in current color scheme */
436 GCG* gcg, /* GCG data structure */
437 const char* newcolor /* new color */
438 )
439{
440 GCG_PARAMDATA* paramdata;
441
442 paramdata = GCGgetParamsVisu(gcg);
443 assert(paramdata != NULL);
444
445 SCIPsnprintf(paramdata->mancolormasterconss, SCIP_MAXSTRLEN, "%s", newcolor);
446}
447
448
449/* sets manual color for mastervar block in current color scheme */
451 GCG* gcg, /* GCG data structure */
452 const char* newcolor /* new color */
453 )
454{
455 GCG_PARAMDATA* paramdata;
456
457 paramdata = GCGgetParamsVisu(gcg);
458 assert(paramdata != NULL);
459
460 SCIPsnprintf(paramdata->mancolormastervars, SCIP_MAXSTRLEN, "%s", newcolor);
461}
462
463
464/* sets manual color for linking blocks in current color scheme */
466 GCG* gcg, /* GCG data structure d refere*/
467 const char* newcolor /* new color */
468 )
469{
470 GCG_PARAMDATA* paramdata;
471
472 paramdata = GCGgetParamsVisu(gcg);
473 assert(paramdata != NULL);
474
475 SCIPsnprintf(paramdata->mancolorlinking, SCIP_MAXSTRLEN, "%s", newcolor);
476}
477
478
479/* sets manual color for stairlinking blocks in current color scheme */
481 GCG* gcg, /* GCG data structure */
482 const char* newcolor /* new color */
483 )
484{
485 GCG_PARAMDATA* paramdata;
486
487 paramdata = GCGgetParamsVisu(gcg);
488 assert(paramdata != NULL);
489
490 SCIPsnprintf(paramdata->mancolorstairlinking, SCIP_MAXSTRLEN, "%s", newcolor);
491}
492
493
494/* sets manual color for normal decomp blocks in current color scheme */
496 GCG* gcg, /* GCG data structure */
497 const char* newcolor /* new color */
498 )
499{
500 GCG_PARAMDATA* paramdata;
501
502 paramdata = GCGgetParamsVisu(gcg);
503 assert(paramdata != NULL);
504
505 SCIPsnprintf(paramdata->mancolorblock, SCIP_MAXSTRLEN, "%s", newcolor);
506}
507
508
509/* sets manual color for open blocks in current color scheme */
511 GCG* gcg, /* GCG data structure */
512 const char* newcolor /* new color */
513 )
514{
515 GCG_PARAMDATA* paramdata;
516
517 paramdata = GCGgetParamsVisu(gcg);
518 assert(paramdata != NULL);
519
520 SCIPsnprintf(paramdata->mancoloropen, SCIP_MAXSTRLEN, "%s", newcolor);
521}
522
523/* sets manual color for non-zero points in current color scheme */
525 GCG* gcg, /* GCG data structure */
526 const char* newcolor /* new color */
527 )
528{
529 GCG_PARAMDATA* paramdata;
530
531 paramdata = GCGgetParamsVisu(gcg);
532 assert(paramdata != NULL);
533
534 SCIPsnprintf(paramdata->mancolornonzero, SCIP_MAXSTRLEN, "%s", newcolor);
535}
536
537
538/* sets manual color for lines in current color scheme */
540 GCG* gcg, /* GCG data structure */
541 const char* newcolor /* new color */
542 )
543{
544 GCG_PARAMDATA* paramdata;
545
546 paramdata = GCGgetParamsVisu(gcg);
547 assert(paramdata != NULL);
548 SCIPsnprintf(paramdata->mancolorline, SCIP_MAXSTRLEN, "%s", newcolor);
549}
550
551
552/* gets appropriate radius for nonzeros
553 * needs highest indices of both axes
554 * @returns radius */
556 GCG* gcg, /* GCG data structure */
557 int maxindx, /* highest index x-axis */
558 int maxindy, /* highest index y-axis */
559 float scalingfactor /* percentage to scale radius, 1 if no scaling */
560 )
561{
562 int maxind;
563 float radius;
564 GCG_PARAMDATA* paramdata;
565
566 paramdata = GCGgetParamsVisu(gcg);
567 assert(paramdata != NULL);
568
569 maxind = 0;
570
571 /* the max indices must be at least one to be compatible with division */
572 if(maxindx <= 0)
573 maxindx = 1;
574
575 if(maxindy <= 0)
576 maxindy = 1;
577
578 /* determine the highest index */
579 if(maxindx > maxindy)
580 maxind = maxindx;
581 else
582 maxind = maxindy;
583
584 /* scale by coordinate system size and given factor */
585 radius = ( (float) paramdata->visuradius / (float) maxind) * scalingfactor;
586
587 return radius;
588}
589
590
591/* if true gp reader should be used for sub-visualizations, otherwise tex reader
592 * @returns true if gp reader should be used, false if tex reader should be used */
594 GCG* gcg /**< GCG data structure */
595 )
596{
597 GCG_PARAMDATA* paramdata;
598 SCIP_Bool usegp;
599
600 paramdata = GCGgetParamsVisu(gcg);
601 assert(paramdata != NULL);
602
603 usegp = paramdata->visuusegp;
604 return usegp;
605}
606
607
608/* gets the name of the pdf reader that should be used
609 * @returns name of pdf reader */
611 GCG* gcg /**< GCG data structure */
612 )
613{
614 GCG_PARAMDATA* paramdata;
615 char* pdfreader;
616
617 paramdata = GCGgetParamsVisu(gcg);
618 assert(paramdata != NULL);
619
620 pdfreader = paramdata->pdfreader;
621 return pdfreader;
622}
623
624
625/* gets the max number of decomps to be included in reports
626 * @returns max number of decomps */
628 GCG* gcg /**< GCG data structure */
629 )
630{
631 GCG_PARAMDATA* paramdata;
632 int max;
633
634 paramdata = GCGgetParamsVisu(gcg);
635 assert(paramdata != NULL);
636
637 max = paramdata->rep_maxndecomps;
638 return max;
639}
640
641
642/* gets whether a titlepage should be included in reports
643 * @returns true iff title page should be generated */
645 GCG* gcg /**< GCG data structure */
646 )
647{
648 GCG_PARAMDATA* paramdata;
649 SCIP_Bool showtitle;
650
651 paramdata = GCGgetParamsVisu(gcg);
652 assert(paramdata != NULL);
653
654 showtitle = paramdata->rep_showtitle;
655 return showtitle;
656}
657
658
659/* gets whether a table of contents should be included in reports
660 * @returns true iff table of contents should be generated */
662 GCG* gcg /**< GCG data structure */
663 )
664{
665 GCG_PARAMDATA* paramdata;
666 SCIP_Bool showtoc;
667
668 paramdata = GCGgetParamsVisu(gcg);
669 assert(paramdata != NULL);
670
671 showtoc = paramdata->rep_showtoc;
672 return showtoc;
673}
674
675
676/* gets whether statistics should be included for each decomp in reports
677 * @returns true iff statistics for each decomp should be generated */
679 GCG* gcg /**< GCG data structure */
680 )
681{
682 GCG_PARAMDATA* paramdata;
683 SCIP_Bool showstats;
684
685 paramdata = GCGgetParamsVisu(gcg);
686 assert(paramdata != NULL);
687
688 showstats = paramdata->rep_statistics;
689 return showstats;
690}
691
692
693#define paramInitVisu NULL
694
695/* frees all visualization parameters */
697 GCG* gcg, /* GCG data structure */
698 GCG_PARAMDATA* paramdata /* input empty paramdata, oputput new set of param data */
699 )
700{
701 SCIP* origprob;
702 assert(gcg != NULL);
703 assert(paramdata != NULL);
704
706
711 SCIPfreeMemory(origprob, &(paramdata->greycolorblock));
712 SCIPfreeMemory(origprob, &(paramdata->greycoloropen));
714 SCIPfreeMemory(origprob, &(paramdata->greycolorline));
715
716 SCIPfreeBlockMemory(origprob, &paramdata);
717}
718
719/** includes the visualization parameters into GCG & initializes them */
721 GCG* gcg, /**< GCG data structure */
722 GCG_PARAMDATA** paramdata /**< input empty paramdata, output new set of param data */
723 )
724{
725 SCIP* origprob;
726 assert(*paramdata == NULL);
727
729 SCIP_CALL( SCIPallocBlockMemory(origprob, &(*paramdata)) );
730
731 /* init string params with NULL pointer */
732 (*paramdata)->pdfreader = NULL;
733 (*paramdata)->mancolormastervars = NULL;
734 (*paramdata)->mancolormasterconss = NULL;
735 (*paramdata)->mancolorlinking = NULL;
736 (*paramdata)->mancolorstairlinking = NULL;
737 (*paramdata)->mancolorblock = NULL;
738 (*paramdata)->mancoloropen = NULL;
739 (*paramdata)->mancolornonzero = NULL;
740 (*paramdata)->mancolorline = NULL;
741
742 /* initialize black and white color scheme */
743 SCIP_CALL( SCIPallocMemoryArray(origprob, &((*paramdata)->greycolormastervars), SCIP_MAXSTRLEN) );
744 SCIPsnprintf((*paramdata)->greycolormastervars, SCIP_MAXSTRLEN, "%s", GREY_COLOR_MASTERVARS);
745 SCIP_CALL( SCIPallocMemoryArray(origprob, &((*paramdata)->greycolormasterconss), SCIP_MAXSTRLEN) );
746 SCIPsnprintf((*paramdata)->greycolormasterconss, SCIP_MAXSTRLEN, "%s", GREY_COLOR_MASTERCONS);
747 SCIP_CALL( SCIPallocMemoryArray(origprob, &((*paramdata)->greycolorlinking), SCIP_MAXSTRLEN) );
748 SCIPsnprintf((*paramdata)->greycolorlinking, SCIP_MAXSTRLEN, "%s", GREY_COLOR_LINKING);
749 SCIP_CALL( SCIPallocMemoryArray(origprob, &((*paramdata)->greycolorstairlinking), SCIP_MAXSTRLEN) );
750 SCIPsnprintf((*paramdata)->greycolorstairlinking, SCIP_MAXSTRLEN, "%s", GREY_COLOR_STAIRLINKING);
751 SCIP_CALL( SCIPallocMemoryArray(origprob, &((*paramdata)->greycolorblock), SCIP_MAXSTRLEN) );
752 SCIPsnprintf((*paramdata)->greycolorblock, SCIP_MAXSTRLEN, "%s", GREY_COLOR_BLOCK);
753 SCIP_CALL( SCIPallocMemoryArray(origprob, &((*paramdata)->greycoloropen), SCIP_MAXSTRLEN) );
754 SCIPsnprintf((*paramdata)->greycoloropen, SCIP_MAXSTRLEN, "%s", GREY_COLOR_OPEN);
755 SCIP_CALL( SCIPallocMemoryArray(origprob, &((*paramdata)->greycolornonzero), SCIP_MAXSTRLEN) );
756 SCIPsnprintf((*paramdata)->greycolornonzero, SCIP_MAXSTRLEN, "%s", GREY_COLOR_NONZERO);
757 SCIP_CALL( SCIPallocMemoryArray(origprob, &((*paramdata)->greycolorline), SCIP_MAXSTRLEN) );
758 SCIPsnprintf((*paramdata)->greycolorline, SCIP_MAXSTRLEN, "%s", GREY_COLOR_LINE);
759
760 /* add general parameters */
762 "visual/draftmode", "if true no nonzeros are shown (may improve performance)",
763 &(*paramdata)->visudraftmode, FALSE, DEFAULT_VISU_DRAFTMODE, NULL, NULL) );
764
766 "visual/colorscheme", "type number: 0=default, 1=black and white, 2=manual",
767 (int*) &(*paramdata)->visucolorscheme, FALSE, DEFAULT_VISU_COLORSCHEME, 0, 2, NULL, NULL) );
768
770 "visual/nonzeroradius", "integer value to scale points on range 1-10",
771 &(*paramdata)->visuradius, FALSE, DEFAULT_VISU_RADIUS, 1, 10, NULL, NULL) );
772
774 "visual/nmaxdecompstowrite", "maximum number of decompositions to write (-1: no limit)",
775 &(*paramdata)->nmaxdecompstowrite, FALSE, -1, -1, INT_MAX, NULL, NULL) );
776
778 "visual/pdfreader", "pdf reader that opens visualizations in decomposition explorer",
779 &(*paramdata)->pdfreader, FALSE,
781 NULL, NULL) );
782
783 /* add parameters for manual colors */
785 "visual/colors/colormastervars", "color for master variables in hex code",
786 &(*paramdata)->mancolormastervars, FALSE, DEFAULT_COLOR_MASTERVARS, NULL, NULL) );
787
789 "visual/colors/colormasterconss", "color for master constraints in hex code",
790 &(*paramdata)->mancolormasterconss, FALSE, DEFAULT_COLOR_MASTERCONSS, NULL, NULL) );
791
793 "visual/colors/colorlinking", "color for linking variables in hex code",
794 &(*paramdata)->mancolorlinking, FALSE, DEFAULT_COLOR_LINKING, NULL, NULL) );
795
797 "visual/colors/colorstairlinking", "color for stairlinking variables in hex code",
798 &(*paramdata)->mancolorstairlinking, FALSE, DEFAULT_COLOR_STAIRLINKING, NULL, NULL) );
799
801 "visual/colors/colorblock", "color for found blocks in hex code",
802 &(*paramdata)->mancolorblock, FALSE, DEFAULT_COLOR_BLOCK, NULL, NULL) );
803
805 "visual/colors/coloropen", "color for open areas in hex code",
806 &(*paramdata)->mancoloropen, FALSE, DEFAULT_COLOR_OPEN, NULL, NULL) );
807
809 "visual/colors/colornonzeros", "color for nonzeros in hex code",
810 &(*paramdata)->mancolornonzero, FALSE, DEFAULT_COLOR_NONZERO, NULL, NULL) );
811
813 "visual/colors/colorlines", "color for lines in hex code",
814 &(*paramdata)->mancolorline, FALSE, DEFAULT_COLOR_LINE, NULL, NULL) );
815
816 /* add parameters for report */
818 "visual/report/maxndecomps", "maximum number of decompositions shown in report (best scores first)",
819 &(*paramdata)->rep_maxndecomps, FALSE, DEFAULT_REPORT_MAXNDECOMPS, 1, INT_MAX, NULL, NULL) );
820
822 "visual/report/showtitle", "if true a title page is included",
823 &(*paramdata)->rep_showtitle, FALSE, DEFAULT_REPORT_SHOWTITLEPAGE, NULL, NULL) );
824
826 "visual/report/showtoc", "if true a table of contents is included",
827 &(*paramdata)->rep_showtoc, FALSE, DEFAULT_REPORT_SHOWTOC, NULL, NULL) );
828
830 "visual/report/showstatistics", "if true statistics are included for each decomp",
831 &(*paramdata)->rep_statistics, FALSE, DEFAULT_REPORT_SHOWSTATISTICS, NULL, NULL) );
832
834 "visual/report/usegp", "if true gnuplot is used for sub-visualizations in report, otherwise LaTeX/Tikz",
835 &(*paramdata)->visuusegp, FALSE, DEFAULT_VISU_USEGP, NULL, NULL) );
836
837 return SCIP_OKAY;
838}
constraint handler for structure detection
#define SCIP_MAXSTRLEN
#define SCIP_Bool
#define FALSE
GCG_EXPORT GCG_PARAMDATA * GCGgetParamsVisu(GCG *gcg)
Definition relax_gcg.c:4285
SCIP * GCGgetOrigprob(GCG *gcg)
Definition gcg.cpp:87
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPaddStringParam(SCIP *scip, const char *name, const char *desc, char **valueptr, SCIP_Bool isadvanced, const char *defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
#define SCIPallocMemoryArray(scip, ptr, num)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIPfreeMemory(GCGgetOrigprob(gcg), &divingdata)
static assert(heur !=NULL)
SCIP_CALL(SCIPgetExternBranchCands(origprob, &lpcands, &lpcandssol, NULL, &nlpcands, NULL, NULL, NULL, NULL))
SCIP * origprob
SCIP_Real scalingfactor
#define NULL
INLINE Rational & max(Rational &r1, Rational &r2)
#define DEFAULT_COLOR_BLOCK
Definition params_visu.c:71
#define DEFAULT_VISU_COLORSCHEME
Definition params_visu.c:88
SCIP_Bool GCGreportGetShowTitlepage(GCG *gcg)
#define GREY_COLOR_NONZERO
Definition params_visu.c:83
#define DEFAULT_REPORT_MAXNDECOMPS
SCIP_Bool GCGreportGetShowStatistics(GCG *gcg)
const char * GCGvisuGetColorStairlinking(GCG *gcg)
#define DEFAULT_VISU_RADIUS
Definition params_visu.c:89
#define GREY_COLOR_STAIRLINKING
Definition params_visu.c:80
const char * GCGvisuGetColorMastervars(GCG *gcg)
const char * GCGVisuGetPdfReader(GCG *gcg)
#define DEFAULT_REPORT_SHOWTOC
SCIP_Bool GCGgetUseGp(GCG *gcg)
#define DEFAULT_PDFREADER
void GCGvisuSetColorManOpen(GCG *gcg, const char *newcolor)
SCIP_Bool GCGvisuGetDraftmode(GCG *gcg)
void GCGvisuSetColorManLinking(GCG *gcg, const char *newcolor)
#define GREY_COLOR_LINKING
Definition params_visu.c:79
SCIP_RETCODE GCGcreateParamsVisu(GCG *gcg, GCG_PARAMDATA **paramdata)
int GCGreportGetMaxNDecomps(GCG *gcg)
void GCGvisuSetDraftmode(GCG *gcg, SCIP_Bool setmode)
#define DEFAULT_COLOR_STAIRLINKING
Definition params_visu.c:70
#define GREY_COLOR_OPEN
Definition params_visu.c:82
#define DEFAULT_VISU_DRAFTMODE
Definition params_visu.c:87
#define GREY_COLOR_MASTERCONS
Definition params_visu.c:78
void GCGvisuSetColorManLine(GCG *gcg, const char *newcolor)
#define DEFAULT_COLOR_OPEN
Definition params_visu.c:72
const char * GCGvisuGetColorNonzero(GCG *gcg)
#define DEFAULT_REPORT_SHOWSTATISTICS
void GCGVisuFreeParams(GCG *gcg, GCG_PARAMDATA *paramdata)
#define GREY_COLOR_LINE
Definition params_visu.c:84
void GCGvisuSetColorManStairlinking(GCG *gcg, const char *newcolor)
void GCGvisuSetColorManBlock(GCG *gcg, const char *newcolor)
float GCGvisuGetNonzeroRadius(GCG *gcg, int maxindx, int maxindy, float scalingfactor)
SCIP_Bool GCGreportGetShowToc(GCG *gcg)
const char * GCGvisuGetColorLinking(GCG *gcg)
#define DEFAULT_COLOR_MASTERCONSS
Definition params_visu.c:68
#define GREY_COLOR_BLOCK
Definition params_visu.c:81
const char * GCGvisuGetColorBlock(GCG *gcg)
void GCGvisuSetColorManMasterconss(GCG *gcg, const char *newcolor)
#define DEFAULT_COLOR_LINKING
Definition params_visu.c:69
void GCGvisuSetColorManMastervars(GCG *gcg, const char *newcolor)
#define DEFAULT_COLOR_LINE
Definition params_visu.c:74
#define DEFAULT_COLOR_MASTERVARS
Definition params_visu.c:67
const char * GCGvisuGetColorLine(GCG *gcg)
VISU_COLORSCHEME GCGvisuGetColorscheme(GCG *gcg)
void GCGvisuSetColorscheme(GCG *gcg, VISU_COLORSCHEME newscheme)
void GCGvisuSetColorManNonzero(GCG *gcg, const char *newcolor)
const char * GCGvisuGetColorOpen(GCG *gcg)
#define GREY_COLOR_MASTERVARS
Definition params_visu.c:77
#define DEFAULT_VISU_USEGP
Definition params_visu.c:90
const char * GCGvisuGetColorMasterconss(GCG *gcg)
#define DEFAULT_REPORT_SHOWTITLEPAGE
#define DEFAULT_COLOR_NONZERO
Definition params_visu.c:73
enum Colorscheme VISU_COLORSCHEME
Definition params_visu.h:57
@ COLORSCHEME_GREY
Definition params_visu.h:53
@ COLORSCHEME_MANUAL
Definition params_visu.h:54
GCG relaxator.
SCIP_Bool rep_showtitle
char * greycoloropen
VISU_COLORSCHEME visucolorscheme
char * mancolorblock
SCIP_Bool rep_showtoc
char * mancolorline
SCIP_Bool visudraftmode
char * mancolornonzero
char * greycolornonzero
SCIP_Bool rep_statistics
char * greycolorline
char * greycolormasterconss
char * mancolorstairlinking
SCIP_Bool visuusegp
char * mancoloropen
char * greycolorstairlinking
char * mancolormasterconss
char * greycolorblock
char * greycolormastervars
char * greycolorlinking
char * mancolorlinking
char * mancolormastervars
type definitions for decomposition information in GCG projects
struct Gcg GCG
Definition type_gcg.h:44
struct GCG_ParamData GCG_PARAMDATA
enum SCIP_Retcode SCIP_RETCODE
struct Scip SCIP