Scippy

SCIP

Solving Constraint Integer Programs

reader_bnd.c File Reference

Detailed Description

file reader for variable bounds

Author
Ambros Gleixner

This reader allows to read a file containing new bounds for variables of the current problem. Each line of the file should have format

<variable name> <lower bound> <upper bound>

where infinite bounds can be written as inf, +inf or -inf. Note that only a subset of the variables may appear in the file. Lines with unknown variable names are ignored. The writing functionality is currently not supported.

Definition in file reader_bnd.c.

#include <assert.h>
#include <string.h>
#include "scip/reader_bnd.h"

Go to the source code of this file.

Macros

#define READER_NAME   "bndreader"
 
#define READER_DESC   "file reader for variable bounds"
 
#define READER_EXTENSION   "bnd"
 

Functions

static SCIP_RETCODE readBounds (SCIP *scip, const char *fname)
 
static SCIP_DECL_READERCOPY (readerCopyBnd)
 
static SCIP_DECL_READERREAD (readerReadBnd)
 
SCIP_RETCODE SCIPincludeReaderBnd (SCIP *scip)
 

Macro Definition Documentation

#define READER_NAME   "bndreader"
#define READER_DESC   "file reader for variable bounds"

Definition at line 37 of file reader_bnd.c.

Referenced by SCIPincludeReaderBnd(), and SCIPincludeReaderZpl().

#define READER_EXTENSION   "bnd"

Definition at line 38 of file reader_bnd.c.

Referenced by SCIPincludeReaderBnd(), and SCIPincludeReaderZpl().

Function Documentation

static SCIP_RETCODE readBounds ( SCIP scip,
const char *  fname 
)
static

reads a given bound file, problem has to be in problem stage

Parameters
scipSCIP data structure
fnamename of the input file

Definition at line 47 of file reader_bnd.c.

References FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_NOFILE, SCIP_OKAY, SCIP_READERROR, SCIP_Real, SCIPchgVarLb(), SCIPchgVarUb(), SCIPerrorMessage, SCIPfclose(), SCIPfeof(), SCIPfgets(), SCIPfindVar(), SCIPfopen(), SCIPgetBoolParam(), SCIPinfinity(), SCIPprintSysError(), SCIPvarGetUbGlobal(), SCIPwarningMessage(), and TRUE.

Referenced by SCIP_DECL_READERREAD().

static SCIP_DECL_READERCOPY ( readerCopyBnd  )
static

copy method for reader plugins (called when SCIP copies plugins)

Definition at line 188 of file reader_bnd.c.

References NULL, READER_NAME, SCIP_CALL, SCIP_OKAY, SCIPincludeReaderBnd(), and SCIPreaderGetName().

static SCIP_DECL_READERREAD ( readerReadBnd  )
static

problem reading method of reader

In order to determine the type of the file, we have to open it. Thus, it has to be opened twice. This might be removed, but is likely to not hurt the performance too much.

Definition at line 207 of file reader_bnd.c.

References NULL, readBounds(), READER_NAME, SCIP_CALL, SCIP_DIDNOTRUN, SCIP_OKAY, SCIP_READERROR, SCIP_STAGE_PROBLEM, SCIP_SUCCESS, SCIPerrorMessage, SCIPgetStage(), and SCIPreaderGetName().

SCIP_RETCODE SCIPincludeReaderBnd ( SCIP scip)

includes the bnd file reader in SCIP

Parameters
scipSCIP data structure

Definition at line 241 of file reader_bnd.c.

References NULL, READER_DESC, READER_EXTENSION, READER_NAME, SCIP_CALL, SCIP_OKAY, SCIPincludeReaderBasic(), SCIPsetReaderCopy(), and SCIPsetReaderRead().

Referenced by SCIP_DECL_READERCOPY(), and SCIPincludeDefaultPlugins().