61#if !defined(_WIN32) && !defined(_WIN64)
66#define READER_NAME "bndreader"
67#define READER_DESC "file reader for variable bounds"
68#define READER_EXTENSION "bnd"
70#define DEFAULT_IMPROVEONLY FALSE
76 SCIP_Bool improveonly;
95 SCIP_Bool unknownvariablemessage;
96 SCIP_Bool usevartable;
106 SCIPerrorMessage(
"Cannot read bounds file if vartable is disabled. Make sure parameter 'misc/usevartable' is set to TRUE.\n");
121 unknownvariablemessage =
FALSE;
143 (void) sscanf(buffer, format, varname, lbstring, ubstring);
148 SCIPerrorMessage(
"Error parsing variable name in line %d of bounds file <%s>\n", lineno, fname);
154 nread = sscanf(endptr, format, lbstring, ubstring);
157 SCIPerrorMessage(
"invalid input line %d in bounds file <%s>: <%s>\n", lineno, fname, buffer);
164 if( !unknownvariablemessage )
166 SCIPwarningMessage(
scip,
"unable to parse variable name in line %d of bounds file <%s>:\n", lineno, fname);
169 unknownvariablemessage =
TRUE;
175 if( strncasecmp(lbstring,
"inv", 3) == 0 )
177 else if( strncasecmp(lbstring,
"+inf", 4) == 0 || strncasecmp(lbstring,
"inf", 3) == 0 )
179 else if( strncasecmp(lbstring,
"-inf", 4) == 0 )
183 nread = sscanf(lbstring,
"%lf", &lb);
186 SCIPerrorMessage(
"invalid lower bound value <%s> for variable <%s> in line %d of bounds file <%s>\n",
187 lbstring, varname, lineno, fname);
194 if( strncasecmp(ubstring,
"inv", 3) == 0 )
196 else if( strncasecmp(ubstring,
"+inf", 4) == 0 || strncasecmp(ubstring,
"inf", 3) == 0 )
198 else if( strncasecmp(ubstring,
"-inf", 4) == 0 )
203 nread = sscanf(ubstring,
"%lf", &ub);
206 SCIPerrorMessage(
"invalid lower bound value <%s> for variable <%s> in line %d of bounds file <%s>\n",
207 ubstring, varname, lineno, fname);
213 if( readerdata->improveonly )
217 SCIPwarningMessage(
scip,
"not applying lower bound value %s for variable <%s> in line %d of bounds file %s,"
218 " because it does not improve existing bound of %f\n",
223 SCIPwarningMessage(
scip,
"not applying upper bound value %s for variable <%s> in line %d of bounds file %s, "
224 "because it does not improve existing bound of %f\n",
237 SCIPerrorMessage(
"Error changing lower bound for variable <%s> in line %d of bounds file <%s>\n", varname, lineno, fname);
245 SCIPerrorMessage(
"Error changing upper bound for variable <%s> in line %d of bounds file <%s>\n", varname, lineno, fname);
297 SCIPerrorMessage(
"reading of bounds file is only possible after a problem was created\n");
303 SCIPerrorMessage(
"reading of bounds file is only possible during problem creation stage\n");
380 varname = varname + 2;
457 "reading/bndreader/improveonly",
"only use improving bounds",
SCIP_FILE * SCIPfopen(const char *path, const char *mode)
int SCIPfeof(SCIP_FILE *stream)
int SCIPfclose(SCIP_FILE *fp)
char * SCIPfgets(char *s, int size, SCIP_FILE *stream)
SCIP_RETCODE SCIPincludeReaderBnd(SCIP *scip)
SCIP_STAGE SCIPgetStage(SCIP *scip)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
SCIP_MESSAGEHDLR * SCIPgetMessagehdlr(SCIP *scip)
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)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPallocBlockMemory(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_READERDATA * SCIPreaderGetData(SCIP_READER *reader)
SCIP_RETCODE SCIPsetReaderWrite(SCIP *scip, SCIP_READER *reader,)
SCIP_RETCODE SCIPsetReaderRead(SCIP *scip, SCIP_READER *reader,)
const char * SCIPreaderGetName(SCIP_READER *reader)
SCIP_RETCODE SCIPsetReaderFree(SCIP *scip, SCIP_READER *reader,)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPchgVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
SCIP_Real SCIPvarGetLbOriginal(SCIP_VAR *var)
SCIP_Bool SCIPvarIsTransformed(SCIP_VAR *var)
SCIP_RETCODE SCIPchgVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
SCIP_RETCODE SCIPparseVarName(SCIP *scip, const char *str, SCIP_VAR **var, char **endptr)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbOriginal(SCIP_VAR *var)
SCIP_Bool SCIPvarIsTransformedOrigvar(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
int SCIPsnprintf(char *t, int len, const char *s,...)
void SCIPprintSysError(const char *message)
assert(minobj< SCIPgetCutoffbound(scip))
void SCIPmessageFPrintInfo(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *formatstr,...)
wrapper functions to map file i/o to standard or zlib file i/o
struct SCIP_File SCIP_FILE
public methods for message output
public data structures and miscellaneous methods
public methods for input file readers
public methods for problem variables
#define DEFAULT_IMPROVEONLY
static SCIP_RETCODE readBounds(SCIP *scip, const char *fname, SCIP_READERDATA *readerdata)
static void printBounds(SCIP *scip, SCIP_MESSAGEHDLR *messagehdlr, FILE *file, SCIP_Real lb, SCIP_Real ub)
static SCIP_RETCODE SCIPwriteBnd(SCIP *scip, FILE *file, SCIP_VAR **vars, int nvars, SCIP_RESULT *result)
file reader for variable bounds
public methods for memory management
public methods for message handling
public methods for numerical tolerances
public methods for SCIP parameter handling
public methods for reader plugins
public methods for SCIP variables
#define SCIP_DECL_READERWRITE(x)
struct SCIP_ReaderData SCIP_READERDATA
#define SCIP_DECL_READERREAD(x)
#define SCIP_DECL_READERCOPY(x)
#define SCIP_DECL_READERFREE(x)
enum SCIP_Result SCIP_RESULT
enum SCIP_Retcode SCIP_RETCODE