Detailed Description
jdec file reader for (JSON formatted) structure information
Definition in file reader_jdec.cpp.
#include "gcg/reader_jdec.h"#include "gcg/class_partialdecomp.h"#include "gcg/class_detprobdata.h"#include "gcg/cons_decomp.hpp"#include <algorithm>#include <cassert>#include <string>#include <jansson.h>Go to the source code of this file.
Data Structures | |
| struct | SCIP_ReaderData |
| struct | JDecBlockData |
| struct | JDecDecompositionData |
| struct | JDecData |
| class | JDecFileHandler |
| class | AbstractJDecElementParser |
| class | AbstractJDecDecompositionElementParser |
| class | JDecBlockElementParser |
| class | JDecDecompositionElementParser |
| class | JDecRootElementParser |
Macros | |
| #define | READER_NAME "jdecreader" |
| #define | READER_DESC "jdec (JSON formatted structure information) file reader" |
| #define | READER_EXTENSION "jdec" |
| #define | JDEC_VERSION 1 |
Functions | |
| static constexpr bool | checkVersion (int version) |
| static constexpr bool | checkJson (int returnvalue) |
| static SCIP_RETCODE | readJDec (GCG *gcg, const char *filename, SCIP_RESULT *result) |
| static SCIP_RETCODE | writePartialdec (GCG *gcg, FILE *file, gcg::PARTIALDECOMP *partialdec, SCIP_RESULT *result) |
| static | SCIP_DECL_READERFREE (readerFreeJDec) |
| static | SCIP_DECL_READERREAD (readerReadJDec) |
| static | SCIP_DECL_READERWRITE (readerWriteJDec) |
| SCIP_RETCODE | GCGincludeReaderJDec (GCG *gcg) |
Macro Definition Documentation
◆ READER_NAME
| #define READER_NAME "jdecreader" |
Definition at line 49 of file reader_jdec.cpp.
◆ READER_DESC
| #define READER_DESC "jdec (JSON formatted structure information) file reader" |
Definition at line 50 of file reader_jdec.cpp.
◆ READER_EXTENSION
| #define READER_EXTENSION "jdec" |
Definition at line 51 of file reader_jdec.cpp.
◆ JDEC_VERSION
| #define JDEC_VERSION 1 |
Definition at line 53 of file reader_jdec.cpp.
Function Documentation
◆ checkVersion()
|
staticconstexpr |
checks version
Definition at line 58 of file reader_jdec.cpp.
References JDEC_VERSION.
Referenced by JDecRootElementParser::handleKeyValuePair(), and JDecFileHandler::readJDec().
◆ checkJson()
|
staticconstexpr |
checks return value of json lib calls
Definition at line 64 of file reader_jdec.cpp.
Referenced by JDecFileHandler::writeJDec().
◆ readJDec()
|
static |
- Parameters
-
gcg GCG data structure filename path of file result pointer to scip result
Definition at line 1248 of file reader_jdec.cpp.
References b, JDecBlockData::blocknumber, JDecDecompositionData::blocks, JDecBlockData::constraints, JDecDecompositionData::createBlockStructure(), JDecBlockData::decomposition, gcg::PARTIALDECOMP::fixConsToBlockByName(), gcg::PARTIALDECOMP::fixConsToMasterByName(), GCGconshdlrDecompAddPreexisitingPartialDec(), GCGgetOrigprob(), gcg::PARTIALDECOMP::getDetprobdata(), gcg::DETPROBDATA::getIndexForVar(), gcg::PARTIALDECOMP::getNBlocks(), gcg::PARTIALDECOMP::getNVarsForBlock(), gcg::DETPROBDATA::getVar(), gcg::PARTIALDECOMP::getVarProbindexForBlock(), gcg::PARTIALDECOMP::getVarsForBlock(), JDecDecompositionData::masterconstraints, NULL, JDecDecompositionData::presolved, JDecFileHandler::readJDec(), JDecData::rootdecomposition, SCIP_DIDNOTRUN, SCIP_OKAY, SCIP_READERROR, SCIP_STAGE_PRESOLVED, SCIP_SUCCESS, SCIPfindVar(), SCIPgetStage(), SCIPinfoMessage(), SCIPpresolve(), SCIPvarGetName(), SCIPwarningMessage(), gcg::PARTIALDECOMP::setBlockStructure(), gcg::PARTIALDECOMP::setNBlocks(), gcg::PARTIALDECOMP::setSymmetryInformation(), and JDecDecompositionData::symmetryvardata.
Referenced by SCIP_DECL_READERREAD().
◆ writePartialdec()
|
static |
- Parameters
-
gcg GCG data structure file file pointer partialdec partialdec to be written result pointer to scip result
Definition at line 1375 of file reader_jdec.cpp.
References SCIP_DIDNOTRUN, SCIP_OKAY, SCIP_SUCCESS, SCIP_WRITEERROR, and JDecFileHandler::writeJDec().
Referenced by SCIP_DECL_READERWRITE().
◆ SCIP_DECL_READERFREE()
|
static |
destructor of reader to free user data (called when SCIP is exiting)
Definition at line 1402 of file reader_jdec.cpp.
References NULL, SCIP_OKAY, SCIPfreeMemory, and SCIPreaderGetData().
◆ SCIP_DECL_READERREAD()
|
static |
problem reading method of reader
Definition at line 1416 of file reader_jdec.cpp.
References SCIP_ReaderData::gcg, NULL, readJDec(), SCIP_CALL, SCIP_OKAY, SCIP_STAGE_INIT, SCIP_VERBLEVEL_DIALOG, SCIPgetNConss(), SCIPgetNVars(), SCIPgetStage(), SCIPreaderGetData(), and SCIPverbMessage().
◆ SCIP_DECL_READERWRITE()
|
static |
problem writing method of reader
Definition at line 1437 of file reader_jdec.cpp.
References SCIP_ReaderData::gcg, GCGgetPartialdecToWrite(), NULL, SCIP_CALL, SCIP_OKAY, SCIPreaderGetData(), SCIPwarningMessage(), and writePartialdec().
◆ GCGincludeReaderJDec()
| SCIP_RETCODE GCGincludeReaderJDec | ( | GCG * | gcg | ) |
includes the ndec file reader into SCIP
- Parameters
-
gcg GCG data structure
Definition at line 1459 of file reader_jdec.cpp.
References SCIP_ReaderData::gcg, GCGgetOrigprob(), NULL, READER_DESC, READER_EXTENSION, READER_NAME, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPallocMemory, SCIPincludeExternalCodeInformation(), SCIPincludeReader(), and SCIPsnprintf().
Referenced by GCGincludeGcgPlugins().