* windowsendlinechar;
116assert(cipinput !=
NULL);
119cipinput->endfile = (
SCIPfgets(cipinput->strbuf, cipinput->len, cipinput->file) ==
NULL);
121 if( cipinput->endfile )
128cipinput->linenumber++;
129endline = strchr(cipinput->strbuf,
'\n');
130endcharacter = strchr(cipinput->strbuf,
';');
132 while( endline ==
NULL|| (endcharacter ==
NULL&& cipinput->section ==
CIP_CONSTRAINTS&& strncmp(cipinput->strbuf,
"END", 3) != 0 ) )
137 if( endline ==
NULL)
138pos = cipinput->len - 1;
140pos = (int) (endline - cipinput->strbuf);
147 if( pos + cipinput->readingsize >= cipinput->len )
154cipinput->endfile = (
SCIPfgets(&(cipinput->strbuf[pos]), cipinput->len - pos, cipinput->file) ==
NULL);
156 if( cipinput->endfile )
163cipinput->linenumber++;
164endline = strrchr(&cipinput->strbuf[pos],
'\n');
165endcharacter = strchr(&cipinput->strbuf[pos],
';');
167assert(endline !=
NULL);
172windowsendlinechar = strrchr(cipinput->strbuf,
'\r');
173 if( windowsendlinechar !=
NULL&& windowsendlinechar + 1 == endline )
177assert(windowsendlinechar ==
NULL);
179 if( cipinput->section ==
CIP_CONSTRAINTS&& endcharacter !=
NULL&& endline - endcharacter != 1 )
181 SCIPerrorMessage(
"Constraint line has to end with ';\\n' (line: %d).\n", cipinput->linenumber);
182cipinput->haserror =
TRUE;
202buf = cipinput->strbuf;
204 if( strncmp(buf,
"STATISTICS", 9) == 0 )
210 if( strncmp(buf,
"VARIABLES", 8) == 0 || strncmp(buf,
"FIXED", 5) == 0 || strncmp(buf,
"CONSTRAINTS", 11) == 0 || strncmp(buf,
"OBJECTIVE", 9) == 0 )
212 SCIPerrorMessage(
"Syntax Error: File has to start with 'STATISTICS' section.\n");
213cipinput->haserror =
TRUE;
227buf = cipinput->strbuf;
229 if( strncmp(buf,
"OBJECTIVE", 9) == 0 )
237 if( strncmp(buf,
" Problem name", 14) == 0 )
242name = strchr(buf,
':');
246 SCIPwarningMessage(
scip,
"did not find problem name (line: %d):\n%s\n", cipinput->linenumber, cipinput->strbuf);
254 if(
NULL!= (s = strpbrk(name,
"#\r\n")) )
281assert(objscale !=
NULL);
282assert(objoffset !=
NULL);
284buf = cipinput->strbuf;
286 if( strncmp(buf,
"VARIABLES", 8) == 0 )
288 else if( strncmp(buf,
"FIXED", 5) == 0 )
290 else if( strncmp(buf,
"CONSTRAINTS", 11) == 0 )
292 else if( strncmp(buf,
"END", 3) == 0 )
307name = strchr(buf,
':');
311 SCIPwarningMessage(
scip,
"did not find objective sense (line: %d):\n%s\n", cipinput->linenumber, cipinput->strbuf);
327 SCIPwarningMessage(
scip,
"unknown objective sense '%s' (line: %d):\n%s\n", name, cipinput->linenumber, cipinput->strbuf);
340name = strchr(buf,
':');
361 SCIPwarningMessage(
scip,
"could not parse offset (line: %d)\n%s\n", cipinput->linenumber, cipinput->strbuf);
370name = strchr(buf,
':');
391 SCIPwarningMessage(
scip,
"could not parse objective scale (line: %d)\n%s\n", cipinput->linenumber, cipinput->strbuf);
414buf = cipinput->strbuf;
416 if( strncmp(buf,
"FIXED", 5) == 0 )
418 else if( strncmp(buf,
"CONSTRAINTS", 4) == 0 )
420 else if( strncmp(buf,
"END", 3) == 0 )
423 if( cipinput->section !=
CIP_VARS)
429 SCIP_CALL(
SCIPparseVar(
scip, &var, buf, initial, removable,
NULL,
NULL,
NULL,
NULL,
NULL, &endptr, &success) );
433 SCIPerrorMessage(
"syntax error in variable information (line: %d):\n%s\n", cipinput->linenumber, cipinput->strbuf);
434cipinput->haserror =
TRUE;
438 if( objscale != 1.0 )
465buf = cipinput->strbuf;
467 if( strncmp(buf,
"CONSTRAINTS", 11) == 0 )
469 else if( strncmp(buf,
"END", 3) == 0 )
478 SCIP_CALL(
SCIPparseVar(
scip, &var, buf,
TRUE,
FALSE,
NULL,
NULL,
NULL,
NULL,
NULL, &endptr, &success) );
482 SCIPerrorMessage(
"syntax error in variable information (line: %d):\n%s\n", cipinput->linenumber, cipinput->strbuf);
483cipinput->haserror =
TRUE;
490 while( *buf !=
'\0'&& (*buf ==
' '|| *buf ==
',') )
494 if( strncmp(buf,
"fixed:", 6) == 0 )
499 else if( strncmp(buf,
"negated:", 8) == 0 )
511 if( negvar ==
NULL)
513 SCIPerrorMessage(
"could not parse negated variable (line: %d):\n%s\n", cipinput->linenumber, cipinput->strbuf);
514cipinput->haserror =
TRUE;
533 SCIP_CALL(
SCIPcreateConsLinear(
scip, &lincons, name, 2, vars, vals, 1.0, 1.0,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
TRUE,
FALSE) );
538 else if( strncmp(buf,
"aggregated:", 11) == 0 )
557 SCIPerrorMessage(
"expected constant when aggregated variable information (line: %d):\n%s\n", cipinput->linenumber, buf);
558cipinput->haserror =
TRUE;
587 if( success && requsize > nvarssize )
590nvarssize = requsize;
595assert( ! success || requsize <= nvarssize);
605 if( strncmp(str,
"indslack", 8) == 0 )
610 else if( strncmp(str,
"t_indslack", 10) == 0 )
620 SCIP_CALL(
SCIPcreateConsLinear(
scip, &lincons, name, nvars + 1, vars, vals, -rhs, -rhs,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
TRUE,
FALSE) );
627 SCIPwarningMessage(
scip,
"Could not read (multi-)aggregated variable <%s>: dependent variables unkown - consider changing the order (line: %d):\n%s\n",
636 SCIPerrorMessage(
"unknown section when parsing variables (line: %d):\n%s\n", cipinput->linenumber, buf);
637cipinput->haserror =
TRUE;
672buf = cipinput->strbuf;
674 if( strncmp(buf,
"END", 3) == 0 )
680 SCIPdebugMsg(
scip,
"parse constraints in line %d\n", cipinput->linenumber);
690len = (int)strlen(buf);
693 SCIPerrorMessage(
"syntax error: expected constraint in line %d.\n", cipinput->linenumber);
694cipinput->haserror =
TRUE;
697 if( buf[len - 1] !=
';')
699 SCIPerrorMessage(
"syntax error: line has to end with ';' (line: %d)\n", cipinput->linenumber);
700cipinput->haserror =
TRUE;
706copybuf[len - 1] =
'\0';
710initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable,
FALSE, &success);
719 SCIPerrorMessage(
"syntax error when reading constraint (line: %d):\n%s\n", cipinput->linenumber, cipinput->strbuf);
720cipinput->haserror =
TRUE;
740assert(reader !=
NULL);
757assert(readerdata !=
NULL);
786cipinput.len = 131071;
789cipinput.linenumber = 0;
791cipinput.haserror =
FALSE;
792cipinput.endfile =
FALSE;
793cipinput.readingsize = 65535;
802initialvar = !dynamiccols;
803removablevar = dynamiccols;
808 while( cipinput.section !=
CIP_END&& !cipinput.haserror )
813 if( cipinput.endfile )
816 switch( cipinput.section )
828retcode =
getVariable(
scip, &cipinput, initialvar, removablevar, objscale);
832cipinput.haserror =
TRUE;
843cipinput.haserror =
TRUE;
850retcode =
getConstraint(
scip, &cipinput, initialconss, dynamicconss, dynamicrows);
854cipinput.haserror =
TRUE;
871objoffset *= objscale;
876 SCIPdebugMsg(
scip,
"added variables <objoffset> for objective offset of <%g>\n", objoffset);
879 if( cipinput.section !=
CIP_END&& !cipinput.haserror )
890 if( cipinput.haserror )
930assert(reader !=
NULL);
935 SCIPinfoMessage(
scip, file,
" Variables : %d (%d binary, %d integer, %d implicit integer, %d continuous)\n",
936nvars, nbinvars, nintvars, nimplvars, ncontvars);
937 SCIPinfoMessage(
scip, file,
" Constraints : %d initial, %d maximal\n", startnconss, maxnconss);
946 if( nfixedvars > 0 )
952 if( nvars + nfixedvars > 0 )
959 for( i = 0; i < nvars; ++i )
964assert( var !=
NULL);
966 if( varhash !=
NULL)
978assert(readerdata !=
NULL);
980 if( readerdata->writefixedvars && nfixedvars > 0 )
988 while( nwritten < nfixedvars )
990 SCIPdebugMsg(
scip,
"written %d of %d fixed variables.\n", nwritten, nfixedvars);
991 for(i = 0; i < nfixedvars; ++i)
997assert( var !=
NULL);
1018assert( tmpvar !=
NULL);
1034assert( tmpvar !=
NULL);
1057assert(aggrvars !=
NULL|| naggrvars == 0);
1059 for(j = 0; j < naggrvars; ++j)
1066 if( j >= naggrvars )
1079 SCIPerrorMessage(
"Only fixed variables are allowed to be present in fixedvars list.\n");
1091 for( i = 0; i < nconss; ++i )
1101 if( nfixedvars > 0 )
1104assert(varhash ==
NULL);
1136 "reading/cipreader/writefixedvars",
"should fixed and aggregated variables be printed (if not, re-parsing might fail)",
Constraint handler for linear constraints in their most general form, .
SCIP_FILE * SCIPfopen(const char *path, const char *mode)
int SCIPfclose(SCIP_FILE *fp)
char * SCIPfgets(char *s, int size, SCIP_FILE *stream)
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 SCIPincludeReaderCip(SCIP *scip)
SCIP_RETCODE SCIPaddVar(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPsetProbName(SCIP *scip, const char *name)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPsetObjsense(SCIP *scip, SCIP_OBJSENSE objsense)
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)
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
SCIP_Bool SCIPhashtableExists(SCIP_HASHTABLE *hashtable, void *element)
SCIP_RETCODE SCIPhashtableCreate(SCIP_HASHTABLE **hashtable, BMS_BLKMEM *blkmem, int tablesize, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr)
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *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 SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
SCIP_RETCODE SCIPparseCons(SCIP *scip, SCIP_CONS **cons, const char *str, 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_Bool *success)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
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 SCIPfreeBlockMemory(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_RETCODE SCIPincludeReaderBasic(SCIP *scip, SCIP_READER **readerptr, const char *name, const char *desc, const char *extension, SCIP_READERDATA *readerdata)
SCIP_RETCODE SCIPsetReaderCopy(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
SCIP_READERDATA * SCIPreaderGetData(SCIP_READER *reader)
SCIP_RETCODE SCIPsetReaderFree(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERFREE((*readerfree)))
const char * SCIPreaderGetName(SCIP_READER *reader)
SCIP_RETCODE SCIPsetReaderRead(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
SCIP_RETCODE SCIPsetReaderWrite(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERWRITE((*readerwrite)))
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_VAR * SCIPvarGetNegatedVar(SCIP_VAR *var)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_RETCODE SCIPparseVarName(SCIP *scip, const char *str, SCIP_VAR **var, char **endptr)
SCIP_RETCODE SCIPparseVar(SCIP *scip, SCIP_VAR **var, const char *str, SCIP_Bool initial, SCIP_Bool removable, SCIP_DECL_VARCOPY((*varcopy)), SCIP_DECL_VARDELORIG((*vardelorig)), SCIP_DECL_VARTRANS((*vartrans)), SCIP_DECL_VARDELTRANS((*vardeltrans)), SCIP_VARDATA *vardata, char **endptr, SCIP_Bool *success)
int SCIPvarGetIndex(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
SCIP_RETCODE SCIPparseVarsLinearsum(SCIP *scip, const char *str, SCIP_VAR **vars, SCIP_Real *vals, int *nvars, int varssize, int *requiredsize, char **endptr, SCIP_Bool *success)
SCIP_RETCODE SCIPflattenVarAggregationGraph(SCIP *scip, SCIP_VAR *var)
SCIP_VAR ** SCIPvarGetMultaggrVars(SCIP_VAR *var)
int SCIPvarGetMultaggrNVars(SCIP_VAR *var)
SCIP_VAR * SCIPvarGetNegationVar(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_RETCODE SCIPprintVar(SCIP *scip, SCIP_VAR *var, FILE *file)
SCIP_RETCODE SCIPchgVarObj(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
SCIP_VAR * SCIPvarGetAggrVar(SCIP_VAR *var)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIP_Bool SCIPstrToRealValue(const char *str, SCIP_Real *value, char **endptr)
void SCIPprintSysError(const char *message)
SCIP_RETCODE SCIPskipSpace(char **s)
int SCIPstrncasecmp(const char *s1, const char *s2, int length)
memory allocation routines
#define BMSclearMemoryArray(ptr, num)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
wrapper functions to map file i/o to standard or zlib file i/o
struct SCIP_File SCIP_FILE
public methods for message output
#define SCIPdebugPrintCons(x, y, z)
public data structures and miscellaneous methods
public methods for input file readers
public methods for problem variables
static SCIP_RETCODE getConstraint(SCIP *scip, CIPINPUT *cipinput, SCIP_Bool initial, SCIP_Bool dynamic, SCIP_Bool removable)
enum CipSection CIPSECTION
static SCIP_DECL_READERFREE(readerFreeCip)
static SCIP_RETCODE getInputString(SCIP *scip, CIPINPUT *cipinput)
static SCIP_DECL_HASHGETKEY(hashGetKeyVar)
static SCIP_RETCODE getObjective(SCIP *scip, CIPINPUT *cipinput, SCIP_Real *objscale, SCIP_Real *objoffset)
static void getStart(SCIP *scip, CIPINPUT *cipinput)
static SCIP_DECL_READERCOPY(readerCopyCip)
static SCIP_DECL_READERREAD(readerReadCip)
static SCIP_RETCODE getStatistics(SCIP *scip, CIPINPUT *cipinput)
#define DEFAULT_CIP_WRITEFIXEDVARS
static SCIP_DECL_READERWRITE(readerWriteCip)
static SCIP_DECL_HASHKEYEQ(hashKeyEqVar)
static SCIP_DECL_HASHKEYVAL(hashKeyValVar)
static SCIP_RETCODE getFixedVariable(SCIP *scip, CIPINPUT *cipinput)
static SCIP_RETCODE getVariable(SCIP *scip, CIPINPUT *cipinput, SCIP_Bool initial, SCIP_Bool removable, SCIP_Real objscale)
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 SCIP variables
enum SCIP_Objsense SCIP_OBJSENSE
struct SCIP_ReaderData SCIP_READERDATA
enum SCIP_Retcode SCIP_RETCODE
@ SCIP_VARTYPE_CONTINUOUS
@ SCIP_VARSTATUS_ORIGINAL
@ SCIP_VARSTATUS_MULTAGGR
@ SCIP_VARSTATUS_AGGREGATED
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4