Detailed Description
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" |
Typedefs | |
typedef enum SCIP_SmpsFileType | SCIP_SMPSFILETYPE |
typedef struct SmpsInput | SMPSINPUT |
Enumerations | |
enum | SCIP_SmpsFileType { SCIP_SMPSFILETYPE_COR = 0 , SCIP_SMPSFILETYPE_TIM = 1 , SCIP_SMPSFILETYPE_STO = 2 } |
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) |
Macro Definition Documentation
◆ READER_NAME
#define READER_NAME "smpsreader" |
Definition at line 55 of file reader_smps.c.
◆ READER_DESC
#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.
◆ READER_EXTENSION
#define READER_EXTENSION "smps" |
Definition at line 57 of file reader_smps.c.
◆ SMPS_MAX_LINELEN
#define SMPS_MAX_LINELEN 1024 |
Definition at line 59 of file reader_smps.c.
◆ BLANK
#define BLANK ' ' |
Definition at line 60 of file reader_smps.c.
◆ LINEWIDTH
#define LINEWIDTH 80 |
Definition at line 61 of file reader_smps.c.
◆ COR_FILEEXTENSION
#define COR_FILEEXTENSION "cor" |
Definition at line 63 of file reader_smps.c.
◆ TIM_FILEEXTENSION
#define TIM_FILEEXTENSION "tim" |
Definition at line 64 of file reader_smps.c.
◆ STO_FILEEXTENSION
#define STO_FILEEXTENSION "sto" |
Definition at line 65 of file reader_smps.c.
Typedef Documentation
◆ SCIP_SMPSFILETYPE
typedef enum SCIP_SmpsFileType SCIP_SMPSFILETYPE |
Definition at line 74 of file reader_smps.c.
◆ SMPSINPUT
Definition at line 87 of file reader_smps.c.
Enumeration Type Documentation
◆ SCIP_SmpsFileType
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.
Function Documentation
◆ smpsinputCreate()
|
static |
creates the smps input structure
- Parameters
-
scip SCIP data structure smpsi smps input structure fp file object for the input file
Definition at line 92 of file reader_smps.c.
References FALSE, SmpsInput::fp, NULL, SCIP_CALL, SCIP_OKAY, and SCIPallocBlockMemory.
Referenced by SCIP_DECL_READERREAD().
◆ smpsinputFree()
free the smps input structure
- Parameters
-
scip SCIP data structure smpsi smps input structure
Definition at line 115 of file reader_smps.c.
References SCIPfreeBlockMemory.
Referenced by SCIP_DECL_READERREAD().
◆ smpsinputField0()
|
static |
return the current value of field 0
- Parameters
-
smpsi smps input structure
Definition at line 125 of file reader_smps.c.
References SmpsInput::f0, and NULL.
Referenced by SCIP_DECL_READERREAD().
◆ clearFrom()
|
static |
fill the line from pos
up to column LINEWIDTH with blanks.
- Parameters
-
buf buffer to clear pos position to start the clearing process
Definition at line 136 of file reader_smps.c.
References BLANK, SmpsInput::buf, and LINEWIDTH.
Referenced by smpsinputReadLine().
◆ smpsinputReadLine()
read a smps format data line and parse the fields.
- Parameters
-
smpsi smps input structure
Definition at line 150 of file reader_smps.c.
References BLANK, SmpsInput::buf, clearFrom(), SmpsInput::f0, SmpsInput::f1, FALSE, SmpsInput::fp, SmpsInput::lineno, LINEWIDTH, NULL, SCIP_Bool, SCIPdebugMessage, SCIPfgets(), SCIPstrtok(), SMPS_MAX_LINELEN, and TRUE.
Referenced by SCIP_DECL_READERREAD().
◆ SCIP_DECL_READERCOPY()
|
static |
copy method for reader plugins (called when SCIP copies plugins)
Definition at line 218 of file reader_smps.c.
References NULL, READER_NAME, SCIP_CALL, SCIP_OKAY, SCIPincludeReaderSmps(), and SCIPreaderGetName().
◆ SCIP_DECL_READERREAD()
|
static |
problem reading method of reader
Definition at line 233 of file reader_smps.c.
References COR_FILEEXTENSION, FALSE, SmpsInput::fp, NULL, SCIP_Bool, SCIP_CALL, SCIP_CALL_TERMINATE, 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.