/** creates the binpacking variable pricer and includes it in SCIP */ SCIP_RETCODE SCIPincludePricerBinpacking( SCIP* scip /**< SCIP data structure */ ) { SCIP_PRICERDATA* pricerdata; /* create binpacking variable pricer data */ SCIP_CALL(SCIPallocMemory(scip, &pricerdata)); pricerdata->conshdlr = SCIPfindConshdlr(scip, "samediff"); assert(pricerdata->conshdlr != NULL); pricerdata->conss = NULL; pricerdata->weights = NULL; pricerdata->ids = NULL; pricerdata->nitems = 0; pricerdata->capacities = NULL; pricerdata->values=NULL; pricerdata->nbins = 0; pricerdata->binids = NULL; /* include variable pricer */ SCIP_CALL(SCIPincludePricer(scip, PRICER_NAME, PRICER_DESC, PRICER_PRIORITY, PRICER_DELAY, pricerCopyBinpacking, pricerFreeBinpacking, pricerInitBinpacking, pricerExitBinpacking, pricerInitsolBinpacking, pricerExitsolBinpacking, pricerRedcostBinpacking, pricerFarkasBinpacking, pricerdata)); /* add binpacking variable pricer parameters */ /* TODO: (optional) add variable pricer specific parameters with SCIPaddTypeParam() here */ return SCIP_OKAY; }
/** creates the xyz variable pricer and includes it in SCIP */ SCIP_RETCODE SCIPincludePricerXyz( SCIP* scip /**< SCIP data structure */ ) { SCIP_PRICERDATA* pricerdata; SCIP_PRICER* pricer; /* create xyz variable pricer data */ pricerdata = NULL; /* TODO: (optional) create variable pricer specific data here */ pricer = NULL; /* include variable pricer */ #if 0 /* use SCIPincludePricer() 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( SCIPincludePricer(scip, PRICER_NAME, PRICER_DESC, PRICER_PRIORITY, PRICER_DELAY, pricerCopyXyz, pricerFreeXyz, pricerInitXyz, pricerExitXyz, pricerInitsolXyz, pricerExitsolXyz, pricerRedcostXyz, pricerFarkasXyz, pricerdata) ); #else /* use SCIPincludePricerBasic() 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( SCIPincludePricerBasic(scip, &pricer, PRICER_NAME, PRICER_DESC, PRICER_PRIORITY, PRICER_DELAY, pricerRedcostXyz, pricerFarkasXyz, pricerdata) ); assert(pricer != NULL); /* set non fundamental callbacks via setter functions */ SCIP_CALL( SCIPsetPricerCopy(scip, pricer, pricerCopyXyz) ); SCIP_CALL( SCIPsetPricerFree(scip, pricer, pricerFreeXyz) ); SCIP_CALL( SCIPsetPricerInit(scip, pricer, pricerInitXyz) ); SCIP_CALL( SCIPsetPricerExit(scip, pricer, pricerExitXyz) ); SCIP_CALL( SCIPsetPricerInitsol(scip, pricer, pricerInitsolXyz) ); SCIP_CALL( SCIPsetPricerExitsol(scip, pricer, pricerExitsolXyz) ); #endif /* add xyz variable pricer parameters */ /* TODO: (optional) add variable pricer specific parameters with SCIPaddTypeParam() here */ return SCIP_OKAY; }