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

Function branch

gecode/set/ldsb.cpp:137–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135 using namespace Set::LDSB;
136
137 void
138 branch(Home home, const SetVarArgs& x,
139 SetVarBranch vars, SetValBranch vals,
140 const Symmetries& syms,
141 SetBranchFilter bf,
142 SetVarValPrint vvp) {
143 using namespace Set;
144 if (home.failed()) return;
145 vars.expand(home,x);
146 ViewArray<SetView> xv(home,x);
147 ViewSel<SetView>* vs[1] = {
148 Branch::viewsel(home,vars)
149 };
150
151 // Construct mapping from each variable in the array to its index
152 // in the array.
153 VariableMap variableMap;
154 for (int i = 0 ; i < x.size() ; i++)
155 variableMap[x[i].varimp()] = i;
156
157 // Convert the modelling-level Symmetries object into an array of
158 // SymmetryImp objects.
159 int n = syms.size();
160 SymmetryImp<SetView>** array =
161 static_cast<Space&>(home).alloc<SymmetryImp<SetView>* >(n);
162 for (int i = 0 ; i < n ; i++) {
163 array[i] = createSetSym(home, syms[i], variableMap);
164 }
165
166 postldsbsetbrancher<SetView,1,int,2>
167 (home,xv,vs,Branch::valselcommit(home,vals),array,n,bf,vvp);
168 }
169
170 void
171 branch(Home home, const SetVarArgs& x,

Callers 15

runMethod · 0.50
runMethod · 0.50
QueensMethod · 0.50
HammingMethod · 0.50
setupMethod · 0.50
setupMethod · 0.50
setupMethod · 0.50
setupMethod · 0.50
setupMethod · 0.50
setupMethod · 0.50
setupMethod · 0.50
setupMethod · 0.50

Calls 9

createSetSymFunction · 0.85
SET_VAR_NONEFunction · 0.85
viewselFunction · 0.50
valselcommitFunction · 0.50
failedMethod · 0.45
expandMethod · 0.45
sizeMethod · 0.45
varimpMethod · 0.45
selectMethod · 0.45

Tested by 2

mainFunction · 0.40
TestSpaceMethod · 0.40