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

Function branch

gecode/flatzinc/branch.cpp:119–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117
118
119 void
120 branch(Home home, const IntVarArgs& x, const BoolVarArgs& y,
121 IntBoolVarBranch vars, IntValBranch vals) {
122 if (home.failed()) return;
123 vars.expand(home,x,y);
124 ViewArray<Int::IntView> xv(home,x);
125 ViewArray<Int::BoolView> yv(home,y);
126 ValSelCommitBase<Int::IntView,int>* xvsc =
127 Int::Branch::valselcommit(home,vals);
128 ValSelCommitBase<Int::BoolView,int>* yvsc =
129 Int::Branch::valselcommit(home,i2b(vals));
130 switch (vars.select()) {
131 case IntBoolVarBranch::SEL_AFC_MAX:
132 {
133 MeritMaxAFC m(home,vars);
134 IntBoolBrancher<MeritMaxAFC>::post(home,xv,yv,m,xvsc,yvsc);
135 }
136 break;
137 case IntBoolVarBranch::SEL_ACTION_MAX:
138 {
139 MeritMaxAction m(home,vars);
140 IntBoolBrancher<MeritMaxAction>::post(home,xv,yv,m,xvsc,yvsc);
141 }
142 break;
143 case IntBoolVarBranch::SEL_CHB_MAX:
144 {
145 MeritMaxCHB m(home,vars);
146 IntBoolBrancher<MeritMaxCHB>::post(home,xv,yv,m,xvsc,yvsc);
147 }
148 break;
149 case IntBoolVarBranch::SEL_AFC_SIZE_MAX:
150 {
151 MeritMaxAFCSize m(home,vars);
152 IntBoolBrancher<MeritMaxAFCSize>::post(home,xv,yv,m,xvsc,yvsc);
153 }
154 break;
155 case IntBoolVarBranch::SEL_ACTION_SIZE_MAX:
156 {
157 MeritMaxActionSize m(home,vars);
158 IntBoolBrancher<MeritMaxActionSize>::post(home,xv,yv,m,xvsc,yvsc);
159 }
160 break;
161 case IntBoolVarBranch::SEL_CHB_SIZE_MAX:
162 {
163 MeritMaxCHBSize m(home,vars);
164 IntBoolBrancher<MeritMaxCHBSize>::post(home,xv,yv,m,xvsc,yvsc);
165 }
166 break;
167 default:
168 GECODE_NEVER;
169 }
170 }
171
172}}
173

Callers 2

choiceMethod · 0.70
createBranchersMethod · 0.70

Calls 5

valselcommitFunction · 0.50
postFunction · 0.50
failedMethod · 0.45
expandMethod · 0.45
selectMethod · 0.45

Tested by

no test coverage detected