Scippy

SCIP

Solving Constraint Integer Programs

reader_cip.c File Reference

Detailed Description

CIP file reader.

Author
Stefan Heinz
Marc Pfetsch
Michael Winkler

Definition in file reader_cip.c.

#include <string.h>
#include <ctype.h>
#include "scip/reader_cip.h"
#include "scip/cons_linear.h"

Go to the source code of this file.

Macros

#define READER_NAME   "cipreader"
 
#define READER_DESC   "file reader for CIP (Constraint Integer Program) format"
 
#define READER_EXTENSION   "cip"
 
#define DEFAULT_CIP_WRITEFIXEDVARS   TRUE
 

Typedefs

typedef enum CipSection CIPSECTION
 
typedef struct CipInput CIPINPUT
 

Enumerations

enum  CipSection {
  CIP_START,
  CIP_STATISTIC,
  CIP_OBJECTIVE,
  CIP_VARS,
  CIP_FIXEDVARS,
  CIP_CONSTRAINTS,
  CIP_END
}
 

Functions

static SCIP_RETCODE getInputString (SCIP *scip, CIPINPUT *cipinput)
 
static void getStart (SCIP *scip, CIPINPUT *cipinput)
 
static SCIP_RETCODE getStatistics (SCIP *scip, CIPINPUT *cipinput)
 
static SCIP_RETCODE getObjective (SCIP *scip, CIPINPUT *cipinput, SCIP_Real *objscale, SCIP_Real *objoffset)
 
static SCIP_RETCODE getVariable (SCIP *scip, CIPINPUT *cipinput, SCIP_Bool initial, SCIP_Bool removable, SCIP_Real objscale)
 
static SCIP_RETCODE getFixedVariable (SCIP *scip, CIPINPUT *cipinput)
 
static SCIP_RETCODE getConstraint (SCIP *scip, CIPINPUT *cipinput, SCIP_Bool initial, SCIP_Bool dynamic, SCIP_Bool removable)
 
static SCIP_DECL_READERCOPY (readerCopyCip)
 
static SCIP_DECL_READERFREE (readerFreeCip)
 
static SCIP_DECL_READERREAD (readerReadCip)
 
static SCIP_DECL_HASHGETKEY (hashGetKeyVar)
 
static SCIP_DECL_HASHKEYEQ (hashKeyEqVar)
 
static SCIP_DECL_HASHKEYVAL (hashKeyValVar)
 
static SCIP_DECL_READERWRITE (readerWriteCip)
 
SCIP_RETCODE SCIPincludeReaderCip (SCIP *scip)
 

Macro Definition Documentation

#define READER_NAME   "cipreader"
#define READER_DESC   "file reader for CIP (Constraint Integer Program) format"

Definition at line 33 of file reader_cip.c.

Referenced by SCIPincludeReaderCip().

#define READER_EXTENSION   "cip"

Definition at line 34 of file reader_cip.c.

Referenced by SCIPincludeReaderCip().

#define DEFAULT_CIP_WRITEFIXEDVARS   TRUE

Should fixed and aggregated variables be written when writing?

Definition at line 36 of file reader_cip.c.

Referenced by SCIPincludeReaderCip().

Typedef Documentation

typedef enum CipSection CIPSECTION

Section of the in CIP files

Definition at line 57 of file reader_cip.c.

typedef struct CipInput CIPINPUT

CIP reading data

Definition at line 76 of file reader_cip.c.

Enumeration Type Documentation

enum CipSection

Section of the in CIP files

Enumerator
CIP_START 

start tag

CIP_STATISTIC 

statistics section

CIP_OBJECTIVE 

objective

CIP_VARS 

list of (free) variables

CIP_FIXEDVARS 

list of fixed variables

CIP_CONSTRAINTS 

constraints

CIP_END 

end of file tag

Definition at line 47 of file reader_cip.c.

Function Documentation

static SCIP_RETCODE getInputString ( SCIP scip,
CIPINPUT cipinput 
)
static

get next input line; this are all characters until the next semicolon

Parameters
scipSCIP data structure
cipinputCIP parsing data

Definition at line 85 of file reader_cip.c.

References BMSclearMemoryArray, CIP_CONSTRAINTS, NULL, SCIP_CALL, SCIP_OKAY, SCIPcalcMemGrowSize(), SCIPerrorMessage, SCIPfgets(), SCIPreallocBufferArray, and TRUE.

Referenced by SCIP_DECL_READERREAD().

