/** constraint activation notification method of constraint handler */ static SCIP_DECL_CONSACTIVE(consActiveSamediff) { /*lint --e{715}*/ SCIP_CONSDATA* consdata; assert(scip != NULL); assert(strcmp(SCIPconshdlrGetName(conshdlr), CONSHDLR_NAME) == 0); assert(cons != NULL); consdata = SCIPconsGetData(cons); assert(consdata != NULL); assert(consdata->npropagatedvars <= SCIPprobdataGetNVars(SCIPgetProbData(scip))); SCIPdebugMessage("activate constraint <%s> at node <%"SCIP_LONGINT_FORMAT"> in depth <%d>: ", SCIPconsGetName(cons), SCIPnodeGetNumber(consdata->node), SCIPnodeGetDepth(consdata->node)); SCIPdebug( consdataPrint(scip, consdata, NULL) ); if( consdata->npropagatedvars != SCIPprobdataGetNVars(SCIPgetProbData(scip)) ) { SCIPdebugMessage("-> mark constraint to be repropagated\n"); consdata->propagated = FALSE; SCIP_CALL( SCIPrepropagateNode(scip, consdata->node) ); } return SCIP_OKAY; }
/** adds a bound change on an original variable found by propagation in the original problem * to the given origbranch constraint so that it will be transferred to the master problem */ SCIP_RETCODE GCGconsOrigbranchAddPropBoundChg( SCIP* scip, /**< SCIP data structure */ SCIP_CONS* cons, /**< origbranch constraint to which the bound change is added */ SCIP_VAR* var, /**< variable on which the bound change was performed */ SCIP_BOUNDTYPE boundtype, /**< bound type of the bound change */ SCIP_Real newbound /**< new bound of the variable after the bound change */ ) { SCIP_CONSDATA* consdata; assert(scip != NULL); assert(cons != NULL); assert(var != NULL); consdata = SCIPconsGetData(cons); assert(consdata != NULL); /* realloc the arrays, if needed */ if( consdata->npropbounds >= consdata->maxpropbounds ) { consdata->maxpropbounds = consdata->npropbounds+5; SCIP_CALL( SCIPreallocMemoryArray(scip, &(consdata->propvars), consdata->maxpropbounds) ); SCIP_CALL( SCIPreallocMemoryArray(scip, &(consdata->propboundtypes), consdata->maxpropbounds) ); SCIP_CALL( SCIPreallocMemoryArray(scip, &(consdata->propbounds), consdata->maxpropbounds) ); } SCIPdebugMessage("Bound change stored at branch orig constraint: <%s>.\n", SCIPconsGetName(cons)); /* store the new bound change */ consdata->propvars[consdata->npropbounds] = var; consdata->propboundtypes[consdata->npropbounds] = boundtype; consdata->propbounds[consdata->npropbounds] = newbound; consdata->npropbounds++; /* mark the corresponding master node to be repropagated */ if( consdata->mastercons != NULL ) { SCIP_CALL( SCIPrepropagateNode(GCGrelaxGetMasterprob(scip), GCGconsMasterbranchGetNode(consdata->mastercons)) ); } return SCIP_OKAY; }