Scippy

GCG

Branch-and-Price & Column Generation for Everyone

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