34namespace Gecode {
namespace Float {
namespace Arithmetic {
42 template<
class A,
class B>
47 template<
class A,
class B>
51 if ((x0.min() == 0.0) && (x0.max() == 0.0))
return ES_FAILED;
57 if ((x1.min() == 0.0) && (x1.max() == 0.0)) {
65 else if (x0.max() <= 0)
78 if (!x0.assigned()) (void)
new (home)
Pow<A,B>(home,x0,x1,
n);
82 template<
class A,
class B>
87 template<
class A,
class B>
90 return new (home)
Pow<A,B>(home,*
this);
93 template<
class A,
class B>
96 if ((x0.min() == 0.0) && (x0.max() == 0.0))
return ES_FAILED;
99 if ((x1.min() == 0.0) && (x1.max() == 0.0)) {
104 if ((m_n % 2) == 0) {
107 else if (x0.max() <= 0)
112 nroot(x1.domain(),m_n),
113 -
nroot(x1.domain(),m_n)
127 template<
class A,
class B>
132 template<
class A,
class B>
143 template<
class A,
class B>
148 template<
class A,
class B>
154 template<
class A,
class B>
int p
Number of positive literals for node type.
int n
Number of negative literals for node type.
Base-class for both propagators and branchers.
Propagator for bounds consistent nth root operator
NthRoot(Space &home, NthRoot &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Create copy during cloning.
static ExecStatus post(Home home, A x0, B x1, int n)
Post propagator for .
Propagator for bounds consistent pow operator
static ExecStatus post(Home home, A x0, B x1, int n)
Post propagator for .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Create copy during cloning.
Pow(Space &home, Pow &p)
Constructor for cloning p.
Home class for posting propagators
ExecStatus ES_SUBSUMED(Propagator &p)
int ModEventDelta
Modification event deltas.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
FloatVal hull(const FloatVal &x, const FloatVal &y)
const Gecode::PropCond PC_FLOAT_BND
Propagate when minimum or maximum of a view changes.
Gecode toplevel namespace
@ ES_OK
Execution is okay.
@ ES_FIX
Propagation has computed fixpoint.
@ ES_FAILED
Execution has resulted in failure.
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n\geq 0$.
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n\geq 0$.