Scippy

SCIP

Solving Constraint Integer Programs

reader.h File Reference

Detailed Description

internal methods for input file readers

Author
Tobias Achterberg

Definition in file reader.h.

#include "scip/def.h"
#include "scip/type_prob.h"
#include "scip/type_retcode.h"
#include "scip/type_result.h"
#include "scip/type_set.h"
#include "scip/type_reader.h"
#include "scip/pub_reader.h"

Go to the source code of this file.

Functions

SCIP_RETCODE SCIPreaderCopyInclude (SCIP_READER *reader, SCIP_SET *set)
 
SCIP_RETCODE SCIPreaderCreate (SCIP_READER **reader, SCIP_SET *set, 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_RETCODE SCIPreaderFree (SCIP_READER **reader, SCIP_SET *set)
 
SCIP_RETCODE SCIPreaderRead (SCIP_READER *reader, SCIP_SET *set, const char *filename, const char *extension, SCIP_RESULT *result)
 
SCIP_RETCODE SCIPreaderWrite (SCIP_READER *reader, SCIP_PROB *prob, SCIP_SET *set, FILE *file, const char *format, SCIP_Bool genericnames, SCIP_RESULT *result)
 
SCIP_Real SCIPreaderGetReadingTime (SCIP_READER *reader)
 
void SCIPreaderEnableOrDisableClocks (SCIP_READER *reader, SCIP_Bool enable)
 
SCIP_RETCODE SCIPreaderResetReadingTime (SCIP_READER *reader)
 
void SCIPreaderSetCopy (SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
 
void SCIPreaderSetFree (SCIP_READER *reader, SCIP_DECL_READERFREE((*readerfree)))
 
void SCIPreaderSetRead (SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
 
void SCIPreaderSetWrite (SCIP_READER *reader, SCIP_DECL_READERWRITE((*readerwrite)))
 

Function Documentation

◆ SCIPreaderCopyInclude()

SCIP_RETCODE SCIPreaderCopyInclude ( SCIP_READER reader,
SCIP_SET set 
)

copies the given reader to a new scip

Parameters
readerreader
setSCIP_SET of SCIP to copy to

Definition at line 58 of file reader.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPreaderGetName(), and SCIPsetDebugMsg.

Referenced by SCIPsetEnableOrDisablePluginClocks().

◆ SCIPreaderCreate()

SCIP_RETCODE SCIPreaderCreate ( SCIP_READER **  reader,
SCIP_SET set,
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 
)

creates a reader

Parameters
readerpointer to store reader
setglobal SCIP settings
namename of reader
descdescription of reader
extensionfile extension that reader processes
readerdatareader data

Definition at line 113 of file reader.c.

References doReaderCreate(), NULL, SCIP_CALL_FINALLY, SCIP_OKAY, and SCIPreaderFree().

Referenced by SCIPincludeReader(), and SCIPincludeReaderBasic().

◆ SCIPreaderFree()

SCIP_RETCODE SCIPreaderFree ( SCIP_READER **  reader,
SCIP_SET set 
)

frees memory of reader

Parameters
readerpointer to reader data structure
setglobal SCIP settings

Definition at line 139 of file reader.c.

References BMSfreeMemory, BMSfreeMemoryArrayNull, NULL, SCIP_CALL, SCIP_OKAY, and SCIPclockFree().

Referenced by SCIPreaderCreate().

◆ SCIPreaderRead()

SCIP_RETCODE SCIPreaderRead ( SCIP_READER reader,
SCIP_SET set,
const char *  filename,
const char *  extension,
SCIP_RESULT result 
)

reads problem data from file with given reader or returns SCIP_DIDNOTRUN

Note
we need temporary clock to measure the reading time correctly since in case of creating a new problem within the reader all clocks are reset (including the reader clocks); this resetting is necessary for example for those case we people solve several problems using the (same) interactive shell
Parameters
readerreader
setglobal SCIP settings
filenamename of the input file
extensionextension of the input file name
resultpointer to store the result of the callback method

Definition at line 183 of file reader.c.

References NULL, readerIsApplicable(), SCIP_Reader::readingtime, SCIP_CALL, SCIP_CLOCKTYPE_DEFAULT, SCIP_DIDNOTRUN, SCIP_NOFILE, SCIP_OKAY, SCIP_READERROR, SCIP_SUCCESS, SCIPclockCreate(), SCIPclockFree(), SCIPclockGetTime(), SCIPclockIsRunning(), SCIPclockSetTime(), SCIPclockStart(), and SCIPclockStop().

Referenced by SCIPreadProb().

◆ SCIPreaderWrite()

SCIP_RETCODE SCIPreaderWrite ( SCIP_READER reader,
SCIP_PROB prob,
SCIP_SET set,
FILE *  file,
const char *  extension,
SCIP_Bool  genericnames,
SCIP_RESULT result 
)

◆ SCIPreaderGetReadingTime()

SCIP_Real SCIPreaderGetReadingTime ( SCIP_READER reader)

gets time in seconds used in this reader for reading

Parameters
readerreader

Definition at line 607 of file reader.c.

References NULL, SCIP_Reader::readingtime, and SCIPclockGetTime().

Referenced by SCIPgetReadingTime().

◆ SCIPreaderEnableOrDisableClocks()

void SCIPreaderEnableOrDisableClocks ( SCIP_READER reader,
SCIP_Bool  enable 
)

enables or disables all clocks of reader, depending on the value of the flag

Parameters
readerthe reader for which all clocks should be enabled or disabled
enableshould the clocks be enabled?

Definition at line 617 of file reader.c.

References NULL, SCIP_Reader::readingtime, and SCIPclockEnableOrDisable().

Referenced by SCIP_DECL_PARAMCHGD().

◆ SCIPreaderResetReadingTime()

SCIP_RETCODE SCIPreaderResetReadingTime ( SCIP_READER reader)

resets reading time of reader

Parameters
readerreader

Definition at line 628 of file reader.c.

References NULL, SCIP_Reader::readingtime, SCIP_OKAY, and SCIPclockReset().

Referenced by SCIPfreeProb().

◆ SCIPreaderSetCopy()

void SCIPreaderSetCopy ( SCIP_READER reader,
SCIP_DECL_READERCOPY((*readercopy))   
)

sets copy method of reader

Parameters
readerreader

Definition at line 513 of file reader.c.

References NULL.

Referenced by SCIPsetReaderCopy().

◆ SCIPreaderSetFree()

void SCIPreaderSetFree ( SCIP_READER reader,
SCIP_DECL_READERFREE((*readerfree))   
)

sets destructor of reader

Parameters
readerreader

Definition at line 524 of file reader.c.

References NULL.

Referenced by SCIPsetReaderFree().

◆ SCIPreaderSetRead()

void SCIPreaderSetRead ( SCIP_READER reader,
SCIP_DECL_READERREAD((*readerread))   
)

sets read method of reader

Parameters
readerreader

Definition at line 535 of file reader.c.

References NULL.

Referenced by SCIPsetReaderRead().

◆ SCIPreaderSetWrite()

void SCIPreaderSetWrite ( SCIP_READER reader,
SCIP_DECL_READERWRITE((*readerwrite))   
)

sets write method of reader

Parameters
readerreader

Definition at line 546 of file reader.c.

References NULL.

Referenced by SCIPsetReaderWrite().