SCIP Doxygen Documentation
Loading...
Searching...
No Matches

Detailed Description

SMPS file reader - smps files list the cor, tim and sto files for a single instance.

Author
Stephen J. Maher

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)

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.

Referenced by smpsinputReadLine().

◆ 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.

Referenced by clearFrom(), and smpsinputReadLine().

◆ COR_FILEEXTENSION

#define COR_FILEEXTENSION   "cor"

Definition at line 63 of file reader_smps.c.

Referenced by SCIP_DECL_READERREAD().

◆ TIM_FILEEXTENSION

#define TIM_FILEEXTENSION   "tim"

Definition at line 64 of file reader_smps.c.

Referenced by SCIP_DECL_READERREAD().

◆ STO_FILEEXTENSION

#define STO_FILEEXTENSION   "sto"

Definition at line 65 of file reader_smps.c.

Referenced by SCIP_DECL_READERREAD().

Typedef Documentation

◆ SCIP_SMPSFILETYPE

Definition at line 74 of file reader_smps.c.

◆ SMPSINPUT

typedef struct SmpsInput SMPSINPUT

Definition at line 87 of file reader_smps.c.

Enumeration Type Documentation

◆ 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()

SCIP_RETCODE smpsinputCreate ( SCIP * scip,
SMPSINPUT ** smpsi,
SCIP_FILE * fp )
static

creates the smps input structure

Parameters
scipSCIP data structure
smpsismps input structure
fpfile object for the input file

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().

◆ smpsinputFree()

void smpsinputFree ( SCIP * scip,
SMPSINPUT ** smpsi )
static

free the smps input structure

Parameters
scipSCIP data structure
smpsismps input structure

Definition at line 115 of file reader_smps.c.

References SCIPfreeBlockMemory.

Referenced by SCIP_DECL_READERREAD().

◆ smpsinputField0()

const char * smpsinputField0 ( const SMPSINPUT * smpsi)
static

return the current value of field 0

Parameters
smpsismps input structure

Definition at line 125 of file reader_smps.c.

References assert(), SmpsInput::f0, and NULL.

Referenced by SCIP_DECL_READERREAD().

◆ clearFrom()

void clearFrom ( char * buf,
unsigned int pos )
static

fill the line from pos up to column LINEWIDTH with blanks.

Parameters
bufbuffer to clear
posposition to start the clearing process

Definition at line 136 of file reader_smps.c.

References BLANK, SmpsInput::buf, i, and LINEWIDTH.

Referenced by smpsinputReadLine().

◆ smpsinputReadLine()

SCIP_Bool smpsinputReadLine ( SMPSINPUT * smpsi)
static

read a smps format data line and parse the fields.

Parameters
smpsismps 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().

◆ SCIP_DECL_READERCOPY()

SCIP_DECL_READERCOPY ( readerCopySmps )
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().

◆ SCIP_DECL_READERREAD()