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

Function p_global_cardinality_closed

gecode/flatzinc/registry.cpp:1047–1065  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1045 }
1046
1047 void p_global_cardinality_closed(FlatZincSpace& s, const ConExpr& ce,
1048 AST::Node* ann) {
1049 IntVarArgs iv0 = s.arg2intvarargs(ce[0]);
1050 IntArgs cover = s.arg2intargs(ce[1]);
1051 IntVarArgs iv1 = s.arg2intvarargs(ce[2]);
1052 IntPropLevel ipl = s.ann2ipl(ann);
1053 if (ipl==IPL_DEF)
1054 ipl=IPL_BND;
1055 if (ipl==IPL_DOM) {
1056 IntVarArgs allvars = iv0+iv1;
1057 unshare(s, allvars);
1058 count(s, allvars.slice(0,1,iv0.size()),
1059 allvars.slice(iv0.size(),1,iv1.size()),
1060 cover, ipl);
1061 } else {
1062 unshare(s, iv0);
1063 count(s, iv0, iv1, cover, ipl);
1064 }
1065 }
1066
1067 void p_global_cardinality_low_up(FlatZincSpace& s, const ConExpr& ce,
1068 AST::Node* ann) {

Callers

nothing calls this directly

Calls 7

unshareFunction · 0.85
arg2intvarargsMethod · 0.80
arg2intargsMethod · 0.80
ann2iplMethod · 0.80
countFunction · 0.50
sliceMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected