reader_tex.cpp
Go to the documentation of this file.
34/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
150/** Converts a hex color code into a tex-conform line of code that defines the color as "colorname"
204 SCIPinfoMessage(scip, file, "%% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n");
212 SCIPinfoMessage(scip, file, "%% * Copyright (C) 2010-2026 Operations Research, RWTH Aachen University * \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");
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");
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");
230 SCIPinfoMessage(scip, file, "%% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n");
247// SCIPinfoMessage(scip, file, "\\pgfplotsset{legend image with text/.style={\nlegend image code/.code={% \n");
300 int* npresentedpartialdecs /**< Number of decompositions to be shown in the file or NULL if unknown */
336 SCIPinfoMessage(scip, file, " Number of decompositions presented in this document: & %i \\\\ \n",
341 SCIPinfoMessage(scip, file, " Number of decompositions presented in this document: & %i \\\\ \n", ndecomps);
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 ),
554 writeTikzBox(scip, file, nvars, nconss, 0, 0, partialdec->getNLinkingvars(), partialdec->getNConss(),
562 writeTikzBox(scip, file, nvars, nconss, 0, 0, partialdec->getNVars(), partialdec->getNMasterconss(),
570 writeTikzBox(scip, file, nvars, nconss, colboxcounter, 0, partialdec->getNMastervars()+colboxcounter,
579 colboxcounter + partialdec->getNVarsForBlock(b), rowboxcounter + partialdec->getNConssForBlock(b),
597 writeTikzBox(scip, file, nvars, nconss, colboxcounter, rowboxcounter, colboxcounter + partialdec->getNOpenvars(),
606 writeTikzNonzeros(scip, file, partialdec, GCGvisuGetNonzeroRadius(gcg, partialdec->getNVars(), partialdec->getNConss(), 1),
654 " Found by detector(s): & \\begin{minipage}{10cm}\\begin{verbatim}%s\\end{verbatim}\\end{minipage} \\\\ \n",
701 SCIP_Bool usegp /* true if the gp reader should be used to visualize the individual partialdecs */
726 std::sort(partialdecs.begin(), partialdecs.end(), [&](PARTIALDECOMP* a, PARTIALDECOMP* b) {return (a->getScore(GCGgetCurrentScore(gcg)) > b->getScore(GCGgetCurrentScore(gcg))); });
742 SCIPsnprintf( decompname, SCIP_MAXSTRLEN, "%s-%d-%d", buffer, partialdec->getID(), partialdec->getNBlocks() );
745 SCIPinfoMessage(scip, file, "\\addcontentsline{toc}{section}{Decomposition: %s}\n", decompname);
790 SCIP_Bool usegp /* true if the gp reader should be used to visualize the individual partialdecs */
872 /* will only be applied if the filename ends with "-tex.tex" due to the standard naming scheme */
904 "\t@latexmk -pdf -pdflatex=\"pdflatex -interaction=batchmode -shell-escape\" -use-make %s.tex \n", filename);
938 SCIPinfoMessage(scip, readme, "README: How to create a PDF file from the .tex file(s) using the %s file.\n", name);
942 SCIPinfoMessage(scip, readme, "Depending on the size of your problem that may take some time.\n");
945 SCIPinfoMessage(scip, readme, "All access files will be deleted automatically once the compilation is complete.\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);
SCIP_VAR * a
SCIP_VAR ** b
SCIP_Real * r
class storing partialdecs and the problem matrix
class storing (potentially incomplete) decompositions
Definition: class_detprobdata.h:110
GCG_EXPORT SCIP_Real getVal(int row, int col)
returns a coefficient from the coefficient matrix
Definition: class_detprobdata.cpp:976
GCG_EXPORT int getNMasterconss()
Gets size of the vector containing master conss.
Definition: class_partialdecomp.cpp:4481
GCG_EXPORT std::vector< GCG_DETECTOR * > & getDetectorchain()
returns detector chain as vector of detector pointers
Definition: class_partialdecomp.cpp:3977
GCG_EXPORT std::vector< int > & getStairlinkingvars(int block)
Gets vector containing stairlinking vars,.
Definition: class_partialdecomp.cpp:4747
GCG_EXPORT SCIP_Real getScore(GCG_SCORE *score)
returns the score of the partialdec
Definition: class_partialdecomp.cpp:4347
GCG_EXPORT int getNStairlinkingvars(int block)
Gets size of the vector containing stairlinking vars.
Definition: class_partialdecomp.cpp:4521
GCG_EXPORT USERGIVEN getUsergiven()
Gets the USERGIVEN status of this partialdecs.
Definition: class_partialdecomp.cpp:4408
GCG_EXPORT int getNOpenvars()
Gets size of vector containing variables not assigned yet.
Definition: class_partialdecomp.cpp:4509
GCG_EXPORT std::vector< int > & getMasterconss()
Gets array containing all master conss indices.
Definition: class_partialdecomp.cpp:4286
GCG_EXPORT std::vector< int > & getConssForBlock(int block)
returns array containing constraints assigned to a block
Definition: class_partialdecomp.cpp:3968
GCG_EXPORT void buildDecChainString(char *buffer)
creates a detector chain short string for this partialdec, is built from detector chain
Definition: class_partialdecomp.cpp:5842
GCG_EXPORT DETPROBDATA * getDetprobdata()
Gets the corresponding detprobdata.
Definition: class_partialdecomp.cpp:4725
GCG_EXPORT int getNOpenconss()
Gets size of vector containing constraints not assigned yet.
Definition: class_partialdecomp.cpp:4503
GCG_EXPORT int getNVarsForBlock(int block)
Gets size of the vector containing vars assigned to a block.
Definition: class_partialdecomp.cpp:4537
GCG_EXPORT std::vector< int > & getLinkingvars()
returns array containing all linking vars indices
Definition: class_partialdecomp.cpp:4261
GCG_EXPORT std::vector< int > & getMastervars()
Gets array containing all master vars indices.
Definition: class_partialdecomp.cpp:4292
GCG_EXPORT int getNLinkingvars()
Gets size of the vector containing linking vars.
Definition: class_partialdecomp.cpp:4459
GCG_EXPORT int getNTotalStairlinkingvars()
Gets total number of stairlinking vars.
Definition: class_partialdecomp.cpp:4493
GCG_EXPORT int getNMastervars()
Gets size of the vector containing master vars.
Definition: class_partialdecomp.cpp:4487
GCG_EXPORT int getNConssForBlock(int block)
Gets size of the vector containing conss assigned to a block.
Definition: class_partialdecomp.cpp:4432
GCG_EXPORT int getID()
returns the unique id of the partialdec
Definition: class_partialdecomp.cpp:4255
GCG_EXPORT std::vector< int > & getOpenconss()
Gets vector containing constraints not assigned yet.
Definition: class_partialdecomp.cpp:4558
GCG_EXPORT std::vector< int > & getOpenvars()
Gets vector containing variables not assigned yet.
Definition: class_partialdecomp.cpp:4564
GCG_EXPORT std::vector< int > & getVarsForBlock(int block)
Gets array containing vars of a block.
Definition: class_partialdecomp.cpp:4771
const char * GCGdetectorGetName(GCG_DETECTOR *detector)
returns the name of the provided detector
Definition: cons_decomp.cpp:2084
GCG_SCORE * GCGgetCurrentScore(GCG *gcg)
Gets the currently enabled score.
Definition: cons_decomp.cpp:2796
PARTIALDECOMP * GCGgetPartialdecToWrite(GCG *gcg, SCIP_Bool transformed)
Definition: cons_decomp.cpp:2441
int GCGconshdlrDecompGetNDecomps(GCG *gcg)
gets the number of decompositions (= amount of finished partialdecs)
Definition: cons_decomp.cpp:4040
unsigned int GCGconshdlrDecompGetNPartialdecs(GCG *gcg)
Gets the number of all partialdecs.
Definition: cons_decomp.cpp:4347
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
Definition: cons_decomp.cpp:281
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)
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)
int SCIPsnprintf(char *t, int len, const char *s,...)
#define NULL
void GCGgetVisualizationFilename(GCG *gcg, PARTIALDECOMP *partialdec, const char *extension, char *filename)
Definition: miscvisualization.cpp:61
miscellaneous methods for visualizations
Definition: class_conspartition.cpp:44
const char * GCGvisuGetColorStairlinking(GCG *gcg)
Definition: params_visu.c:301
const char * GCGvisuGetColorMastervars(GCG *gcg)
Definition: params_visu.c:247
float GCGvisuGetNonzeroRadius(GCG *gcg, int maxindx, int maxindy, float scalingfactor)
Definition: params_visu.c:555
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
static SCIP_RETCODE writeTexHeader(GCG *gcg, FILE *file, SCIP_Bool externalizepics)
Definition: reader_tex.cpp:194
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
static SCIP_RETCODE getTexColorFromHex(const char *hex, const char *colorname, char *code)
Definition: reader_tex.cpp:154
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
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
parameter settings for visualization readers
various SCIP helper methods
Definition: struct_gcg.h:55
Definition: reader_blk.cpp:112
SCIP_DIDNOTRUN
SCIP_SUCCESS
SCIP_FILECREATEERROR
SCIP_READERROR
SCIP_OKAY
enum SCIP_Retcode SCIP_RETCODE