/** includes the cip file reader in SCIP */ SCIP_RETCODE SCIPincludeReaderCip( SCIP* scip /**< SCIP data structure */ ) { SCIP_READERDATA* readerdata; SCIP_READER* reader; /* create cip reader data */ SCIP_CALL( SCIPallocMemory(scip, &readerdata) ); /* include reader */ SCIP_CALL( SCIPincludeReaderBasic(scip, &reader, READER_NAME, READER_DESC, READER_EXTENSION, readerdata) ); /* set non fundamental callbacks via setter functions */ SCIP_CALL( SCIPsetReaderCopy(scip, reader, readerCopyCip) ); SCIP_CALL( SCIPsetReaderFree(scip, reader, readerFreeCip) ); SCIP_CALL( SCIPsetReaderRead(scip, reader, readerReadCip) ); SCIP_CALL( SCIPsetReaderWrite(scip, reader, readerWriteCip) ); /* add cip reader parameters */ SCIP_CALL( SCIPaddBoolParam(scip, "reading/cipreader/writefixedvars", "should fixed and aggregated variables be printed (if not, re-parsing might fail)", &readerdata->writefixedvars, FALSE, DEFAULT_CIP_WRITEFIXEDVARS, NULL, NULL) ); return SCIP_OKAY; }
/** includes the cnf file reader in SCIP */ SCIP_RETCODE SCIPincludeReaderCnf( SCIP* scip /**< SCIP data structure */ ) { SCIP_READERDATA* readerdata; SCIP_READER* reader; /* create reader data */ readerdata = NULL; /* include reader */ SCIP_CALL( SCIPincludeReaderBasic(scip, &reader, READER_NAME, READER_DESC, READER_EXTENSION, readerdata) ); /* set non fundamental callbacks via setter functions */ SCIP_CALL( SCIPsetReaderCopy(scip, reader, readerCopyCnf) ); SCIP_CALL( SCIPsetReaderRead(scip, reader, readerReadCnf) ); /* add cnf reader parameters */ SCIP_CALL( SCIPaddBoolParam(scip, "reading/cnfreader/dynamicconss", "should model constraints be subject to aging?", NULL, FALSE, TRUE, NULL, NULL) ); SCIP_CALL( SCIPaddBoolParam(scip, "reading/cnfreader/dynamiccols", "should columns be added and removed dynamically to the LP?", NULL, FALSE, FALSE, NULL, NULL) ); SCIP_CALL( SCIPaddBoolParam(scip, "reading/cnfreader/dynamicrows", "should rows be added and removed dynamically to the LP?", NULL, FALSE, FALSE, NULL, NULL) ); SCIP_CALL( SCIPaddBoolParam(scip, "reading/cnfreader/useobj", "should an artificial objective, depending on the number of clauses a variable appears in, be used?", NULL, FALSE, FALSE, NULL, NULL) ); return SCIP_OKAY; }
/** includes the cip file reader in SCIP */ SCIP_RETCODE SCIPincludeReaderCip( SCIP* scip /**< SCIP data structure */ ) { SCIP_READERDATA* readerdata; SCIP_READER* reader; /* create reader data */ readerdata = NULL; /* include reader */ SCIP_CALL( SCIPincludeReaderBasic(scip, &reader, READER_NAME, READER_DESC, READER_EXTENSION, readerdata) ); /* set non fundamental callbacks via setter functions */ SCIP_CALL( SCIPsetReaderCopy(scip, reader, readerCopyCip) ); SCIP_CALL( SCIPsetReaderRead(scip, reader, readerReadCip) ); SCIP_CALL( SCIPsetReaderWrite(scip, reader, readerWriteCip) ); /* add cip reader parameters */ SCIP_CALL( SCIPaddBoolParam(scip, "reading/"READER_NAME"/dynamicconss", "should model constraints be subject to aging?", NULL, FALSE, TRUE, NULL, NULL) ); SCIP_CALL( SCIPaddBoolParam(scip, "reading/"READER_NAME"/dynamiccols", "should columns be added and removed dynamically to the LP?", NULL, FALSE, FALSE, NULL, NULL) ); SCIP_CALL( SCIPaddBoolParam(scip, "reading/"READER_NAME"/dynamicrows", "should rows be added and removed dynamically to the LP?", NULL, FALSE, FALSE, NULL, NULL) ); return SCIP_OKAY; }
/** includes the lp file reader in SCIP */ SCIP_RETCODE SCIPincludeReaderDiff( SCIP* scip /**< SCIP data structure */ ) { SCIP_READERDATA* readerdata = NULL; SCIP_READER* reader; /* include reader */ SCIP_CALL( SCIPincludeReaderBasic(scip, &reader, READER_NAME, READER_DESC, READER_EXTENSION, readerdata) ); /* set non fundamental callbacks via setter functions */ SCIP_CALL( SCIPsetReaderCopy(scip, reader, readerCopyDiff) ); SCIP_CALL( SCIPsetReaderFree(scip, reader, readerFreeDiff) ); SCIP_CALL( SCIPsetReaderRead(scip, reader, readerReadDiff) ); return SCIP_OKAY; }
/** includes the bpa file reader in SCIP */ SCIP_RETCODE SCIPincludeReaderBpa( SCIP* scip /**< SCIP data structure */ ) { SCIP_READERDATA* readerdata; SCIP_READER* reader; /* create binpacking reader data */ readerdata = NULL; /* include binpacking reader */ SCIP_CALL( SCIPincludeReaderBasic(scip, &reader, READER_NAME, READER_DESC, READER_EXTENSION, readerdata) ); assert(reader != NULL); SCIP_CALL( SCIPsetReaderRead(scip, reader, readerReadBpa) ); return SCIP_OKAY; }
/** includes the col file reader in SCIP */ SCIP_RETCODE SCIPincludeReaderCol( SCIP* scip /**< SCIP data structure */ ) { SCIP_READERDATA* readerdata; SCIP_READER* reader; /* create col reader data */ readerdata = NULL; /* include col reader */ SCIP_CALL( SCIPincludeReaderBasic(scip, &reader, READER_NAME, READER_DESC, READER_EXTENSION, readerdata) ); SCIP_CALL( SCIPsetReaderCopy(scip, reader, readerCopyCol) ); SCIP_CALL( SCIPsetReaderRead(scip, reader, readerReadCol) ); return SCIP_OKAY; }
/** includes the sol file reader in SCIP */ SCIP_RETCODE SCIPincludeReaderSol( SCIP* scip /**< SCIP data structure */ ) { SCIP_READERDATA* readerdata; SCIP_READER* reader; /* create reader data */ readerdata = NULL; /* include reader */ SCIP_CALL( SCIPincludeReaderBasic(scip, &reader, READER_NAME, READER_DESC, READER_EXTENSION, readerdata) ); assert(reader != NULL); /* set non fundamental callbacks via setter functions */ SCIP_CALL( SCIPsetReaderCopy(scip, reader, readerCopySol) ); SCIP_CALL( SCIPsetReaderRead(scip, reader, readerReadSol) ); return SCIP_OKAY; }
/** includes the xyz file reader in SCIP */ SCIP_RETCODE SCIPincludeReaderXyz( SCIP* scip /**< SCIP data structure */ ) { SCIP_READERDATA* readerdata; SCIP_READER* reader; /* create xyz reader data */ readerdata = NULL; /* TODO: (optional) create reader specific data here */ reader = NULL; /* include reader */ #if 0 /* use SCIPincludeReader() if you want to set all callbacks explicitly and realize (by getting compiler errors) when * new callbacks are added in future SCIP versions */ SCIP_CALL( SCIPincludeReader(scip, READER_NAME, READER_DESC, READER_EXTENSION, readerCopyXyz, readerFreeXyz, readerReadXyz, readerWriteXyz, readerdata) ); #else /* use SCIPincludeReaderBasic() plus setter functions if you want to set callbacks one-by-one and your code should * compile independent of new callbacks being added in future SCIP versions */ SCIP_CALL( SCIPincludeReaderBasic(scip, &reader, READER_NAME, READER_DESC, READER_EXTENSION, readerdata) ); assert(reader != NULL); /* set non fundamental callbacks via setter functions */ SCIP_CALL( SCIPsetReaderCopy(scip, reader, readerCopyXyz) ); SCIP_CALL( SCIPsetReaderFree(scip, reader, readerFreeXyz) ); SCIP_CALL( SCIPsetReaderRead(scip, reader, readerReadXyz) ); SCIP_CALL( SCIPsetReaderWrite(scip, reader, readerWriteXyz) ); #endif /* add xyz reader parameters */ /* TODO: (optional) add reader specific parameters with SCIPaddTypeParam() here */ return SCIP_OKAY; }
/** includes the sch file reader in SCIP */ SCIP_RETCODE SCIPincludeReaderSm( SCIP* scip /**< SCIP data structure */ ) { SCIP_READERDATA* readerdata; SCIP_READER* reader; /* create sch reader data */ readerdata = NULL; /* include sch reader */ SCIP_CALL( SCIPincludeReaderBasic(scip, &reader, READER_NAME, READER_DESC, READER_EXTENSION, readerdata) ); assert(reader != NULL); SCIP_CALL( SCIPsetReaderCopy(scip, reader, readerCopySm) ); SCIP_CALL( SCIPsetReaderRead(scip, reader, readerReadSm) ); /* add reader parameters */ SCIP_CALL( SCIPaddBoolParam(scip, "reading/"READER_NAME"/mipmodel", "create MIP model?", NULL, FALSE, FALSE, NULL, NULL) ); return SCIP_OKAY; }