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

Function nroot

gecode/int/arithmetic.cpp:418–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

416 }
417
418 void
419 nroot(Home home, IntVar x0, int n, IntVar x1, IntPropLevel ipl) {
420 using namespace Int;
421 Limits::positive(n,"Int::nroot");
422 GECODE_POST;
423 if (n == 2) {
424 sqrt(home, x0, x1, ipl);
425 return;
426 }
427 Arithmetic::PowOps ops(n);
428 if (vbd(ipl) == IPL_DOM) {
429 GECODE_ES_FAIL(Arithmetic::NrootDom<Arithmetic::PowOps>
430 ::post(home,x0,x1,ops));
431 } else {
432 GECODE_ES_FAIL(Arithmetic::NrootBnd<Arithmetic::PowOps>
433 ::post(home,x0,x1,ops));
434 }
435 }
436
437}
438

Callers

nothing calls this directly

Calls 2

sqrtFunction · 0.70
postFunction · 0.50

Tested by

no test coverage detected