reader_diff.c
Go to the documentation of this file.
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
114 SCIPerrorMessage("Syntax error in line %d ('%s'): %s \n", lpinput->linenumber, lpinput->token, msg);
200 else if( (*exptype == LP_EXP_NONE) && !(*hasdot) && (c == '.') && isdigit((unsigned char)nextc) )
240 /* if we previously detected a comment we have to parse the remaining line away if there is something left */
281 SCIPwarningMessage(scip, "we read %d characters from the file; this might indicate a corrupted input file!",
289 SCIPdebugMsg(scip, "correct buffer, reread the last %ld characters\n", (long) strlen(last) + 1);
298 lpinput->linebuf[LP_MAX_LINELEN-1] = '\0'; /* we want to use lookahead of one char -> we need two \0 at the end */
310 *(commentstart+1) = '\0'; /* we want to use lookahead of one char -> we need two \0 at the end */
334 /** reads the next token from the input file into the token buffer; returns whether a token was read */
413 * if the token is an equality token '=' and the next character is a '<' or '>', replace the token by the inequality sense
420 && (lpinput->token[tokenlen-1] == '<' || lpinput->token[tokenlen-1] == '>' || lpinput->token[tokenlen-1] == '=')
425 else if( lpinput->token[tokenlen-1] == '=' && (buf[lpinput->linepos] == '<' || buf[lpinput->linepos] == '>') )
439 /** puts the current token on the token stack, such that it is read at the next call to getNextToken() */
452 /** puts the buffered token on the token stack, such that it is read at the next call to getNextToken() */
476 /** checks whether the current token is a section identifier, and if yes, switches to the corresponding section */
687 SCIP_Bool isobjective, /**< indicates whether we are currently reading the coefficients of the objective */
692 SCIP_Real** coefs, /**< pointer to store the array with coefficients (must be freed by caller) */
743 /* the second token was no colon: push the tokens back onto the token stack and parse them as coefficients */
750 /* there was only one token left: push it back onto the token stack and parse it as coefficient */
781 SCIPdebugMsg(scip, "(line %d) read coefficient value: %g with sign %+d\n", lpinput->linenumber, coef, coefsign);
805 /* check if we reached a new section, that will be only allowed when having no current sign and value and if we
812 SCIPwarningMessage(scip, "skipped single sign %c without value or variable in objective\n", coefsign == 1 ? '+' : '-');
850 SCIPdebugMsg(scip, "(line %d) read linear coefficient: %+g<%s>\n", lpinput->linenumber, coefsign * coef, SCIPvarGetName(var));
899 SCIP_CALL( readCoefficients(scip, lpinput, TRUE, name, &coefssize, &vars, &coefs, &ncoefs, &newsection) );
1014 SCIP_CALL( SCIPincludeReaderBasic(scip, &reader, READER_NAME, READER_DESC, READER_EXTENSION, NULL) );
1029 const char* filename, /**< full path and name of file to read, or NULL if stdin should be used */
1043 SCIP_CALL( SCIPallocBlockMemoryArray(scip, &lpinput.tokenbuf, LP_MAX_LINELEN) ); /*lint !e506*/
1047 SCIP_CALL( SCIPallocBlockMemoryArray(scip, &(lpinput.pushedtokens[i]), LP_MAX_LINELEN) ); /*lint !e866 !e506*/
Definition: reader_diff.c:64
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
Definition: scip_mem.h:105
Definition: reader_diff.c:64
int SCIPmemccpy(char *dest, const char *src, char stop, unsigned int cnt)
Definition: misc.c:9901
Definition: struct_reader.h:36
Definition: struct_scip.h:58
static SCIP_Bool isValueChar(char c, char nextc, SCIP_Bool firstchar, SCIP_Bool *hasdot, LPEXPTYPE *exptype)
Definition: reader_diff.c:187
Definition: type_prob.h:38
public methods for memory management
SCIP_RETCODE SCIPreadDiff(SCIP *scip, SCIP_READER *reader, const char *filename, SCIP_RESULT *result)
Definition: reader_diff.c:1026
static SCIP_RETCODE readDiffFile(SCIP *scip, LPINPUT *lpinput, const char *filename)
Definition: reader_diff.c:913
static SCIP_Bool getNextToken(SCIP *scip, LPINPUT *lpinput)
Definition: reader_diff.c:336
Definition: type_result.h:49
static SCIP_Bool isValue(SCIP *scip, LPINPUT *lpinput, SCIP_Real *value)
Definition: reader_diff.c:581
public solving methods
Definition: struct_var.h:198
diff file reader
SCIP_RETCODE SCIPchgReoptObjective(SCIP *scip, SCIP_OBJSENSE objsense, SCIP_VAR **vars, SCIP_Real *coefs, int nvars)
Definition: scip_prob.c:1175
Definition: reader_diff.c:70
public methods for problem variables
Definition: reader_diff.c:70
Definition: grphload.c:242
Definition: type_retcode.h:38
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
Definition: scip_message.c:203
public methods for numerical tolerances
static SCIP_RETCODE readCoefficients(SCIP *scip, LPINPUT *lpinput, SCIP_Bool isobjective, char *name, int *coefssize, SCIP_VAR ***vars, SCIP_Real **coefs, int *ncoefs, SCIP_Bool *newsection)
Definition: reader_diff.c:684
static SCIP_RETCODE getVariable(SCIP *scip, char *name, SCIP_VAR **var)
Definition: reader_diff.c:644
Definition: type_retcode.h:36
Definition: type_retcode.h:33
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
Definition: scip_message.c:296
wrapper functions to map file i/o to standard or zlib file i/o
public data structures and miscellaneous methods
Definition: reader_diff.c:64
static void syntaxError(SCIP *scip, LPINPUT *lpinput, const char *msg)
Definition: reader_diff.c:104
SCIP_RETCODE SCIPincludeReaderBasic(SCIP *scip, SCIP_READER **readerptr, const char *name, const char *desc, const char *extension, SCIP_READERDATA *readerdata)
Definition: scip_reader.c:180
Definition: type_message.h:43
Definition: reader_diff.c:58
SCIP_RETCODE SCIPsetReaderCopy(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
Definition: scip_reader.c:218
Definition: type_set.h:36
general public methods
Definition: reader_diff.c:70
public methods for message output
public methods for input file readers
public methods for message handling
static SCIP_RETCODE readObjective(SCIP *scip, LPINPUT *lpinput)
Definition: reader_diff.c:884
SCIP_RETCODE SCIPsetReaderRead(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
Definition: scip_reader.c:266
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
Definition: scip_mem.h:117
Definition: reader_diff.c:58
Definition: type_prob.h:39
Definition: type_retcode.h:43
Definition: objbenders.h:33
public methods for reader plugins
public methods for global and local (sub)problems
Definition: reader_diff.c:58
SCIP_RETCODE SCIPsetReaderFree(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERFREE((*readerfree)))
Definition: scip_reader.c:242
static SCIP_Bool isNewSection(SCIP *scip, LPINPUT *lpinput)
Definition: reader_diff.c:478