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

Function p_int_set_channel

gecode/flatzinc/registry.cpp:2101–2118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2099 }
2100
2101 void p_int_set_channel(FlatZincSpace& s, const ConExpr& ce,
2102 AST::Node *) {
2103 int xoff=ce[1]->getInt();
2104 assert(xoff >= 0);
2105 int yoff=ce[3]->getInt();
2106 assert(yoff >= 0);
2107 IntVarArgs xv = s.arg2intvarargs(ce[0], xoff);
2108 SetVarArgs yv = s.arg2setvarargs(ce[2], yoff, 1, IntSet(0, xoff-1));
2109 IntSet xd(yoff,yv.size()-1);
2110 for (int i=xoff; i<xv.size(); i++) {
2111 dom(s, xv[i], xd);
2112 }
2113 IntSet yd(xoff,xv.size()-1);
2114 for (int i=yoff; i<yv.size(); i++) {
2115 dom(s, yv[i], SRT_SUB, yd);
2116 }
2117 channel(s,xv,yv);
2118 }
2119
2120 void p_range(FlatZincSpace& s, const ConExpr& ce, AST::Node*) {
2121 int xoff=ce[1]->getInt();

Callers

nothing calls this directly

Calls 7

IntSetClass · 0.85
getIntMethod · 0.80
arg2intvarargsMethod · 0.80
arg2setvarargsMethod · 0.80
domFunction · 0.50
channelFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected