Scippy

GCG

Branch-and-Price & Column Generation for Everyone

reader_jdec.cpp File Reference

Detailed Description

jdec file reader for (JSON formatted) structure information

Author
Erik Muehmer

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()

static constexpr bool checkVersion ( int  version)
staticconstexpr

checks version

Definition at line 58 of file reader_jdec.cpp.

References JDEC_VERSION.

Referenced by JDecRootElementParser::handleKeyValuePair(), and JDecFileHandler::readJDec().

◆ checkJson()

static constexpr bool checkJson ( int  returnvalue)
staticconstexpr

checks return value of json lib calls

Definition at line 64 of file reader_jdec.cpp.

Referenced by JDecFileHandler::writeJDec().

◆ readJDec()

◆ writePartialdec()

static SCIP_RETCODE writePartialdec ( GCG *  gcg,
FILE *  file,
gcg::PARTIALDECOMP *  partialdec,
SCIP_RESULT *  result 
)
static
Parameters
gcgGCG data structure
filefile pointer
partialdecpartialdec to be written
resultpointer 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 SCIP_DECL_READERFREE ( readerFreeJDec  )
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 SCIP_DECL_READERREAD ( readerReadJDec  )
static

◆ SCIP_DECL_READERWRITE()

static SCIP_DECL_READERWRITE ( readerWriteJDec  )
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
gcgGCG 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().