33 #define EVENTHDLR_NAME "globalbnd" 34 #define EVENTHDLR_DESC "event handler for globalbnd event" 44 struct SCIP_EventhdlrData
66 assert(eventhdlr !=
NULL);
70 assert(eventhdlrdata !=
NULL);
85 assert(eventhdlr !=
NULL);
89 assert(eventhdlrdata !=
NULL);
100 eventhdlrdata->storebounds =
TRUE;
104 for( i = 0; i < nvars ; ++i )
120 assert(eventhdlr !=
NULL);
124 assert(eventhdlrdata !=
NULL);
127 if( eventhdlrdata->filterpos >= 0 )
130 eventhdlrdata->filterpos = -1;
148 assert(eventhdlr !=
NULL);
150 assert(event !=
NULL);
154 assert(eventhdlrdata !=
NULL);
173 if( !eventhdlrdata->storebounds )
187 newbound = (newbound - constant) / scalar;
203 eventhdlrdata =
NULL;
205 eventhdlrdata->filterpos = -1;
214 eventExecGlobalbnd, eventhdlrdata) );
215 assert(eventhdlr !=
NULL);
232 assert(eventhdlr !=
NULL);
236 assert(eventhdlrdata !=
NULL);
238 return eventhdlrdata->boundstore;
248 assert(eventhdlr !=
NULL);
252 assert(eventhdlrdata !=
NULL);
254 eventhdlrdata->storebounds =
TRUE;
264 assert(eventhdlr !=
NULL);
268 assert(eventhdlrdata !=
NULL);
270 eventhdlrdata->storebounds =
FALSE;
280 assert(eventhdlr !=
NULL);
284 assert(eventhdlrdata !=
NULL);
enum SCIP_BoundType SCIP_BOUNDTYPE
SCIP_RETCODE SCIPcatchVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
static SCIP_DECL_EVENTEXEC(eventExecGlobalbnd)
SCIP_RETCODE SCIPsetEventhdlrExit(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTEXIT((*eventexit)))
eventhdlr for storing all global bound changes
int SCIPgetNOrigVars(SCIP *scip)
void SCIPeventGlobalbndDisableBoundStorage(SCIP_EVENTHDLR *eventhdlr)
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
struct SCIP_EventhdlrData SCIP_EVENTHDLRDATA
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
int SCIPgetSubscipDepth(SCIP *scip)
enum SCIP_Retcode SCIP_RETCODE
#define SCIP_EVENTTYPE_GLBCHANGED
static SCIP_DECL_EVENTEXIT(eventExitGlobalbnd)
void SCIPeventhdlrSetData(SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTHDLRDATA *eventhdlrdata)
SCIP_Real SCIPeventGetNewbound(SCIP_EVENT *event)
#define SCIPallocMemory(scip, ptr)
SCIP_BOUNDTYPE SCIPboundtypeOpposite(SCIP_BOUNDTYPE boundtype)
SCIP_Bool SCIPsyncstoreIsInitialized(SCIP_SYNCSTORE *syncstore)
SCIP_RETCODE SCIPsetEventhdlrFree(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTFREE((*eventfree)))
void SCIPboundstoreFree(SCIP *scip, SCIP_BOUNDSTORE **boundstore)
SCIP_RETCODE SCIPincludeEventHdlrGlobalbnd(SCIP *scip)
SCIP_RETCODE SCIPboundstoreAdd(SCIP *scip, SCIP_BOUNDSTORE *boundstore, int varidx, SCIP_Real newbound, SCIP_BOUNDTYPE boundtype)
SCIP_RETCODE SCIPsetEventhdlrInit(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTINIT((*eventinit)))
void SCIPeventGlobalbndClearBoundChanges(SCIP_EVENTHDLR *eventhdlr)
the interface of the boundstore structure
void SCIPeventGlobalbndEnableBoundStorage(SCIP_EVENTHDLR *eventhdlr)
the function declarations for the synchronization store
public data structures and miscellaneous methods
SCIP_VAR * SCIPeventGetVar(SCIP_EVENT *event)
SCIP_RETCODE SCIPcatchEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
SCIP_BOUNDSTORE * SCIPeventGlobalbndGetBoundChanges(SCIP_EVENTHDLR *eventhdlr)
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
SCIP_SYNCSTORE * SCIPgetSyncstore(SCIP *scip)
int SCIPgetConcurrentVaridx(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPdropEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
static SCIP_DECL_EVENTFREE(eventFreeGlobalbnd)
#define SCIP_EVENTTYPE_GBDCHANGED
SCIP_RETCODE SCIPvarGetOrigvarSum(SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
helper functions for concurrent scip solvers
int SCIPgetNVars(SCIP *scip)
#define SCIPfreeMemory(scip, ptr)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
SCIP_RETCODE SCIPboundstoreCreate(SCIP *scip, SCIP_BOUNDSTORE **boundstore, int nvars)
#define SCIP_EVENTTYPE_GUBCHANGED
static SCIP_DECL_EVENTINIT(eventInitGlobalbnd)
SCIP_EVENTHDLRDATA * SCIPeventhdlrGetData(SCIP_EVENTHDLR *eventhdlr)
#define SCIP_EVENTTYPE_VARADDED
void SCIPboundstoreClear(SCIP_BOUNDSTORE *boundstore)