Example #1
0
/** output method of display column to output file stream 'file' */
static
SCIP_DECL_DISPOUTPUT(SCIPdispOutputSolfound)
{  /*lint --e{715}*/
   SCIP* origprob;
   SCIP_SOL* sol;
   SCIP_DISPDATA* dispdata;

   /* get original problem */
   origprob = GCGpricerGetOrigprob(scip);
   assert(origprob != NULL);

   assert(disp != NULL);
   assert(strcmp(SCIPdispGetName(disp), DISP_NAME_SOLFOUND) == 0);
   assert(scip != NULL);

   sol = SCIPgetBestSol(scip);
   if( sol == NULL )
      SCIPdispSetData(disp, NULL);

   dispdata = SCIPdispGetData(disp);
   if( sol != (SCIP_SOL*)dispdata )
   {
      SCIPinfoMessage(scip, file, "%c%c",
            GCGrelaxGetProbingheur(origprob) == NULL ? '*' : SCIPheurGetDispchar(GCGrelaxGetProbingheur(origprob)),
            SCIPgetSolHeur(scip, sol) == NULL ? '*' : SCIPheurGetDispchar(SCIPgetSolHeur(scip, sol)));
      SCIPdispSetData(disp, (SCIP_DISPDATA*)sol);
   }
   else
      SCIPinfoMessage(scip, file, "  ");

   return SCIP_OKAY;
}
Example #2
0
/** destructor of display column to free user data (called when SCIP is exiting) */
static
SCIP_DECL_DISPFREE(dispFreeObj)
{  /*lint --e{715}*/
   SCIP_DISPDATA* dispdata;

   dispdata = SCIPdispGetData(disp);
   assert(dispdata != NULL);
   assert(dispdata->objdisp != NULL);
   assert(dispdata->objdisp->scip_ == scip);

   /* call virtual method of display column object */
   SCIP_CALL( dispdata->objdisp->scip_free(scip, disp) );

   /* free display column object */
   if( dispdata->deleteobject )
      delete dispdata->objdisp;

   /* free display column data */
   delete dispdata;
   SCIPdispSetData(disp, NULL); /*lint !e64*/
   
   return SCIP_OKAY;
}