Detailed Description
interface for input file readers
Definition in file reader.c.
#include <assert.h>
#include <string.h>
#include <strings.h>
#include <math.h>
#include "scip/def.h"
#include "blockmemshell/memory.h"
#include "scip/set.h"
#include "scip/clock.h"
#include "scip/pub_misc.h"
#include "scip/reader.h"
#include "scip/prob.h"
#include "scip/pub_var.h"
#include "scip/var.h"
#include "scip/pub_cons.h"
#include "scip/cons.h"
#include "scip/pub_message.h"
#include "scip/struct_reader.h"
Go to the source code of this file.
Function Documentation
◆ SCIPreaderCopyInclude()
SCIP_RETCODE SCIPreaderCopyInclude | ( | SCIP_READER * | reader, |
SCIP_SET * | set | ||
) |
copies the given reader to a new scip
- Parameters
-
reader reader set SCIP_SET of SCIP to copy to
Definition at line 48 of file reader.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIPreaderGetName(), and SCIPsetDebugMsg.
Referenced by SCIPsetEnableOrDisablePluginClocks().
◆ doReaderCreate()
|
static |
internal method to create a reader
- Parameters
-
reader pointer to store reader name name of reader desc description of reader extension file extension that reader processes readerdata reader data
Definition at line 67 of file reader.c.
References BMSallocMemory, BMSclearMemory, BMSduplicateMemoryArray, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_CLOCKTYPE_DEFAULT, SCIP_OKAY, and SCIPclockCreate().
Referenced by SCIPreaderCreate().
◆ 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
-
reader pointer to store reader set global SCIP settings name name of reader desc description of reader extension file extension that reader processes readerdata reader data
Definition at line 103 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
-
reader pointer to reader data structure set global SCIP settings
Definition at line 129 of file reader.c.
References BMSfreeMemory, BMSfreeMemoryArrayNull, NULL, SCIP_CALL, SCIP_OKAY, and SCIPclockFree().
Referenced by SCIPreaderCreate().
◆ readerIsApplicable()
|
static |
returns TRUE, if reader is responsible for files with the given extension
- Parameters
-
reader reader extension extension of the input file name
Definition at line 160 of file reader.c.
References SCIP_Reader::extension, and NULL.
Referenced by SCIPreaderRead(), and SCIPreaderWrite().
◆ 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
-
reader reader set global SCIP settings filename name of the input file extension extension of the input file name result pointer to store the result of the callback method
Definition at line 173 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().
◆ resetVarname()
- Parameters
-
var variable set global SCIP settings name variable name
Definition at line 239 of file reader.c.
References NULL, SCIPsetFreeBufferArray, SCIPvarGetName(), and SCIPvarSetNamePointer().
Referenced by SCIPreaderWrite().
◆ SCIPreaderWrite()
SCIP_RETCODE SCIPreaderWrite | ( | SCIP_READER * | reader, |
SCIP_PROB * | prob, | ||
SCIP_SET * | set, | ||
FILE * | file, | ||
const char * | extension, | ||
SCIP_Bool | genericnames, | ||
SCIP_RESULT * | result | ||
) |
writes problem data to file with given reader or returns SCIP_DIDNOTRUN
- Parameters
-
reader reader prob problem data set global SCIP settings file output file (or NULL for standard output) extension file format genericnames using generic variable and constraint names? result pointer to store the result of the callback method
Definition at line 260 of file reader.c.
References SCIP_Prob::conss, SCIP_Prob::fixedvars, SCIP_Prob::maxnconss, SCIP_Prob::name, SCIP_Prob::nbinvars, SCIP_Prob::nconss, SCIP_Prob::ncontvars, SCIP_Prob::nfixedvars, SCIP_Prob::nimplvars, SCIP_Prob::nintvars, NULL, SCIP_Prob::nvars, SCIP_Prob::objoffset, SCIP_Prob::objscale, SCIP_Prob::objsense, SCIP_Prob::probdata, readerIsApplicable(), resetVarname(), SCIP_CALL, SCIP_DIDNOTRUN, SCIP_OBJSENSE_MINIMIZE, SCIP_OKAY, SCIP_WRITEERROR, SCIPconsGetName(), SCIPconshdlrGetConss(), SCIPconshdlrGetEnfoConss(), SCIPconshdlrGetName(), SCIPconshdlrGetNConss(), SCIPconshdlrGetNEnfoConss(), SCIPconsSetNamePointer(), SCIPsetAllocBufferArray, SCIPsetDebugMsg, SCIPsetFreeBufferArray, SCIPsnprintf(), SCIPvarGetName(), SCIPvarSetNamePointer(), SCIP_Prob::startnconss, SCIP_Prob::startnvars, SCIP_Prob::transformed, and SCIP_Prob::vars.
Referenced by printProblem().
◆ SCIPreaderSetCopy()
void SCIPreaderSetCopy | ( | SCIP_READER * | reader, |
SCIP_DECL_READERCOPY((*readercopy)) | |||
) |
sets copy method of reader
- Parameters
-
reader reader
Definition at line 503 of file reader.c.
References NULL.
Referenced by SCIPsetReaderCopy().
◆ SCIPreaderSetFree()
void SCIPreaderSetFree | ( | SCIP_READER * | reader, |
SCIP_DECL_READERFREE((*readerfree)) | |||
) |
sets destructor of reader
- Parameters
-
reader reader
Definition at line 514 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
-
reader reader
Definition at line 525 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
-
reader reader
Definition at line 536 of file reader.c.
References NULL.
Referenced by SCIPsetReaderWrite().
◆ SCIPreaderGetReadingTime()
SCIP_Real SCIPreaderGetReadingTime | ( | SCIP_READER * | reader | ) |
gets time in seconds used in this reader for reading
- Parameters
-
reader reader
Definition at line 597 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
-
reader the reader for which all clocks should be enabled or disabled enable should the clocks be enabled?
Definition at line 607 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
-
reader reader
Definition at line 618 of file reader.c.
References NULL, SCIP_Reader::readingtime, SCIP_OKAY, and SCIPclockReset().
Referenced by SCIPfreeProb().