/** destructor of event handler to free user data (called when SCIP is exiting) */
static
SCIP_DECL_EVENTFREE(eventFreeDistributiondiving)
{
   SCIP_EVENTHDLRDATA* eventhdlrdata;

   eventhdlrdata = SCIPeventhdlrGetData(eventhdlr);
   assert(eventhdlrdata != NULL);

   SCIPfreeMemory(scip, &eventhdlrdata);
   SCIPeventhdlrSetData(eventhdlr, NULL);

   return SCIP_OKAY;
}
Пример #2
0
/** destructor of event handler to free user data (called when SCIP is exiting) */
static
SCIP_DECL_EVENTFREE(eventFreeSofttimelimit)
{  /*lint --e{715}*/
   SCIP_EVENTHDLRDATA* eventhdlrdata;

   assert(scip != NULL);
   assert(eventhdlr != NULL);
   assert(strcmp(SCIPeventhdlrGetName(eventhdlr), EVENTHDLR_NAME) == 0);

   eventhdlrdata = SCIPeventhdlrGetData(eventhdlr);
   assert(eventhdlrdata != NULL);

   SCIPfreeMemory(scip, &eventhdlrdata);
   SCIPeventhdlrSetData(eventhdlr, NULL);

   return SCIP_OKAY;
}
/** destructor of event handler to free user data (called when SCIP is exiting) */
static
SCIP_DECL_EVENTFREE(eventhdlrFreeObj)
{  /*lint --e{715}*/
   SCIP_EVENTHDLRDATA* eventhdlrdata;

   eventhdlrdata = SCIPeventhdlrGetData(eventhdlr);
   assert(eventhdlrdata != NULL);
   assert(eventhdlrdata->objeventhdlr != NULL);
   assert(eventhdlrdata->objeventhdlr->scip_ == scip);

   /* call virtual method of eventhdlr object */
   SCIP_CALL( eventhdlrdata->objeventhdlr->scip_free(scip, eventhdlr) );

   /* free eventhdlr object */
   if( eventhdlrdata->deleteobject )
      delete eventhdlrdata->objeventhdlr;

   /* free eventhdlr data */
   delete eventhdlrdata;
   SCIPeventhdlrSetData(eventhdlr, NULL); /*lint !e64*/
   
   return SCIP_OKAY;
}
Пример #4
0
/** destructor of event handler to free user data (called when SCIP is exiting) */
static
SCIP_DECL_EVENTFREE(eventhdlrFreeJava)
{  /*lint --e{715}*/
   SCIP_EVENTHDLRDATA* eventhdlrdata;

   JNIEnv* env;
   jobject jobj;
   jlong jscip;
   jlong jeventhdlr;

   eventhdlrdata = SCIPeventhdlrGetData(eventhdlr);
   assert(eventhdlrdata != NULL);
   assert(eventhdlrdata->javaeventhdlr != NULL);
   assert(eventhdlrdata->scip_free != NULL);

   jscip = (jlong) (size_t) scip;
   jeventhdlr = (jlong) (size_t) eventhdlr;

   env = eventhdlrdata->env;
   jobj = eventhdlrdata->jobj;

   /* call virtual method of eventhdlr object */
   JNISCIP_CALL( (*env)->CallIntMethod(env, jobj, eventhdlrdata->scip_free, jscip, jeventhdlr) );

   /* free eventhdlr object
    *
    * ??????????????????????????
    */
   // if( eventhdlrdata->deleteobject )
   //    delete eventhdlrdata->objeventhdlr;

   /* free eventhdlr data */
   SCIPfreeMemory(scip, &eventhdlrdata)
   SCIPeventhdlrSetData(eventhdlr, NULL); /*lint !e64*/

   return SCIP_OKAY;
}