36 #if defined(_WIN32) || defined(_WIN64) 44 #define READER_NAME "fixreader" 45 #define READER_DESC "file reader for variable fixings" 46 #define READER_EXTENSION "fix" 67 assert(filename != NULL);
80 unknownvariablemessage =
FALSE;
97 if(
SCIPfgets(buffer, (
int)
sizeof(buffer), file) == NULL )
102 if( strncasecmp(buffer,
"solution status:", 16) == 0 || strncasecmp(buffer,
"objective value:", 16) == 0 )
107 nread = sscanf(buffer, format, varname, valuestring, objstring);
110 SCIPerrorMessage(
"invalid input line %d in solution file <%s>: <%s>\n", lineno, filename, buffer);
119 if( !unknownvariablemessage )
121 SCIPwarningMessage(scip,
"unknown variable <%s> in line %d of solution file <%s>\n", varname, lineno, filename);
123 unknownvariablemessage =
TRUE;
129 if( strncasecmp(valuestring,
"inv", 3) == 0 )
131 else if( strncasecmp(valuestring,
"+inf", 4) == 0 || strncasecmp(valuestring,
"inf", 3) == 0 )
133 else if( strncasecmp(valuestring,
"-inf", 4) == 0 )
137 nread = sscanf(valuestring,
"%lf", &value);
140 SCIPerrorMessage(
"invalid solution value <%s> for variable <%s> in line %d of solution file <%s>\n",
141 valuestring, varname, lineno, filename);
151 SCIPerrorMessage(
"infeasible solution value of <%s>[%.15g,%.15g] to %.15g in line %d of solution file <%s>\n",
180 assert(
scip != NULL);
181 assert(reader != NULL);
194 assert(reader != NULL);
196 assert(result != NULL);
202 SCIPerrorMessage(
"reading of fixing file is only possible after a problem was created\n");
SCIP_STAGE SCIPgetStage(SCIP *scip)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
const char * SCIPreaderGetName(SCIP_READER *reader)
SCIP_Real SCIPinfinity(SCIP *scip)
int SCIPsnprintf(char *t, int len, const char *s,...)
enum SCIP_Retcode SCIP_RETCODE
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
static SCIP_DECL_READERREAD(readerReadFix)
SCIP_VAR * SCIPfindVar(SCIP *scip, const char *name)
SCIP_FILE * SCIPfopen(const char *path, const char *mode)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPincludeReaderFix(SCIP *scip)
static SCIP_RETCODE readSol(SCIP *scip, const char *filename)
int SCIPfeof(SCIP_FILE *stream)
struct SCIP_File SCIP_FILE
char * SCIPfgets(char *s, int size, SCIP_FILE *stream)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
SCIP_RETCODE SCIPfreeTransform(SCIP *scip)
SCIP_RETCODE SCIPincludeReaderBasic(SCIP *scip, SCIP_READER **readerptr, const char *name, const char *desc, const char *extension, SCIP_READERDATA *readerdata)
void SCIPprintSysError(const char *message)
file reader for variable fixings
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
SCIP_RETCODE SCIPsetReaderCopy(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
SCIP_RETCODE SCIPsetReaderRead(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
int SCIPfclose(SCIP_FILE *fp)
static SCIP_DECL_READERCOPY(readerCopyFix)