/** destructor of primal heuristic to free user data (called when SCIP is exiting) */ static SCIP_DECL_HEURFREE(heurFreeFixandinfer) /*lint --e{715}*/ { /*lint --e{715}*/ SCIP_HEURDATA* heurdata; /* free heuristic data */ heurdata = SCIPheurGetData(heur); assert(heurdata != NULL); SCIPfreeMemory(scip, &heurdata); SCIPheurSetData(heur, NULL); return SCIP_OKAY; }
/** destructor of primal heuristic to free user data (called when SCIP is exiting) */ static SCIP_DECL_HEURFREE(heurFreeZirounding) { /*lint --e{715}*/ SCIP_HEURDATA* heurdata; assert(strcmp(SCIPheurGetName(heur), HEUR_NAME) == 0); heurdata = SCIPheurGetData(heur); assert(heurdata != NULL); /* free heuristic data */ SCIPfreeMemory(scip, &heurdata); SCIPheurSetData(heur, NULL); return SCIP_OKAY; }
/** destructor of primal heuristic to free user data (called when SCIP is exiting) */ static SCIP_DECL_HEURFREE(heurFreeLinesearchdiving) { /*lint --e{715}*/ SCIP_HEURDATA* heurdata; assert(heur != NULL); assert(scip != NULL); /* free heuristic data */ heurdata = SCIPheurGetData(heur); assert(heurdata != NULL); SCIPfreeMemory(scip, &heurdata); SCIPheurSetData(heur, NULL); return SCIP_OKAY; }
/** deinitialization method of primal heuristic (called before transformed problem is freed) */ static SCIP_DECL_HEUREXIT(heurExitSimplerounding) /*lint --e{715}*/ { /*lint --e{715}*/ SCIP_HEURDATA* heurdata; assert(strcmp(SCIPheurGetName(heur), HEUR_NAME) == 0); /* free heuristic data */ heurdata = SCIPheurGetData(heur); assert(heurdata != NULL); SCIP_CALL( SCIPfreeSol(scip, &heurdata->sol) ); SCIPfreeMemory(scip, &heurdata); SCIPheurSetData(heur, NULL); return SCIP_OKAY; }
/* free data of the heuristic */ static SCIP_DECL_HEURFREE(heurFreeReoptsols) { SCIP_HEURDATA* heurdata; assert(scip != NULL ); assert(heur != NULL ); heurdata = SCIPheurGetData(heur); assert(heurdata != NULL ); SCIPfreeMemory(scip, &heurdata); SCIPheurSetData(heur, NULL); return SCIP_OKAY; }
/** initialization method of primal heuristic (called after problem was transformed) */ static SCIP_DECL_HEURINIT(heurInitSimplerounding) /*lint --e{715}*/ { /*lint --e{715}*/ SCIP_HEURDATA* heurdata; assert(strcmp(SCIPheurGetName(heur), HEUR_NAME) == 0); assert(SCIPheurGetData(heur) == NULL); /* create heuristic data */ SCIP_CALL( SCIPallocMemory(scip, &heurdata) ); SCIP_CALL( SCIPcreateSol(scip, &heurdata->sol, heur) ); heurdata->lastlp = -1; heurdata->nroundablevars = -1; SCIPheurSetData(heur, heurdata); return SCIP_OKAY; }
/** destructor of primal heuristic to free user data (called when SCIP is exiting) */ static SCIP_DECL_HEURFREE(heurFreeIndicator) { /*lint --e{715}*/ SCIP_HEURDATA* heurdata; assert( heur != NULL ); assert( scip != NULL ); /* get heuristic data */ heurdata = SCIPheurGetData(heur); assert( heurdata != NULL ); SCIPfreeBlockMemoryArrayNull(scip, &(heurdata->indconss), heurdata->nindconss); SCIPfreeBlockMemoryArrayNull(scip, &(heurdata->solcand), heurdata->nindconss); /* free heuristic data */ SCIPfreeMemory(scip, &heurdata); SCIPheurSetData(heur, NULL); return SCIP_OKAY; }
/** destructor of primal heuristic to free user data (called when SCIP is exiting) */ static SCIP_DECL_HEURFREE(heurFreeObj) { /*lint --e{715}*/ SCIP_HEURDATA* heurdata; heurdata = SCIPheurGetData(heur); assert(heurdata != NULL); assert(heurdata->objheur != NULL); assert(heurdata->objheur->scip_ == scip); /* call virtual method of heur object */ SCIP_CALL( heurdata->objheur->scip_free(scip, heur) ); /* free heur object */ if( heurdata->deleteobject ) delete heurdata->objheur; /* free heur data */ delete heurdata; SCIPheurSetData(heur, NULL); /*lint !e64*/ return SCIP_OKAY; }