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

Function prop_pow_bnd

gecode/int/arithmetic/pow.hpp:121–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119
120 template<class Ops>
121 inline ExecStatus
122 prop_pow_bnd(Space& home, IntView x0, IntView x1, const Ops& ops) {
123 assert((x0.min() < 0) && (0 < x0.max()));
124 if (ops.even()) {
125 assert(x1.min() >= 0);
126 int u = ops.fnroot(x1.max());
127 GECODE_ME_CHECK(x0.lq(home,u));
128 GECODE_ME_CHECK(x0.gq(home,-u));
129 GECODE_ME_CHECK(x1.lq(home,std::max(ops.pow(x0.max()),
130 ops.pow(-x0.min()))));
131 } else {
132 assert((x1.min() < 0) && (0 < x1.max()));
133 GECODE_ME_CHECK(x0.lq(home,ops.fnroot(x1.max())));
134 GECODE_ME_CHECK(x0.gq(home,-ops.fnroot(-x1.min())));
135 GECODE_ME_CHECK(x1.lq(home,ops.pow(x0.max())));
136 GECODE_ME_CHECK(x1.gq(home,ops.pow(x0.min())));
137 }
138 return ES_OK;
139 }
140
141 template<class Ops>
142 forceinline

Callers

nothing calls this directly

Calls 8

evenMethod · 0.80
fnrootMethod · 0.80
maxFunction · 0.50
minMethod · 0.45
maxMethod · 0.45
lqMethod · 0.45
gqMethod · 0.45
powMethod · 0.45

Tested by

no test coverage detected