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

Method propagate

gecode/float/arithmetic/sqr-sqrt.hpp:76–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74
75 template<class VA, class VB>
76 ExecStatus
77 SqrPlus<VA,VB>::propagate(Space& home, const ModEventDelta&) {
78 if (x0 == x1) {
79 if (x0.max() < 1) GECODE_ME_CHECK(x0.eq(home,0));
80 else if (x0.min() > 0) GECODE_ME_CHECK(x0.eq(home,1));
81 if (x0.assigned())
82 return ((x0.val() == 0) || (x0.val() == 1))? home.ES_SUBSUMED(*this) : ES_FAILED;
83 } else {
84 GECODE_ME_CHECK(x0.eq(home,sqrt(x1.val())));
85 GECODE_ME_CHECK(x1.eq(home,sqr(x0.val())));
86 if (x0.assigned() || x1.assigned()) return home.ES_SUBSUMED(*this);
87 }
88
89 return ES_FIX;
90 }
91
92
93 /*

Callers

nothing calls this directly

Calls 13

ES_SUBSUMEDMethod · 0.80
sqrtFunction · 0.50
sqrFunction · 0.50
postFunction · 0.50
MinusViewClass · 0.50
hullFunction · 0.50
maxMethod · 0.45
eqMethod · 0.45
minMethod · 0.45
assignedMethod · 0.45
valMethod · 0.45
sqrt_upMethod · 0.45

Tested by

no test coverage detected