reader_tex.cpp
Go to the documentation of this file.
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
137 /** Converts a hex color code into a tex-conform line of code that defines the color as "colorname"
190 SCIPinfoMessage(scip, file, "%% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n");
198 SCIPinfoMessage(scip, file, "%% * Copyright (C) 2010-2021 Operations Research, RWTH Aachen University * \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");
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");
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");
215 SCIPinfoMessage(scip, file, "%% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n");
232 // SCIPinfoMessage(scip, file, "\\pgfplotsset{legend image with text/.style={\nlegend image code/.code={% \n");
278 /** Write LaTeX code title page that includes general statistics about the problem to given file
285 int* npresentedpartialdecs /**< Number of decompositions to be shown in the file or NULL if unknown */
320 SCIPinfoMessage(scip, file, " Number of decompositions presented in this document: & %i \\\\ \n",
325 SCIPinfoMessage(scip, file, " Number of decompositions presented in this document: & %i \\\\ \n", ndecomps);
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 ),
537 writeTikzBox(scip, file, nvars, nconss, 0, 0, partialdec->getNLinkingvars(), partialdec->getNConss(),
545 writeTikzBox(scip, file, nvars, nconss, 0, 0, partialdec->getNVars(), partialdec->getNMasterconss(),
553 writeTikzBox(scip, file, nvars, nconss, colboxcounter, 0, partialdec->getNMastervars()+colboxcounter,
562 colboxcounter + partialdec->getNVarsForBlock(b), rowboxcounter + partialdec->getNConssForBlock(b),
580 writeTikzBox(scip, file, nvars, nconss, colboxcounter, rowboxcounter, colboxcounter + partialdec->getNOpenvars(),
589 writeTikzNonzeros(scip, file, partialdec, SCIPvisuGetNonzeroRadius(scip, partialdec->getNVars(), partialdec->getNConss(), 1),
636 " Found by detector(s): & \\begin{minipage}{10cm}\\begin{verbatim}%s\\end{verbatim}\\end{minipage} \\\\ \n",
683 SCIP_Bool usegp /* true if the gp reader should be used to visualize the individual partialdecs */
708 std::sort(partialdecs.begin(), partialdecs.end(), [&](PARTIALDECOMP* a, PARTIALDECOMP* b) {return (a->getScore(sctype) > b->getScore(sctype)); });
724 SCIPsnprintf( decompname, SCIP_MAXSTRLEN, "%s-%d-%d", buffer, partialdec->getID(), partialdec->getNBlocks() );
727 SCIPinfoMessage(scip, file, "\\addcontentsline{toc}{section}{Decomposition: %s}\n", decompname);
772 SCIP_Bool usegp /* true if the gp reader should be used to visualize the individual partialdecs */
852 /* will only be applied if the filename ends with "-tex.tex" due to the standard naming scheme */
884 "\t@latexmk -pdf -pdflatex=\"pdflatex -interaction=batchmode -shell-escape\" -use-make %s.tex \n", filename);
918 SCIPinfoMessage(scip, readme, "README: How to create a PDF file from the .tex file(s) using the %s file.\n", name);
922 SCIPinfoMessage(scip, readme, "Depending on the size of your problem that may take some time.\n");
925 SCIPinfoMessage(scip, readme, "All access files will be deleted automatically once the compilation is complete.\n");
928 SCIPinfoMessage(scip, readme, "\t'make -f %s clean' clears all present intermediate files (if any exist)\n", name);
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
Definition: cons_decomp.cpp:2618
std::vector< int > & getMastervars()
Gets array containing all master vars indices.
Definition: class_partialdecomp.cpp:3998
std::vector< int > & getVarsForBlock(int block)
Gets array containing vars of a block.
Definition: class_partialdecomp.cpp:4470
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.
Definition: class_partialdecomp.cpp:4198
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
static SCIP_RETCODE writeTexTitlepage(SCIP *scip, FILE *file, int *npresentedpartialdecs)
Definition: reader_tex.cpp:282
Definition: class_conspartition.cpp:43
std::vector< int > & getMasterconss()
Gets array containing all master conss indices.
Definition: class_partialdecomp.cpp:3992
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.
Definition: cons_decomp.cpp:5505
USERGIVEN getUsergiven()
Gets the USERGIVEN status of this partialdecs.
Definition: class_partialdecomp.cpp:4097
int getNVarsForBlock(int block)
Gets size of the vector containing vars assigned to a block.
Definition: class_partialdecomp.cpp:4226
int getNTotalStairlinkingvars()
Gets total number of stairlinking vars.
Definition: class_partialdecomp.cpp:4182
void buildDecChainString(char *buffer)
creates a detector chain short string for this partialdec, is built from detector chain
Definition: class_partialdecomp.cpp:5480
PARTIALDECOMP * DECgetPartialdecToWrite(SCIP *scip, SCIP_Bool transformed)
Definition: cons_decomp.cpp:2928
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.
Definition: class_partialdecomp.cpp:4210
int getNConssForBlock(int block)
Gets size of the vector containing conss assigned to a block.
Definition: class_partialdecomp.cpp:4121
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
int getNLinkingvars()
Gets size of the vector containing linking vars.
Definition: class_partialdecomp.cpp:4148
C++ interface of cons_decomp.
const int * getStairlinkingvars(int block)
Gets array containing stairlinking vars,.
Definition: class_partialdecomp.cpp:4446
const int * getOpenconss()
Gets array containing constraints not assigned yet.
Definition: class_partialdecomp.cpp:4247
SCIP_RETCODE GCGwriteGpVisualization(SCIP *scip, char *filename, char *outputname, int partialdecid)
Definition: reader_gp.cpp:483
Definition: class_detprobdata.h:106
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)
Definition: cons_decomp.cpp:5327
std::vector< int > & getConssForBlock(int block)
returns array containing constraints assigned to a block
Definition: class_partialdecomp.cpp:3693
SCIP_Real getScore(SCORETYPE type)
returns the score of the partialdec (depending on used scoretype)
Definition: class_partialdecomp.cpp:4025
DETPROBDATA * getDetprobdata()
Gets the corresponding detprobdata.
Definition: class_partialdecomp.cpp:4424
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
Definition: cons_decomp.cpp:317
std::vector< int > & getLinkingvars()
returns array containing all linking vars indices
Definition: class_partialdecomp.cpp:3986
static SCIP_RETCODE writeTexEnding(SCIP *scip, FILE *file)
Definition: reader_tex.cpp:663
int getNOpenconss()
Gets size of vector containing constraints not assigned yet.
Definition: class_partialdecomp.cpp:4192
const char * SCIPvisuGetColorMastervars(SCIP *scip)
Definition: params_visu.c:246
class storing (potentially incomplete) decompositions
SCORETYPE GCGconshdlrDecompGetScoretype(SCIP *scip)
Gets the currently selected scoretype.
Definition: cons_decomp.cpp:5601
GP file reader writing decompositions to gnuplot files.
SCIP_Real getVal(int row, int col)
returns a coefficient from the coefficient matrix
Definition: class_detprobdata.cpp:916
std::vector< DEC_DETECTOR * > & getDetectorchain()
returns detector chain as vector of detector pointers
Definition: class_partialdecomp.cpp:3702
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.
Definition: class_partialdecomp.cpp:4170
const int * getOpenvars()
Gets array containing variables not assigned yet.
Definition: class_partialdecomp.cpp:4259
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.
Definition: class_partialdecomp.cpp:4176
class storing partialdecs and the problem matrix
void GCGgetVisualizationFilename(SCIP *scip, PARTIALDECOMP *partialdec, const char *extension, char *filename)
Definition: miscvisualization.cpp:54
public methods for working with decomposition structures