94 #define READER_NAME "bpareader" 95 #define READER_DESC "file reader for binpacking data format" 96 #define READER_EXTENSION "bpa" 138 sprintf(name,
"++ uninitialized ++");
150 nread = sscanf(buffer, format, name);
172 nread = sscanf(buffer,
"%d %d %d\n", &capacity, &nitems, &bestsolvalue);
179 SCIPdebugMsg(
scip,
"capacity = <%d>, number of items = <%d>, best known solution = <%d>\n", capacity, nitems, bestsolvalue);
199 nread = sscanf(buffer,
"%d\n", &weight);
208 weights[nweights] = weight;
209 ids[nweights] = nweights;
212 if( nweights == nitems )
216 if( nweights < nitems )
218 SCIPwarningMessage(
scip,
"set nitems from <%d> to <%d> since the file <%s> only contains <%d> weights\n", nitems, weights, filename, weights);
261 assert(reader !=
NULL);
SCIP_RETCODE SCIPincludeReaderBpa(SCIP *scip)
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE SCIPprobdataCreate(SCIP *scip, const char *probname, int *ids, SCIP_Longint *weights, int nitems, SCIP_Longint capacity)
#define SCIPfreeBufferArray(scip, ptr)
Constraint handler for the set partitioning / packing / covering constraints .
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
SCIP_FILE * SCIPfopen(const char *path, const char *mode)
int SCIPfeof(SCIP_FILE *stream)
struct SCIP_File SCIP_FILE
char * SCIPfgets(char *s, int size, SCIP_FILE *stream)
#define SCIPallocBufferArray(scip, ptr, num)
struct SCIP_ReaderData SCIP_READERDATA
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)
Problem data for binpacking problem.
Binpacking problem reader file reader.
static SCIP_DECL_READERREAD(readerReadBpa)
SCIP_RETCODE SCIPsetReaderRead(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
int SCIPfclose(SCIP_FILE *fp)