78#include "zimpl/attribute.h"
79#include "zimpl/ratlptypes.h"
80#include "zimpl/lint.h"
83#include "zimpl/numb.h"
84#include "zimpl/bound.h"
85#include "zimpl/mono.h"
86#include "zimpl/term.h"
88#include "zimpl/xlpglue.h"
89#include "zimpl/zimpllib.h"
95#define READER_NAME "zplreader"
96#define READER_DESC "file reader for ZIMPL model files"
97#define READER_EXTENSION "zpl"
104#if (ZIMPL_VERSION >= 341)
115 SCIP_Bool initialconss;
116 SCIP_Bool dynamicconss;
117 SCIP_Bool dynamiccols;
118 SCIP_Bool dynamicrows;
143 readerdata->valid =
TRUE;
164 assert(!readerdata->readerror);
166 scip = readerdata->scip;
172 return (
Lps*) readerdata;
260 SCIP_CALL(
SCIPcreateExprQuadratic(
scip, expr, nlinvars, linvars, lincoefs,
nquadterms,
quadvar1,
quadvar2,
quadcoefs,
NULL,
NULL) );
324 exponent = exponent ==
SCIP_INVALID ? 1.0 : exponent + 1.0;
481 SCIP_Bool modifiable;
513 readerdata->readerror =
TRUE;
520 initial = readerdata->initialconss;
576 SCIPerrorMessage(
"invalid constraint type <%d> in ZIMPL callback xlp_addcon()\n", type);
577 readerdata->readerror =
TRUE;
585 initial, separate, enforce, check,
propagate, local, readerdata->dynamicconss, readerdata->dynamicrows,
FALSE) );
621 initial, separate, enforce, check,
propagate, local, readerdata->dynamicconss, readerdata->dynamicrows,
FALSE) );
656 initial, separate, enforce, check,
propagate, local, modifiable, readerdata->dynamicconss, readerdata->dynamicrows,
FALSE) );
692 initial, separate, enforce, check,
propagate, local, modifiable, readerdata->dynamicconss, readerdata->dynamicrows) );
750 SCIPerrorMessage(
"Could not convert ZIMPL objective term into SCIP expression due to unsupported ZIMPL function.\n");
792 SCIP_Bool created =
FALSE;
797 scip = readerdata->scip;
800 if( readerdata->retcode !=
SCIP_OKAY || readerdata->readerror )
817 const Numb* priority,
880 readerdata->readerror =
TRUE;
883 initial = !(readerdata->dynamiccols);
884 removable = readerdata->dynamiccols;
887 SCIP_CALL(
SCIPcreateVar(
scip, &
var, name, lb, ub, 0.0, vartype, initial, removable,
NULL,
NULL,
NULL,
NULL,
NULL) );
898 if( !readerdata->branchpriowarning )
901 "ZIMPL reader: fractional branching priorities in input - rounding down to integer values\n");
902 readerdata->branchpriowarning =
TRUE;
912 if( readerdata->valid )
917 SCIPdebugMsg(
scip,
"primal solution candidate contains an unknown value for variable <%s>(%g)\n",
919 readerdata->valid =
FALSE;
948 const Numb* priority,
959 scip = readerdata->scip;
964 if( readerdata->retcode !=
SCIP_OKAY || readerdata->readerror )
1000 readerdata->initialconss, separate, enforce, check,
propagate, local, readerdata->dynamicconss, readerdata->dynamicrows,
FALSE) );
1025 readerdata->initialconss, separate, enforce, check,
propagate, local, readerdata->dynamicconss, readerdata->dynamicrows,
FALSE) );
1044 SCIPerrorMessage(
"invalid SOS type <%d> in ZIMPL callback xlp_addsos_term()\n", type);
1045 readerdata->readerror =
TRUE;
1057 const Numb* priority,
1068 scip = readerdata->scip;
1071 if( readerdata->retcode !=
SCIP_OKAY || readerdata->readerror )
1074 readerdata->retcode =
addSOS(
scip, readerdata, name, type,
term);
1092 scip = readerdata->scip;
1123 readerdata->readerror =
TRUE;
1148 scip = readerdata->scip;
1199 scip = readerdata->scip;
1246 scip = readerdata->scip;
1249 if( readerdata->retcode !=
SCIP_OKAY || readerdata->readerror )
1270 scip = readerdata->scip;
1273 if( readerdata->retcode !=
SCIP_OKAY || readerdata->readerror )
1340 if(
chdir(path) != 0 )
1370 readerdata->scip =
scip;
1371 readerdata->sol =
NULL;
1372 readerdata->valid =
FALSE;
1373 readerdata->branchpriowarning =
FALSE;
1374 readerdata->readerror =
FALSE;
1387 readerdata->readerror =
TRUE;
1394 return readerdata->retcode;
1400 char dummy[2] =
"x";
1480 readerdata->readerror =
TRUE;
1483 for(
i =
argc - 1;
i >= 1; --
i )
1492 return readerdata->retcode;
1508 if( readerdata->valid )
1528 if( readerdata->readerror )
1534 if( readerdata->sol !=
NULL )
1559#ifdef SCIP_WITH_ZIMPL
1560#if (ZIMPL_VERSION >= 341)
1579 "reading/zplreader/changedir",
"should the current directory be changed to that of the ZIMPL file before parsing?",
1582 "reading/zplreader/usestartsol",
"should ZIMPL starting solutions be forwarded to SCIP?",
1585 "reading/zplreader/parameters",
"additional parameter string passed to the ZIMPL parser (or - for no additional parameters)",
1593 SCIPwarningMessage(
scip,
"SCIP does only support ZIMPL 3.4.1 and higher. Please update your ZIMPL version %d.%d.%d\n",
constraint handler for indicator constraints
Constraint handler for linear constraints in their most general form, .
constraint handler for nonlinear constraints specified by algebraic expressions
constraint handler for SOS type 1 constraints
constraint handler for SOS type 2 constraints
absolute expression handler
exponential expression handler
logarithm expression handler
power and signed power expression handlers
product expression handler
handler for sin expressions
SCIP_RETCODE SCIPaddLinearVarNonlinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real coef)
SCIP_RETCODE SCIPaddCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
SCIP_RETCODE SCIPaddVarSOS1(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real weight)
SCIP_RETCODE SCIPcreateConsIndicator(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *binvar, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_RETCODE SCIPcreateConsSOS1(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *weights, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_RETCODE SCIPcreateConsNonlinear(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_EXPR *expr, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable)
SCIP_RETCODE SCIPcreateConsSOS2(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *weights, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_RETCODE SCIPcreateConsLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_RETCODE SCIPsetBinaryVarIndicator(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *binvar)
SCIP_RETCODE SCIPaddVarIndicator(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
SCIP_RETCODE SCIPaddVarSOS2(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real weight)
SCIP_RETCODE SCIPcreateExprProduct(SCIP *scip, SCIP_EXPR **expr, int nchildren, SCIP_EXPR **children, SCIP_Real coefficient, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPcreateExprSin(SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPcreateExprCos(SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPcreateExprAbs(SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPcreateExprSignpower(SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_Real exponent, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPcreateExprLog(SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPcreateExprExp(SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPcreateExprSum(SCIP *scip, SCIP_EXPR **expr, int nchildren, SCIP_EXPR **children, SCIP_Real *coefficients, SCIP_Real constant, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPcreateExprPow(SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_Real exponent, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
void SCIPsplitFilename(char *filename, char **path, char **name, char **extension, char **compression)
SCIP_RETCODE SCIPincludeReaderZpl(SCIP *scip)
SCIP_RETCODE SCIPaddVar(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPsetObjsense(SCIP *scip, SCIP_OBJSENSE objsense)
SCIP_RETCODE SCIPaddOrigObjoffset(SCIP *scip, SCIP_Real addval)
SCIP_OBJSENSE SCIPgetObjsense(SCIP *scip)
SCIP_RETCODE SCIPcreateProb(SCIP *scip, const char *name, SCIP_DECL_PROBDELORIG((*probdelorig)), SCIP_DECL_PROBTRANS((*probtrans)), SCIP_DECL_PROBDELTRANS((*probdeltrans)), SCIP_DECL_PROBINITSOL((*probinitsol)), SCIP_DECL_PROBEXITSOL((*probexitsol)), SCIP_DECL_PROBCOPY((*probcopy)), SCIP_PROBDATA *probdata)
SCIP_CONS * SCIPfindCons(SCIP *scip, const char *name)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
SCIP_Real SCIPhashmapGetImageReal(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapSetImageReal(SCIP_HASHMAP *hashmap, void *origin, SCIP_Real image)
int SCIPhashmapGetNElements(SCIP_HASHMAP *hashmap)
int SCIPhashmapGetNEntries(SCIP_HASHMAP *hashmap)
SCIP_HASHMAPENTRY * SCIPhashmapGetEntry(SCIP_HASHMAP *hashmap, int entryidx)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
void * SCIPhashmapEntryGetOrigin(SCIP_HASHMAPENTRY *entry)
SCIP_RETCODE SCIPhashmapRemoveAll(SCIP_HASHMAP *hashmap)
SCIP_Real SCIPhashmapEntryGetImageReal(SCIP_HASHMAPENTRY *entry)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
SCIP_VERBLEVEL SCIPgetVerbLevel(SCIP *scip)
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
SCIP_RETCODE SCIPaddStringParam(SCIP *scip, const char *name, const char *desc, char **valueptr, SCIP_Bool isadvanced, const char *defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPgetStringParam(SCIP *scip, const char *name, char **value)
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
SCIP_RETCODE SCIPcreateExprQuadratic(SCIP *scip, SCIP_EXPR **expr, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nquadterms, SCIP_VAR **quadvars1, SCIP_VAR **quadvars2, SCIP_Real *quadcoefs, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPcreateExprMonomial(SCIP *scip, SCIP_EXPR **expr, int nfactors, SCIP_VAR **vars, SCIP_Real *exponents, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPreleaseExpr(SCIP *scip, SCIP_EXPR **expr)
SCIP_RETCODE SCIPincludeExternalCodeInformation(SCIP *scip, const char *name, const char *description)
#define SCIPfreeBuffer(scip, ptr)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPreallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
#define SCIPallocBuffer(scip, ptr)
#define SCIPfreeBufferArrayNull(scip, ptr)
SCIP_RETCODE SCIPsetReaderCopy(SCIP *scip, SCIP_READER *reader,)
SCIP_RETCODE SCIPincludeReaderBasic(SCIP *scip, SCIP_READER **readerptr, const char *name, const char *desc, const char *extension, SCIP_READERDATA *readerdata)
SCIP_RETCODE SCIPsetReaderRead(SCIP *scip, SCIP_READER *reader,)
const char * SCIPreaderGetName(SCIP_READER *reader)
SCIP_RETCODE SCIPaddSolFree(SCIP *scip, SCIP_SOL **sol, SCIP_Bool *stored)
SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPchgVarBranchPriority(SCIP *scip, SCIP_VAR *var, int branchpriority)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
SCIP_RETCODE SCIPcreateVar(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype, SCIP_Bool initial, SCIP_Bool removable, SCIP_DECL_VARDELORIG((*vardelorig)), SCIP_DECL_VARTRANS((*vartrans)), SCIP_DECL_VARDELTRANS((*vardeltrans)), SCIP_DECL_VARCOPY((*varcopy)), SCIP_VARDATA *vardata)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPcreateVarBasic(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype)
SCIP_RETCODE SCIPaddVarObj(SCIP *scip, SCIP_VAR *var, SCIP_Real addobj)
int SCIPsnprintf(char *t, int len, const char *s,...)
int SCIPstrncpy(char *t, const char *s, int size)
SCIPfreeSol(scip, &heurdata->sol))
SCIPcreateSol(scip, &heurdata->sol, heur))
assert(minobj< SCIPgetCutoffbound(scip))
static SCIP_Bool propagate
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
public functions to work with algebraic expressions
public data structures and miscellaneous methods
public methods for NLP management
public methods for input file readers
public methods for problem variables
public methods for constraint handler plugins and constraints
public methods for memory management
public methods for message handling
public methods for numerical tolerances
public methods for SCIP parameter handling
public methods for global and local (sub)problems
public methods for reader plugins
public methods for solutions
public methods for SCIP variables
miscellaneous datastructures
enum SCIP_Objsense SCIP_OBJSENSE
type definitions for input file readers
struct SCIP_ReaderData SCIP_READERDATA
#define SCIP_DECL_READERREAD(x)
#define SCIP_DECL_READERCOPY(x)
enum SCIP_Retcode SCIP_RETCODE
@ SCIP_VARTYPE_CONTINUOUS
enum SCIP_Vartype SCIP_VARTYPE