GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
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.

Referenced by checkVersion(), and JDecFileHandler::writeJDec().

Function Documentation

◆ checkVersion()

constexpr bool checkVersion ( int version)
staticconstexpr

checks version

Definition at line 58 of file reader_jdec.cpp.

References checkVersion(), and JDEC_VERSION.

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

◆ checkJson()

constexpr bool checkJson ( int returnvalue)
staticconstexpr

checks return value of json lib calls

Definition at line 64 of file reader_jdec.cpp.

References checkJson().

Referenced by checkJson(), and JDecFileHandler::writeJDec().

◆ readJDec()

◆ writePartialdec()

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 result, JDecFileHandler::writeJDec(), and writePartialdec().

Referenced by SCIP_DECL_READERWRITE(), and writePartialdec().

◆ SCIP_DECL_READERFREE()

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 assert(), and SCIPfreeMemory().

◆ SCIP_DECL_READERREAD()

SCIP_DECL_READERREAD ( readerReadJDec )
static

problem reading method of reader

Definition at line 1416 of file reader_jdec.cpp.

References assert(), SCIP_ReaderData::gcg, readJDec(), result, and SCIP_CALL().

◆ SCIP_DECL_READERWRITE()

SCIP_DECL_READERWRITE ( readerWriteJDec )
static

problem writing method of reader

Definition at line 1437 of file reader_jdec.cpp.

References assert(), SCIP_ReaderData::gcg, GCGgetPartialdecToWrite(), result, SCIP_CALL(), 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 assert(), SCIP_ReaderData::gcg, GCGgetOrigprob(), GCGincludeReaderJDec(), origprob, READER_DESC, READER_EXTENSION, READER_NAME, and SCIP_CALL().

Referenced by GCGincludeGcgPlugins(), and GCGincludeReaderJDec().