32 #define READER_NAME "lopreader" 33 #define READER_DESC "file reader for linear ordering problems" 34 #define READER_EXTENSION "lop" 63 file = fopen(filename,
"r");
79 status = fscanf(file,
"%d", n);
89 for (i = 0; i < *n; ++i)
93 for (i = 0; i < *n; ++i)
95 for (j = 0; j < *n; ++j)
98 status = fscanf(file,
"%lf", &val);
118 const char* filename,
128 while ( filename[i] != 0)
133 while ((i > 0) && (filename[i] !=
'.') && (filename[i] !=
'/') && (filename[i] !=
'\\'))
137 if (filename[i] ==
'.')
140 while ((i > 0) && (filename[i] !=
'/') && (filename[i] !=
'\\'))
145 if ((filename[i] ==
'/') || (filename[i] ==
'\\'))
149 while ( (i < l) && (filename[i] != 0) )
151 probname[j++] = filename[i++];
180 assert( result !=
NULL );
203 for (i = 0; i < n; ++i)
206 for (j = 0; j < n; ++j)
221 SCIP_CALL(
SCIPcreateConsLOP(
scip, &cons,
"LOP", n, vars,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
234 for (i = 0; i < n; ++i)
236 for (j = 0; j < n; ++j)
271 assert( reader !=
NULL );
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
SCIP_RETCODE SCIPcreateConsLOP(SCIP *scip, SCIP_CONS **cons, const char *name, int n, SCIP_VAR ***vars, 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 SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
static SCIP_RETCODE LOPreadFile(SCIP *scip, const char *filename, int *n, SCIP_Real ***W)
int SCIPsnprintf(char *t, int len, const char *s,...)
enum SCIP_Retcode SCIP_RETCODE
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
SCIP_RETCODE SCIPcreateProbBasic(SCIP *scip, const char *name)
SCIP_RETCODE SCIPsetObjsense(SCIP *scip, SCIP_OBJSENSE objsense)
SCIP_RETCODE SCIPincludeReaderLOP(SCIP *scip)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
constraint handler for linear ordering constraints
SCIP_RETCODE SCIPprintOrigProblem(SCIP *scip, FILE *file, const char *extension, SCIP_Bool genericnames)
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)
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 SCIPaddVar(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
static SCIP_DECL_READERREAD(LOPreaderRead)
SCIP_RETCODE SCIPsetReaderRead(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
linear ordering file reader
static SCIP_RETCODE getProblemName(const char *filename, char *probname, int maxSize)