SMPS file reader - smps files list the cor, tim and sto files for a single instance.
Definition in file reader_smps.c.
#include "blockmemshell/memory.h"#include "scip/pub_fileio.h"#include "scip/pub_message.h"#include "scip/pub_misc.h"#include "scip/pub_reader.h"#include "scip/reader_cor.h"#include "scip/reader_smps.h"#include "scip/reader_sto.h"#include "scip/reader_tim.h"#include "scip/scip_mem.h"#include "scip/scip_message.h"#include "scip/scip_prob.h"#include "scip/scip_reader.h"#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | SmpsInput |
Macros | |
| #define | READER_NAME "smpsreader" |
| #define | READER_DESC "file reader for core problem of stochastic programs in the SMPS file format" |
| #define | READER_EXTENSION "smps" |
| #define | SMPS_MAX_LINELEN 1024 |
| #define | BLANK ' ' |
| #define | LINEWIDTH 80 |
| #define | COR_FILEEXTENSION "cor" |
| #define | TIM_FILEEXTENSION "tim" |
| #define | STO_FILEEXTENSION "sto" |
Functions | |
| static SCIP_RETCODE | smpsinputCreate (SCIP *scip, SMPSINPUT **smpsi, SCIP_FILE *fp) |
| static void | smpsinputFree (SCIP *scip, SMPSINPUT **smpsi) |
| static const char * | smpsinputField0 (const SMPSINPUT *smpsi) |
| static void | clearFrom (char *buf, unsigned int pos) |
| static SCIP_Bool | smpsinputReadLine (SMPSINPUT *smpsi) |
| static | SCIP_DECL_READERCOPY (readerCopySmps) |
| static | SCIP_DECL_READERREAD (readerReadSmps) |
| SCIP_RETCODE | SCIPincludeReaderSmps (SCIP *scip) |
| #define READER_NAME "smpsreader" |
Definition at line 55 of file reader_smps.c.
| #define READER_DESC "file reader for core problem of stochastic programs in the SMPS file format" |
Definition at line 56 of file reader_smps.c.
| #define READER_EXTENSION "smps" |
Definition at line 57 of file reader_smps.c.
| #define SMPS_MAX_LINELEN 1024 |
Definition at line 59 of file reader_smps.c.
Referenced by smpsinputReadLine().
| #define BLANK ' ' |
Definition at line 60 of file reader_smps.c.
| #define LINEWIDTH 80 |
Definition at line 61 of file reader_smps.c.
Referenced by clearFrom(), and smpsinputReadLine().
| #define COR_FILEEXTENSION "cor" |
Definition at line 63 of file reader_smps.c.
Referenced by SCIP_DECL_READERREAD().
| #define TIM_FILEEXTENSION "tim" |
Definition at line 64 of file reader_smps.c.
Referenced by SCIP_DECL_READERREAD().
| #define STO_FILEEXTENSION "sto" |
Definition at line 65 of file reader_smps.c.
Referenced by SCIP_DECL_READERREAD().
| typedef enum SCIP_SmpsFileType SCIP_SMPSFILETYPE |
Definition at line 74 of file reader_smps.c.
Definition at line 87 of file reader_smps.c.
| enum SCIP_SmpsFileType |
enum for the file types that are read by the SMPS reader
| Enumerator | |
|---|---|
| SCIP_SMPSFILETYPE_COR | |
| SCIP_SMPSFILETYPE_TIM | |
| SCIP_SMPSFILETYPE_STO | |
Definition at line 68 of file reader_smps.c.
|
static |
creates the smps input structure
Definition at line 92 of file reader_smps.c.
References assert(), FALSE, SmpsInput::fp, NULL, SCIP_CALL, SCIP_OKAY, and SCIPallocBlockMemory.
Referenced by SCIP_DECL_READERREAD().
free the smps input structure
Definition at line 115 of file reader_smps.c.
References SCIPfreeBlockMemory.
Referenced by SCIP_DECL_READERREAD().
|
static |
return the current value of field 0
| smpsi | smps input structure |
Definition at line 125 of file reader_smps.c.
References assert(), SmpsInput::f0, and NULL.
Referenced by SCIP_DECL_READERREAD().
|
static |
fill the line from pos up to column LINEWIDTH with blanks.
| buf | buffer to clear |
| pos | position to start the clearing process |
Definition at line 136 of file reader_smps.c.
References BLANK, SmpsInput::buf, i, and LINEWIDTH.
Referenced by smpsinputReadLine().
read a smps format data line and parse the fields.
| smpsi | smps input structure |
Definition at line 150 of file reader_smps.c.
References assert(), BLANK, SmpsInput::buf, clearFrom(), SmpsInput::f0, SmpsInput::f1, FALSE, SmpsInput::fp, i, SmpsInput::lineno, LINEWIDTH, NULL, SCIP_Bool, SCIPdebugMessage, SCIPfgets(), SCIPstrtok(), SMPS_MAX_LINELEN, and TRUE.
Referenced by SCIP_DECL_READERREAD().
|
static |
copy method for reader plugins (called when SCIP copies plugins)
Definition at line 218 of file reader_smps.c.
References assert(), NULL, READER_NAME, SCIP_CALL, SCIP_OKAY, SCIPincludeReaderSmps(), and SCIPreaderGetName().
|
static |
problem reading method of reader
Definition at line 233 of file reader_smps.c.
References assert(), COR_FILEEXTENSION, FALSE, SmpsInput::fp, i, NULL, nvars, result, SCIP_Bool, SCIP_CALL, SCIP_CALL_TERMINATE, SCIP_DIDNOTRUN, SCIP_MAXSTRLEN, SCIP_NOFILE, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIP_READERROR, SCIP_SMPSFILETYPE_COR, SCIP_SMPSFILETYPE_STO, SCIP_SMPSFILETYPE_TIM, SCIP_SUCCESS, SCIPABORT, SCIPduplicateBufferArray, SCIPerrorMessage, SCIPfclose(), SCIPfopen(), SCIPfreeBufferArray, SCIPgetBoolParam(), SCIPgetNOrigConss(), SCIPgetOrigVarsData(), SCIPinfoMessage(), SCIPprintSysError(), SCIPreadCor(), SCIPreadSto(), SCIPreadTim(), SCIPsnprintf(), SCIPsplitFilename(), SCIPstoGetNScenarios(), SCIPstrcasecmp(), SCIPstrncpy(), SCIPtimGetNStages(), smpsinputCreate(), smpsinputField0(), smpsinputFree(), smpsinputReadLine(), STO_FILEEXTENSION, TIM_FILEEXTENSION, and TRUE.