Пример #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;
}
Пример #2
0
/** returns the display column object for the given display column */
scip::ObjDisp* SCIPgetObjDisp(
   SCIP*                 scip,               /**< SCIP data structure */
   SCIP_DISP*            disp                /**< display column */
   )
{
   SCIP_DISPDATA* dispdata;

   dispdata = SCIPdispGetData(disp);
   assert(dispdata != NULL);

   return dispdata->objdisp;
}
Пример #3
0
/** output method of display column to output file stream 'file' */
static
SCIP_DECL_DISPOUTPUT(dispOutputObj)
{  /*lint --e{715}*/
   SCIP_DISPDATA* dispdata;

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

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

   return SCIP_OKAY;
}
Пример #4
0
/** solving process deinitialization method of display column (called before branch and bound process data is freed) */
static
SCIP_DECL_DISPEXITSOL(dispExitsolObj)
{  /*lint --e{715}*/
   SCIP_DISPDATA* dispdata;

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

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

   return SCIP_OKAY;
}
Пример #5
0
/** initialization method of display column (called after problem was transformed) */
static
SCIP_DECL_DISPINIT(dispInitObj)
{  /*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_init(scip, disp) );

   return SCIP_OKAY;
}
Пример #6
0
/** returns the display column object of the given name, or 0 if not existing */
scip::ObjDisp* SCIPfindObjDisp(
   SCIP*                 scip,               /**< SCIP data structure */
   const char*           name                /**< name of display column */
   )
{
   SCIP_DISP* disp;
   SCIP_DISPDATA* dispdata;

   disp = SCIPfindDisp(scip, name);
   if( disp == NULL )
      return 0;

   dispdata = SCIPdispGetData(disp);
   assert(dispdata != NULL);

   return dispdata->objdisp;
}
Пример #7
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;
}
Пример #8
0
/** copy method for display column plugins (called when SCIP copies plugins) */
static
SCIP_DECL_DISPCOPY(dispCopyObj)
{  /*lint --e{715}*/
   SCIP_DISPDATA* dispdata;
   
   assert(scip != NULL);
   
   dispdata = SCIPdispGetData(disp);
   assert(dispdata != NULL);
   assert(dispdata->objdisp != NULL);
   assert(dispdata->objdisp->scip_ != scip);

   if( dispdata->objdisp->iscloneable() )
   {
      scip::ObjDisp*  newobjdisp;
      newobjdisp = dynamic_cast<scip::ObjDisp*> (dispdata->objdisp->clone(scip));

      /* call include method of display column object */
      SCIP_CALL( SCIPincludeObjDisp(scip, newobjdisp, TRUE) );
   }

   return SCIP_OKAY;
}