Detailed Description
SCFLP reader file reader.
This file implements the reader/parser used to read the CAP input data and builds a SCFLP instance. For more details see Parsing the input format.
Definition in file reader_scflp.c.
#include <assert.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include "probdata_scflp.h"
#include "reader_scflp.h"
Go to the source code of this file.
Macros | |
Reader properties | |
#define | READER_NAME "scflpreader" |
#define | READER_DESC "file reader for CAP data format and creates a SCFLP instance" |
#define | READER_EXTENSION "cap" |
#define | DEFAULT_USEBENDERS TRUE |
#define | DEFAULT_NUMSCENARIOS 250 |
#define | DEFAULT_RANDOMSEED 1 |
#define | DEFAULT_QUADCOSTS FALSE |
#define | MAXNCOSTS 7 |
Functions | |
static SCIP_Real | generateGaussianNoise (SCIP_RANDNUMGEN *randomgen, SCIP_Real mean, SCIP_Real stdDev, SCIP_Real *spare, SCIP_Bool *hasspare) |
static SCIP_RETCODE | readerdataCreate (SCIP *scip, SCIP_READERDATA **readerdata) |
static SCIP_RETCODE | readerdataFree (SCIP *scip, SCIP_READERDATA **readerdata) |
Callback methods | |
static | SCIP_DECL_READERFREE (readerFreeScflp) |
static | SCIP_DECL_READERREAD (readerReadScflp) |
Interface methods | |
SCIP_RETCODE | SCIPincludeReaderScflp (SCIP *scip) |
Macro Definition Documentation
◆ READER_NAME
#define READER_NAME "scflpreader" |
Definition at line 109 of file reader_scflp.c.
Referenced by SCIPincludeReaderScflp().
◆ READER_DESC
#define READER_DESC "file reader for CAP data format and creates a SCFLP instance" |
Definition at line 110 of file reader_scflp.c.
Referenced by SCIPincludeReaderScflp().
◆ READER_EXTENSION
#define READER_EXTENSION "cap" |
Definition at line 111 of file reader_scflp.c.
Referenced by SCIPincludeReaderScflp().
◆ DEFAULT_USEBENDERS
#define DEFAULT_USEBENDERS TRUE |
Definition at line 114 of file reader_scflp.c.
Referenced by SCIPincludeReaderScflp().
◆ DEFAULT_NUMSCENARIOS
#define DEFAULT_NUMSCENARIOS 250 |
Definition at line 115 of file reader_scflp.c.
Referenced by SCIPincludeReaderScflp().
◆ DEFAULT_RANDOMSEED
#define DEFAULT_RANDOMSEED 1 |
Definition at line 116 of file reader_scflp.c.
Referenced by SCIPincludePresolMILP(), and SCIPincludeReaderScflp().
◆ DEFAULT_QUADCOSTS
#define DEFAULT_QUADCOSTS FALSE |
should the problem be formulated with quadratic costs
Definition at line 117 of file reader_scflp.c.
Referenced by SCIPincludeReaderScflp().
◆ MAXNCOSTS
#define MAXNCOSTS 7 |
Definition at line 120 of file reader_scflp.c.
Referenced by SCIP_DECL_READERREAD().
Function Documentation
◆ generateGaussianNoise()
|
static |
generates a normally distributed random number
- Parameters
-
randomgen the random number generator mean the mean of the normal distribution stdDev the standard deviation of the normal distribution spare the spare value that has been collected hasspare whether a spare value exists
Definition at line 134 of file reader_scflp.c.
References FALSE, SCIP_Real, SCIPrandomGetReal(), and TRUE.
Referenced by SCIP_DECL_READERREAD().
◆ readerdataCreate()
|
static |
creates the reader data
- Parameters
-
scip SCIP data structure readerdata pointer to store the reader data
Definition at line 170 of file reader_scflp.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, and TRUE.
Referenced by SCIPincludeReaderScflp().
◆ readerdataFree()
|
static |
frees the reader data
- Parameters
-
scip SCIP data structure readerdata pointer to store the reader data
Definition at line 186 of file reader_scflp.c.
References NULL, SCIP_OKAY, and SCIPfreeBlockMemory.
Referenced by SCIP_DECL_READERFREE().
◆ SCIP_DECL_READERFREE()
|
static |
destructor of reader to free user data (called when SCIP is exiting)
Definition at line 208 of file reader_scflp.c.
References NULL, readerdataFree(), SCIP_CALL, SCIP_OKAY, and SCIPreaderGetData().
◆ SCIP_DECL_READERREAD()
|
static |
problem reading method of reader
Definition at line 225 of file reader_scflp.c.
References FALSE, generateGaussianNoise(), MAXNCOSTS, NULL, SCIP_Bool, SCIP_CALL, SCIP_DIDNOTRUN, SCIP_MAXSTRLEN, SCIP_NOFILE, SCIP_OKAY, SCIP_READERROR, SCIP_Real, SCIP_SUCCESS, SCIPallocBufferArray, SCIPceil(), SCIPcreateRandom(), SCIPdebugMsg, SCIPerrorMessage, SCIPfclose(), SCIPfeof(), SCIPfgets(), SCIPfopen(), SCIPfreeBufferArray, SCIPfreeRandom(), SCIPprintSysError(), SCIPprobdataCreate(), SCIPrandomGetReal(), SCIPreaderGetData(), SCIPround(), SCIPwarningMessage(), and TRUE.
◆ SCIPincludeReaderScflp()
SCIP_RETCODE SCIPincludeReaderScflp | ( | SCIP * | scip | ) |
includes the scflp file reader in SCIP
- Parameters
-
scip SCIP data structure
Definition at line 475 of file reader_scflp.c.
References DEFAULT_NUMSCENARIOS, DEFAULT_QUADCOSTS, DEFAULT_RANDOMSEED, DEFAULT_USEBENDERS, FALSE, NULL, READER_DESC, READER_EXTENSION, READER_NAME, readerdataCreate(), SCIP_CALL, SCIP_OKAY, SCIPaddBoolParam(), SCIPaddIntParam(), SCIPincludeReaderBasic(), SCIPsetReaderFree(), and SCIPsetReaderRead().
Referenced by runShell().