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