Scippy

SCIP

Solving Constraint Integer Programs

reader_scflp.c File Reference

Detailed Description

SCFLP reader file reader.

Author
Stephen J. Maher

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   FALSE
 
#define DEFAULT_NUMSCENARIOS   250
 
#define DEFAULT_RANDOMSEED   1
 
#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 100 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 101 of file reader_scflp.c.

Referenced by SCIPincludeReaderScflp().

◆ READER_EXTENSION

#define READER_EXTENSION   "cap"

Definition at line 102 of file reader_scflp.c.

Referenced by SCIPincludeReaderScflp().

◆ DEFAULT_USEBENDERS

#define DEFAULT_USEBENDERS   FALSE

Definition at line 105 of file reader_scflp.c.

Referenced by SCIPincludeReaderScflp().

◆ DEFAULT_NUMSCENARIOS

#define DEFAULT_NUMSCENARIOS   250

Definition at line 106 of file reader_scflp.c.

Referenced by SCIPincludeReaderScflp().

◆ DEFAULT_RANDOMSEED

#define DEFAULT_RANDOMSEED   1

Definition at line 107 of file reader_scflp.c.

Referenced by SCIPincludeReaderScflp().

◆ MAXNCOSTS

#define MAXNCOSTS   7

Definition at line 109 of file reader_scflp.c.

Referenced by SCIP_DECL_READERREAD().

Function Documentation

◆ generateGaussianNoise()

static SCIP_Real generateGaussianNoise ( SCIP_RANDNUMGEN randomgen,
SCIP_Real  mean,
SCIP_Real  stdDev,
SCIP_Real spare,
SCIP_Bool hasspare 
)
static

generates a normally distributed random number

Parameters
randomgenthe random number generator
meanthe mean of the normal distribution
stdDevthe standard deviation of the normal distribution
sparethe spare value that has been collected
hassparewhether a spare value exists

Definition at line 122 of file reader_scflp.c.

References FALSE, log(), SCIP_Real, SCIPrandomGetReal(), sqrt(), and TRUE.

Referenced by SCIP_DECL_READERREAD().

◆ readerdataCreate()

static SCIP_RETCODE readerdataCreate ( SCIP scip,
SCIP_READERDATA **  readerdata 
)
static

creates the reader data

Parameters
scipSCIP data structure
readerdatapointer to store the reader data

Definition at line 158 of file reader_scflp.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, and TRUE.

Referenced by SCIPincludeReaderScflp().

◆ readerdataFree()

static SCIP_RETCODE readerdataFree ( SCIP scip,
SCIP_READERDATA **  readerdata 
)
static

frees the reader data

Parameters
scipSCIP data structure
readerdatapointer to store the reader data

Definition at line 174 of file reader_scflp.c.

References NULL, SCIP_OKAY, and SCIPfreeBlockMemory.

Referenced by SCIP_DECL_READERFREE().

◆ SCIP_DECL_READERFREE()

static SCIP_DECL_READERFREE ( readerFreeScflp  )
static

destructor of reader to free user data (called when SCIP is exiting)

Definition at line 196 of file reader_scflp.c.

References NULL, readerdataFree(), SCIP_CALL, SCIP_OKAY, and SCIPreaderGetData().

◆ SCIP_DECL_READERREAD()

◆ SCIPincludeReaderScflp()

SCIP_RETCODE SCIPincludeReaderScflp ( SCIP scip)