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

Function p_among

gecode/flatzinc/registry.cpp:1626–1637  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1624 }
1625
1626 void p_among(FlatZincSpace& s, const ConExpr& ce, AST::Node* ann) {
1627 IntVarArgs x = s.arg2intvarargs(ce[1]);
1628 IntSet v = s.arg2intset(ce[2]);
1629 if (ce[0]->isIntVar()) {
1630 IntVar n = s.arg2IntVar(ce[0]);
1631 unshare(s, x);
1632 count(s,x,v,IRT_EQ,n,s.ann2ipl(ann));
1633 } else {
1634 unshare(s, x);
1635 count(s,x,v,IRT_EQ,ce[0]->getInt(),s.ann2ipl(ann));
1636 }
1637 }
1638
1639 void p_member_int(FlatZincSpace& s, const ConExpr& ce, AST::Node* ann) {
1640 IntVarArgs x = s.arg2intvarargs(ce[0]);

Callers

nothing calls this directly

Calls 8

unshareFunction · 0.85
arg2intvarargsMethod · 0.80
arg2intsetMethod · 0.80
isIntVarMethod · 0.80
arg2IntVarMethod · 0.80
ann2iplMethod · 0.80
getIntMethod · 0.80
countFunction · 0.50

Tested by

no test coverage detected