Scippy

GCG

Branch-and-Price & Column Generation for Everyone

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