Scippy

GCG

Branch-and-Price & Column Generation for Everyone

reader_tex.cpp
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 reader_tex.cpp
29  * @brief tex file reader for writing partialdecs to LaTeX files
30  * @author Hanna Franzen
31  */
32 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #include <cassert>
36 #include <cstring>
37 
38 #if defined(_WIN32) || defined(_WIN64)
39 #else
40 #include <strings.h> /*lint --e{766}*/ /* needed for strcasecmp() */
41 #endif
42 #include <cstdio>
43 #include <vector>
44 #include <sstream>
45 #include <algorithm> // std::sort
46 
47 #include "reader_tex.h"
48 #include "scip_misc.h"
49 #include "reader_gp.h"
50 #include "cons_decomp.h"
51 #include "cons_decomp.hpp"
52 #include "pub_decomp.h"
53 #include "miscvisualization.h"
54 #include "class_partialdecomp.h"
55 #include "class_detprobdata.h"
56 #include "params_visu.h"
57 #include "scoretype.h"
58 
59 #define READER_NAME "texreader"
60 #define READER_DESC "LaTeX file writer for partialdec visualization"
61 #define READER_EXTENSION "tex"
62 
63 using namespace gcg;
64 
65 /** Destructor of reader to free user data (called when SCIP is exiting) */
66 SCIP_DECL_READERFREE(readerFreeTex)
67 {
68  return SCIP_OKAY;
69 }
70 
71 /** Problem reading method of reader.
72  * Since the reader is not supposed to read files this returns a reading error. */
73 SCIP_DECL_READERREAD(readerReadTex)
74 { /*lint --e{715}*/
75  return SCIP_READERROR;
76 }
77 
78 /** Problem writing method of reader */
79 SCIP_DECL_READERWRITE(readerWriteTex)
80 {
81  PARTIALDECOMP* pd;
82  assert(scip != NULL);
83  assert(reader != NULL);
84 
85 
86  /* get partialdec to write */
87  pd = DECgetPartialdecToWrite(scip, transformed);
88 
89  if( pd == NULL )
90  {
91  SCIPerrorMessage("Could not find Partialdecomp to write!\n");
92  *result = SCIP_DIDNOTRUN;
93  }
94  else
95  {
96  GCGwriteTexVisualization(scip, file, pd->getID(), TRUE, FALSE);
97  *result = SCIP_SUCCESS;
98  }
99 
100  return SCIP_OKAY;
101 }
102 
103 
104 /** Outputs the r, g, b decimal values for the rgb hex input
105  *
106  * @returns SCIP status */
107 static
108 SCIP_RETCODE getRgbFromHex(
109  const char* hex, /**< input hex rgb code of form "#000000" */
110  int* red, /**< output decimal r */
111  int* green,/**< output decimal g */
112  int* blue /**< output decimal b */
113  )
114 {
115  char temp[SCIP_MAXSTRLEN];
116  unsigned int r = 0;
117  unsigned int g = 0;
118  unsigned int b = 0;
119 
120  assert( hex[0] == '#' );
121 
122  /* remove the '#' at the beginning */
123  strcpy( temp, hex );
124  memmove( temp, temp+1, strlen( temp ) );
125 
126  /* extract int values from the rest */
127  sscanf( temp, "%02x%02x%02x", &r, &g, &b );
128 
129  *red = (int) r;
130  *green = (int) g;
131  *blue = (int) b;
132 
133  return SCIP_OKAY;
134 }
135 
136 
137 /** Converts a hex color code into a tex-conform line of code that defines the color as "colorname"
138  *
139  * @returns SCIP status */
140 static
141 SCIP_RETCODE getTexColorFromHex(
142  const char* hex, /**< hex code for color */
143  const char* colorname, /**< name of color */
144  char* code /**< output resulting code line */
145  )
146 {
147  char texcode[SCIP_MAXSTRLEN];
148  char colorcode[SCIP_MAXSTRLEN];
149  int r;
150  int g;
151  int b;
152 
153  /* convert hex color code to rgb color */
154  getRgbFromHex( hex, &r, &g, &b );
155 
156  /* make tex code line that defines a rgb color with the computed values */
157  strcpy( texcode, "\\definecolor{" );
158  strcat( texcode, colorname );
159  strcat( texcode, "}{RGB}{" );
160  snprintf(colorcode, SCIP_MAXSTRLEN, "%d", r);
161  strcat( texcode, colorcode );
162  strcat( texcode, "," );
163  snprintf(colorcode, SCIP_MAXSTRLEN, "%d", g);
164  strcat( texcode, colorcode );
165  strcat( texcode, "," );
166  snprintf(colorcode, SCIP_MAXSTRLEN, "%d", b);
167  strcat( texcode, colorcode );
168  strcat( texcode, "}" );
169 
170  /* copy the code line into the output variable */
171  strcpy( code, texcode );
172 
173  return SCIP_OKAY;
174 }
175 
176 
177 /** Write LaTeX code header & begin of document to given file
178  *
179  * @returns SCIP status */
180 static
181 SCIP_RETCODE writeTexHeader(
182  SCIP* scip, /**< SCIP data structure */
183  FILE* file, /**< File pointer to write to */
184  SCIP_Bool externalizepics /**< whether to use the tikz externalize package */
185  )
186 {
187  char temp[SCIP_MAXSTRLEN];
188 
189  /* write header */
190  SCIPinfoMessage(scip, file, "%% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n");
191  SCIPinfoMessage(scip, file, "%% * * \n");
192  SCIPinfoMessage(scip, file, "%% * This file is part of the program * \n");
193  SCIPinfoMessage(scip, file, "%% * GCG --- Generic Column Generation * \n");
194  SCIPinfoMessage(scip, file, "%% * a Dantzig-Wolfe decomposition based extension * \n");
195  SCIPinfoMessage(scip, file, "%% * of the branch-cut-and-price framework * \n");
196  SCIPinfoMessage(scip, file, "%% * SCIP --- Solving Constraint Integer Programs * \n");
197  SCIPinfoMessage(scip, file, "%% * * \n");
198  SCIPinfoMessage(scip, file, "%% * Copyright (C) 2010-2021 Operations Research, RWTH Aachen University * \n");
199  SCIPinfoMessage(scip, file, "%% * Zuse Institute Berlin (ZIB) * \n");
200  SCIPinfoMessage(scip, file, "%% * * \n");
201  SCIPinfoMessage(scip, file, "%% * This program is free software; you can redistribute it and/or * \n");
202  SCIPinfoMessage(scip, file, "%% * modify it under the terms of the GNU Lesser General Public License * \n");
203  SCIPinfoMessage(scip, file, "%% * as published by the Free Software Foundation; either version 3 * \n");
204  SCIPinfoMessage(scip, file, "%% * of the License, or (at your option) any later version. * \n");
205  SCIPinfoMessage(scip, file, "%% * * \n");
206  SCIPinfoMessage(scip, file, "%% * This program is distributed in the hope that it will be useful, * \n");
207  SCIPinfoMessage(scip, file, "%% * but WITHOUT ANY WARRANTY; without even the implied warranty of * \n");
208  SCIPinfoMessage(scip, file, "%% * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * \n");
209  SCIPinfoMessage(scip, file, "%% * GNU Lesser General Public License for more details. * \n");
210  SCIPinfoMessage(scip, file, "%% * * \n");
211  SCIPinfoMessage(scip, file, "%% * You should have received a copy of the GNU Lesser General Public License * \n");
212  SCIPinfoMessage(scip, file, "%% * along with this program; if not, write to the Free Software * \n");
213  SCIPinfoMessage(scip, file, "%% * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.* \n");
214  SCIPinfoMessage(scip, file, "%% * * \n");
215  SCIPinfoMessage(scip, file, "%% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n");
216  SCIPinfoMessage(scip, file, "%%\n");
217  SCIPinfoMessage(scip, file, "%% @author Hanna Franzen\n");
218  SCIPinfoMessage(scip, file, "\n");
219  SCIPinfoMessage(scip, file, "\n");
220  SCIPinfoMessage(scip, file, "\\documentclass[a4paper,10pt]{article}\n");
221  SCIPinfoMessage(scip, file, "\n");
222  SCIPinfoMessage(scip, file, "%% packages\n");
223  SCIPinfoMessage(scip, file, "\\usepackage[utf8]{inputenc}\n");
224  SCIPinfoMessage(scip, file, "\\usepackage[hidelinks]{hyperref}\n");
225  SCIPinfoMessage(scip, file, "\\usepackage{pdfpages}\n");
226  SCIPinfoMessage(scip, file, "\\usepackage{fancybox}\n");
227  if(!GCGgetUseGp(scip))
228  {
229  SCIPinfoMessage(scip, file, "\\usepackage{pgfplots}\n");
230  SCIPinfoMessage(scip, file, "\\pgfplotsset{compat=1.12}\n");
231 // SCIPinfoMessage(scip, file, "\\pgfplotsset{compat=newest} \n");
232 // SCIPinfoMessage(scip, file, "\\pgfplotsset{legend image with text/.style={\nlegend image code/.code={% \n");
233 // SCIPinfoMessage(scip, file, "\\node[anchor=center] at (0.3cm,0cm) {#1};\n}},}\n" );
234 // SCIPinfoMessage(scip, file, "\\usepackage{tikz} \n");
235  SCIPinfoMessage(scip, file, "\\usetikzlibrary{positioning}\n");
236  if(externalizepics)
237  {
238  SCIPinfoMessage(scip, file, " \\usetikzlibrary{external}\n");
239  SCIPinfoMessage(scip, file, " \\tikzexternalize\n");
240  }
241  }
242  SCIPinfoMessage(scip, file, "\n");
243 
244  /* introduce colors of current color scheme */
245  getTexColorFromHex(SCIPvisuGetColorMasterconss(scip), "colormasterconss", temp);
246  SCIPinfoMessage(scip, file, "%s\n", temp);
247 
248  getTexColorFromHex(SCIPvisuGetColorMastervars(scip), "colormastervars", temp);
249  SCIPinfoMessage(scip, file, "%s\n", temp);
250 
251  getTexColorFromHex(SCIPvisuGetColorLinking(scip), "colorlinking", temp);
252  SCIPinfoMessage(scip, file, "%s\n", temp);
253 
254  getTexColorFromHex(SCIPvisuGetColorStairlinking(scip), "colorstairlinking", temp);
255  SCIPinfoMessage(scip, file, "%s\n", temp);
256 
257  getTexColorFromHex(SCIPvisuGetColorBlock(scip), "colorblock", temp);
258  SCIPinfoMessage(scip, file, "%s\n", temp);
259 
260  getTexColorFromHex(SCIPvisuGetColorOpen(scip), "coloropen", temp);
261  SCIPinfoMessage(scip, file, "%s\n", temp);
262 
263  getTexColorFromHex(SCIPvisuGetColorNonzero(scip), "colornonzero", temp);
264  SCIPinfoMessage(scip, file, "%s\n", temp);
265 
266  getTexColorFromHex(SCIPvisuGetColorLine(scip), "colorline", temp);
267  SCIPinfoMessage(scip, file, "%s\n", temp);
268 
269  /* start writing the document */
270  SCIPinfoMessage(scip, file, "\n");
271  SCIPinfoMessage(scip, file, "\\begin{document}\n");
272  SCIPinfoMessage(scip, file, "\n");
273 
274  return SCIP_OKAY;
275 }
276 
277 
278 /** Write LaTeX code title page that includes general statistics about the problem to given file
279  *
280  * @returns SCIP status */
281 static
282 SCIP_RETCODE writeTexTitlepage(
283  SCIP* scip, /**< SCIP data structure */
284  FILE* file, /**< File pointer to write to */
285  int* npresentedpartialdecs /**< Number of decompositions to be shown in the file or NULL if unknown */
286  )
287 {
288  char* pname;
289  char ppath[SCIP_MAXSTRLEN];
290  int ndecomps;
291 
292  ndecomps = GCGconshdlrDecompGetNDecomps(scip);
293  strcpy(ppath, SCIPgetProbName(scip));
294  SCIPsplitFilename(ppath, NULL, &pname, NULL, NULL);
295 
296  SCIPinfoMessage(scip, file, "\\begin{titlepage}\n");
297  SCIPinfoMessage(scip, file, " \\centering\n");
298  SCIPinfoMessage(scip, file, " \\thispagestyle{empty}\n");
299  SCIPinfoMessage(scip, file, " {\\Huge Report: %s} \\\\ \\today \n",
300  pname);
301  SCIPinfoMessage(scip, file, "\n");
302  SCIPinfoMessage(scip, file, "\\vspace{2cm}\n");
303  SCIPinfoMessage(scip, file, "\\begin{tabular}{{lp{10cm}}}\n");
304  SCIPinfoMessage(scip, file, " \\textbf{Problem}: & \\begin{minipage}{10cm}\n");
305  SCIPinfoMessage(scip, file, " \\begin{verbatim}%s\\end{verbatim}\n",
306  pname);
307  SCIPinfoMessage(scip, file, " \\end{minipage} \\\\ \n");
308  SCIPinfoMessage(scip, file, " Number of variables in original problem: & %i \\\\ \n",
309  SCIPgetNOrigVars(scip));
310  SCIPinfoMessage(scip, file, " \\vspace{0.5cm}\n");
311  SCIPinfoMessage(scip, file, " Number of constraints in original problem: & %i \\\\ \n",
312  SCIPgetNOrigConss(scip));
313  SCIPinfoMessage(scip, file, " Number of found finished decompositions: & %i \\\\ \n",
315  SCIPinfoMessage(scip, file, " Number of found incomplete decompositions: & %i \\\\ \n",
317  if(npresentedpartialdecs != NULL){
318  if( ndecomps > *npresentedpartialdecs )
319  {
320  SCIPinfoMessage(scip, file, " Number of decompositions presented in this document: & %i \\\\ \n",
321  *npresentedpartialdecs);
322  }
323  else
324  {
325  SCIPinfoMessage(scip, file, " Number of decompositions presented in this document: & %i \\\\ \n", ndecomps);
326  }
327  }
328 
329  SCIPinfoMessage(scip, file, "Score info: & \\begin{minipage}{5cm}\n");
330  SCIPinfoMessage(scip, file, " %s\n",
332  SCIPinfoMessage(scip, file, " \\end{minipage} \\\\ \n");
333 
334  SCIPinfoMessage(scip, file, "\\end{tabular}\n");
335  SCIPinfoMessage(scip, file, "\n");
336  SCIPinfoMessage(scip, file, "\\end{titlepage}\n");
337  SCIPinfoMessage(scip, file, "\\newpage\n");
338 
339  return SCIP_OKAY;
340 }
341 
342 
343 /** Write LaTeX code for table of contents to given file
344  *
345  * @returns SCIP status */
346 static
348  SCIP* scip, /**< SCIP data structure */
349  FILE* file /**< File pointer to write to */
350  )
351 {
352  SCIPinfoMessage(scip, file, "\\thispagestyle{empty}\n");
353  SCIPinfoMessage(scip, file, "\\tableofcontents\n");
354  SCIPinfoMessage(scip, file, "\\newpage\n");
355  SCIPinfoMessage(scip, file, "\n");
356 
357  return SCIP_OKAY;
358 }
359 
360 
361 /** Writes tikz code for a box
362  *
363  * @returns SCIP status */
364 static
365 SCIP_RETCODE writeTikzBox(
366  SCIP* scip, /**< SCIP data structure */
367  FILE* file, /**< File pointer to write to */
368  int xmax, /**< maximum x axis value */
369  int ymax, /**< maximum y axis value */
370  int x1, /**< x value of lower left vertex coordinate */
371  int y1, /**< y value of lower left vertex coordinate */
372  int x2, /**< x value of upper right vertex coordinate */
373  int y2, /**< y value of upper right vertex coordinate */
374  const char* color /**< color name of box color */
375  )
376 {
377  SCIPinfoMessage(scip, file,
378  " \\filldraw [fill=%s, draw=colorline] (%f*\\textwidth*0.75,%f*\\textwidth*0.75) rectangle (%f*\\textwidth*0.75,%f*\\textwidth*0.75);\n",
379  color, ( (float) x1 / (float) xmax ), ( (float) y1 / (float) ymax ), ( (float) x2 / (float) xmax ),
380  ( (float) y2 / (float) ymax ));
381  return SCIP_OKAY;
382 }
383 
384 
385 /** Writes tikz code for dots representing nonzeros
386  *
387  * @returns SCIP status */
388 static
389 SCIP_RETCODE writeTikzNonzeros(
390  SCIP* scip, /**< SCIP data structure */
391  FILE* file, /**< file to write to */
392  PARTIALDECOMP* partialdec, /**< PARTIALDECOMP for which the nonzeros should be visualized */
393  float radius, /**< radius of the dots */
394  int xmax, /**< maximum x axis value */
395  int ymax /**< maximum y axis value */
396  )
397 {
398  std::vector<int> orderToRows(partialdec->getNConss(), -1);
399  std::vector<int> rowToOrder(partialdec->getNConss(), -1);
400  std::vector<int> orderToCols(partialdec->getNVars(), -1);
401  std::vector<int> colsToOrder(partialdec->getNVars(), -1);
402  int counterrows = 0;
403  int countercols = 0;
404  DETPROBDATA* detprobdata;
405 
406  detprobdata = partialdec->getDetprobdata();
407 
408  /* order of constraints */
409  /* master constraints */
410  for( int i = 0; i < partialdec->getNMasterconss() ; ++i )
411  {
412  int rowidx = partialdec->getMasterconss()[i];
413  orderToRows[counterrows] = rowidx;
414  rowToOrder[rowidx] = counterrows;
415  ++counterrows;
416  }
417 
418  /* block constraints */
419  for( int b = 0; b < partialdec->getNBlocks(); ++b )
420  {
421  for(int i = 0; i < partialdec->getNConssForBlock(b); ++i )
422  {
423  int rowidx = partialdec->getConssForBlock(b)[i];
424  orderToRows[counterrows] = rowidx;
425  rowToOrder[rowidx] = counterrows;
426  ++counterrows;
427  }
428  }
429 
430  /* open constraints */
431  for( int i = 0; i < partialdec->getNOpenconss(); ++i )
432  {
433  int rowidx = partialdec->getOpenconss()[i];
434  orderToRows[counterrows] = rowidx;
435  rowToOrder[rowidx] = counterrows;
436  ++counterrows;
437  }
438 
439  /* order of variables */
440 
441  /* linking variables */
442  for( int i = 0; i < partialdec->getNLinkingvars() ; ++i )
443  {
444  int colidx = partialdec->getLinkingvars()[i];
445  orderToCols[countercols] = colidx;
446  colsToOrder[colidx] = countercols;
447  ++countercols;
448  }
449 
450  /* master variables */
451  for( int i = 0; i < partialdec->getNMastervars() ; ++i )
452  {
453  int colidx = partialdec->getMastervars()[i];
454  orderToCols[countercols] = colidx;
455  colsToOrder[colidx] = countercols;
456  ++countercols;
457  }
458 
459  /* block variables */
460  for( int b = 0; b < partialdec->getNBlocks(); ++b )
461  {
462  for(int i = 0; i < partialdec->getNVarsForBlock(b); ++i )
463  {
464  int colidx = partialdec->getVarsForBlock(b)[i];
465  orderToCols[countercols] = colidx;
466  colsToOrder[colidx] = countercols;
467  ++countercols;
468  }
469  for(int i = 0; i < partialdec->getNStairlinkingvars(b); ++i )
470  {
471  int colidx = partialdec->getStairlinkingvars(b)[i];
472  orderToCols[countercols] = colidx;
473  colsToOrder[colidx] = countercols;
474  ++countercols;
475  }
476  }
477 
478  /* open vars */
479  for( int i = 0; i < partialdec->getNOpenvars() ; ++i )
480  {
481  int colidx = partialdec->getOpenvars()[i];
482  orderToCols[countercols] = colidx;
483  colsToOrder[colidx] = countercols;
484  ++countercols;
485  }
486 
487  /* write scatter plot */
488  for( int row = 0; row < partialdec->getNConss(); ++row )
489  {
490  for ( int col = 0; col < partialdec->getNVars(); ++col )
491  {
492  assert( orderToRows[row] != -1 );
493  assert( orderToCols[col] != -1 );
494  if( detprobdata->getVal( orderToRows[row], orderToCols[col] ) != 0 )
495  {
496  SCIPinfoMessage(scip, file,
497  " \\draw [fill] (%f*\\textwidth*0.75,%f*\\textwidth*0.75) circle [radius=%f*0.75];\n",
498  ( (float) col + 0.5 ) / (float) xmax, ( (float) row + 0.5 ) / (float) ymax, radius);
499  }
500  }
501  }
502 
503  return SCIP_OKAY;
504 }
505 
506 
507 /** Writes LaTeX code that contains a figure with a tikz picture of the given partialdec
508  *
509  * @returns SCIP status */
510 static
511 SCIP_RETCODE writeTexPartialdec(
512  SCIP* scip, /**< SCIP data structure */
513  FILE* file, /**< file to write to */
514  PARTIALDECOMP* partialdec, /**< PARTIALDECOMP to be visualized */
515  SCIP_Bool nofigure /**< if true there will be no figure environment around tikz code*/
516  )
517 {
518  int rowboxcounter = 0;
519  int colboxcounter = 0;
520  int nvars;
521  int nconss;
522 
523  nvars = partialdec->getNVars();
524  nconss = partialdec->getNConss();
525 
526  if(!nofigure)
527  {
528  SCIPinfoMessage(scip, file, "\\begin{figure}[!htb]\n");
529  SCIPinfoMessage(scip, file, " \\begin{center}\n");
530  }
531  SCIPinfoMessage(scip, file, " \\begin{tikzpicture}[yscale=-1]\n");
532  /* --- draw boxes ---*/
533 
534  /* linking vars */
535  if(partialdec->getNLinkingvars() != 0)
536  {
537  writeTikzBox(scip, file, nvars, nconss, 0, 0, partialdec->getNLinkingvars(), partialdec->getNConss(),
538  (const char*) "colorlinking");
539  colboxcounter += partialdec->getNLinkingvars();
540  }
541 
542  /* masterconss */
543  if(partialdec->getNMasterconss() != 0)
544  {
545  writeTikzBox(scip, file, nvars, nconss, 0, 0, partialdec->getNVars(), partialdec->getNMasterconss(),
546  (const char*) "colormasterconss");
547  rowboxcounter += partialdec->getNMasterconss();
548  }
549 
550  /* mastervars */
551  if(partialdec->getNMastervars() != 0)
552  {
553  writeTikzBox(scip, file, nvars, nconss, colboxcounter, 0, partialdec->getNMastervars()+colboxcounter,
554  partialdec->getNMasterconss(), (const char*) "colormastervars");
555  colboxcounter += partialdec->getNMastervars();
556  }
557 
558  /* blocks (blocks are not empty) */
559  for( int b = 0; b < partialdec->getNBlocks() ; ++b )
560  {
561  writeTikzBox(scip, file, nvars, nconss, colboxcounter, rowboxcounter,
562  colboxcounter + partialdec->getNVarsForBlock(b), rowboxcounter + partialdec->getNConssForBlock(b),
563  (const char*) "colorblock");
564  colboxcounter += partialdec->getNVarsForBlock(b);
565 
566  if( partialdec->getNStairlinkingvars(b) != 0 )
567  {
568  writeTikzBox(scip, file, nvars, nconss, colboxcounter, rowboxcounter,
569  colboxcounter + partialdec->getNStairlinkingvars(b),
570  rowboxcounter + partialdec->getNConssForBlock(b) + partialdec->getNConssForBlock(b+1),
571  (const char*) "colorstairlinking");
572  }
573  colboxcounter += partialdec->getNStairlinkingvars(b);
574  rowboxcounter += partialdec->getNConssForBlock(b);
575  }
576 
577  /* open */
578  if(partialdec->getNOpenvars() != 0)
579  {
580  writeTikzBox(scip, file, nvars, nconss, colboxcounter, rowboxcounter, colboxcounter + partialdec->getNOpenvars(),
581  rowboxcounter+partialdec->getNOpenconss(), (const char*) "coloropen" );
582  colboxcounter += partialdec->getNOpenvars();
583  rowboxcounter += partialdec->getNOpenconss();
584  }
585 
586  /* --- draw nonzeros --- */
587  if(SCIPvisuGetDraftmode(scip) == FALSE)
588  {
589  writeTikzNonzeros(scip, file, partialdec, SCIPvisuGetNonzeroRadius(scip, partialdec->getNVars(), partialdec->getNConss(), 1),
590  nvars, nconss);
591  }
592 
593  SCIPinfoMessage(scip, file, " \\end{tikzpicture}\n");
594  if(!nofigure)
595  {
596  SCIPinfoMessage(scip, file, " \\end{center}\n");
597  SCIPinfoMessage(scip, file, "\\end {figure}\n");
598  }
599 
600  return SCIP_OKAY;
601 }
602 
603 
604 /** Writes LaTeX code for some statistics about the partialdec:
605  * - amount of blocks
606  * - amount of master, linking, stairlinking variables
607  * - amount of master constraints
608  * - score
609  *
610  * @returns SCIP status */
611 static
613  SCIP* scip, /**< SCIP data structure */
614  FILE* file, /**< file to write to */
615  PARTIALDECOMP* partialdec /**< statistics are about this partialdec */
616  )
617 {
618  std::ostringstream fulldetectorstring;
619 
620  /* get detector chain full-text string*/
621  if( partialdec->getUsergiven() != gcg::USERGIVEN::NOT )
622  {
623  fulldetectorstring << "user";
624  }
625  for( auto detector : partialdec->getDetectorchain() )
626  {
627  if( fulldetectorstring.tellp() > 0 )
628  fulldetectorstring << ", ";
629  fulldetectorstring << DECdetectorGetName(detector);
630  }
631 
632  SCIPinfoMessage(scip, file, "\n");
633  SCIPinfoMessage(scip, file, "\\vspace{0.3cm}\n");
634  SCIPinfoMessage(scip, file, "\\begin{tabular}{lp{10cm}}\n");
635  SCIPinfoMessage(scip, file,
636  " Found by detector(s): & \\begin{minipage}{10cm}\\begin{verbatim}%s\\end{verbatim}\\end{minipage} \\\\ \n",
637  fulldetectorstring.str().c_str());
638  SCIPinfoMessage(scip, file, " Number of blocks: & %i \\\\ \n",
639  partialdec->getNBlocks());
640  SCIPinfoMessage(scip, file, " Number of master variables: & %i \\\\ \n",
641  partialdec->getNMastervars());
642  SCIPinfoMessage(scip, file, " Number of master constraints: & %i \\\\ \n",
643  partialdec->getNMasterconss());
644  SCIPinfoMessage(scip, file, " Number of linking variables: & %i \\\\ \n",
645  partialdec->getNLinkingvars());
646  SCIPinfoMessage(scip, file, " Number of stairlinking variables: & %i \\\\ \n",
647  partialdec->getNTotalStairlinkingvars());
648  SCIPinfoMessage(scip, file, " Score: & %f \\\\ \n",
649  partialdec->getScore(GCGconshdlrDecompGetScoretype(scip)));
650  SCIPinfoMessage(scip, file, "\\end{tabular}\n");
651 
652  SCIPinfoMessage(scip, file, "\\clearpage\n");
653  SCIPinfoMessage(scip, file, "\n");
654 
655  return SCIP_OKAY;
656 }
657 
658 
659 /** Write LaTeX code for end of document to given file
660  *
661  * @returns SCIP status */
662 static
663 SCIP_RETCODE writeTexEnding(
664  SCIP* scip, /**< SCIP data structure */
665  FILE* file /**< File pointer to write to */
666  )
667 {
668  SCIPinfoMessage(scip, file, "\\end{document} \n");
669 
670  return SCIP_OKAY;
671 }
672 
673 
674 /* Writes a report for the given partialdecs */
675 SCIP_RETCODE GCGwriteTexReport(
676  SCIP* scip, /* SCIP data structure */
677  FILE* file, /* file to write to */
678  int* partialdecids, /* ids of partialdecs to visualize */
679  int* npartialdecs, /* number of partialdecs to visualize */
680  SCIP_Bool titlepage, /* true if a title page should be included in the document */
681  SCIP_Bool toc, /* true if an interactive table of contents should be included */
682  SCIP_Bool statistics, /* true if statistics for each partialdec should be included */
683  SCIP_Bool usegp /* true if the gp reader should be used to visualize the individual partialdecs */
684  )
685 {
686  PARTIALDECOMP* partialdec;
687  char gppath[PATH_MAX];
688  char filepath[PATH_MAX];
689  char* path;
690  char gpname[SCIP_MAXSTRLEN];
691  char pdfname[SCIP_MAXSTRLEN];
692 
693  /* write tex code into file */
694  writeTexHeader(scip, file, TRUE);
695  if(titlepage)
696  writeTexTitlepage(scip, file, npartialdecs);
697  if(toc)
699 
700  /* get partialdec pointers and sort them according to current score */
701  std::vector<PARTIALDECOMP*> partialdecs;
702  partialdecs.reserve(*npartialdecs);
703  for(int i = 0; i < *npartialdecs; i++)
704  {
705  partialdecs.push_back(GCGconshdlrDecompGetPartialdecFromID(scip, partialdecids[i]));
706  }
708  std::sort(partialdecs.begin(), partialdecs.end(), [&](PARTIALDECOMP* a, PARTIALDECOMP* b) {return (a->getScore(sctype) > b->getScore(sctype)); });
709 
710  /* if there are more decomps than the maximum, reset npartialdecs */
711  if(*npartialdecs > GCGreportGetMaxNDecomps(scip))
712  *npartialdecs = GCGreportGetMaxNDecomps(scip);
713 
714  for(int i = 0; i < *npartialdecs; i++)
715  {
716  /* write each partialdec */
717  partialdec = partialdecs.at(i);
718 
719  if(toc)
720  {
721  char decompname[SCIP_MAXSTRLEN];
722  char buffer[SCIP_MAXSTRLEN];
723  partialdec->buildDecChainString(buffer);
724  SCIPsnprintf( decompname, SCIP_MAXSTRLEN, "%s-%d-%d", buffer, partialdec->getID(), partialdec->getNBlocks() );
725 
726  SCIPinfoMessage(scip, file, "\\section*{Decomposition: %s}\n", decompname);
727  SCIPinfoMessage(scip, file, "\\addcontentsline{toc}{section}{Decomposition: %s}\n", decompname);
728  SCIPinfoMessage(scip, file, "\n");
729  }
730 
731  if(!usegp)
732  {
733  writeTexPartialdec(scip, file, partialdec, FALSE);
734  }
735  else
736  {
737  /* in case a gp file should be generated include it in the tex code */
738  GCGgetVisualizationFilename(scip, partialdec, "gp", gpname);
739  GCGgetVisualizationFilename(scip, partialdec, "pdf", pdfname);
740  strcat(pdfname, ".pdf");
741 
742  GCGgetFilePath(file, filepath);
743  SCIPsplitFilename(filepath, &path, NULL, NULL, NULL);
744 
745  SCIPsnprintf(gppath, PATH_MAX, "%s/%s.gp", path, gpname);
746 
747  GCGwriteGpVisualization(scip, gppath, pdfname, partialdecids[i]);
748 
749  SCIPinfoMessage(scip, file, "\\begin{figure}[!htb]\n");
750  SCIPinfoMessage(scip, file, " \\begin{center}\n");
751  SCIPinfoMessage(scip, file, " \\includegraphics{%s}\n", pdfname);
752  SCIPinfoMessage(scip, file, " \\end{center}\n");
753  SCIPinfoMessage(scip, file, "\\end {figure}\n");
754  }
755  if(statistics)
756  writeTexPartialdecStatistics(scip, file, partialdec);
757  }
758  writeTexEnding(scip, file);
759 
760  GCGtexWriteMakefileAndReadme(scip, file, usegp, FALSE);
761 
762  return SCIP_OKAY;
763 }
764 
765 
766 /* Writes a visualization for the given partialdec */
768  SCIP* scip, /* SCIP data structure */
769  FILE* file, /* file to write to */
770  int partialdecid, /* id of partialdec to visualize */
771  SCIP_Bool statistics, /* additionally to picture show statistics */
772  SCIP_Bool usegp /* true if the gp reader should be used to visualize the individual partialdecs */
773  )
774 {
775  PARTIALDECOMP* partialdec;
776  char gpname[SCIP_MAXSTRLEN];
777  char pdfname[SCIP_MAXSTRLEN];
778 
779  /* get partialdec */
780  partialdec = GCGconshdlrDecompGetPartialdecFromID(scip, partialdecid);
781 
782  /* write tex code into file */
783  writeTexHeader(scip, file, FALSE);
784 
785  if(!usegp)
786  {
787  writeTexPartialdec(scip, file, partialdec, FALSE);
788  }
789  else
790  {
791  /* in case a gp file should be generated include it */
792  GCGgetVisualizationFilename(scip, partialdec, "gp", gpname);
793  GCGgetVisualizationFilename(scip, partialdec, "pdf", pdfname);
794 
795  GCGwriteGpVisualization(scip, gpname, pdfname, partialdecid);
796 
797  SCIPinfoMessage(scip, file, "\\begin{figure}[!htb]\n");
798  SCIPinfoMessage(scip, file, " \\begin{center}\n");
799  SCIPinfoMessage(scip, file, " \\input{%s}\n", pdfname);
800  SCIPinfoMessage(scip, file, " \\end{center}\n");
801  SCIPinfoMessage(scip, file, "\\end {figure}\n");
802  }
803  if(statistics)
804  writeTexPartialdecStatistics(scip, file, partialdec);
805 
806  writeTexEnding(scip, file);
807 
808  return SCIP_OKAY;
809 }
810 
811 
812 /* Makes a new makefile and readme for the given .tex file */
814  SCIP* scip, /* SCIP data structure */
815  FILE* file, /* File for which the makefile & readme are generated */
816  SCIP_Bool usegp, /* true if there are gp files to be included in the makefile */
817  SCIP_Bool compiletex /* true if there are tex files to be compiled before main document */
818 
819  )
820 {
821  FILE* makefile;
822  FILE* readme;
823  char* filepath;
824  char* filename;
825  char pfile[PATH_MAX];
826  char makefilename[PATH_MAX];
827  char readmename[PATH_MAX];
828  char name[PATH_MAX];
829  const char makename[SCIP_MAXSTRLEN] = "makepdf";
830 
831  /* --- create a Makefile --- */
832 
833  /* get path to write to and put it into makefilename */
834  GCGgetFilePath(file, pfile);
835  SCIPsplitFilename(pfile, &filepath, &filename, NULL, NULL);
836  SCIPsnprintf(name, PATH_MAX, "%s_%s.make", makename, filename);
837  SCIPsnprintf(makefilename, PATH_MAX, "%s/%s", filepath, name);
838 
839  /* open and write makefile */
840  makefile = fopen(makefilename, "w");
841  if( makefile == NULL )
842  {
843  return SCIP_FILECREATEERROR;
844  }
845 
846  if( usegp )
847  {
848  SCIPinfoMessage(scip, makefile, "GPFILES := $(wildcard *.gp)\n");
849  }
850  if( compiletex )
851  {
852  /* will only be applied if the filename ends with "-tex.tex" due to the standard naming scheme */
853  SCIPinfoMessage(scip, makefile, "TEXFILES := $(wildcard *-pdf.tex)\n");
854  }
855  SCIPinfoMessage(scip, makefile, "\n");
856  SCIPinfoMessage(scip, makefile, "# latexmk automatically manages the .tex files\n");
857  SCIPinfoMessage(scip, makefile, "%s.pdf: %s.tex\n",
858  filename, filename);
859  if( usegp )
860  {
861  SCIPinfoMessage(scip, makefile, "\t@echo ------------\n");
862  SCIPinfoMessage(scip, makefile, "\t@echo \n");
863  SCIPinfoMessage(scip, makefile, "\t@echo Compiling gp files to tex\n");
864  SCIPinfoMessage(scip, makefile, "\t@echo \n");
865  SCIPinfoMessage(scip, makefile, "\t@echo ------------\n");
866  SCIPinfoMessage(scip, makefile, "\t$(SHELL) -ec 'for i in $(GPFILES); \\\n");
867  SCIPinfoMessage(scip, makefile, "\t\tdo \\\n");
868  SCIPinfoMessage(scip, makefile, "\t\tgnuplot $$i; \\\n");
869  SCIPinfoMessage(scip, makefile, "\t\tdone'\n");
870  }
871  SCIPinfoMessage(scip, makefile, "\t@echo ------------\n");
872  SCIPinfoMessage(scip, makefile, "\t@echo \n");
873  SCIPinfoMessage(scip, makefile, "\t@echo Compiling tex code. This may take a while.\n");
874  SCIPinfoMessage(scip, makefile, "\t@echo \n");
875  SCIPinfoMessage(scip, makefile, "\t@echo ------------\n");
876  if( compiletex )
877  {
878  SCIPinfoMessage(scip, makefile, "\t$(SHELL) -ec 'for j in $(TEXFILES); \\\n");
879  SCIPinfoMessage(scip, makefile, "\t\tdo \\\n");
880  SCIPinfoMessage(scip, makefile, "\t\tpdflatex $$j; \\\n");
881  SCIPinfoMessage(scip, makefile, "\t\tdone'\n");
882  }
883  SCIPinfoMessage(scip, makefile,
884  "\t@latexmk -pdf -pdflatex=\"pdflatex -interaction=batchmode -shell-escape\" -use-make %s.tex \n", filename);
885  SCIPinfoMessage(scip, makefile, "\t@make -f %s clean\n", name);
886  SCIPinfoMessage(scip, makefile, "\n");
887  SCIPinfoMessage(scip, makefile, "clean:\n");
888  SCIPinfoMessage(scip, makefile, "\t@latexmk -c\n");
889  SCIPinfoMessage(scip, makefile, "\t@rm -f report_*figure*.*\n");
890  SCIPinfoMessage(scip, makefile, "\t@rm -f *.auxlock\n");
891  SCIPinfoMessage(scip, makefile, "\t@rm -f *figure*.md5\n");
892  SCIPinfoMessage(scip, makefile, "\t@rm -f *figure*.log\n");
893  SCIPinfoMessage(scip, makefile, "\t@rm -f *figure*.dpth\n");
894  if( usegp )
895  {
896  SCIPinfoMessage(scip, makefile, "\t@rm -f *.gp\n");
897  }
898  SCIPinfoMessage(scip, makefile, "\n");
899  SCIPinfoMessage(scip, makefile, "cleanall:\n");
900  SCIPinfoMessage(scip, makefile, "\t@latexmk -C\n");
901  SCIPinfoMessage(scip, makefile, "\t@make -f %s clean\n", name);
902 
903  /* close makefile */
904  fclose(makefile);
905 
906  /* --- create a readme file --- */
907 
908  /* use same file path as the makefile */
909  SCIPsnprintf(readmename, PATH_MAX, "%s/README_%s", filepath, makename);
910 
911  /* open and write readme */
912  readme = fopen(readmename, "w");
913  if( readme == NULL )
914  {
915  return SCIP_FILECREATEERROR;
916  }
917 
918  SCIPinfoMessage(scip, readme, "README: How to create a PDF file from the .tex file(s) using the %s file.\n", name);
919  SCIPinfoMessage(scip, readme, "Note: The package pdflatex is required.\n");
920  SCIPinfoMessage(scip, readme, "\n");
921  SCIPinfoMessage(scip, readme, "Use the command\n\t'make -f %s'\nto compile.\n", name);
922  SCIPinfoMessage(scip, readme, "Depending on the size of your problem that may take some time.\n");
923  SCIPinfoMessage(scip, readme,
924  "Please do not delete any new files that might be generated during the compile process.\n");
925  SCIPinfoMessage(scip, readme, "All access files will be deleted automatically once the compilation is complete.\n");
926  SCIPinfoMessage(scip, readme, "\n");
927  SCIPinfoMessage(scip, readme, "Clean options:\n");
928  SCIPinfoMessage(scip, readme, "\t'make -f %s clean' clears all present intermediate files (if any exist)\n", name);
929  SCIPinfoMessage(scip, readme, "\t'make -f %s cleanall' clears all generated files INCLUDING .pdf\n", name);
930 
931  /* close readme file */
932  fclose(readme);
933 
934  return SCIP_OKAY;
935 }
936 
937 
938 /* Includes the tex file reader in SCIP */
939 SCIP_RETCODE SCIPincludeReaderTex(
940  SCIP* scip /*< SCIP data structure */
941  )
942 {
943  SCIP_CALL(SCIPincludeReader(scip, READER_NAME, READER_DESC, READER_EXTENSION, NULL,
944  readerFreeTex, readerReadTex, readerWriteTex, NULL));
945 
946  return SCIP_OKAY;
947 }
948 
SCIP_RETCODE GCGtexWriteMakefileAndReadme(SCIP *scip, FILE *file, SCIP_Bool usegp, SCIP_Bool compiletex)
Definition: reader_tex.cpp:813
const char * DECdetectorGetName(DEC_DETECTOR *detector)
returns the name of the provided detector
std::vector< int > & getMastervars()
Gets array containing all master vars indices.
std::vector< int > & getVarsForBlock(int block)
Gets array containing vars of a block.
miscellaneous methods for working with SCORETYPE
float SCIPvisuGetNonzeroRadius(SCIP *scip, int maxindx, int maxindy, float scalingfactor)
Definition: params_visu.c:554
int getNOpenvars()
Gets size of vector containing variables not assigned yet.
static SCIP_RETCODE getRgbFromHex(const char *hex, int *red, int *green, int *blue)
Definition: reader_tex.cpp:108
const char * SCIPvisuGetColorMasterconss(SCIP *scip)
Definition: params_visu.c:219
constraint handler for structure detection
const char * GCGscoretypeGetDescription(SCORETYPE sctype)
returns the description of the given scoretype
Definition: scoretype.c:73
SCIP_Bool GCGgetUseGp(SCIP *scip)
Definition: params_visu.c:592
static SCIP_RETCODE writeTexTitlepage(SCIP *scip, FILE *file, int *npresentedpartialdecs)
Definition: reader_tex.cpp:282
std::vector< int > & getMasterconss()
Gets array containing all master conss indices.
static SCIP_RETCODE writeTexTableOfContents(SCIP *scip, FILE *file)
Definition: reader_tex.cpp:347
static SCIP_RETCODE writeTikzBox(SCIP *scip, FILE *file, int xmax, int ymax, int x1, int y1, int x2, int y2, const char *color)
Definition: reader_tex.cpp:365
const char * SCIPvisuGetColorNonzero(SCIP *scip)
Definition: params_visu.c:381
static SCIP_RETCODE getTexColorFromHex(const char *hex, const char *colorname, char *code)
Definition: reader_tex.cpp:141
unsigned int GCGconshdlrDecompGetNPartialdecs(SCIP *scip)
Gets the number of all partialdecs.
USERGIVEN getUsergiven()
Gets the USERGIVEN status of this partialdecs.
int getNVarsForBlock(int block)
Gets size of the vector containing vars assigned to a block.
SCIP_DECL_READERWRITE(readerWriteTex)
Definition: reader_tex.cpp:79
const char * SCIPvisuGetColorLine(SCIP *scip)
Definition: params_visu.c:408
int getNTotalStairlinkingvars()
Gets total number of stairlinking vars.
const char * SCIPvisuGetColorBlock(SCIP *scip)
Definition: params_visu.c:327
void buildDecChainString(char *buffer)
creates a detector chain short string for this partialdec, is built from detector chain
PARTIALDECOMP * DECgetPartialdecToWrite(SCIP *scip, SCIP_Bool transformed)
various SCIP helper methods
static SCIP_RETCODE writeTexPartialdec(SCIP *scip, FILE *file, PARTIALDECOMP *partialdec, SCIP_Bool nofigure)
Definition: reader_tex.cpp:511
int getNStairlinkingvars(int block)
Gets size of the vector containing stairlinking vars.
int getNConssForBlock(int block)
Gets size of the vector containing conss assigned to a block.
SCIP_RETCODE SCIPincludeReaderTex(SCIP *scip)
Definition: reader_tex.cpp:939
#define READER_DESC
Definition: reader_tex.cpp:60
SCIP_RETCODE GCGwriteTexReport(SCIP *scip, FILE *file, int *partialdecids, int *npartialdecs, SCIP_Bool titlepage, SCIP_Bool toc, SCIP_Bool statistics, SCIP_Bool usegp)
Definition: reader_tex.cpp:675
static SCIP_RETCODE writeTexHeader(SCIP *scip, FILE *file, SCIP_Bool externalizepics)
Definition: reader_tex.cpp:181
static SCIP_RETCODE writeTikzNonzeros(SCIP *scip, FILE *file, PARTIALDECOMP *partialdec, float radius, int xmax, int ymax)
Definition: reader_tex.cpp:389
const char * SCIPvisuGetColorLinking(SCIP *scip)
Definition: params_visu.c:273
miscellaneous methods for visualizations
SCIP_DECL_READERREAD(readerReadTex)
Definition: reader_tex.cpp:73
int getNLinkingvars()
Gets size of the vector containing linking vars.
C++ interface of cons_decomp.
const int * getStairlinkingvars(int block)
Gets array containing stairlinking vars,.
const int * getOpenconss()
Gets array containing constraints not assigned yet.
SCIP_RETCODE GCGwriteGpVisualization(SCIP *scip, char *filename, char *outputname, int partialdecid)
Definition: reader_gp.cpp:483
int getNConss()
Gets the number of constraints.
static SCIP_RETCODE writeTexPartialdecStatistics(SCIP *scip, FILE *file, PARTIALDECOMP *partialdec)
Definition: reader_tex.cpp:612
int GCGconshdlrDecompGetNDecomps(SCIP *scip)
gets the number of decompositions (= amount of finished partialdecs)
int GCGreportGetMaxNDecomps(SCIP *scip)
Definition: params_visu.c:626
std::vector< int > & getConssForBlock(int block)
returns array containing constraints assigned to a block
class to manage partial decompositions
int getNBlocks()
Gets the number of blocks.
void GCGgetFilePath(FILE *file, char *path)
SCIP_Real getScore(SCORETYPE type)
returns the score of the partialdec (depending on used scoretype)
DETPROBDATA * getDetprobdata()
Gets the corresponding detprobdata.
PARTIALDECOMP * GCGconshdlrDecompGetPartialdecFromID(SCIP *scip, int partialdecid)
local method to find a partialdec for a given id or NULL if no partialdec with such id is found
SCIP_FILE * file
Definition: reader_ref.c:79
std::vector< int > & getLinkingvars()
returns array containing all linking vars indices
static SCIP_RETCODE writeTexEnding(SCIP *scip, FILE *file)
Definition: reader_tex.cpp:663
int getNOpenconss()
Gets size of vector containing constraints not assigned yet.
const char * SCIPvisuGetColorMastervars(SCIP *scip)
Definition: params_visu.c:246
#define READER_EXTENSION
Definition: reader_tex.cpp:61
int getID()
returns the unique id of the partialdec
class storing (potentially incomplete) decompositions
SCORETYPE GCGconshdlrDecompGetScoretype(SCIP *scip)
Gets the currently selected scoretype.
GP file reader writing decompositions to gnuplot files.
SCIP_DECL_READERFREE(readerFreeTex)
Definition: reader_tex.cpp:66
SCIP_Real getVal(int row, int col)
returns a coefficient from the coefficient matrix
SCIP_Bool SCIPvisuGetDraftmode(SCIP *scip)
Definition: params_visu.c:155
std::vector< DEC_DETECTOR * > & getDetectorchain()
returns detector chain as vector of detector pointers
parameter settings for visualization readers
const char * SCIPvisuGetColorStairlinking(SCIP *scip)
Definition: params_visu.c:300
int getNMasterconss()
Gets size of the vector containing master conss.
const int * getOpenvars()
Gets array containing variables not assigned yet.
const char * SCIPvisuGetColorOpen(SCIP *scip)
Definition: params_visu.c:354
enum scoretype SCORETYPE
SCIP_RETCODE GCGwriteTexVisualization(SCIP *scip, FILE *file, int partialdecid, SCIP_Bool statistics, SCIP_Bool usegp)
Definition: reader_tex.cpp:767
int getNMastervars()
Gets size of the vector containing master vars.
class storing partialdecs and the problem matrix
void GCGgetVisualizationFilename(SCIP *scip, PARTIALDECOMP *partialdec, const char *extension, char *filename)
#define READER_NAME
Definition: reader_tex.cpp:59
public methods for working with decomposition structures
int getNVars()
Gets number of vars.