Generated on Sat Oct 20 2018 12:43:45 for Gecode by doxygen 1.8.13
trigonometric.cpp
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Christian Schulte <schulte@gecode.org>
5  * Vincent Barichard <Vincent.Barichard@univ-angers.fr>
6  *
7  * Copyright:
8  * Christian Schulte, 2005
9  * Vincent Barichard, 2012
10  *
11  * This file is part of Gecode, the generic constraint
12  * development environment:
13  * http://www.gecode.org
14  *
15  * Permission is hereby granted, free of charge, to any person obtaining
16  * a copy of this software and associated documentation files (the
17  * "Software"), to deal in the Software without restriction, including
18  * without limitation the rights to use, copy, modify, merge, publish,
19  * distribute, sublicense, and/or sell copies of the Software, and to
20  * permit persons to whom the Software is furnished to do so, subject to
21  * the following conditions:
22  *
23  * The above copyright notice and this permission notice shall be
24  * included in all copies or substantial portions of the Software.
25  *
26  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
29  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
30  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
31  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
32  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33  *
34  */
35 
36 #include "test/float.hh"
37 #include <gecode/minimodel.hh>
38 
39 #ifdef GECODE_HAS_MPFR
40 
41 #include <cmath>
42 #include <algorithm>
43 
44 namespace Test { namespace Float {
45 
47  namespace Trigonometric {
48 
50  class SinXY : public Test {
51  public:
53  SinXY(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
54  : Test("Trigonometric::Sin::XY::"+s,2,d,st,CPLT_ASSIGNMENT,false) {}
56  virtual MaybeType solution(const Assignment& x) const {
57  return eq(sin(x[0]), x[1]);
58  }
60  virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
61  if (flip())
62  Gecode::sin(home, x[0], x[1]);
63  else
64  Gecode::rel(home, sin(x[0]) == x[1]);
65  }
66  };
67 
69  class SinXYSol : public Test {
70  public:
72  SinXYSol(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
73  : Test("Trigonometric::Sin::XY::Sol::"+s,2,d,st,EXTEND_ASSIGNMENT,false) {}
75  virtual MaybeType solution(const Assignment& x) const {
76  return eq(sin(x[0]), x[1]);
77  }
79  virtual bool extendAssignement(Assignment& x) const {
80  Gecode::FloatVal d = sin(x[0]);
81  if (Gecode::Float::subset(d, dom)) {
82  x.set(1, d);
83  return true;
84  } else {
85  return false;
86  }
87  }
89  virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
90  Gecode::sin(home, x[0], x[1]);
91  }
92  };
93 
95  class SinXX : public Test {
96  public:
98  SinXX(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
99  : Test("Trigonometric::Sin::XX::"+s,1,d,st,CPLT_ASSIGNMENT,false) {}
101  virtual MaybeType solution(const Assignment& x) const {
102  return eq(sin(x[0]), x[0]);
103  }
105  virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
106  Gecode::sin(home, x[0], x[0]);
107  }
108  };
109 
111  class CosXY : public Test {
112  public:
114  CosXY(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
115  : Test("Trigonometric::Cos::XY::"+s,2,d,st,CPLT_ASSIGNMENT,false) {}
117  virtual MaybeType solution(const Assignment& x) const {
118  return eq(cos(x[0]), x[1]);
119  }
121  virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
122  if (flip())
123  Gecode::cos(home, x[0], x[1]);
124  else
125  Gecode::rel(home, cos(x[0]) == x[1]);
126  }
127  };
128 
130  class CosXYSol : public Test {
131  public:
133  CosXYSol(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
134  : Test("Trigonometric::Cos::XY::Sol::"+s,2,d,st,EXTEND_ASSIGNMENT,false) {}
136  virtual MaybeType solution(const Assignment& x) const {
137  return eq(cos(x[0]), x[1]);
138  }
140  virtual bool extendAssignement(Assignment& x) const {
141  Gecode::FloatVal d = cos(x[0]);
142  if (Gecode::Float::subset(d, dom)) {
143  x.set(1, d);
144  return true;
145  } else {
146  return false;
147  }
148  }
150  virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
151  Gecode::cos(home, x[0], x[1]);
152  }
153  };
154 
156  class CosXX : public Test {
157  public:
159  CosXX(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
160  : Test("Trigonometric::Cos::XX::"+s,1,d,st,CPLT_ASSIGNMENT,false) {}
162  virtual MaybeType solution(const Assignment& x) const {
163  return eq(cos(x[0]), x[0]);
164  }
166  virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
167  Gecode::cos(home, x[0], x[0]);
168  }
169  };
170 
172  class TanXY : public Test {
173  public:
175  TanXY(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
176  : Test("Trigonometric::Tan::XY::"+s,2,d,st,CPLT_ASSIGNMENT,false) {}
178  virtual MaybeType solution(const Assignment& x) const {
179  return eq(tan(x[0]), x[1]);
180  }
182  virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
183  if (flip())
184  Gecode::tan(home, x[0], x[1]);
185  else
186  Gecode::rel(home, tan(x[0]) == x[1]);
187  }
188  };
189 
191  class TanXYSol : public Test {
192  public:
194  TanXYSol(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
195  : Test("Trigonometric::Tan::XY::Sol::"+s,2,d,st,EXTEND_ASSIGNMENT,false) {}
197  virtual MaybeType solution(const Assignment& x) const {
198  return eq(tan(x[0]), x[1]);
199  }
201  virtual bool extendAssignement(Assignment& x) const {
202  Gecode::FloatVal d = tan(x[0]);
203  if (Gecode::Float::subset(d, dom)) {
204  x.set(1, d);
205  return true;
206  } else {
207  return false;
208  }
209  }
211  virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
212  Gecode::tan(home, x[0], x[1]);
213  }
214  };
215 
217  class TanXX : public Test {
218  public:
220  TanXX(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
221  : Test("Trigonometric::Tan::XX::"+s,1,d,st,CPLT_ASSIGNMENT,false) {}
223  virtual MaybeType solution(const Assignment& x) const {
224  return eq(tan(x[0]), x[0]);
225  }
227  virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
228  Gecode::tan(home, x[0], x[0]);
229  }
230  };
231 
233  class ASinXY : public Test {
234  public:
236  ASinXY(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
237  : Test("Trigonometric::ASin::XY::"+s,2,d,st,CPLT_ASSIGNMENT,false) {}
239  virtual MaybeType solution(const Assignment& x) const {
240  if ((x[0].min() > 1.0) || (x[0].max() < -1.0))
241  return MT_FALSE;
242  return eq(asin(x[0]), x[1]);
243  }
245  virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
246  if (flip())
247  Gecode::asin(home, x[0], x[1]);
248  else
249  Gecode::rel(home, asin(x[0]) == x[1]);
250  }
251  };
252 
254  class ASinXYSol : public Test {
255  public:
257  ASinXYSol(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
258  : Test("Trigonometric::ASin::XY::Sol::"+s,2,d,st,EXTEND_ASSIGNMENT,false) {}
260  virtual MaybeType solution(const Assignment& x) const {
261  if ((x[0].min() > 1.0) || (x[0].max() < -1.0))
262  return MT_FALSE;
263  return eq(asin(x[0]), x[1]);
264  }
266  virtual bool extendAssignement(Assignment& x) const {
267  if ((x[0].min() > 1.0) || (x[0].max() < -1.0))
268  return false;
269  Gecode::FloatVal d = asin(x[0]);
270  if (Gecode::Float::subset(d, dom)) {
271  x.set(1, d);
272  return true;
273  } else {
274  return false;
275  }
276  }
278  virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
279  Gecode::asin(home, x[0], x[1]);
280  }
281  };
282 
284  class ASinXX : public Test {
285  public:
287  ASinXX(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
288  : Test("Trigonometric::ASin::XX::"+s,1,d,st,CPLT_ASSIGNMENT,false) {}
290  virtual MaybeType solution(const Assignment& x) const {
291  if ((x[0].min() > 1.0) || (x[0].max() < -1.0))
292  return MT_FALSE;
293  return eq(asin(x[0]), x[0]);
294  }
296  virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
297  Gecode::asin(home, x[0], x[0]);
298  }
299  };
300 
302  class ACosXY : public Test {
303  public:
305  ACosXY(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
306  : Test("Trigonometric::ACos::XY::"+s,2,d,st,CPLT_ASSIGNMENT,false) {}
308  virtual MaybeType solution(const Assignment& x) const {
309  if ((x[0].min() > 1.0) || (x[0].max() < -1.0))
310  return MT_FALSE;
311  return eq(acos(x[0]), x[1]);
312  }
314  virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
315  if (flip())
316  Gecode::acos(home, x[0], x[1]);
317  else
318  Gecode::rel(home, acos(x[0]) == x[1]);
319  }
320  };
321 
323  class ACosXYSol : public Test {
324  public:
326  ACosXYSol(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
327  : Test("Trigonometric::ACos::XY::Sol::"+s,2,d,st,EXTEND_ASSIGNMENT,false) {}
329  virtual MaybeType solution(const Assignment& x) const {
330  if ((x[0].min() > 1.0) || (x[0].max() < -1.0))
331  return MT_FALSE;
332  return eq(acos(x[0]), x[1]);
333  }
335  virtual bool extendAssignement(Assignment& x) const {
336  if ((x[0].min() > 1.0) || (x[0].max() < -1.0))
337  return false;
338  Gecode::FloatVal d = acos(x[0]);
339  if (Gecode::Float::subset(d, dom)) {
340  x.set(1, d);
341  return true;
342  } else {
343  return false;
344  }
345  }
347  virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
348  Gecode::acos(home, x[0], x[1]);
349  }
350  };
351 
353  class ACosXX : public Test {
354  public:
356  ACosXX(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
357  : Test("Trigonometric::ACos::XX::"+s,1,d,st,CPLT_ASSIGNMENT,false) {}
359  virtual MaybeType solution(const Assignment& x) const {
360  if ((x[0].min() > 1.0) || (x[0].max() < -1.0))
361  return MT_FALSE;
362  return eq(acos(x[0]), x[0]);
363  }
365  virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
366  Gecode::acos(home, x[0], x[0]);
367  }
368  };
369 
371  class ATanXY : public Test {
372  public:
374  ATanXY(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
375  : Test("Trigonometric::ATan::XY::"+s,2,d,st,CPLT_ASSIGNMENT,false) {}
377  virtual MaybeType solution(const Assignment& x) const {
378  return eq(atan(x[0]), x[1]);
379  }
381  virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
382  if (flip())
383  Gecode::atan(home, x[0], x[1]);
384  else
385  Gecode::rel(home, atan(x[0]) == x[1]);
386  }
387  };
388 
390  class ATanXYSol : public Test {
391  public:
393  ATanXYSol(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
394  : Test("Trigonometric::ATan::XY::Sol::"+s,2,d,st,EXTEND_ASSIGNMENT,false) {}
396  virtual MaybeType solution(const Assignment& x) const {
397  return eq(atan(x[0]), x[1]);
398  }
400  virtual bool extendAssignement(Assignment& x) const {
401  Gecode::FloatVal d = atan(x[0]);
402  if (Gecode::Float::subset(d, dom)) {
403  x.set(1, d);
404  return true;
405  } else {
406  return false;
407  }
408  }
410  virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
411  Gecode::atan(home, x[0], x[1]);
412  }
413  };
414 
416  class ATanXX : public Test {
417  public:
419  ATanXX(const std::string& s, const Gecode::FloatVal& d, Gecode::FloatNum st)
420  : Test("Trigonometric::ATan::XX::"+s,1,d,st,CPLT_ASSIGNMENT,false) {}
422  virtual MaybeType solution(const Assignment& x) const {
423  return eq(atan(x[0]), x[0]);
424  }
426  virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) {
427  Gecode::atan(home, x[0], x[0]);
428  }
429  };
430 
431  const Gecode::FloatNum step = 0.15;
433  Gecode::FloatVal a(-8,5);
434  Gecode::FloatVal b(9,12);
435  Gecode::FloatVal c(-8,8);
436 
437  SinXY sin_xy_a("A",a,step);
438  SinXY sin_xy_b("B",b,step);
439  SinXY sin_xy_c("C",c,step);
440 
441  SinXYSol sin_xy_sol_a("A",a,step);
442  SinXYSol sin_xy_sol_b("B",b,step);
443  SinXYSol sin_xy_sol_c("C",c,step);
444 
445  SinXX sin_xx_a("A",a,step);
446  SinXX sin_xx_b("B",b,step);
447  SinXX sin_xx_c("C",c,step);
448 
449  CosXY cos_xy_a("A",a,step);
450  CosXY cos_xy_b("B",b,step);
451  CosXY cos_xy_c("C",c,step);
452 
453  CosXYSol cos_xy_sol_a("A",a,step);
454  CosXYSol cos_xy_sol_b("B",b,step);
455  CosXYSol cos_xy_sol_c("C",c,step);
456 
457  CosXX cos_xx_a("A",a,step);
458  CosXX cos_xx_b("B",b,step);
459  CosXX cos_xx_c("C",c,step);
460 
461  TanXY tan_xy_a("A",a,step);
462  TanXY tan_xy_b("B",b,step);
463  TanXY tan_xy_c("C",c,step);
464 
465  TanXYSol tan_xy_sol_a("A",a,step);
466  TanXYSol tan_xy_sol_b("B",b,step);
467  TanXYSol tan_xy_sol_c("C",c,step);
468 
469  TanXX tan_xx_a("A",a,step);
470  TanXX tan_xx_b("B",b,step);
471  TanXX tan_xx_c("C",c,step);
472 
473  ASinXY asin_xy_a("A",a,step);
474  ASinXY asin_xy_b("B",b,step);
475  ASinXY asin_xy_c("C",c,step);
476 
477  ASinXYSol asin_xy_sol_a("A",a,step);
478  ASinXYSol asin_xy_sol_b("B",b,step);
479  ASinXYSol asin_xy_sol_c("C",c,step);
480 
481  ASinXX asin_xx_a("A",a,step);
482  ASinXX asin_xx_b("B",b,step);
483  ASinXX asin_xx_c("C",c,step);
484 
485  ACosXY acos_xy_a("A",a,step);
486  ACosXY acos_xy_b("B",b,step);
487  ACosXY acos_xy_c("C",c,step);
488 
489  ACosXYSol acos_xy_sol_a("A",a,step);
490  ACosXYSol acos_xy_sol_b("B",b,step);
491  ACosXYSol acos_xy_sol_c("C",c,step);
492 
493  ACosXX acos_xx_a("A",a,step);
494  ACosXX acos_xx_b("B",b,step);
495  ACosXX acos_xx_c("C",c,step);
496 
497  ATanXY atan_xy_a("A",a,step);
498  ATanXY atan_xy_b("B",b,step);
499  ATanXY atan_xy_c("C",c,step);
500 
501  ATanXYSol atan_xy_sol_a("A",a,step);
502  ATanXYSol atan_xy_sol_b("B",b,step);
503  ATanXYSol atan_xy_sol_c("C",c,step);
504 
505  ATanXX atan_xx_a("A",a,step);
506  ATanXX atan_xx_b("B",b,step);
507  ATanXX atan_xx_c("C",c,step);
508 
510 
511  }
512 }}
513 
514 #endif
515 // STATISTICS: test-float
static MaybeType eq(Gecode::FloatVal x, Gecode::FloatVal y)
Whether x and y are equal.
Definition: float.hpp:268
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
ACosXY acos_xy_b("B", b, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
CosXYSol cos_xy_sol_b("B", b, step)
Gecode::FloatNum step
Step for going to next solution.
Definition: float.hh:251
CosXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
ATanXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Test for cosinus constraint
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
bool subset(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:490
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
const FloatNum max
Largest allowed float value.
Definition: float.hh:844
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
ATanXY atan_xy_a("A", a, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
ACosXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
TanXX tan_xx_a("A", a, step)
Test for atangent constraint with shared variables
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
ACosXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
TanXX tan_xx_b("B", b, step)
TanXYSol tan_xy_sol_a("A", a, step)
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
CosXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
ATanXY atan_xy_c("C", c, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
TanXY tan_xy_a("A", a, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
CosXYSol cos_xy_sol_c("C", c, step)
Gecode::FloatVal b(9, 12)
Test for sinus constraint where solution is ensured
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Test for cosinus constraint where solution is ensured
SinXX sin_xx_b("B", b, step)
SinXX sin_xx_a("A", a, step)
ATanXX atan_xx_a("A", a, step)
Float variable array.
Definition: float.hh:1030
Test for tangent constraint with shared variables
Computation spaces.
Definition: core.hpp:1701
CosXYSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Test for tangent constraint where solution is ensured
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
ASinXYSol asin_xy_sol_c("C", c, step)
Test for acosinus constraint
ACosXYSol acos_xy_sol_b("B", b, step)
Gecode::IntSet d(v, 7)
virtual void set(int i, const Gecode::FloatVal &val)=0
Set assignment to value val for variable i.
TanXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
ASinXYSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
ATanXYSol atan_xy_sol_c("C", c, step)
CosXY cos_xy_c("C", c, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
SinXY sin_xy_a("A", a, step)
CosXX cos_xx_c("C", c, step)
const FloatNum min
Smallest allowed float value.
Definition: float.hh:846
TanXYSol tan_xy_sol_c("C", c, step)
TanXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
SinXY sin_xy_b("B", b, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
SinXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
ASinXY asin_xy_a("A", a, step)
ACosXYSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
SinXX sin_xx_c("C", c, step)
CosXYSol cos_xy_sol_a("A", a, step)
CosXX cos_xx_b("B", b, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
TanXY tan_xy_b("B", b, step)
TanXX tan_xx_c("C", c, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Test for atangent constraint
ACosXX acos_xx_c("C", c, step)
ACosXX acos_xx_b("B", b, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
SinXYSol sin_xy_sol_b("B", b, step)
const Gecode::FloatNum step2
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
Test for tangent constraint
Test for asinus constraint with shared variables
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
ASinXYSol asin_xy_sol_a("A", a, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
Gecode::FloatVal a(-8, 5)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Test for acosinus constraint where solution is ensured
ACosXY acos_xy_c("C", c, step)
ASinXX asin_xx_c("C", c, step)
void asin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
ATanXYSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
ACosXYSol acos_xy_sol_a("A", a, step)
ACosXY acos_xy_a("A", a, step)
ACosXX acos_xx_a("A", a, step)
CosXX cos_xx_a("A", a, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
ASinXX asin_xx_a("A", a, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
void cos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
General test support.
Definition: afc.cpp:39
ASinXY asin_xy_b("B", b, step)
Float value type.
Definition: float.hh:334
Gecode::FloatVal c(-8, 8)
Node * x
Pointer to corresponding Boolean expression node.
Definition: bool-expr.cpp:249
Test for sinus constraint with shared variables
void tan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
ASinXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
Gecode::FloatVal dom
Domain of variables.
Definition: float.hh:249
ATanXYSol atan_xy_sol_a("A", a, step)
TanXYSol tan_xy_sol_b("B", b, step)
Test for atangent constraint where solution is ensured
MaybeType
Type for comparisons and solutions.
Definition: float.hh:51
CosXY cos_xy_a("A", a, step)
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Definition: rel.cpp:43
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
ASinXY(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
ATanXYSol atan_xy_sol_b("B", b, step)
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
ATanXX atan_xx_b("B", b, step)
SinXYSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
SinXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
ASinXY asin_xy_c("C", c, step)
ATanXY atan_xy_b("B", b, step)
TanXYSol(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
ASinXYSol asin_xy_sol_b("B", b, step)
Test for cosinus constraint with shared variables
void sin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Test for asinus constraint where solution is ensured
Test for asinus constraint
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
ATanXX atan_xx_c("C", c, step)
void acos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
ASinXX asin_xx_b("B", b, step)
Test for sinus constraint
ACosXYSol acos_xy_sol_c("C", c, step)
double FloatNum
Floating point number base type.
Definition: float.hh:106
virtual MaybeType solution(const Assignment &x) const
Test whether x is solution
SinXY sin_xy_c("C", c, step)
TanXY tan_xy_c("C", c, step)
virtual bool extendAssignement(Assignment &x) const
Extend assignment x.
CosXY cos_xy_b("B", b, step)
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
void atan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
ATanXX(const std::string &s, const Gecode::FloatVal &d, Gecode::FloatNum st)
Create and register test.
SinXYSol sin_xy_sol_a("A", a, step)
bool flip(void)
Flip a coin and return true or false randomly.
Definition: float.hpp:273
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)
Post constraint on x.
Base class for assignments
Definition: float.hh:80
Test for acosinus constraint with shared variables
SinXYSol sin_xy_sol_c("C", c, step)