MCPcopy Create free account
hub / github.com/Gecode/gecode / ExecStatus prop_nroot_plus_bnd

Function ExecStatus prop_nroot_plus_bnd

gecode/int/arithmetic/nroot.hpp:47–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45
46 template<class Ops, bool minus>
47 forceinline ExecStatus
48 prop_nroot_plus_bnd(Space& home, IntView x0, IntView x1, const Ops& ops) {
49 if (minus) {
50 bool mod;
51 do {
52 mod = false;
53 {
54 ModEvent me = x1.gq(home,-ops.cnroot(-x0.min()));
55 if (me_failed(me)) return ES_FAILED;
56 mod |= me_modified(me);
57 }
58 {
59 ModEvent me = x1.lq(home,-ops.cnroot(-x0.max()));
60 if (me_failed(me)) return ES_FAILED;
61 mod |= me_modified(me);
62 }
63 {
64 ModEvent me = x0.gq(home,-ops.tpow(-x1.min()));
65 if (me_failed(me)) return ES_FAILED;
66 mod |= me_modified(me);
67 }
68 {
69 ModEvent me = x0.lq(home,-(ops.tpow(-x1.max()-1)+1));
70 if (me_failed(me)) return ES_FAILED;
71 mod |= me_modified(me);
72 }
73 } while (mod);
74 } else {
75 bool mod;
76 do {
77 mod = false;
78 {
79 ModEvent me = x1.lq(home,ops.fnroot(x0.max()));
80 if (me_failed(me)) return ES_FAILED;
81 mod |= me_modified(me);
82 }
83 {
84 ModEvent me = x1.gq(home,ops.fnroot(x0.min()));
85 if (me_failed(me)) return ES_FAILED;
86 mod |= me_modified(me);
87 }
88 {
89 ModEvent me = x0.le(home,ops.tpow(x1.max()+1));
90 if (me_failed(me)) return ES_FAILED;
91 mod |= me_modified(me);
92 }
93 {
94 ModEvent me = x0.gq(home,ops.tpow(x1.min()));
95 if (me_failed(me)) return ES_FAILED;
96 mod |= me_modified(me);
97 }
98 } while (mod);
99 }
100 return ES_OK;
101 }
102
103 template<class Ops, bool minus>
104 forceinline

Callers

nothing calls this directly

Calls 10

me_failedFunction · 0.85
me_modifiedFunction · 0.85
cnrootMethod · 0.80
tpowMethod · 0.80
fnrootMethod · 0.80
gqMethod · 0.45
minMethod · 0.45
lqMethod · 0.45
maxMethod · 0.45
leMethod · 0.45

Tested by

no test coverage detected