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

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

◆ READER_EXTENSION

#define READER_EXTENSION   "cap"

Definition at line 111 of file reader_scflp.c.

◆ DEFAULT_USEBENDERS

#define DEFAULT_USEBENDERS   TRUE

Definition at line 114 of file reader_scflp.c.

◆ DEFAULT_NUMSCENARIOS

#define DEFAULT_NUMSCENARIOS   250

Definition at line 115 of file reader_scflp.c.

◆ DEFAULT_RANDOMSEED

#define DEFAULT_RANDOMSEED   1

Definition at line 116 of file reader_scflp.c.

◆ DEFAULT_QUADCOSTS

#define DEFAULT_QUADCOSTS   FALSE

should the problem be formulated with quadratic costs

Definition at line 117 of file reader_scflp.c.

◆ MAXNCOSTS

#define MAXNCOSTS   7

Definition at line 120 of file reader_scflp.c.

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 134 of file reader_scflp.c.

References FALSE, SCIP_Real, SCIPrandomGetReal(), 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 170 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 186 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 208 of file reader_scflp.c.

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

◆ SCIP_DECL_READERREAD()

◆ SCIPincludeReaderScflp()

SCIP_RETCODE SCIPincludeReaderScflp ( SCIP scip)