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

Function pow

gecode/int/arithmetic.cpp:399–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397 }
398
399 void
400 pow(Home home, IntVar x0, int n, IntVar x1, IntPropLevel ipl) {
401 using namespace Int;
402 Limits::nonnegative(n,"Int::pow");
403 GECODE_POST;
404 if (n == 2) {
405 sqr(home, x0, x1, ipl);
406 return;
407 }
408 Arithmetic::PowOps ops(n);
409 if (vbd(ipl) == IPL_DOM) {
410 GECODE_ES_FAIL(Arithmetic::PowDom<Arithmetic::PowOps>
411 ::post(home,x0,x1,ops));
412 } else {
413 GECODE_ES_FAIL(Arithmetic::PowBnd<Arithmetic::PowOps>
414 ::post(home,x0,x1,ops));
415 }
416 }
417
418 void
419 nroot(Home home, IntVar x0, int n, IntVar x1, IntPropLevel ipl) {

Callers 2

fnrootMethod · 0.50
cnrootMethod · 0.50

Calls 2

sqrFunction · 0.70
postFunction · 0.50

Tested by

no test coverage detected