/** creates the multi-aggregated branching rule and includes it in SCIP */ SCIP_RETCODE SCIPincludeBranchruleStp( SCIP* scip /**< SCIP data structure */ ) { SCIP_BRANCHRULEDATA* branchruledata; SCIP_BRANCHRULE* branchrule; /* create stp branching rule data */ SCIP_CALL( SCIPallocMemory(scip, &branchruledata) ); branchruledata->lastcand = 0; /* include branching rule */ SCIP_CALL( SCIPincludeBranchruleBasic(scip, &branchrule, BRANCHRULE_NAME, BRANCHRULE_DESC, BRANCHRULE_PRIORITY, BRANCHRULE_MAXDEPTH, BRANCHRULE_MAXBOUNDDIST, branchruledata) ); assert(branchrule != NULL); /* set non fundamental callbacks via setter functions */ SCIP_CALL( SCIPsetBranchruleCopy(scip, branchrule, branchCopyStp) ); SCIP_CALL( SCIPsetBranchruleFree(scip, branchrule, branchFreeStp) ); SCIP_CALL( SCIPsetBranchruleInit(scip, branchrule, branchInitStp) ); SCIP_CALL( SCIPsetBranchruleExit(scip, branchrule, branchExitStp) ); SCIP_CALL( SCIPsetBranchruleExecLp(scip, branchrule, branchExeclpStp) ); return SCIP_OKAY; }
/** creates the myfullstrong branching rule and includes it in SCIP */ SCIP_RETCODE SCIPincludeBranchruleMyfullstrong( SCIP* scip /**< SCIP data structure */ ) { SCIP_BRANCHRULEDATA* branchruledata; SCIP_BRANCHRULE* branchrule; /* create myfullstrong branching rule data */ SCIP_CALL( SCIPallocMemory(scip, &branchruledata) ); /* TODO: (optional) create branching rule specific data here */ /* include branching rule */ SCIP_CALL( SCIPincludeBranchruleBasic(scip, &branchrule, BRANCHRULE_NAME, BRANCHRULE_DESC, BRANCHRULE_PRIORITY, BRANCHRULE_MAXDEPTH, BRANCHRULE_MAXBOUNDDIST, branchruledata) ); assert(branchrule != NULL); /* set non fundamental callbacks via setter functions */ SCIP_CALL( SCIPsetBranchruleCopy(scip, branchrule, branchCopyMyfullstrong) ); SCIP_CALL( SCIPsetBranchruleFree(scip, branchrule, branchFreeMyfullstrong) ); SCIP_CALL( SCIPsetBranchruleInit(scip, branchrule, branchInitMyfullstrong) ); SCIP_CALL( SCIPsetBranchruleExit(scip, branchrule, branchExitMyfullstrong) ); SCIP_CALL( SCIPsetBranchruleExecPs(scip, branchrule, branchExecpsMyfullstrong) ); #if 0 SCIP_CALL( SCIPsetBranchruleInitsol(scip, branchrule, branchInitsolMyfullstrong) ); SCIP_CALL( SCIPsetBranchruleExitsol(scip, branchrule, branchExitsolMyfullstrong) ); SCIP_CALL( SCIPsetBranchruleExecExt(scip, branchrule, branchExecextMyfullstrong) ); SCIP_CALL( SCIPsetBranchruleExecLp(scip, branchrule, branchExeclpMyfullstrong) ); #endif return SCIP_OKAY; }