43 #define I0_PI_2I FloatVal(0,pi_half_upper())
44 #define IPI_2_PII FloatVal(pi_half_lower(),pi_upper())
45 #define IPI_3PI_2I FloatVal(pi_lower(),3*pi_half_upper())
46 #define I3PI_2_2PII FloatVal(3*pi_half_lower(),pi_twice_upper())
47 #define POS(X) ((I0_PI_2I.in(X))?0: (IPI_2_PII.in(X))?1: (IPI_3PI_2I.in(X))?2: 3 )
48 #define ASININF_DOWN r.asin_down(aSinIv.min())
49 #define ASINSUP_UP r.asin_up(aSinIv.max())
55 switch (
POS(iv_min) )
82 switch (
POS(iv_max) )
118 template<
class A,
class B>
125 if (
x0.min() < 0) n_min-=2;
126 if (
x0.max() < 0) n_max-=2;
132 if (n_iv_min > n_iv_max)
return ES_FAILED;
138 template<
class A,
class B>
143 template<
class A,
class B>
159 template<
class A,
class B>
164 template<
class A,
class B>
167 return new (home)
Sin<A,B>(home,*
this);
170 template<
class A,
class B>
182 template<
class A,
class B>
190 if (x0Trans.
min() < 0) n_min-=2;
191 if (x0Trans.
max() < 0) n_max-=2;
197 if (n_iv_min > n_iv_max)
return ES_FAILED;
203 template<
class A,
class B>
208 template<
class A,
class B>
229 template<
class A,
class B>
234 template<
class A,
class B>
237 return new (home)
Cos<A,B>(home,*
this);
240 template<
class A,
class B>
Base-class for both propagators and branchers.
friend FloatVal max(const FloatVal &x, const FloatVal &y)
friend FloatVal min(const FloatVal &x, const FloatVal &y)
static FloatVal pi_half(void)
Return .
Floating point rounding policy.
FloatNum sin_down(FloatNum x)
Return lower bound of sine of x (domain: ).
FloatNum sub_up(FloatNum x, FloatNum y)
Return upper bound of x minus y (domain: ).
FloatNum add_up(FloatNum x, FloatNum y)
Return upper bound of x plus y (domain: ).
FloatNum sub_down(FloatNum x, FloatNum y)
Return lower bound of x minus y (domain: ).
FloatNum div_up(FloatNum x, FloatNum y)
Return upper bound of x divided y (domain: ).
FloatNum mul_down(FloatNum x, FloatNum y)
Return lower bound of x times y (domain: ).
FloatNum sin_up(FloatNum x)
Return upper bound of sine of x (domain: ).
FloatNum add_down(FloatNum x, FloatNum y)
Return lower bound of x plus y (domain: ).
static ExecStatus dopropagate(Space &home, A x0, B x1)
Perform actual propagation.
static ExecStatus post(Home home, A x0, B x1)
Post propagator for .
Cos(Space &home, Cos &p)
Constructor for cloning p.
virtual Actor * copy(Space &home)
Create copy during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus dopropagate(Space &home, A x0, B x1)
Perform actual propagation.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, A x0, B x1)
Post propagator for .
virtual Actor * copy(Space &home)
Create copy during cloning.
Sin(Space &home, Sin &p)
Constructor for cloning p.
Home class for posting propagators
MixBinaryPropagator(Space &home, MixBinaryPropagator &p)
ExecStatus ES_SUBSUMED(Propagator &p)
Propagator p is subsumed
int ModEventDelta
Modification event deltas.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
#define GECODE_ME_CHECK_MODIFIED(modified, me)
Check whether me is failed or modified, and forward failure.
double FloatNum
Floating point number base type.
Trigonometric propagators
void aSinProject(Rounding &r, const V &aSinIv, FloatNum &iv_min, FloatNum &iv_max, int &n_min, int &n_max)
const Gecode::PropCond PC_FLOAT_BND
Propagate when minimum or maximum of a view changes.
Gecode toplevel namespace
void sin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
FloatNum pi_upper(void)
Return upper bound of .
void mod(Home home, IntVar x0, IntVar x1, IntVar x2, IntPropLevel ipl=IPL_DEF)
Post propagator for .
void cos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
FloatNum pi_twice_upper(void)
Return upper bound of .
@ ES_OK
Execution is okay.
@ ES_FIX
Propagation has computed fixpoint.
@ ES_FAILED
Execution has resulted in failure.
#define GECODE_NEVER
Assert that this command is never executed.