MCPcopy Create free account
hub / github.com/Gecode/gecode / branch

Function branch

gecode/int/branch.cpp:38–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36namespace Gecode {
37
38 void
39 branch(Home home, const IntVarArgs& x,
40 IntVarBranch vars, IntValBranch vals,
41 IntBranchFilter bf,
42 IntVarValPrint vvp) {
43 using namespace Int;
44 if (home.failed()) return;
45 vars.expand(home,x);
46 ViewArray<IntView> xv(home,x);
47 ViewSel<IntView>* vs[1] = {
48 Branch::viewsel(home,vars)
49 };
50 switch (vals.select()) {
51 case IntValBranch::SEL_VALUES_MIN:
52 Branch::postviewvaluesbrancher<1,true>(home,xv,vs,bf,vvp);
53 break;
54 case IntValBranch::SEL_VALUES_MAX:
55 Branch::postviewvaluesbrancher<1,false>(home,xv,vs,bf,vvp);
56 break;
57 default:
58 postviewvalbrancher<IntView,1,int,2>
59 (home,xv,vs,Branch::valselcommit(home,vals),bf,vvp);
60 break;
61 }
62 }
63
64 void
65 branch(Home home, const IntVarArgs& x,

Callers

nothing calls this directly

Calls 8

INT_VAR_NONEFunction · 0.85
BOOL_VAR_NONEFunction · 0.85
assignFunction · 0.70
viewselFunction · 0.50
valselcommitFunction · 0.50
failedMethod · 0.45
expandMethod · 0.45
selectMethod · 0.45

Tested by

no test coverage detected