GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
reader_gp.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_gp.cpp
30 * @brief GP file reader writing decompositions to gnuplot files
31 * @author Martin Bergner
32 * @author Hanna Franzen
33 * @author Michael Bastubbe
34 */
35
36/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
37
38#include <assert.h>
39#include <string.h>
40
41#include <cstring>
42#include <fstream>
43
44#include "scip/scip.h"
45
46#include "gcg/reader_gp.h"
47#include "gcg/scip_misc.h"
48#include "gcg/struct_decomp.h"
49#include "gcg/cons_decomp.h"
50#include "gcg/cons_decomp.hpp"
51#include "gcg/pub_decomp.h"
52#include "gcg/params_visu.h"
53
57
58#define READER_NAME "gpreader"
59#define READER_DESC "gnuplot file writer for partialdec visualization"
60#define READER_EXTENSION "gp"
61
62#define SCALING_FACTOR_NONZEROS 0.6
63
64using namespace gcg;
65
66struct SCIP_ReaderData
67{
68 GCG* gcg;
69};
70
71/*
72 * Callback methods of reader
73 */
74
75
76/** Destructor of reader to free user data (called when SCIP is exiting) */
77static
79{
80 SCIP_READERDATA* readerdata;
81
82 readerdata = SCIPreaderGetData(reader);
83 assert(readerdata != NULL);
84
85 SCIPfreeMemory(scip, &readerdata);
86 assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
87 return SCIP_OKAY;
88}
89
90
91/** Problem writing method of reader */
92static
94{
95 PARTIALDECOMP* partialdec;
96 char gpoutname[SCIP_MAXSTRLEN];
97 char outputname[SCIP_MAXSTRLEN];
98 SCIP_READERDATA* readerdata;
99
100 readerdata = SCIPreaderGetData(reader);
101 assert(readerdata != NULL);
102 assert(scip != NULL);
103 assert(file != NULL);
104
105 /* get partialdec to write */
106 partialdec = GCGgetPartialdecToWrite(readerdata->gcg, transformed);
107
108 if( filename != NULL )
109 {
110 SCIPstrncpy(gpoutname, filename, SCIP_MAXSTRLEN);
111 }
112 else if( file != NULL )
113 {
114 GCGgetFilePath(file, gpoutname);
115 }
116 else
117 {
118 SCIPwarningMessage(scip, "Could not find file path to write!\n");
120 return SCIP_OKAY;
121 }
122
123 if( partialdec == NULL )
124 {
125 SCIPwarningMessage(scip, "Could not find Partialdecomp to write!\n");
127 }
128 else
129 {
130 /* get filename for compiled file */
131 GCGgetVisualizationFilename(readerdata->gcg, partialdec, "pdf", outputname);
132 strcat(outputname, ".pdf");
133
134 GCGwriteGpVisualization(readerdata->gcg, gpoutname, outputname, partialdec->getID() );
135
137 }
138
139 return SCIP_OKAY;
140}
141
142
143/** Write gnuplot file header with terminal etc.
144 * @returns SCIP status */
145static
147 GCG* gcg, /**< GCG data structure */
148 const char* filename, /**< filename (including path) to write to */
149 const char* outputname, /**< the filename to which gnuplot should compile the visualization */
150 GP_OUTPUT_FORMAT outputformat /**< the output format which gnuplot should emit */
151 )
152{
153 std::ofstream ofs;
154
155 ofs.open( filename, std::ofstream::out );
156
157 /* set output format and file */
158 ofs << "set encoding utf8" << std::endl;
159
160 ofs << "set terminal ";
161 switch (outputformat)
162 {
164 ofs << "pdf";
165 break;
167 ofs << "pngcairo";
168 break;
170 ofs << "svg";
171 break;
172 }
173 ofs << std::endl;
174
175 ofs << "set output \"" << outputname << "\"" << std::endl;
176
177 ofs.close();
178
179 return SCIP_OKAY;
180}
181
182
183/** Adds gnuplot code to given file that contains a box with given coordinates and color
184 * @returns SCIP status */
185static
187 GCG* gcg, /**< GCG data structure */
188 const char* filename, /**< filename (including path) to write to */
189 int objectid, /**< id number of box (>0), must be unique */
190 int x1, /**< x value of lower left vertex coordinate */
191 int y1, /**< y value of lower left vertex coordinate */
192 int x2, /**< x value of upper right vertex coordinate */
193 int y2, /**< y value of upper right vertex coordinate */
194 const char* color /**< color hex code (e.g. #000000) for box filling */
195 )
196{
197 std::ofstream ofs;
198 ofs.open( filename, std::ofstream::out | std::ofstream::app );
199
200 ofs << "set object " << objectid << " rect from " << x1 << "," << y1 << " to " << x2 << "," << y2
201 << " fc rgb \"" << color << "\"" << " lc rgb \"" << GCGvisuGetColorLine(gcg) << "\"" << std::endl;
202
203 ofs.close();
204 return SCIP_OKAY;
205}
206
207
208/** Writes gnuplot code to given file that contains all nonzero points
209 * @returns SCIP status */
210static
212 GCG* gcg, /**< GCG data structure */
213 const char* filename, /**< filename to write to (including path & extension) */
214 PARTIALDECOMP* partialdec, /**< PARTIALDECOMP for which the nonzeros should be visualized */
215 float radius /**< radius of the dots (scaled concerning matrix dimensions)*/
216 )
217{
218 int radiusscale;
219 std::vector<int> orderToRows(partialdec->getNConss(), -1);
220 std::vector<int> rowToOrder(partialdec->getNConss(), -1);
221 std::vector<int> orderToCols(partialdec->getNVars(), -1);
222 std::vector<int> colsToOrder(partialdec->getNVars(), -1);
223 int counterrows = 0;
224 int countercols = 0;
225 std::ofstream ofs;
226 DETPROBDATA* detprobdata;
227
228 detprobdata = partialdec->getDetprobdata();
229
230 /* order of constraints */
231 /* master constraints */
232 for( int i = 0; i < partialdec->getNMasterconss() ; ++i )
233 {
234 int rowidx = partialdec->getMasterconss()[i];
235 orderToRows[counterrows] = rowidx;
236 rowToOrder[rowidx] = counterrows;
237 ++counterrows;
238 }
239
240 /* block constraints */
241 for( int b = 0; b < partialdec->getNBlocks(); ++b )
242 {
243 for(int i = 0; i < partialdec->getNConssForBlock(b); ++i )
244 {
245 int rowidx = partialdec->getConssForBlock(b)[i];
246 orderToRows[counterrows] = rowidx;
247 rowToOrder[rowidx] = counterrows;
248 ++counterrows;
249 }
250 }
251
252 /* open constraints */
253 for( int i = 0; i < partialdec->getNOpenconss(); ++i )
254 {
255 int rowidx = partialdec->getOpenconss()[i];
256 orderToRows[counterrows] = rowidx;
257 rowToOrder[rowidx] = counterrows;
258 ++counterrows;
259 }
260
261 /* order of variables */
262
263 /* linking variables */
264 for( int i = 0; i < partialdec->getNLinkingvars() ; ++i )
265 {
266 int colidx = partialdec->getLinkingvars()[i];
267 orderToCols[countercols] = colidx;
268 colsToOrder[colidx] = countercols;
269 ++countercols;
270 }
271
272 /* master variables */
273 for( int i = 0; i < partialdec->getNMastervars() ; ++i )
274 {
275 int colidx = partialdec->getMastervars()[i];
276 orderToCols[countercols] = colidx;
277 colsToOrder[colidx] = countercols;
278 ++countercols;
279 }
280
281 /* block variables */
282 for( int b = 0; b < partialdec->getNBlocks(); ++b )
283 {
284 for(int i = 0; i < partialdec->getNVarsForBlock(b); ++i )
285 {
286 int colidx = partialdec->getVarsForBlock(b)[i];
287 orderToCols[countercols] = colidx;
288 colsToOrder[colidx] = countercols;
289 ++countercols;
290 }
291 for(int i = 0; i < partialdec->getNStairlinkingvars(b); ++i )
292 {
293 int colidx = partialdec->getStairlinkingvars(b)[i];
294 orderToCols[countercols] = colidx;
295 colsToOrder[colidx] = countercols;
296 ++countercols;
297 }
298 }
299
300 /* open vars */
301 for( int i = 0; i < partialdec->getNOpenvars() ; ++i )
302 {
303 int colidx = partialdec->getOpenvars()[i];
304 orderToCols[countercols] = colidx;
305 colsToOrder[colidx] = countercols;
306 ++countercols;
307 }
308
309 ofs.open (filename, std::ofstream::out | std::ofstream::app );
310
311 /* scaling factor concerning user wishes */
312 SCIPgetIntParam(GCGgetOrigprob(gcg), "visual/nonzeroradius", &radiusscale);
313 radius *= radiusscale;
314
315
316 /* dot should be visible, so enforce minimum radius of 0.01 */
317 if( radius < 0.01 )
318 radius = (float)0.01;
319
320 /* start writing dots */
321 ofs << "set style line 99 lc rgb \"" << GCGvisuGetColorNonzero(gcg) << "\" " << std::endl;
322 ofs << "plot \"-\" using 1:2:(" << radius << ") with dots ls 99 notitle " << std::endl;
323 /* write scatter plot */
324 for( int row = 0; row < partialdec->getNConss(); ++row )
325 {
326 int cons;
327 cons = orderToRows[row];
328 for( int v = 0; v < detprobdata->getNVarsForCons(cons); ++v )
329 {
330 int col;
331 int var;
332 var = detprobdata->getVarsForCons(cons)[v];
333 col = colsToOrder[var];
334 ofs << col + 0.5 << " " << row + 0.5 << std::endl;
335 }
336
337 }
338
339 /* end writing dots */
340 ofs << "e" << std::endl;
341
342 ofs.close();
343
344 return SCIP_OKAY;
345}
346
347/** \brief Adds the gnuplot body of the partialdec visualization to the given file
348 *
349 * Adds the gnuplot body of the partialdec visualization to the given file.
350 * This includes axes, blocks and nonzeros. */
351static
353 GCG* gcg, /**< GCG data structure */
354 const char* filename, /**< filename (including path) to write to */
355 PARTIALDECOMP* partialdec /**< PARTIALDECOMP for which the nonzeros should be visualized */
356 )
357{
358 int rowboxcounter = 0;
359 int colboxcounter = 0;
360 int objcounter = 0;
361 int nvars;
362 int nconss;
363 SCIP_Bool writematrix;
364
365 nvars = partialdec->getNVars();
366 nconss = partialdec->getNConss();
367
368 std::ofstream ofs;
369 ofs.open( filename, std::ofstream::out | std::ofstream::app );
370
371 writematrix = FALSE;
372
373 if ( partialdec->getNBlocks() == 1 && partialdec->isComplete() && partialdec->getNMasterconss() == 0
374 && partialdec->getNLinkingvars() == 0 && partialdec->getNMastervars() == 0 )
375 writematrix = TRUE;
376
377 /* set coordinate range */
378 if( !writematrix )
379 {
380 ofs << "set xrange [-1:" << nvars << "]" << std::endl;
381 ofs << "set yrange[" << nconss << ":-1]" << std::endl;
382 }
383 else
384 {
385 ofs << "set xrange [0:" << nvars << "]" << std::endl;
386 ofs << "set yrange[" << nconss << ":0]" << std::endl;
387
388 ofs << " set xtics nomirror " << std::endl;
389 ofs << " set ytics nomirror" << std::endl;
390 ofs << " set xtics out " << std::endl;
391 ofs << " set ytics out" << std::endl;
392 }
393
394 /* --- draw boxes ---*/
395
396 if( !writematrix )
397 {
398 /* linking vars */
399 if(partialdec->getNLinkingvars() != 0)
400 {
401 ++objcounter; /* has to start at 1 for gnuplot */
402 drawGpBox(gcg, filename, objcounter, 0, 0, partialdec->getNLinkingvars(), partialdec->getNConss(),
404 colboxcounter += partialdec->getNLinkingvars();
405 }
406
407 /* masterconss */
408 if(partialdec->getNMasterconss() != 0)
409 {
410 ++objcounter;
411 drawGpBox(gcg, filename, objcounter, 0, 0, partialdec->getNVars(), partialdec->getNMasterconss(),
413 rowboxcounter += partialdec->getNMasterconss();
414 }
415
416 /* mastervars */
417 if(partialdec->getNMastervars() != 0)
418 {
419 ++objcounter;
420 // drawGpBox( scip, filename, objcounter, colboxcounter, 0, partialdec->getNMastervars()+colboxcounter,
421 // partialdec->getNMasterconss(), GCGvisuGetColorMastervars() );
422 colboxcounter += partialdec->getNMastervars();
423 }
424
425 /* blocks (blocks are not empty) */
426 for( int b = 0; b < partialdec->getNBlocks() ; ++b )
427 {
428 ++objcounter;
429 drawGpBox(gcg, filename, objcounter, colboxcounter, rowboxcounter,
430 colboxcounter + partialdec->getNVarsForBlock(b), rowboxcounter + partialdec->getNConssForBlock(b),
432 colboxcounter += partialdec->getNVarsForBlock(b);
433
434 if( partialdec->getNStairlinkingvars(b) != 0 )
435 {
436 ++objcounter;
437 drawGpBox(gcg, filename, objcounter, colboxcounter, rowboxcounter,
438 colboxcounter + partialdec->getNStairlinkingvars(b),
439 rowboxcounter + partialdec->getNConssForBlock(b) + partialdec->getNConssForBlock(b+1),
441 }
442 colboxcounter += partialdec->getNStairlinkingvars(b);
443 rowboxcounter += partialdec->getNConssForBlock(b);
444 }
445
446 /* open */
447 if(partialdec->getNOpenvars() != 0)
448 {
449 ++objcounter;
450 drawGpBox(gcg, filename, objcounter, colboxcounter, rowboxcounter, colboxcounter + partialdec->getNOpenvars(),
451 rowboxcounter+partialdec->getNOpenconss(), GCGvisuGetColorOpen(gcg) );
452 colboxcounter += partialdec->getNOpenvars();
453 rowboxcounter += partialdec->getNOpenconss();
454 }
455 }
456 /* --- draw nonzeros --- */
458 {
459 /* scale the dots according to matrix dimensions here */
460 writeGpNonzeros(gcg, filename, partialdec, GCGvisuGetNonzeroRadius(gcg, partialdec->getNVars(), partialdec->getNConss(),
461 (float)SCALING_FACTOR_NONZEROS) );
462 }
463 else
464 {
465 ofs << "plot \"-\" using 1:2:(0) notitle with circles fill solid lw 2 fc rgb \"black\" "
466 << std::endl << "0 0" << std::endl << "e" << std::endl;
467 }
468
469 ofs.close();
470
471 return SCIP_OKAY;
472}
473
474
475/* Writes a visualization for the given partialdec */
477 GCG* gcg, /**< GCG data structure */
478 const char* filename, /**< filename (including path) to write to */
479 const char* outputname, /**< filename for compiled output file */
480 int partialdecid, /**< id of partialdec to visualize */
481 GP_OUTPUT_FORMAT outputformat /**< the output format which gnuplot should emit */
482 )
483{
484 DETPROBDATA* detprobdata;
485 PARTIALDECOMP* partialdec;
486
487 /* get partialdec and detprobdata */
488 partialdec = GCGconshdlrDecompGetPartialdecFromID(gcg, partialdecid);
489 if( partialdec == NULL )
490 {
491 SCIPerrorMessage("Could not find PARTIALDECOMP!\n");
492 return SCIP_ERROR;
493 }
494
495 detprobdata = partialdec->getDetprobdata();
496 if( detprobdata == NULL )
497 {
498 SCIPerrorMessage("Could not find DETPROBDATA!\n");
499 return SCIP_ERROR;
500 }
501
502 /* write file */
503 writeGpHeader(gcg, filename, outputname, outputformat );
504 writeGpPartialdec(gcg, filename, partialdec );
505
506 return SCIP_OKAY;
507}
508
509/* Writes a visualization as .pdf file for the given partialdec */
511 GCG* gcg, /**< GCG data structure */
512 const char* filename, /**< filename (including path) to write to */
513 const char* outputname, /**< filename for compiled output file */
514 int partialdecid /**< id of partialdec to visualize */
515 )
516{
517 return GCGwriteGpVisualizationFormat(gcg, filename, outputname, partialdecid, GP_OUTPUT_FORMAT_PDF);
518}
519
520
521/* Creates a block matrix and outputs its visualization as .pdf file
522 * @returns SCIP return code*/
524 GCG* gcg, /* GCG data structure */
525 const char* filename, /* filename the output should be written to (including directory) */
526 const char* workfolder, /* directory in which should be worked */
527 SCIP_Bool originalmatrix /* should the original (or transformed) matrix be written */
528 )
529{
530 char outputname[SCIP_MAXSTRLEN];
531 char filename2[SCIP_MAXSTRLEN];
532
533 int id = GCGconshdlrDecompAddMatrixPartialdec(gcg, !originalmatrix);
534
536
537 strcat(outputname, ".pdf");
538 strcpy(filename2, filename);
539 SCIPinfoMessage(GCGgetOrigprob(gcg), NULL, "filename for matrix plot is %s \n", filename );
540 SCIPinfoMessage(GCGgetOrigprob(gcg), NULL, "foldername for matrix plot is %s \n", workfolder );
541
542 /* actual writing */
543 GCGwriteGpVisualization(gcg, filename2, outputname, id );
544
545 return SCIP_OKAY;
546}
547
548
549/*
550 * reader include
551 */
552
553/* includes the gp file reader into SCIP */
555 GCG* gcg /**< GCG data structure */
556 )
557{
558 SCIP_READERDATA* readerdata = NULL;
560 assert(origprob != NULL);
561 /* create cls reader data */
562 SCIP_CALL( SCIPallocMemory(origprob, &readerdata) );
563 readerdata->gcg = gcg;
565 NULL, readerFreeGp, NULL, readerWriteGp, readerdata) );
566
567 return SCIP_OKAY;
568}
569
SCIP_DECL_READERWRITE(ReaderTSP::scip_write)
SCIP_DECL_READERFREE(ReaderTSP::scip_free)
SCIP_VAR ** b
class storing partialdecs and the problem matrix
class storing (potentially incomplete) decompositions
GCG_EXPORT int getNVarsForCons(int consIndex)
returns the number of variables for a given constraint
GCG_EXPORT std::vector< int > & getVarsForCons(int consIndex)
returns the variable indices of the coefficient matrix for a constraint
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< int > & getStairlinkingvars(int block)
Gets vector containing stairlinking vars,.
GCG_EXPORT int getNStairlinkingvars(int block)
Gets size of the vector containing stairlinking vars.
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 DETPROBDATA * getDetprobdata()
Gets the corresponding detprobdata.
GCG_EXPORT bool isComplete()
Gets whether this partialdec is complete, i.e. it has no more open constraints and variables.
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 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.
int GCGconshdlrDecompAddMatrixPartialdec(GCG *gcg, SCIP_Bool presolved)
creates a pure matrix partialdecomp (i.e. all cons/vars to one single block)
PARTIALDECOMP * GCGgetPartialdecToWrite(GCG *gcg, SCIP_Bool transformed)
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_Bool
#define TRUE
#define FALSE
SCIP * GCGgetOrigprob(GCG *gcg)
Definition gcg.cpp:87
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
SCIP_RETCODE SCIPgetIntParam(SCIP *scip, const char *name, int *value)
#define SCIPallocMemory(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)
const char * SCIPreaderGetName(SCIP_READER *reader)
int SCIPstrncpy(char *t, const char *s, int size)
SCIPfreeMemory(GCGgetOrigprob(gcg), &divingdata)
static assert(heur !=NULL)
SCIP_CALL(SCIPgetExternBranchCands(origprob, &lpcands, &lpcandssol, NULL, &nlpcands, NULL, NULL, NULL, NULL))
SCIP * origprob
* result
SCIP_VAR * var
int i
int nvars
#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)
SCIP_Bool GCGvisuGetDraftmode(GCG *gcg)
const char * GCGvisuGetColorNonzero(GCG *gcg)
float GCGvisuGetNonzeroRadius(GCG *gcg, int maxindx, int maxindy, float scalingfactor)
const char * GCGvisuGetColorLinking(GCG *gcg)
const char * GCGvisuGetColorBlock(GCG *gcg)
const char * GCGvisuGetColorLine(GCG *gcg)
const char * GCGvisuGetColorOpen(GCG *gcg)
const char * GCGvisuGetColorMasterconss(GCG *gcg)
public methods for working with decomposition structures
#define SCIPerrorMessage
#define READER_DESC
#define READER_EXTENSION
#define READER_NAME
SCIP_RETCODE GCGWriteGpDecompMatrix(GCG *gcg, const char *filename, const char *workfolder, SCIP_Bool originalmatrix)
static SCIP_RETCODE writeGpNonzeros(GCG *gcg, const char *filename, PARTIALDECOMP *partialdec, float radius)
static SCIP_RETCODE drawGpBox(GCG *gcg, const char *filename, int objectid, int x1, int y1, int x2, int y2, const char *color)
SCIP_RETCODE GCGwriteGpVisualization(GCG *gcg, const char *filename, const char *outputname, int partialdecid)
static SCIP_RETCODE writeGpHeader(GCG *gcg, const char *filename, const char *outputname, GP_OUTPUT_FORMAT outputformat)
#define SCALING_FACTOR_NONZEROS
Definition reader_gp.cpp:62
SCIP_RETCODE GCGincludeReaderGp(GCG *gcg)
static SCIP_RETCODE writeGpPartialdec(GCG *gcg, const char *filename, PARTIALDECOMP *partialdec)
Adds the gnuplot body of the partialdec visualization to the given file.
SCIP_RETCODE GCGwriteGpVisualizationFormat(GCG *gcg, const char *filename, const char *outputname, int partialdecid, GP_OUTPUT_FORMAT outputformat)
GP file reader writing decompositions to gnuplot files.
@ GP_OUTPUT_FORMAT_SVG
Definition reader_gp.h:56
@ GP_OUTPUT_FORMAT_PDF
Definition reader_gp.h:54
@ GP_OUTPUT_FORMAT_PNG
Definition reader_gp.h:55
enum GPOutputFormat GP_OUTPUT_FORMAT
Definition reader_gp.h:58
various SCIP helper methods
structure information for decomposition information in GCG projects
struct Gcg GCG
Definition type_gcg.h:44
struct SCIP_ReaderData SCIP_READERDATA
SCIP_DIDNOTRUN
SCIP_SUCCESS
SCIP_ERROR
enum SCIP_Retcode SCIP_RETCODE
struct Scip SCIP