static void getStart ( SCIP scip,
CIPINPUT cipinput 
)
static

read the problem name out of the statistics

Parameters
scipSCIP data structure
cipinputCIP parsing data

Definition at line 171 of file reader_cip.c.

References CIP_STATISTIC, SCIPerrorMessage, and TRUE.

Referenced by SCIP_DECL_READERREAD().

static SCIP_RETCODE getStatistics ( SCIP scip,
CIPINPUT cipinput 
)
static

read the problem name out of the statistics

Parameters
scipSCIP data structure
cipinputCIP parsing data

Definition at line 196 of file reader_cip.c.

References CIP_OBJECTIVE, NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPsetProbName(), and SCIPwarningMessage().

Referenced by SCIP_DECL_READERREAD().

static SCIP_RETCODE getObjective ( SCIP scip,
CIPINPUT cipinput,
SCIP_Real objscale,
SCIP_Real objoffset 
)
static

read objective sense, offset, and scale

Parameters
scipSCIP data structure
cipinputCIP parsing data
objscalebuffer where to multiply with objective scale
objoffsetbuffer where to add with objective offset

Definition at line 248 of file reader_cip.c.

References CIP_CONSTRAINTS, CIP_END, CIP_FIXEDVARS, CIP_OBJECTIVE, CIP_VARS, NULL, SCIP_CALL, SCIP_OBJSENSE_MAXIMIZE, SCIP_OBJSENSE_MINIMIZE, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPsetObjsense(), SCIPstrToRealValue(), and SCIPwarningMessage().

Referenced by SCIP_DECL_READERREAD().

static SCIP_RETCODE getVariable ( SCIP scip,
CIPINPUT cipinput,
SCIP_Bool  initial,
SCIP_Bool  removable,
SCIP_Real  objscale 
)
static

read variable

Parameters
scipSCIP data structure
cipinputCIP parsing data
initialshould var's column be present in the initial root LP?
removableis var's column removable from the LP (due to aging or cleanup)?
objscaleobjective scale

Definition at line 382 of file reader_cip.c.

References CIP_CONSTRAINTS, CIP_END, CIP_FIXEDVARS, CIP_VARS, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPaddVar(), SCIPchgVarObj(), SCIPdebug, SCIPdebugMessage, SCIPerrorMessage, SCIPparseVar(), SCIPprintVar(), SCIPreleaseVar(), SCIPvarGetObj(), and TRUE.

Referenced by SCIP_DECL_READERREAD().

static SCIP_RETCODE getConstraint ( SCIP scip,
CIPINPUT cipinput,
SCIP_Bool  initial,
SCIP_Bool  dynamic,
SCIP_Bool  removable 
)
static

read constraint

Parameters
scipSCIP data structure
cipinputCIP parsing data
initialshould the LP relaxation of constraint be in the initial LP? Usually set to TRUE. Set to FALSE for 'lazy constraints'.
dynamicIs constraint subject to aging? Usually set to FALSE. Set to TRUE for own cuts which are separated as constraints.
removableshould the relaxation be removed from the LP due to aging or cleanup? Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'.

Definition at line 628 of file reader_cip.c.

References CIP_END, FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPaddCons(), SCIPdebugMessage, SCIPdebugPrintCons, SCIPduplicateMemoryArray, SCIPerrorMessage, SCIPfreeMemoryArray, SCIPparseCons(), SCIPreleaseCons(), and TRUE.

Referenced by SCIP_DECL_READERREAD().

static SCIP_DECL_READERCOPY ( readerCopyCip  )
static

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

Definition at line 718 of file reader_cip.c.

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

static SCIP_DECL_READERFREE ( readerFreeCip  )
static

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

Definition at line 732 of file reader_cip.c.

References NULL, READER_NAME, SCIP_OKAY, SCIPfreeMemory, SCIPreaderGetData(), and SCIPreaderGetName().

static SCIP_DECL_HASHGETKEY ( hashGetKeyVar  )
static

hash key retrieval function for variables

Definition at line 882 of file reader_cip.c.

static SCIP_DECL_HASHKEYEQ ( hashKeyEqVar  )
static

returns TRUE iff the indices of both variables are equal

Definition at line 889 of file reader_cip.c.

References FALSE, and TRUE.

static SCIP_DECL_HASHKEYVAL ( hashKeyValVar  )
static

returns the hash value of the key

Definition at line 898 of file reader_cip.c.

References SCIPvarGetIndex().

SCIP_RETCODE SCIPincludeReaderCip ( SCIP scip)