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

Function valselcommit

gecode/int/branch/val-sel-commit.cpp:38–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36namespace Gecode { namespace Int { namespace Branch {
37
38 ValSelCommitBase<IntView,int>*
39 valselcommit(Space& home, const IntValBranch& ivb) {
40 assert((ivb.select() != IntValBranch::SEL_VALUES_MIN) &&
41 (ivb.select() != IntValBranch::SEL_VALUES_MAX));
42 switch (ivb.select()) {
43 case IntValBranch::SEL_MIN:
44 return new (home)
45 ValSelCommit<ValSelMin<IntView>,ValCommitEq<IntView> >(home,ivb);
46 case IntValBranch::SEL_MED:
47 return new (home)
48 ValSelCommit<ValSelMed<IntView>,ValCommitEq<IntView> >(home,ivb);
49 case IntValBranch::SEL_MAX:
50 return new (home)
51 ValSelCommit<ValSelMax<IntView>,ValCommitEq<IntView> >(home,ivb);
52 case IntValBranch::SEL_RND:
53 return new (home)
54 ValSelCommit<ValSelRnd<IntView>,ValCommitEq<IntView> >(home,ivb);
55 case IntValBranch::SEL_SPLIT_MIN:
56 return new (home)
57 ValSelCommit<ValSelAvg<IntView>,ValCommitLq<IntView> >(home,ivb);
58 case IntValBranch::SEL_SPLIT_MAX:
59 return new (home)
60 ValSelCommit<ValSelAvg<IntView>,ValCommitGr<IntView> >(home,ivb);
61 case IntValBranch::SEL_RANGE_MIN:
62 return new (home)
63 ValSelCommit<ValSelRangeMin,ValCommitLq<IntView> >(home,ivb);
64 case IntValBranch::SEL_RANGE_MAX:
65 return new (home)
66 ValSelCommit<ValSelRangeMax,ValCommitGq<IntView> >(home,ivb);
67 case IntValBranch::SEL_VAL_COMMIT:
68 if (!ivb.commit()) {
69 return new (home)
70 ValSelCommit<ValSelFunction<IntView>,ValCommitEq<IntView> >(home,ivb);
71 } else {
72 return new (home)
73 ValSelCommit<ValSelFunction<IntView>,ValCommitFunction<IntView> >(home,ivb);
74 }
75 default:
76 throw UnknownBranching("Int::branch");
77 }
78 }
79
80 ValSelCommitBase<IntView,int>*
81 valselcommit(Space& home, const IntAssign& ia) {

Callers 3

branchFunction · 0.50
branchFunction · 0.50
assignFunction · 0.50

Calls 2

selectMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected