/** 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; }
/** frees constraint data and releases all constraints in conjunction */ static SCIP_RETCODE consdataFree( SCIP* scip, /**< SCIP data structure */ SCIP_CONSDATA** consdata /**< pointer to constraint data */ ) { int c; assert(consdata != NULL); assert(*consdata != NULL); /* release constraints */ for( c = 0; c < (*consdata)->nconss; ++c ) { SCIP_CALL( SCIPreleaseCons(scip, &(*consdata)->conss[c]) ); } /* free memory */ SCIPfreeBlockMemoryArrayNull(scip, &(*consdata)->conss, (*consdata)->consssize); SCIPfreeBlockMemory(scip, consdata); return SCIP_OKAY; }