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

Function p_int_in

gecode/flatzinc/registry.cpp:843–859  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

841 }
842
843 void p_int_in(FlatZincSpace& s, const ConExpr& ce, AST::Node *) {
844 IntSet d = s.arg2intset(ce[1]);
845 if (ce[0]->isBoolVar()) {
846 IntSetRanges dr(d);
847 Iter::Ranges::Singleton sr(0,1);
848 Iter::Ranges::Inter<IntSetRanges,Iter::Ranges::Singleton> i(dr,sr);
849 IntSet d01(i);
850 if (d01.size() == 0) {
851 s.fail();
852 } else {
853 rel(s, s.arg2BoolVar(ce[0]), IRT_GQ, d01.min());
854 rel(s, s.arg2BoolVar(ce[0]), IRT_LQ, d01.max());
855 }
856 } else {
857 dom(s, s.arg2IntVar(ce[0]), d);
858 }
859 }
860 void p_int_in_reif(FlatZincSpace& s, const ConExpr& ce, AST::Node *) {
861 IntSet d = s.arg2intset(ce[1]);
862 if (ce[0]->isBoolVar()) {

Callers

nothing calls this directly

Calls 10

arg2intsetMethod · 0.80
isBoolVarMethod · 0.80
arg2BoolVarMethod · 0.80
arg2IntVarMethod · 0.80
relFunction · 0.50
domFunction · 0.50
sizeMethod · 0.45
failMethod · 0.45
minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected