file reader for polynomial mixed-integer programs in PIP format
Definition in file reader_pip.c.
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <strings.h>
#include <ctype.h>
#include "scip/reader_pip.h"
#include "scip/cons_knapsack.h"
#include "scip/cons_linear.h"
#include "scip/cons_logicor.h"
#include "scip/cons_setppc.h"
#include "scip/cons_varbound.h"
#include "scip/cons_quadratic.h"
#include "scip/cons_nonlinear.h"
#include "scip/cons_abspower.h"
#include "scip/cons_and.h"
#include "scip/cons_bivariate.h"
#include "scip/pub_misc.h"
Go to the source code of this file.
Macros | |
#define | READER_NAME "pipreader" |
#define | READER_DESC "file reader for polynomial mixed-integer programs in PIP format" |
#define | READER_EXTENSION "pip" |
#define | PIP_MAX_LINELEN 65536 |
#define | PIP_MAX_PUSHEDTOKENS 2 |
#define | PIP_INIT_VARSSIZE 256 |
#define | PIP_INIT_MONOMIALSSIZE 128 |
#define | PIP_INIT_FACTORSSIZE 16 |
#define | PIP_MAX_PRINTLEN 561 |
#define | PIP_MAX_NAMELEN 256 |
#define | PIP_PRINTLEN 100 |
Typedefs | |
typedef enum PipSection | PIPSECTION |
typedef enum PipExpType | PIPEXPTYPE |
typedef enum PipSense | PIPSENSE |
typedef struct PipInput | PIPINPUT |
Enumerations | |
enum | PipSection { PIP_START, PIP_OBJECTIVE, PIP_CONSTRAINTS, PIP_BOUNDS, PIP_GENERALS, PIP_BINARIES, PIP_END } |
enum | PipExpType { PIP_EXP_NONE, PIP_EXP_UNSIGNED, PIP_EXP_SIGNED } |
enum | PipSense { PIP_SENSE_NOTHING, PIP_SENSE_LE, PIP_SENSE_GE, PIP_SENSE_EQ } |
Functions | |
static void | syntaxError (SCIP *scip, PIPINPUT *pipinput, const char *msg) |
static SCIP_Bool | hasError (PIPINPUT *pipinput) |
static SCIP_Bool | isDelimChar (char c) |
static SCIP_Bool | isTokenChar (char c) |
static SCIP_Bool | isValueChar (char c, char nextc, SCIP_Bool firstchar, SCIP_Bool *hasdot, PIPEXPTYPE *exptype) |
static SCIP_Bool | getNextLine (SCIP *scip, PIPINPUT *pipinput) |
static void | swapPointers (char **pointer1, char **pointer2) |
static SCIP_Bool | getNextToken (SCIP *scip, PIPINPUT *pipinput) |
static void | pushToken (PIPINPUT *pipinput) |
static void | pushBufferToken (PIPINPUT *pipinput) |
static void | swapTokenBuffer (PIPINPUT *pipinput) |
static SCIP_Bool | isNewSection (SCIP *scip, PIPINPUT *pipinput) |
static SCIP_Bool | isSign (PIPINPUT *pipinput, int *sign) |
static SCIP_Bool | isValue (SCIP *scip, PIPINPUT *pipinput, SCIP_Real *value) |
static SCIP_Bool | isSense (PIPINPUT *pipinput, PIPSENSE *sense) |
static SCIP_RETCODE | getVariable (SCIP *scip, char *name, SCIP_Bool dynamiccols, SCIP_VAR **var, SCIP_Bool *created) |
static SCIP_RETCODE | readStart (SCIP *scip, PIPINPUT *pipinput) |
static SCIP_RETCODE | ensureMonomialsSize (SCIP *scip, SCIP_EXPRDATA_MONOMIAL ***monomials, int *monomialssize, int minnmonomials) |
static SCIP_RETCODE | ensureFactorsSize (SCIP *scip, SCIP_Real **exponents, int **varidxs, int *factorssize, int minnfactors) |
static SCIP_RETCODE | getVariableIndex (SCIP *scip, SCIP_VAR ***vars, int *varssize, int *nvars, SCIP_HASHMAP *varhash, SCIP_VAR *var, int *varidx) |
static SCIP_RETCODE | readPolynomial (SCIP *scip, PIPINPUT *pipinput, char *name, SCIP_EXPRTREE **exprtree, int *degree, SCIP_Bool *newsection) |
static void | getLinearAndQuadraticCoefs (SCIP *scip, SCIP_EXPRTREE *exprtree, SCIP_Real *constant, int *nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int *nquadterms, SCIP_VAR **quadvars1, SCIP_VAR **quadvars2, SCIP_Real *quadcoefs) |
static SCIP_RETCODE | readObjective (SCIP *scip, PIPINPUT *pipinput) |
static SCIP_RETCODE | readConstraints (SCIP *scip, PIPINPUT *pipinput) |
static SCIP_RETCODE | readBounds (SCIP *scip, PIPINPUT *pipinput) |
static SCIP_RETCODE | readGenerals (SCIP *scip, PIPINPUT *pipinput) |
static SCIP_RETCODE | readBinaries (SCIP *scip, PIPINPUT *pipinput) |
static SCIP_RETCODE | readPIPFile (SCIP *scip, PIPINPUT *pipinput, const char *filename) |
static | SCIP_DECL_HASHGETKEY (hashGetKeyVar) |
static | SCIP_DECL_HASHKEYEQ (hashKeyEqVar) |
static | SCIP_DECL_HASHKEYVAL (hashKeyValVar) |
static SCIP_RETCODE | getActiveVariables (SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, SCIP_Real *constant, SCIP_Bool transformed) |
static void | clearLine (char *linebuffer, int *linecnt) |
static void | endLine (SCIP *scip, FILE *file, char *linebuffer, int *linecnt) |
static void | appendLine (SCIP *scip, FILE *file, char *linebuffer, int *linecnt, const char *extension) |
static void | printRow (SCIP *scip, FILE *file, const char *rowname, const char *rownameextension, const char *type, SCIP_VAR **linvars, SCIP_Real *linvals, int nlinvars, SCIP_QUADVARTERM *quadvarterms, int nquadvarterms, SCIP_BILINTERM *bilinterms, int nbilinterms, SCIP_Real rhs) |
static void | printRowNl (SCIP *scip, FILE *file, const char *rowname, const char *rownameextension, const char *type, SCIP_VAR **linvars, SCIP_Real *linvals, int nlinvars, SCIP_EXPRTREE **exprtrees, SCIP_Real *exprtreecoefs, int nexprtrees, SCIP_Real rhs) |
static SCIP_RETCODE | printQuadraticCons (SCIP *scip, FILE *file, const char *rowname, SCIP_VAR **linvars, SCIP_Real *linvals, int nlinvars, SCIP_QUADVARTERM *quadvarterms, int nquadvarterms, SCIP_BILINTERM *bilinterms, int nbilinterms, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool transformed) |
static SCIP_RETCODE | printNonlinearCons (SCIP *scip, FILE *file, const char *rowname, SCIP_VAR **linvars, SCIP_Real *linvals, int nlinvars, SCIP_EXPRTREE **exprtrees, SCIP_Real *exprtreecoefs, int nexprtrees, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool transformed) |
static SCIP_RETCODE | collectAggregatedVars (SCIP *scip, int nvars, SCIP_VAR **vars, int *nAggregatedVars, SCIP_VAR ***aggregatedVars, SCIP_HASHTABLE **varAggregated) |
static SCIP_RETCODE | printAggregatedCons (SCIP *scip, FILE *file, SCIP_Bool transformed, int nvars, int nAggregatedVars, SCIP_VAR **aggregatedVars) |
static void | checkVarnames (SCIP *scip, SCIP_VAR **vars, int nvars) |
static void | checkConsnames (SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_Bool transformed) |
SCIP_RETCODE | SCIPwritePip (SCIP *scip, FILE *file, const char *name, SCIP_Bool transformed, SCIP_OBJSENSE objsense, SCIP_Real objscale, SCIP_Real objoffset, SCIP_VAR **vars, int nvars, int nbinvars, int nintvars, int nimplvars, int ncontvars, SCIP_CONS **conss, int nconss, SCIP_RESULT *result) |
static | SCIP_DECL_READERCOPY (readerCopyPip) |
static | SCIP_DECL_READERREAD (readerReadPip) |
static | SCIP_DECL_READERWRITE (readerWritePip) |
SCIP_RETCODE | SCIPincludeReaderPip (SCIP *scip) |
SCIP_RETCODE | SCIPreadPip (SCIP *scip, SCIP_READER *reader, const char *filename, SCIP_RESULT *result) |
Variables | |
static const char | delimchars [] = " \f\n\r\t\v" |
static const char | tokenchars [] = "-+:<>=*^" |
static const char | commentchars [] = "\\" |
#define READER_NAME "pipreader" |
Definition at line 46 of file reader_pip.c.
Referenced by SCIP_DECL_READERCOPY(), and SCIPincludeReaderPip().
#define READER_DESC "file reader for polynomial mixed-integer programs in PIP format" |
Definition at line 47 of file reader_pip.c.
Referenced by SCIPincludeReaderPip().
#define READER_EXTENSION "pip" |
Definition at line 48 of file reader_pip.c.
Referenced by SCIPincludeReaderPip().
#define PIP_MAX_LINELEN 65536 |
Definition at line 54 of file reader_pip.c.
Referenced by getNextLine(), getNextToken(), readConstraints(), readObjective(), readPolynomial(), and SCIPreadPip().
#define PIP_MAX_PUSHEDTOKENS 2 |
Definition at line 55 of file reader_pip.c.
Referenced by pushBufferToken(), pushToken(), and SCIPreadPip().
#define PIP_INIT_VARSSIZE 256 |
Definition at line 56 of file reader_pip.c.
Referenced by readPolynomial().
#define PIP_INIT_MONOMIALSSIZE 128 |
Definition at line 57 of file reader_pip.c.
Referenced by readPolynomial().
#define PIP_INIT_FACTORSSIZE 16 |
Definition at line 58 of file reader_pip.c.
Referenced by readPolynomial().
#define PIP_MAX_PRINTLEN 561 |
the maximum length of any line is 560 + '\0' = 561
Definition at line 59 of file reader_pip.c.
Referenced by appendLine(), printRow(), printRowNl(), and SCIPwritePip().
#define PIP_MAX_NAMELEN 256 |
the maximum length for any name is 255 + '\0' = 256
Definition at line 60 of file reader_pip.c.
Referenced by checkConsnames(), checkVarnames(), printAggregatedCons(), printRow(), printRowNl(), and SCIPwritePip().
#define PIP_PRINTLEN 100 |
Definition at line 61 of file reader_pip.c.
Referenced by appendLine().
typedef enum PipSection PIPSECTION |
Definition at line 74 of file reader_pip.c.
typedef enum PipExpType PIPEXPTYPE |
Definition at line 82 of file reader_pip.c.
Definition at line 91 of file reader_pip.c.
typedef struct PipInput PIPINPUT |
Definition at line 114 of file reader_pip.c.
enum PipSection |
Section in PIP File
Enumerator | |
---|---|
PIP_START | |
PIP_OBJECTIVE | |
PIP_CONSTRAINTS | |
PIP_BOUNDS | |
PIP_GENERALS | |
PIP_BINARIES | |
PIP_END |
Definition at line 64 of file reader_pip.c.
enum PipExpType |
Enumerator | |
---|---|
PIP_EXP_NONE | |
PIP_EXP_UNSIGNED | |
PIP_EXP_SIGNED |
Definition at line 76 of file reader_pip.c.
enum PipSense |
Enumerator | |
---|---|
PIP_SENSE_NOTHING | |
PIP_SENSE_LE | |
PIP_SENSE_GE | |
PIP_SENSE_EQ |
Definition at line 84 of file reader_pip.c.
issues an error message and marks the PIP data to have errors
scip | SCIP data structure |
pipinput | PIP reading data |
msg | error message |
Definition at line 127 of file reader_pip.c.
References PIP_END, SCIP_VERBLEVEL_MINIMAL, SCIPerrorMessage, SCIPsnprintf(), SCIPverbMessage(), and TRUE.
Referenced by readBinaries(), readBounds(), readConstraints(), readGenerals(), and readPolynomial().
returns whether a syntax error was detected
pipinput | PIP reading data |
Definition at line 154 of file reader_pip.c.
Referenced by readConstraints(), readObjective(), and readPIPFile().
|
static |
returns whether the given character is a token delimiter
c | input character |
Definition at line 165 of file reader_pip.c.
References delimchars.
Referenced by getNextToken().
|
static |
returns whether the given character is a single token
c | input character |
Definition at line 174 of file reader_pip.c.
References tokenchars.
Referenced by getNextToken().
|
static |
returns whether the current character is member of a value string
c | input character |
nextc | next input character |
firstchar | is the given character the first char of the token? |
hasdot | pointer to update the dot flag |
exptype | pointer to update the exponent type |
Definition at line 183 of file reader_pip.c.
References FALSE, PIP_EXP_NONE, PIP_EXP_SIGNED, PIP_EXP_UNSIGNED, and TRUE.
Referenced by getNextToken().
reads the next line from the input file into the line buffer; skips comments; returns whether a line could be read
scip | SCIP data structure |
pipinput | PIP reading data |
Definition at line 227 of file reader_pip.c.
References BMSclearMemoryArray, commentchars, FALSE, PIP_MAX_LINELEN, SCIPerrorMessage, SCIPfgets(), and TRUE.
Referenced by getNextToken().
|
static |
swaps the addresses of two pointers
pointer1 | first pointer |
pointer2 | second pointer |
Definition at line 271 of file reader_pip.c.
Referenced by getNextToken(), pushBufferToken(), pushToken(), and swapTokenBuffer().
reads the next token from the input file into the token buffer; returns whether a token was read
scip | SCIP data structure |
pipinput | PIP reading data |
Definition at line 285 of file reader_pip.c.
References FALSE, getNextLine(), isDelimChar(), isTokenChar(), isValueChar(), PIP_END, PIP_EXP_NONE, PIP_MAX_LINELEN, SCIP_Bool, SCIPdebugMsg, swapPointers(), and TRUE.
Referenced by isNewSection(), readBinaries(), readBounds(), readConstraints(), readGenerals(), readPolynomial(), and readStart().
|
static |
puts the current token on the token stack, such that it is read at the next call to getNextToken()
pipinput | PIP reading data |
Definition at line 384 of file reader_pip.c.
References PIP_MAX_PUSHEDTOKENS, and swapPointers().
Referenced by isNewSection(), readBounds(), and readPolynomial().
|
static |
puts the buffered token on the token stack, such that it is read at the next call to getNextToken()
pipinput | PIP reading data |
Definition at line 397 of file reader_pip.c.
References PIP_MAX_PUSHEDTOKENS, and swapPointers().
Referenced by readPolynomial().
|
static |
swaps the current token with the token buffer
pipinput | PIP reading data |
Definition at line 410 of file reader_pip.c.
References swapPointers().
Referenced by isNewSection(), and readPolynomial().
checks whether the current token is a section identifier, and if yes, switches to the corresponding section
scip | SCIP data structure |
pipinput | PIP reading data |
Definition at line 421 of file reader_pip.c.
References FALSE, getNextToken(), PIP_BINARIES, PIP_BOUNDS, PIP_CONSTRAINTS, PIP_END, PIP_GENERALS, PIP_OBJECTIVE, pushToken(), SCIP_Bool, SCIP_OBJSENSE_MAXIMIZE, SCIP_OBJSENSE_MINIMIZE, SCIPdebugMsg, swapTokenBuffer(), and TRUE.
Referenced by readBinaries(), readBounds(), readGenerals(), readPolynomial(), and readStart().
returns whether the current token is a sign
pipinput | PIP reading data |
sign | pointer to update the sign |
Definition at line 554 of file reader_pip.c.
Referenced by readBounds(), readConstraints(), and readPolynomial().
returns whether the current token is a value
scip | SCIP data structure |
pipinput | PIP reading data |
value | pointer to store the value (unchanged, if token is no value) |
Definition at line 579 of file reader_pip.c.
References FALSE, SCIPinfinity(), and TRUE.
Referenced by readBounds(), readConstraints(), and readPolynomial().
returns whether the current token is an equation sense
pipinput | PIP reading data |
sense | pointer to store the equation sense, or NULL |
Definition at line 611 of file reader_pip.c.
References FALSE, PIP_SENSE_EQ, PIP_SENSE_GE, PIP_SENSE_LE, and TRUE.
Referenced by readBounds(), readConstraints(), and readPolynomial().
|
static |
returns the variable with the given name, or creates a new variable if it does not exist
scip | SCIP data structure |
name | name of the variable |
dynamiccols | should columns be added and removed dynamically to the LP? |
var | pointer to store the variable |
created | pointer to store whether a new variable was created, or NULL |
Definition at line 642 of file reader_pip.c.
References FALSE, SCIP_CALL, SCIP_OKAY, SCIP_VARTYPE_CONTINUOUS, SCIPaddVar(), SCIPcreateVar(), SCIPdebugMsg, SCIPfindVar(), SCIPinfinity(), SCIPreleaseVar(), and TRUE.
Referenced by readBinaries(), readBounds(), readGenerals(), and readPolynomial().
|
static |
reads the header of the file
scip | SCIP data structure |
pipinput | PIP reading data |
Definition at line 681 of file reader_pip.c.
References getNextToken(), isNewSection(), and SCIP_OKAY.
Referenced by readPIPFile().
|
static |
ensure that an array of monomials can hold a minimum number of entries
scip | SCIP data structure |
monomials | pointer to current array of monomials |
monomialssize | current size of monomials array at input; new size at exit |
minnmonomials | required minimal size of monomials array |
Definition at line 702 of file reader_pip.c.
References SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPcalcMemGrowSize(), and SCIPreallocBufferArray.
Referenced by readPolynomial().
|
static |
ensure that arrays of exponents and variable indices can hold a minimum number of entries
scip | SCIP data structure |
exponents | pointer to current array of exponents |
varidxs | pointer to current array of variable indices |
factorssize | current size of arrays at input; new size at exit |
minnfactors | required minimal size of arrays |
Definition at line 736 of file reader_pip.c.
References SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPcalcMemGrowSize(), and SCIPreallocBufferArray.
Referenced by readPolynomial().
|
static |
gives index of variable in vars array, inserts it at the end if not existing yet
scip | SCIP data structure |
vars | pointer to current array of variables |
varssize | current size of variables array at input; new size at exit |
nvars | number of variables stored in array |
varhash | hashmap variables -> indices |
var | the variable which index we need |
varidx | pointer to store index of variable in *vars |
Definition at line 776 of file reader_pip.c.
References SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPcalcMemGrowSize(), SCIPhashmapExists(), SCIPhashmapGetImage(), SCIPhashmapInsert(), and SCIPreallocBufferArray.
Referenced by readPolynomial().
|
static |
reads an objective or constraint with name and coefficients
scip | SCIP data structure |
pipinput | PIP reading data |
name | pointer to store the name of the line; must be at least of size PIP_MAX_LINELEN |
exprtree | pointer to store constraint function as polynomial expression |
degree | pointer to store degree of polynomial |
newsection | pointer to store whether a new section was encountered |
Definition at line 834 of file reader_pip.c.
References ensureFactorsSize(), ensureMonomialsSize(), FALSE, getNextToken(), getVariable(), getVariableIndex(), isNewSection(), isSense(), isSign(), isValue(), PIP_INIT_FACTORSSIZE, PIP_INIT_MONOMIALSSIZE, PIP_INIT_VARSSIZE, PIP_MAX_LINELEN, pushBufferToken(), pushToken(), SCIP_Bool, SCIP_CALL, SCIP_EXPR_DEGREEINFINITY, SCIP_EXPR_VARIDX, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPblkmem(), SCIPdebug, SCIPdebugMsg, SCIPdebugMsgPrint, SCIPexprCreate(), SCIPexprCreateMonomial(), SCIPexprCreatePolynomial(), SCIPexprtreeCreate(), SCIPexprtreePrintWithNames(), SCIPexprtreeSetVars(), SCIPfreeBufferArray, SCIPgetMessagehdlr(), SCIPhashmapCreate(), SCIPhashmapFree(), SCIPisIntegral(), SCIPvarGetName(), swapTokenBuffer(), syntaxError(), and TRUE.
Referenced by readConstraints(), and readObjective().
|
static |
given an expression tree that holds a polynomial expression of degree at most two, gives the coefficients of the constant, linear, and quadratic part of this expression
scip | SCIP data structure |
exprtree | expression tree holding polynomial expression |
constant | buffer to store constant monomials |
nlinvars | buffer to store number of linear coefficients |
linvars | array to fill with linear variables |
lincoefs | array to fill with coefficients of linear variables |
nquadterms | buffer to store number of quadratic terms |
quadvars1 | array to fill with quadratic variables |
quadvars2 | array to fill with quadratic variables |
quadcoefs | array to fill with coefficients of quadratic terms |
Definition at line 1139 of file reader_pip.c.
References SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_VARIDX, SCIPexprGetChildren(), SCIPexprGetMonomialChildIndices(), SCIPexprGetMonomialCoef(), SCIPexprGetMonomialExponents(), SCIPexprGetMonomialNFactors(), SCIPexprGetMonomials(), SCIPexprGetNChildren(), SCIPexprGetNMonomials(), SCIPexprGetOperator(), SCIPexprGetOpIndex(), SCIPexprGetPolynomialConstant(), SCIPexprtreeGetNVars(), SCIPexprtreeGetRoot(), and SCIPexprtreeGetVars().
Referenced by readConstraints(), and readObjective().
|
static |
reads the objective section
scip | SCIP data structure |
pipinput | PIP reading data |
Definition at line 1239 of file reader_pip.c.
References FALSE, getLinearAndQuadraticCoefs(), hasError(), PIP_MAX_LINELEN, readPolynomial(), SCIP_Bool, SCIP_CALL, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_VARIDX, SCIP_OBJSENSE_MINIMIZE, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_CONTINUOUS, SCIPaddCons(), SCIPaddLinearVarQuadratic(), SCIPaddVar(), SCIPallocBufferArray, SCIPchgVarObj(), SCIPconsGetName(), SCIPcreateConsNonlinear(), SCIPcreateConsQuadratic(), SCIPcreateVar(), SCIPcreateVarBasic(), SCIPdebugMsg, SCIPdebugPrintCons, SCIPexprGetChildren(), SCIPexprGetMonomialChildIndices(), SCIPexprGetMonomialCoef(), SCIPexprGetMonomialExponents(), SCIPexprGetMonomialNFactors(), SCIPexprGetMonomials(), SCIPexprGetNChildren(), SCIPexprGetNMonomials(), SCIPexprGetOperator(), SCIPexprGetOpIndex(), SCIPexprGetPolynomialConstant(), SCIPexprtreeFree(), SCIPexprtreeGetNVars(), SCIPexprtreeGetRoot(), SCIPexprtreeGetVars(), SCIPfreeBufferArray, SCIPinfinity(), SCIPreleaseCons(), SCIPreleaseVar(), SCIPvarGetObj(), and TRUE.
Referenced by readPIPFile().
|
static |
reads the constraints section
scip | SCIP data structure |
pipinput | PIP reading data |
Definition at line 1440 of file reader_pip.c.
References FALSE, getLinearAndQuadraticCoefs(), getNextToken(), hasError(), isSense(), isSign(), isValue(), PIP_MAX_LINELEN, PIP_SENSE_EQ, PIP_SENSE_GE, PIP_SENSE_LE, PIP_SENSE_NOTHING, readPolynomial(), SCIP_Bool, SCIP_CALL, SCIP_CALL_TERMINATE, SCIP_EXPR_POLYNOMIAL, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_READERROR, SCIP_Real, SCIPaddCons(), SCIPallocBufferArray, SCIPcreateConsLinear(), SCIPcreateConsNonlinear(), SCIPcreateConsQuadratic(), SCIPdebugMsg, SCIPdebugPrintCons, SCIPerrorMessage, SCIPexprGetNMonomials(), SCIPexprGetOperator(), SCIPexprtreeFree(), SCIPexprtreeGetRoot(), SCIPfreeBufferArray, SCIPinfinity(), SCIPreleaseCons(), syntaxError(), and TRUE.
Referenced by readPIPFile().
|
static |
reads the bounds section
scip | SCIP data structure |
pipinput | PIP reading data |
Definition at line 1639 of file reader_pip.c.
References getNextToken(), getVariable(), isNewSection(), isSense(), isSign(), isValue(), PIP_SENSE_EQ, PIP_SENSE_GE, PIP_SENSE_LE, PIP_SENSE_NOTHING, pushToken(), SCIP_Bool, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_Real, SCIPchgVarLb(), SCIPchgVarUb(), SCIPdebugMsg, SCIPerrorMessage, SCIPinfinity(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), sign(), and syntaxError().
Referenced by readPIPFile().
|
static |
reads the generals section
scip | SCIP data structure |
pipinput | PIP reading data |
Definition at line 1810 of file reader_pip.c.
References getNextToken(), getVariable(), isNewSection(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_VARTYPE_INTEGER, SCIPchgVarType(), and syntaxError().
Referenced by readPIPFile().
|
static |
reads the binaries section
scip | SCIP data structure |
pipinput | PIP reading data |
Definition at line 1845 of file reader_pip.c.
References getNextToken(), getVariable(), isNewSection(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_VARTYPE_BINARY, SCIPchgVarLb(), SCIPchgVarType(), SCIPchgVarUb(), SCIPvarGetLbGlobal(), SCIPvarGetUbGlobal(), and syntaxError().
Referenced by readPIPFile().
|
static |
reads a PIP file
scip | SCIP data structure |
pipinput | PIP reading data |
filename | name of the input file |
Definition at line 1889 of file reader_pip.c.
References hasError(), PIP_BINARIES, PIP_BOUNDS, PIP_CONSTRAINTS, PIP_END, PIP_GENERALS, PIP_OBJECTIVE, PIP_START, readBinaries(), readBounds(), readConstraints(), readGenerals(), readObjective(), readStart(), SCIP_CALL, SCIP_INVALIDDATA, SCIP_NOFILE, SCIP_OKAY, SCIPcreateProb(), SCIPerrorMessage, SCIPfclose(), SCIPfopen(), and SCIPprintSysError().
Referenced by SCIPreadPip().
|
static |
hash key retrieval function for variables
Definition at line 1959 of file reader_pip.c.
|
static |
returns TRUE iff the indices of both variables are equal
Definition at line 1966 of file reader_pip.c.
|
static |
returns the hash value of the key
Definition at line 1975 of file reader_pip.c.
References SCIPvarGetIndex().
|
static |
transforms given variables, scalars, and constant to the corresponding active variables, scalars, and constant
scip | SCIP data structure |
vars | vars array to get active variables for |
scalars | scalars a_1, ..., a_n in linear sum a_1*x_1 + ... + a_n*x_n + c |
nvars | pointer to number of variables and values in vars and vals array |
constant | pointer to constant c in linear sum a_1*x_1 + ... + a_n*x_n + c |
transformed | transformed constraint? |
Definition at line 1983 of file reader_pip.c.
References SCIP_CALL, SCIP_OKAY, SCIPgetProbvarLinearSum(), SCIPreallocBufferArray, SCIPvarGetOrigvarSum(), and TRUE.
Referenced by printAggregatedCons(), printNonlinearCons(), and printQuadraticCons().
|
static |
clears the given line buffer
linebuffer | line |
linecnt | number of characters in line |
Definition at line 2024 of file reader_pip.c.
Referenced by endLine(), printRow(), printRowNl(), and SCIPwritePip().
|
static |
ends the given line with '\0' and prints it to the given file stream
scip | SCIP data structure |
file | output file (or NULL for standard output) |
linebuffer | line |
linecnt | number of characters in line |
Definition at line 2038 of file reader_pip.c.
References clearLine(), and SCIPinfoMessage().
Referenced by appendLine(), printRow(), printRowNl(), and SCIPwritePip().
|
static |
appends extension to line and prints it to the give file stream if the line exceeded the length given in the define PIP_PRINTLEN
scip | SCIP data structure |
file | output file (or NULL for standard output) |
linebuffer | line |
linecnt | number of characters in line |
extension | string to extent the line |
Definition at line 2060 of file reader_pip.c.
References endLine(), PIP_MAX_PRINTLEN, PIP_PRINTLEN, and SCIPdebugMsg.
Referenced by printRow(), printRowNl(), and SCIPwritePip().
|
static |
scip | SCIP data structure |
file | output file (or NULL for standard output) |
rowname | row name |
rownameextension | row name extension |
type | row type ("=", "<=", or ">=") |
linvars | array of linear variables |
linvals | array of linear coefficient values |
nlinvars | number of linear variables |
quadvarterms | quadratic variable terms |
nquadvarterms | number of quadratic variable terms |
bilinterms | bilinear terms |
nbilinterms | number of bilinear terms |
rhs | right hand side |
Definition at line 2091 of file reader_pip.c.
References appendLine(), clearLine(), endLine(), PIP_MAX_NAMELEN, PIP_MAX_PRINTLEN, SCIPisZero(), SCIPsnprintf(), and SCIPvarGetName().
Referenced by printAggregatedCons(), and printQuadraticCons().
|
static |
scip | SCIP data structure |
file | output file (or NULL for standard output) |
rowname | row name |
rownameextension | row name extension |
type | row type ("=", "<=", or ">=") |
linvars | array of linear variables |
linvals | array of linear coefficient values |
nlinvars | number of linear variables |
exprtrees | expression trees |
exprtreecoefs | coefficients of expression trees |
nexprtrees | number of expression trees |
rhs | right hand side |
Definition at line 2222 of file reader_pip.c.
References appendLine(), clearLine(), SCIP_QuadElement::coef, endLine(), SCIP_QuadElement::idx1, SCIP_QuadElement::idx2, PIP_MAX_NAMELEN, PIP_MAX_PRINTLEN, SCIP_EXPR_CONST, SCIP_EXPR_INTPOWER, SCIP_EXPR_LINEAR, SCIP_EXPR_MINUS, SCIP_EXPR_MUL, SCIP_EXPR_PLUS, SCIP_EXPR_POLYNOMIAL, SCIP_EXPR_PRODUCT, SCIP_EXPR_QUADRATIC, SCIP_EXPR_REALPOWER, SCIP_EXPR_SQRT, SCIP_EXPR_SQUARE, SCIP_EXPR_SUM, SCIP_EXPR_VARIDX, SCIPerrorMessage, SCIPexprGetChildren(), SCIPexprGetIntPowerExponent(), SCIPexprGetLinearCoefs(), SCIPexprGetLinearConstant(), SCIPexprGetMonomialChildIndices(), SCIPexprGetMonomialCoef(), SCIPexprGetMonomialExponents(), SCIPexprGetMonomialNFactors(), SCIPexprGetMonomials(), SCIPexprGetNChildren(), SCIPexprGetNMonomials(), SCIPexprGetNQuadElements(), SCIPexprGetOperator(), SCIPexprGetOpIndex(), SCIPexprGetOpReal(), SCIPexprGetPolynomialConstant(), SCIPexprGetQuadConstant(), SCIPexprGetQuadElements(), SCIPexprGetQuadLinearCoefs(), SCIPexprGetRealPowerExponent(), SCIPexpropGetName(), SCIPexprtreeGetNVars(), SCIPexprtreeGetRoot(), SCIPexprtreeGetVars(), SCIPisZero(), SCIPsnprintf(), and SCIPvarGetName().
Referenced by printNonlinearCons().
|
static |
prints given (linear or) quadratic constraint information in LP format to file stream
scip | SCIP data structure |
file | output file (or NULL for standard output) |
rowname | name of the row |
linvars | array of linear variables |
linvals | array of linear coefficients values (or NULL if all linear coefficient values are 1) |
nlinvars | number of linear variables |
quadvarterms | quadratic variable terms |
nquadvarterms | number of quadratic variable terms |
bilinterms | bilinear terms |
nbilinterms | number of bilinear terms |
lhs | left hand side |
rhs | right hand side |
transformed | transformed constraint? |
Definition at line 2576 of file reader_pip.c.
References getActiveVariables(), printRow(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPduplicateBufferArray, SCIPfreeBufferArray, SCIPisEQ(), and SCIPisInfinity().
Referenced by SCIPwritePip().
|
static |
prints given nonlinear constraint information in LP format to file stream
scip | SCIP data structure |
file | output file (or NULL for standard output) |
rowname | name of the row |
linvars | array of linear variables |
linvals | array of linear coefficients values (or NULL if all linear coefficient values are 1) |
nlinvars | number of linear variables |
exprtrees | expression trees |
exprtreecoefs | coefficients of expression trees |
nexprtrees | number of expression trees |
lhs | left hand side |
rhs | right hand side |
transformed | transformed constraint? |
Definition at line 2673 of file reader_pip.c.
References getActiveVariables(), printRowNl(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPduplicateBufferArray, SCIPfreeBufferArray, SCIPisEQ(), and SCIPisInfinity().
Referenced by SCIPwritePip().
|
static |
check whether given variables are aggregated and put them into an array without duplication
scip | SCIP data structure |
nvars | number of active variables in the problem |
vars | variable array |
nAggregatedVars | number of aggregated variables on output |
aggregatedVars | array storing the aggregated variables on output |
varAggregated | hashtable for checking duplicates |
Definition at line 2769 of file reader_pip.c.
References SCIP_CALL, SCIP_OKAY, SCIP_VARSTATUS_AGGREGATED, SCIP_VARSTATUS_MULTAGGR, SCIP_VARSTATUS_NEGATED, SCIPhashtableExists(), SCIPhashtableInsert(), and SCIPvarGetStatus().
Referenced by SCIPwritePip().
|
static |
print aggregated variable-constraints
scip | SCIP data structure |
file | output file (or NULL for standard output) |
transformed | TRUE iff problem is the transformed problem |
nvars | number of active variables in the problem |
nAggregatedVars | number of aggregated variables |
aggregatedVars | array storing the aggregated variables |
Definition at line 2810 of file reader_pip.c.
References getActiveVariables(), PIP_MAX_NAMELEN, printRow(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPsnprintf(), and SCIPvarGetName().
Referenced by SCIPwritePip().
method check if the variable names are not longer than PIP_MAX_NAMELEN
scip | SCIP data structure |
vars | array of variables |
nvars | number of variables |
Definition at line 2863 of file reader_pip.c.
References PIP_MAX_NAMELEN, SCIPvarGetName(), and SCIPwarningMessage().
Referenced by SCIPwritePip().
|
static |
method check if the constraint names are not longer than PIP_MAX_NAMELEN
scip | SCIP data structure |
conss | array of constraints |
nconss | number of constraints |
transformed | TRUE iff problem is the transformed problem |
Definition at line 2888 of file reader_pip.c.
References PIP_MAX_NAMELEN, SCIP_Real, SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconshdlrGetName(), SCIPconsIsEnabled(), SCIPconsIsTransformed(), SCIPgetLhsLinear(), SCIPisEQ(), and SCIPwarningMessage().
Referenced by SCIPwritePip().
|
static |
copy method for reader plugins (called when SCIP copies plugins)
Definition at line 3694 of file reader_pip.c.
References READER_NAME, SCIP_CALL, SCIP_OKAY, SCIPincludeReaderPip(), and SCIPreaderGetName().
|
static |
problem reading method of reader
Definition at line 3709 of file reader_pip.c.
References SCIP_CALL, SCIP_OKAY, and SCIPreadPip().
|
static |
problem writing method of reader
Definition at line 3720 of file reader_pip.c.
References SCIP_CALL, SCIP_OKAY, and SCIPwritePip().
|
static |
Definition at line 116 of file reader_pip.c.
Referenced by isDelimChar().
|
static |
Definition at line 117 of file reader_pip.c.
Referenced by isTokenChar().
|
static |
Definition at line 118 of file reader_pip.c.
Referenced by getNextLine().