Generated on Sat Jan 12 2019 20:58:51 for Gecode by doxygen 1.8.13
float.hh
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  * Guido Tack <tack@gecode.org>
6  * Vincent Barichard <Vincent.Barichard@univ-angers.fr>
7  *
8  * Copyright:
9  * Christian Schulte, 2002
10  * Guido Tack, 2004
11  * Vincent Barichard, 2012
12  *
13  * This file is part of Gecode, the generic constraint
14  * development environment:
15  * http://www.gecode.org
16  *
17  * Permission is hereby granted, free of charge, to any person obtaining
18  * a copy of this software and associated documentation files (the
19  * "Software"), to deal in the Software without restriction, including
20  * without limitation the rights to use, copy, modify, merge, publish,
21  * distribute, sublicense, and/or sell copies of the Software, and to
22  * permit persons to whom the Software is furnished to do so, subject to
23  * the following conditions:
24  *
25  * The above copyright notice and this permission notice shall be
26  * included in all copies or substantial portions of the Software.
27  *
28  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35  *
36  */
37 
38 #ifndef __GECODE_FLOAT_HH__
39 #define __GECODE_FLOAT_HH__
40 
41 #include <climits>
42 #include <cfloat>
43 #include <iostream>
44 
45 #include <functional>
46 
47 #include <gecode/kernel.hh>
48 #include <gecode/int.hh>
49 
50 /*
51  * Configure linking
52  *
53  */
54 #if !defined(GECODE_STATIC_LIBS) && \
55  (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
56 
57 #ifdef GECODE_BUILD_FLOAT
58 #define GECODE_FLOAT_EXPORT __declspec( dllexport )
59 #else
60 #define GECODE_FLOAT_EXPORT __declspec( dllimport )
61 #endif
62 
63 #else
64 
65 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
66 #define GECODE_FLOAT_EXPORT __attribute__ ((visibility("default")))
67 #else
68 #define GECODE_FLOAT_EXPORT
69 #endif
70 
71 #endif
72 
73 // Configure auto-linking
74 #ifndef GECODE_BUILD_FLOAT
75 #define GECODE_LIBRARY_NAME "Float"
77 #endif
78 
79 // Include interval implementation
80 #include <boost/numeric/interval.hpp>
81 
94 
96 
97 namespace Gecode {
98 
106  typedef double FloatNum;
107 
109  FloatNum pi_half_lower(void);
111  FloatNum pi_half_upper(void);
113  FloatNum pi_lower(void);
115  FloatNum pi_upper(void);
117  FloatNum pi_twice_lower(void);
119  FloatNum pi_twice_upper(void);
120 
121  // Forward declaration
122  class FloatVal;
123 
124 }
125 
126 #include <gecode/float/num.hpp>
127 
128 namespace Gecode { namespace Float {
129 
130 
131 #if defined(_MSC_VER) && (defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP > 0)))
132 
133  /*
134  * This is used for the MSVC compiler for x64 or x86 with SSE enabled.
135  *
136  */
138  typedef boost::numeric::interval_lib::rounded_arith_std<FloatNum>
139  RoundingBase;
140 
141 #else
142 
144  typedef boost::numeric::interval_lib::rounded_arith_opp<FloatNum>
146 
147 #endif
148 
154  class Rounding : public RoundingBase {
155  public:
157 
158  Rounding(void);
161  ~Rounding(void);
163 
165 
187 
189 
197 
198 #ifdef GECODE_HAS_MPFR
199 
210 
212 
226 
228 
242 
244 
258 
260 
274 #endif
275  };
276 
277 }}
278 
279 #include <gecode/float/rounding.hpp>
280 
281 namespace Gecode { namespace Float {
282 
287  bool subset(const FloatVal& x, const FloatVal& y);
292  bool proper_subset(const FloatVal& x, const FloatVal& y);
297  bool overlap(const FloatVal& x, const FloatVal& y);
298 
303  FloatVal intersect(const FloatVal& x, const FloatVal& y);
308  FloatVal hull(const FloatVal& x, const FloatVal& y);
313  FloatVal hull(const FloatVal& x, const FloatNum& y);
318  FloatVal hull(const FloatNum& x, const FloatVal& y);
323  FloatVal hull(const FloatNum& x, const FloatNum& y);
324 
325 }}
326 
327 namespace Gecode {
328 
334  class FloatVal {
335  friend FloatVal operator +(const FloatVal& x);
336  friend FloatVal operator -(const FloatVal& x);
337  friend FloatVal operator +(const FloatVal& x, const FloatVal& y);
338  friend FloatVal operator +(const FloatVal& x, const FloatNum& y);
339  friend FloatVal operator +(const FloatNum& x, const FloatVal& y);
340  friend FloatVal operator -(const FloatVal& x, const FloatVal& y);
341  friend FloatVal operator -(const FloatVal& x, const FloatNum& y);
342  friend FloatVal operator -(const FloatNum& x, const FloatVal& y);
343  friend FloatVal operator *(const FloatVal& x, const FloatVal& y);
344  friend FloatVal operator *(const FloatVal& x, const FloatNum& y);
345  friend FloatVal operator *(const FloatNum& x, const FloatVal& y);
346  friend FloatVal operator /(const FloatVal& x, const FloatVal& y);
347  friend FloatVal operator /(const FloatVal& x, const FloatNum& y);
348  friend FloatVal operator /(const FloatNum& x, const FloatVal& y);
349 
350  friend bool operator <(const FloatVal& x, const FloatVal& y);
351  friend bool operator <(const FloatVal& x, const FloatNum& y);
352  friend bool operator <(const FloatNum& x, const FloatVal& y);
353  friend bool operator <=(const FloatVal& x, const FloatVal& y);
354  friend bool operator <=(const FloatVal& x, const FloatNum& y);
355  friend bool operator <=(const FloatNum& x, const FloatVal& y);
356  friend bool operator >(const FloatVal& x, const FloatVal& y);
357  friend bool operator >(const FloatVal& x, const FloatNum& y);
358  friend bool operator >(const FloatNum& x, const FloatVal& y);
359  friend bool operator >=(const FloatVal& x, const FloatVal& y);
360  friend bool operator >=(const FloatVal& x, const FloatNum& y);
361  friend bool operator >=(const FloatNum& x, const FloatVal& y);
362  friend bool operator ==(const FloatVal& x, const FloatVal& y);
363  friend bool operator ==(const FloatVal& x, const FloatNum& y);
364  friend bool operator ==(const FloatNum& x, const FloatVal& y);
365  friend bool operator !=(const FloatVal& x, const FloatVal& y);
366  friend bool operator !=(const FloatVal& x, const FloatNum& y);
367  friend bool operator !=(const FloatNum& x, const FloatVal& y);
368 
369  template<class Char, class Traits>
370  friend std::basic_ostream<Char,Traits>&
371  operator <<(std::basic_ostream<Char,Traits>& os, const FloatVal& x);
372 
373  friend FloatVal abs(const FloatVal& x);
374  friend FloatVal sqrt(const FloatVal& x);
375  friend FloatVal sqr(const FloatVal& x);
376  friend FloatVal pow(const FloatVal& x, int n);
377  friend FloatVal nroot(const FloatVal& x, int n);
378 
379  friend FloatVal max(const FloatVal& x, const FloatVal& y);
380  friend FloatVal max(const FloatVal& x, const FloatNum& y);
381  friend FloatVal max(const FloatNum& x, const FloatVal& y);
382  friend FloatVal min(const FloatVal& x, const FloatVal& y);
383  friend FloatVal min(const FloatVal& x, const FloatNum& y);
384  friend FloatVal min(const FloatNum& x, const FloatVal& y);
385 
386 #ifdef GECODE_HAS_MPFR
387  friend FloatVal exp(const FloatVal& x);
388  friend FloatVal log(const FloatVal& x);
389  friend FloatVal fmod(const FloatVal& x, const FloatVal& y);
390  friend FloatVal fmod(const FloatVal& x, const FloatNum& y);
391  friend FloatVal fmod(const FloatNum& x, const FloatVal& y);
392  friend FloatVal sin(const FloatVal& x);
393  friend FloatVal cos(const FloatVal& x);
394  friend FloatVal tan(const FloatVal& x);
395  friend FloatVal asin(const FloatVal& x);
396  friend FloatVal acos(const FloatVal& x);
397  friend FloatVal atan(const FloatVal& x);
398  friend FloatVal sinh(const FloatVal& x);
399  friend FloatVal cosh(const FloatVal& x);
400  friend FloatVal tanh(const FloatVal& x);
401  friend FloatVal asinh(const FloatVal& x);
402  friend FloatVal acosh(const FloatVal& x);
403  friend FloatVal atanh(const FloatVal& x);
404 #endif
405 
406  friend bool Float::subset(const FloatVal& x, const FloatVal& y);
407  friend bool Float::proper_subset(const FloatVal& x, const FloatVal& y);
408  friend bool Float::overlap(const FloatVal& x, const FloatVal& y);
409  friend FloatVal Float::intersect(const FloatVal& x, const FloatVal& y);
410  friend FloatVal Float::hull(const FloatVal& x, const FloatVal& y);
411  friend FloatVal Float::hull(const FloatVal& x, const FloatNum& y);
412  friend FloatVal Float::hull(const FloatNum& x, const FloatVal& y);
413  friend FloatVal Float::hull(const FloatNum& x, const FloatNum& y);
414  protected:
416  typedef boost::numeric::interval_lib::save_state<Float::Rounding> R;
418  typedef boost::numeric::interval_lib::checking_strict<FloatNum> P;
420  typedef boost::numeric::interval
421  <FloatNum,
422  boost::numeric::interval_lib::policies<R, P> >
427  explicit FloatVal(const FloatValImpType& i);
428  public:
430 
431  FloatVal(void);
434  FloatVal(const FloatNum& n);
436  FloatVal(const FloatNum& l, const FloatNum& u);
438  FloatVal(const FloatVal& v);
439 
441  FloatVal& operator =(const FloatNum& n);
443  FloatVal& operator =(const FloatVal& v);
444 
446  void assign(FloatNum const &l, FloatNum const &u);
448 
450 
451  FloatNum min(void) const;
454  FloatNum max(void) const;
456  FloatNum size(void) const;
458  FloatNum med(void) const;
460 
462 
463  bool tight(void) const;
466  bool singleton(void) const;
468  bool in(FloatNum n) const;
470  bool zero_in(void) const;
472 
474 
475  static FloatVal hull(FloatNum x, FloatNum y);
478  static FloatVal pi_half(void);
480  static FloatVal pi(void);
482  static FloatVal pi_twice(void);
484 
486 
487  FloatVal& operator +=(const FloatNum& n);
490  FloatVal& operator -=(const FloatNum& n);
492  FloatVal& operator *=(const FloatNum& n);
494  FloatVal& operator /=(const FloatNum& n);
496  FloatVal& operator +=(const FloatVal& v);
498  FloatVal& operator -=(const FloatVal& v);
500  FloatVal& operator *=(const FloatVal& v);
502  FloatVal& operator /=(const FloatVal& v);
504  };
505 
510  FloatVal operator +(const FloatVal& x);
515  FloatVal operator -(const FloatVal& x);
516 
521  FloatVal operator +(const FloatVal& x, const FloatVal& y);
526  FloatVal operator +(const FloatVal& x, const FloatNum& y);
531  FloatVal operator +(const FloatNum& x, const FloatVal& y);
536  FloatVal operator -(const FloatVal& x, const FloatVal& y);
541  FloatVal operator -(const FloatVal& x, const FloatNum& y);
546  FloatVal operator -(const FloatNum& x, const FloatVal& y);
551  FloatVal operator *(const FloatVal& x, const FloatVal& y);
556  FloatVal operator *(const FloatVal& x, const FloatNum& y);
561  FloatVal operator *(const FloatNum& x, const FloatVal& y);
566  FloatVal operator /(const FloatVal& x, const FloatVal& y);
571  FloatVal operator /(const FloatVal& x, const FloatNum& y);
576  FloatVal operator /(const FloatNum& r, const FloatVal& x);
577 
582  bool operator <(const FloatVal& x, const FloatVal& y);
587  bool operator <(const FloatVal& x, const FloatNum& y);
592  bool operator <(const FloatNum& x, const FloatVal& y);
593 
598  bool operator <=(const FloatVal& x, const FloatVal& y);
603  bool operator <=(const FloatVal& x, const FloatNum& y);
608  bool operator <=(const FloatNum& x, const FloatVal& y);
609 
614  bool operator >(const FloatVal& x, const FloatVal& y);
619  bool operator >(const FloatVal& x, const FloatNum& y);
624  bool operator >(const FloatNum& x, const FloatVal& y);
625 
630  bool operator >=(const FloatVal& x, const FloatVal& y);
635  bool operator >=(const FloatVal& x, const FloatNum& y);
640  bool operator >=(const FloatNum& x, const FloatVal& y);
645  bool operator ==(const FloatVal& x, const FloatVal& y);
650  bool operator ==(const FloatVal& x, const FloatNum& y);
655  bool operator ==(const FloatNum& x, const FloatVal& y);
656 
661  bool operator !=(const FloatVal& x, const FloatVal& y);
666  bool operator !=(const FloatVal& x, const FloatNum& y);
671  bool operator !=(const FloatNum& x, const FloatVal& y);
672 
677  template<class Char, class Traits>
678  std::basic_ostream<Char,Traits>&
679  operator <<(std::basic_ostream<Char,Traits>& os, const FloatVal& x);
680 
685  FloatVal abs(const FloatVal& x);
690  FloatVal sqrt(const FloatVal& x);
695  FloatVal sqr(const FloatVal& x);
700  FloatVal pow(const FloatVal& x, int n);
705  FloatVal nroot(const FloatVal& x, int n);
706 
711  FloatVal max(const FloatVal& x, const FloatVal& y);
716  FloatVal max(const FloatVal& x, const FloatNum& y);
721  FloatVal max(const FloatNum& x, const FloatVal& y);
726  FloatVal min(const FloatVal& x, const FloatVal& y);
731  FloatVal min(const FloatVal& x, const FloatNum& y);
736  FloatVal min(const FloatNum& x, const FloatVal& y);
737 
738 #ifdef GECODE_HAS_MPFR
739  /* transcendental functions: exp, log */
744  FloatVal exp(const FloatVal& x);
749  FloatVal log(const FloatVal& x);
750 
755  FloatVal fmod(const FloatVal& x, const FloatVal& y);
760  FloatVal fmod(const FloatVal& x, const FloatNum& y);
765  FloatVal fmod(const FloatNum& x, const FloatVal& y);
766 
771  FloatVal sin(const FloatVal& x);
776  FloatVal cos(const FloatVal& x);
781  FloatVal tan(const FloatVal& x);
786  FloatVal asin(const FloatVal& x);
791  FloatVal acos(const FloatVal& x);
796  FloatVal atan(const FloatVal& x);
797 
802  FloatVal sinh(const FloatVal& x);
807  FloatVal cosh(const FloatVal& x);
812  FloatVal tanh(const FloatVal& x);
817  FloatVal asinh(const FloatVal& x);
822  FloatVal acosh(const FloatVal& x);
827  FloatVal atanh(const FloatVal& x);
828 
829 #endif
830 
831 }
832 
833 #include <gecode/float/val.hpp>
834 
835 namespace Gecode { namespace Float {
836 
842  namespace Limits {
846  const FloatNum min = -max;
848  bool valid(const FloatVal& n);
850  void check(const FloatVal& n, const char* l);
851  }
852 
853 }}
854 
855 #include <gecode/float/limits.hpp>
856 
857 #include <gecode/float/var-imp.hpp>
858 
859 namespace Gecode {
860 
861  namespace Float {
862  class FloatView;
863  }
864 
870  class FloatVar : public VarImpVar<Float::FloatVarImp> {
871  friend class FloatVarArray;
872  friend class FloatVarArgs;
873  private:
881  void _init(Space& home, FloatNum min, FloatNum max);
882  public:
884 
885  FloatVar(void);
888  FloatVar(const FloatVar& y);
890  FloatVar(const Float::FloatView& y);
904 
906 
907  FloatVal domain(void) const;
910  FloatNum min(void) const;
912  FloatNum max(void) const;
914  FloatNum med(void) const;
916  FloatNum size(void) const;
924  FloatVal val(void) const;
925 
927 
929 
930  bool in(const FloatVal& n) const;
933  };
934 
939  template<class Char, class Traits>
940  std::basic_ostream<Char,Traits>&
941  operator <<(std::basic_ostream<Char,Traits>& os, const FloatVar& x);
942 }
943 
944 #include <gecode/float/view.hpp>
946 
947 namespace Gecode {
948 
950  class FloatValArgs : public ArgArray<FloatVal> {
951  public:
953 
954  FloatValArgs(void);
957  explicit FloatValArgs(int n);
961  FloatValArgs(const std::vector<FloatVal>& x);
963  FloatValArgs(std::initializer_list<FloatVal> x);
965  template<class InputIterator>
966  FloatValArgs(InputIterator first, InputIterator last);
968  FloatValArgs(int n, const FloatVal* e);
971 
974  static FloatValArgs create(int n, FloatVal start, int inc=1);
976  };
977 
979  class FloatVarArgs : public VarArgArray<FloatVar> {
980  public:
982 
983  FloatVarArgs(void);
986  explicit FloatVarArgs(int n);
988  FloatVarArgs(const FloatVarArgs& a);
992  FloatVarArgs(const std::vector<FloatVar>& a);
994  FloatVarArgs(std::initializer_list<FloatVar> a);
996  template<class InputIterator>
997  FloatVarArgs(InputIterator first, InputIterator last);
1010  FloatVarArgs(Space& home, int n, FloatNum min, FloatNum max);
1012  };
1014 
1030  class FloatVarArray : public VarArray<FloatVar> {
1031  public:
1033 
1034  FloatVarArray(void);
1037  FloatVarArray(Space& home, int n);
1039  FloatVarArray(const FloatVarArray& a);
1041  FloatVarArray(Space& home, const FloatVarArgs& a);
1054  FloatVarArray(Space& home, int n, FloatNum min, FloatNum max);
1056  };
1057 
1058 }
1059 
1060 #include <gecode/float/array.hpp>
1061 
1062 namespace Gecode {
1063 
1075  };
1076 
1084  GECODE_FLOAT_EXPORT void
1086  dom(Home home, FloatVar x, FloatVal n);
1088  GECODE_FLOAT_EXPORT void
1089  dom(Home home, const FloatVarArgs& x, FloatVal n);
1091  GECODE_FLOAT_EXPORT void
1092  dom(Home home, FloatVar x, FloatNum l, FloatNum m);
1094  GECODE_FLOAT_EXPORT void
1095  dom(Home home, const FloatVarArgs& x, FloatNum l, FloatNum u);
1097  GECODE_FLOAT_EXPORT void
1098  dom(Home home, FloatVar x, FloatVal n, Reify r);
1100  GECODE_FLOAT_EXPORT void
1101  dom(Home home, FloatVar x, FloatNum l, FloatNum u, Reify r);
1103  GECODE_FLOAT_EXPORT void
1104  dom(Home home, FloatVar x, FloatVar d);
1106  GECODE_FLOAT_EXPORT void
1107  dom(Home home, const FloatVarArgs& x, const FloatVarArgs& d);
1109 
1118  GECODE_FLOAT_EXPORT void
1119  rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1);
1123  GECODE_FLOAT_EXPORT void
1124  rel(Home home, FloatVar x, FloatRelType frt, FloatVal c);
1128  GECODE_FLOAT_EXPORT void
1129  rel(Home home, FloatVar x, FloatRelType frt, FloatVal c, Reify r);
1133  GECODE_FLOAT_EXPORT void
1134  rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1, Reify r);
1138  GECODE_FLOAT_EXPORT void
1139  rel(Home home, const FloatVarArgs& x, FloatRelType frt, FloatVal c);
1143  GECODE_FLOAT_EXPORT void
1144  rel(Home home, const FloatVarArgs& x, FloatRelType frt, FloatVar y);
1151  GECODE_FLOAT_EXPORT void
1152  ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z);
1153 
1154 }
1155 
1156 
1157 namespace Gecode {
1158 
1167  GECODE_FLOAT_EXPORT void
1168  min(Home home, FloatVar x0, FloatVar x1, FloatVar x2);
1172  GECODE_FLOAT_EXPORT void
1173  min(Home home, const FloatVarArgs& x, FloatVar y);
1176  GECODE_FLOAT_EXPORT void
1177  max(Home home, FloatVar x0, FloatVar x1, FloatVar x2);
1181  GECODE_FLOAT_EXPORT void
1182  max(Home home, const FloatVarArgs& x, FloatVar y);
1183 
1186  GECODE_FLOAT_EXPORT void
1187  abs(Home home, FloatVar x0, FloatVar x1);
1188 
1191  GECODE_FLOAT_EXPORT void
1192  mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2);
1193 
1196  GECODE_FLOAT_EXPORT void
1197  sqr(Home home, FloatVar x0, FloatVar x1);
1198 
1201  GECODE_FLOAT_EXPORT void
1202  sqrt(Home home, FloatVar x0, FloatVar x1);
1203 
1206  GECODE_FLOAT_EXPORT void
1207  pow(Home home, FloatVar x0, int n, FloatVar x1);
1208 
1211  GECODE_FLOAT_EXPORT void
1212  nroot(Home home, FloatVar x0, int n, FloatVar x1);
1213 
1216  GECODE_FLOAT_EXPORT void
1217  div(Home home, FloatVar x0, FloatVar x1, FloatVar x2);
1218 #ifdef GECODE_HAS_MPFR
1219 
1221  GECODE_FLOAT_EXPORT void
1222  exp(Home home, FloatVar x0, FloatVar x1);
1225  GECODE_FLOAT_EXPORT void
1226  log(Home home, FloatVar x0, FloatVar x1);
1229  GECODE_FLOAT_EXPORT void
1230  pow(Home home, FloatNum base, FloatVar x0, FloatVar x1);
1233  GECODE_FLOAT_EXPORT void
1234  log(Home home, FloatNum base, FloatVar x0, FloatVar x1);
1237  GECODE_FLOAT_EXPORT void
1238  asin(Home home, FloatVar x0, FloatVar x1);
1241  GECODE_FLOAT_EXPORT void
1242  sin(Home home, FloatVar x0, FloatVar x1);
1245  GECODE_FLOAT_EXPORT void
1246  acos(Home home, FloatVar x0, FloatVar x1);
1249  GECODE_FLOAT_EXPORT void
1250  cos(Home home, FloatVar x0, FloatVar x1);
1253  GECODE_FLOAT_EXPORT void
1254  atan(Home home, FloatVar x0, FloatVar x1);
1257  GECODE_FLOAT_EXPORT void
1258  tan(Home home, FloatVar x0, FloatVar x1);
1260 #endif
1261 
1276  GECODE_FLOAT_EXPORT void
1277  linear(Home home, const FloatVarArgs& x,
1278  FloatRelType frt, FloatVal c);
1289  GECODE_FLOAT_EXPORT void
1290  linear(Home home, const FloatVarArgs& x,
1291  FloatRelType frt, FloatVar y);
1302  GECODE_FLOAT_EXPORT void
1303  linear(Home home, const FloatVarArgs& x,
1304  FloatRelType frt, FloatVal c, Reify r);
1315  GECODE_FLOAT_EXPORT void
1316  linear(Home home, const FloatVarArgs& x,
1317  FloatRelType frt, FloatVar y, Reify r);
1330  GECODE_FLOAT_EXPORT void
1331  linear(Home home, const FloatValArgs& a, const FloatVarArgs& x,
1332  FloatRelType frt, FloatVal c);
1346  GECODE_FLOAT_EXPORT void
1347  linear(Home home, const FloatValArgs& a, const FloatVarArgs& x,
1348  FloatRelType frt, FloatVar y);
1362  GECODE_FLOAT_EXPORT void
1363  linear(Home home, const FloatValArgs& a, const FloatVarArgs& x,
1364  FloatRelType frt, FloatVal c, Reify r);
1378  GECODE_FLOAT_EXPORT void
1379  linear(Home home, const FloatValArgs& a, const FloatVarArgs& x,
1380  FloatRelType frt, FloatVar y, Reify r);
1381 
1382 
1388  GECODE_FLOAT_EXPORT void
1390  channel(Home home, FloatVar x0, IntVar x1);
1392  void
1393  channel(Home home, IntVar x0, FloatVar x1);
1395  GECODE_FLOAT_EXPORT void
1396  channel(Home home, FloatVar x0, BoolVar x1);
1398  void
1399  channel(Home home, BoolVar x0, FloatVar x1);
1401 
1402 }
1403 
1404 #include <gecode/float/channel.hpp>
1405 
1406 namespace Gecode {
1407 
1416  GECODE_FLOAT_EXPORT void
1418  wait(Home home, FloatVar x, std::function<void(Space& home)> c);
1420  GECODE_FLOAT_EXPORT void
1421  wait(Home home, const FloatVarArgs& x, std::function<void(Space& home)> c);
1423 
1424 }
1425 
1426 namespace Gecode {
1427 
1441  typedef std::function<bool(const Space& home, FloatVar x, int i)>
1443 
1454  typedef std::function<double(const Space& home, FloatVar x, int i)>
1456 
1463  public:
1467  bool l;
1468  };
1469 
1480  typedef std::function<FloatNumBranch(const Space& home, FloatVar x, int i)>
1482 
1494  typedef std::function<void(Space& home, unsigned int a,
1495  FloatVar x, int i, FloatNumBranch nl)>
1497 
1498 }
1499 
1501 
1502 namespace Gecode {
1503 
1509  class FloatAFC : public AFC {
1510  public:
1518  FloatAFC(void);
1520  FloatAFC(const FloatAFC& a);
1522  FloatAFC& operator =(const FloatAFC& a);
1530  FloatAFC(Home home, const FloatVarArgs& x, double d=1.0, bool share=true);
1541  void init(Home home, const FloatVarArgs& x, double d=1.0, bool share=true);
1542  };
1543 
1544 }
1545 
1546 #include <gecode/float/branch/afc.hpp>
1547 
1548 namespace Gecode {
1549 
1555  class FloatAction : public Action {
1556  public:
1564  FloatAction(void);
1566  FloatAction(const FloatAction& a);
1568  FloatAction& operator =(const FloatAction& a);
1578  FloatAction(Home home, const FloatVarArgs& x, double d=1.0,
1579  FloatBranchMerit bm=nullptr);
1591  GECODE_FLOAT_EXPORT void
1592  init(Home home, const FloatVarArgs& x, double d=1.0,
1593  FloatBranchMerit bm=nullptr);
1594  };
1595 
1596 }
1597 
1599 
1600 namespace Gecode {
1601 
1607  class FloatCHB : public CHB {
1608  public:
1616  FloatCHB(void);
1618  FloatCHB(const FloatCHB& chb);
1620  FloatCHB& operator =(const FloatCHB& chb);
1630  FloatCHB(Home home, const FloatVarArgs& x, FloatBranchMerit bm=nullptr);
1642  GECODE_FLOAT_EXPORT void
1643  init(Home home, const FloatVarArgs& x, FloatBranchMerit bm=nullptr);
1644  };
1645 
1646 }
1647 
1648 #include <gecode/float/branch/chb.hpp>
1649 
1650 namespace Gecode {
1651 
1653  typedef std::function<void(const Space &home, const Brancher& b,
1654  unsigned int a,
1655  FloatVar x, int i, const FloatNumBranch& n,
1656  std::ostream& o)>
1658 
1659 }
1660 
1661 namespace Gecode {
1662 
1668  class FloatVarBranch : public VarBranch<FloatVar> {
1669  public:
1671  enum Select {
1672  SEL_NONE = 0,
1697  SEL_CHB_SIZE_MAX
1698  };
1699  protected:
1702  public:
1704  FloatVarBranch(void);
1706  FloatVarBranch(Rnd r);
1710  FloatVarBranch(Select s, double, BranchTbl t);
1720  Select select(void) const;
1722  void expand(Home home, const FloatVarArgs& x);
1723  };
1724 
1725 
1744  FloatVarBranch FLOAT_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr);
1748  FloatVarBranch FLOAT_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr);
1752  FloatVarBranch FLOAT_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr);
1756  FloatVarBranch FLOAT_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr);
1784  FloatVarBranch FLOAT_VAR_AFC_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr);
1788  FloatVarBranch FLOAT_VAR_AFC_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr);
1808 
1809 }
1810 
1811 #include <gecode/float/branch/var.hpp>
1812 
1813 namespace Gecode {
1814 
1820  class FloatValBranch : public ValBranch<FloatVar> {
1821  public:
1823  enum Select {
1827  SEL_VAL_COMMIT
1828  };
1829  protected:
1832  public:
1834  FloatValBranch(Select s = SEL_SPLIT_MIN);
1836  FloatValBranch(Rnd r);
1840  Select select(void) const;
1841  };
1842 
1862 
1863 }
1864 
1865 #include <gecode/float/branch/val.hpp>
1866 
1867 namespace Gecode {
1868 
1874  class FloatAssign : public ValBranch<FloatVar> {
1875  public:
1877  enum Select {
1881  SEL_VAL_COMMIT
1882  };
1883  protected:
1886  public:
1888  FloatAssign(Select s = SEL_MIN);
1890  FloatAssign(Rnd r);
1894  Select select(void) const;
1895  };
1896 
1915 
1916 }
1917 
1919 
1920 namespace Gecode {
1921 
1927  GECODE_FLOAT_EXPORT void
1928  branch(Home home, const FloatVarArgs& x,
1929  FloatVarBranch vars, FloatValBranch vals,
1930  FloatBranchFilter bf=nullptr,
1931  FloatVarValPrint vvp=nullptr);
1937  GECODE_FLOAT_EXPORT void
1938  branch(Home home, const FloatVarArgs& x,
1940  FloatBranchFilter bf=nullptr,
1941  FloatVarValPrint vvp=nullptr);
1947  GECODE_FLOAT_EXPORT void
1948  branch(Home home, FloatVar x, FloatValBranch vals,
1949  FloatVarValPrint vvp=nullptr);
1950 
1956  GECODE_FLOAT_EXPORT void
1957  assign(Home home, const FloatVarArgs& x, FloatAssign vals,
1958  FloatBranchFilter bf=nullptr,
1959  FloatVarValPrint vvp=nullptr);
1965  GECODE_FLOAT_EXPORT void
1966  assign(Home home, FloatVar x, FloatAssign vals,
1967  FloatVarValPrint vvp=nullptr);
1969 
1970 }
1971 
1972 namespace Gecode {
1973 
1974  /*
1975  * \brief Relaxed assignment of variables in \a x from values in \a sx
1976  *
1977  * The variables in \a x are assigned values from the assigned variables
1978  * in the solution \a sx with a relaxation probability \a p. That is,
1979  * if \$fp=0.1\f$ approximately 10% of the variables in \a x will be
1980  * assigned a value from \a sx.
1981  *
1982  * The random numbers are generated from the generator \a r. At least
1983  * one variable will not be assigned: in case the relaxation attempt
1984  * would suggest that all variables should be assigned, a single
1985  * variable will be selected randomly to remain unassigned.
1986  *
1987  * Throws an exception of type Float::ArgumentSizeMismatch, if \a x and
1988  * \a sx are of different size.
1989  *
1990  * Throws an exception of type Float::OutOfLimits, if \a p is not between
1991  * \a 0.0 and \a 1.0.
1992  *
1993  * \ingroup TaskModeFloat
1994  */
1995  GECODE_FLOAT_EXPORT void
1996  relax(Home home, const FloatVarArgs& x, const FloatVarArgs& sx,
1997  Rnd r, double p);
1998 
1999 }
2000 
2002 
2003 namespace Gecode {
2004 
2015  protected:
2019  const Delta& d;
2020  public:
2022 
2025  const Delta& d);
2027 
2029  FloatNum min(void) const;
2032  FloatNum max(void) const;
2034  };
2035 
2036 }
2037 
2039 
2041 
2042 namespace Gecode {
2043 
2054 
2059  class GECODE_FLOAT_EXPORT StdFloatTracer : public FloatTracer {
2060  protected:
2062  std::ostream& os;
2063  public:
2065  StdFloatTracer(std::ostream& os0 = std::cerr);
2067  virtual void init(const Space& home, const FloatTraceRecorder& t);
2069  virtual void prune(const Space& home, const FloatTraceRecorder& t,
2070  const ViewTraceInfo& vti, int i, FloatTraceDelta& d);
2072  virtual void fix(const Space& home, const FloatTraceRecorder& t);
2074  virtual void fail(const Space& home, const FloatTraceRecorder& t);
2076  virtual void done(const Space& home, const FloatTraceRecorder& t);
2078  static StdFloatTracer def;
2079  };
2080 
2081 
2086  GECODE_FLOAT_EXPORT void
2087  trace(Home home, const FloatVarArgs& x,
2088  TraceFilter tf,
2089  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
2090  FloatTracer& t = StdFloatTracer::def);
2095  void
2096  trace(Home home, const FloatVarArgs& x,
2097  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
2098  FloatTracer& t = StdFloatTracer::def);
2099 
2100 }
2101 
2102 #include <gecode/float/trace.hpp>
2103 
2104 #endif
2105 
2106 // IFDEF: GECODE_HAS_FLOAT_VARS
2107 // STATISTICS: float-post
2108 
boost::numeric::interval_lib::checking_strict< FloatNum > P
Used checking policy.
Definition: float.hh:418
#define GECODE_FLOAT_EXPORT
Definition: float.hh:68
FloatNum pi_half_upper(void)
Return upper bound of .
Definition: num.hpp:41
Select values greater than mean of smallest and largest value.
Definition: float.hh:1825
FloatVal operator-(const FloatVal &x)
Definition: val.hpp:168
With smallest degree divided by domain size.
Definition: float.hh:1690
SetExpr singleton(const LinIntExpr &e)
Singleton expression.
Definition: set-expr.cpp:691
Passing float arguments.
Definition: float.hh:950
FloatVarBranch FLOAT_VAR_CHB_SIZE_MIN(BranchTbl tbl)
Select variable with smallest CHB Q-score divided by domain size.
Definition: var.hpp:267
FloatNum atanh_down(FloatNum x)
Return lower bound of hyperbolic arctangent of x (domain: )
FloatNum tanh_up(FloatNum x)
Return upper bound of hyperbolic tangent of x (domain: )
Variables as interfaces to variable implementations.
Definition: var.hpp:47
NodeType t
Type of node.
Definition: bool-expr.cpp:230
FloatNum add_down(FloatNum x, FloatNum y)
Return lower bound of x plus y (domain: )
FloatNum asinh_down(FloatNum x)
Return lower bound of hyperbolic arcsine of x (domain: )
Select
Which value selection.
Definition: float.hh:1823
Tracer that process view trace information.
Definition: tracer.hpp:51
Combine variable selection criteria for tie-breaking.
Definition: tiebreak.hpp:38
Which values to select for branching first.
Definition: float.hh:1820
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:88
With smallest domain size.
Definition: float.hh:1688
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: )
FloatValBranch FLOAT_VAL_SPLIT_MAX(void)
Select values greater than mean of smallest and largest value.
Definition: val.hpp:60
NNF * l
Left subtree.
Definition: bool-expr.cpp:240
bool valid(const FloatVal &n)
Return whether float n is a valid number.
Definition: limits.hpp:39
With largest domain size.
Definition: float.hh:1689
FloatNum cosh_down(FloatNum x)
Return lower bound of hyperbolic cosine of x (domain: )
View trace information.
Definition: core.hpp:905
bool subset(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:490
void branch(Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatValBranch vals, FloatBranchFilter bf, FloatVarValPrint vvp)
Branch over x with variable selection vars and value selection vals.
Definition: branch.cpp:39
With smallest accumulated failure count divided by domain size.
Definition: float.hh:1692
FloatNum asinh_up(FloatNum x)
Return upper bound of hyperbolic arcsine of x (domain: )
void log(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Definition: channel.cpp:41
const FloatNum max
Largest allowed float value.
Definition: float.hh:844
FloatNum int_down(FloatNum x)
Return next downward-rounded integer of x (domain: )
FloatVarBranch FLOAT_VAR_CHB_SIZE_MAX(BranchTbl tbl)
Select variable with largest CHB Q-score divided by domain size.
Definition: var.hpp:277
FloatVal operator/(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:213
Disequality ( )
Definition: float.hh:1070
ViewTraceRecorder< Float::FloatView > FloatTraceRecorder
Trace recorder for float variables.
Definition: float.hh:2053
FloatAssign FLOAT_ASSIGN_MAX(void)
Select median value of the upper part.
Definition: assign.hpp:60
bool operator!=(const MinusView &x, const MinusView &y)
Definition: minus.hpp:169
Recording actions for float variables.
Definition: float.hh:1555
FloatNum tanh_down(FloatNum x)
Return lower bound of hyperbolic tangent of x (domain: )
FloatVarBranch FLOAT_VAR_DEGREE_MAX(BranchTbl tbl)
Select variable with largest degree.
Definition: var.hpp:122
Less or equal ( )
Definition: float.hh:1071
FloatVal fmod(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:422
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:49
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:41
Passing float variables.
Definition: float.hh:979
FloatVarBranch FLOAT_VAR_AFC_SIZE_MIN(double d, BranchTbl tbl)
Select variable with smalllest accumulated failure count divided by domain size with decay factor d...
Definition: var.hpp:227
With smallest degree.
Definition: float.hh:1676
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Definition: arithmetic.cpp:118
boost::numeric::interval_lib::save_state< Float::Rounding > R
Used rounding policies.
Definition: float.hh:416
bool overlap(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:498
Select median value of a randomly chosen part.
Definition: float.hh:1880
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Definition: arithmetic.cpp:109
FloatAssign FLOAT_ASSIGN_MIN(void)
Select median value of the lower part.
Definition: assign.hpp:55
Select s
Which value to select.
Definition: float.hh:1831
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Definition: dom.cpp:40
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatVal c)
Post propagator for .
Definition: linear.cpp:41
FloatVal hull(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:507
FloatNum sqrt_down(FloatNum x)
Return lower bound of square root of x (domain: )
With largest accumulated failure count.
Definition: float.hh:1679
FloatNum asin_up(FloatNum x)
Return upper bound of arcsine of x (domain: )
Which variable to select for branching.
Definition: float.hh:1668
Select values randomly which are not greater or not smaller than mean of largest and smallest value...
Definition: float.hh:1826
Less ( )
Definition: float.hh:1072
Select
Which variable selection.
Definition: float.hh:1671
FloatNum sinh_up(FloatNum x)
Return upper bound of hyperbolic sine of x (domain: )
FloatNum sqrt_up(FloatNum x)
Return upper bound of square root of x (domain: )
With highest CHB Q-score.
Definition: float.hh:1683
FloatValBranch FLOAT_VAL(FloatBranchVal v, FloatBranchCommit c)
Definition: val.hpp:70
Trace init events.
Definition: recorder.hpp:43
FloatVarBranch FLOAT_VAR_ACTION_SIZE_MIN(double d, BranchTbl tbl)
Select variable with smallest action divided by domain size with decay factor d.
Definition: var.hpp:247
Float variable array.
Definition: float.hh:1030
Computation spaces.
Definition: core.hpp:1701
ExecStatus prune(Space &home, ViewArray< VX > &x, ConstIntView)
Definition: rel.hpp:264
FloatVarBranch FLOAT_VAR_NONE(void)
Select first unassigned variable.
Definition: var.hpp:97
FloatVarBranch FLOAT_VAR_DEGREE_MIN(BranchTbl tbl)
Select variable with smallest degree.
Definition: var.hpp:117
FloatVarBranch FLOAT_VAR_MERIT_MIN(FloatBranchMerit bm, BranchTbl tbl)
Select variable with least merit according to branch merit function bm.
Definition: var.hpp:102
Select s
Which value to select.
Definition: float.hh:1885
FloatValBranch FLOAT_VAL_SPLIT_RND(Rnd r)
Select values randomly which are not greater or not smaller than mean of largest and smallest value...
Definition: val.hpp:65
With smallest action divided by domain size.
Definition: float.hh:1694
Gecode::IntSet d(v, 7)
FloatValImpType x
Implementation of float value.
Definition: float.hh:425
std::string expand(Gecode::IntRelType irt)
Expand relation to abbreviation.
Definition: mm-count.cpp:44
With lowest CHB Q-score.
Definition: float.hh:1682
FloatNum pi_twice_lower(void)
Return lower bound of .
Definition: num.hpp:53
Gecode::FloatVal c(-8, 8)
Trace prune events.
Definition: recorder.hpp:44
Greater or equal ( )
Definition: float.hh:1073
FloatVarBranch FLOAT_VAR_SIZE_MAX(BranchTbl tbl)
Select variable with largest domain size.
Definition: var.hpp:212
FloatNum log_down(FloatNum x)
Return lower bound of logarithm of x (domain: )
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:232
Standard float variable tracer.
Definition: float.hh:2059
bool proper_subset(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:494
FloatVarBranch FLOAT_VAR_DEGREE_SIZE_MIN(BranchTbl tbl)
Select variable with smallest degree divided by domain size.
Definition: var.hpp:217
Base-class for branchers.
Definition: core.hpp:1401
FloatNum n
The middle value for branching.
Definition: float.hh:1465
Class for AFC (accumulated failure count) management.
Definition: afc.hpp:40
FloatNum asin_down(FloatNum x)
Return lower bound of arcsine of x (domain: )
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:234
FloatNum sin_up(FloatNum x)
Return upper bound of sine of x (domain: )
FloatNum int_up(FloatNum x)
Return next upward-rounded integer of x (domain: )
Argument array for non-primitive types.
Definition: array.hpp:638
FloatAssign FLOAT_ASSIGN_RND(Rnd r)
Select median value of a randomly chosen part.
Definition: assign.hpp:65
Gecode::IntArgs i({1, 2, 3, 4})
FloatVal sinh(const FloatVal &x)
Definition: val.hpp:460
FloatNum pi_twice_upper(void)
Return upper bound of .
Definition: num.hpp:57
FloatVal intersect(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:503
Value description class for branching.
Definition: float.hh:1462
FloatVal operator+(const FloatVal &x)
Definition: val.hpp:164
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:95
FloatRelType
Relation types for floats.
Definition: float.hh:1068
FloatNum log_up(FloatNum x)
Return upper bound of logarithm of x (domain: )
New view Float::FloatView n
Definition: float.hh:2017
bool operator==(const MinusView &x, const MinusView &y)
Definition: minus.hpp:165
FloatNum cos_down(FloatNum x)
Return lower bound of cosine of x (domain: )
Output stream to use std::ostream & os
Definition: float.hh:2062
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:102
struct Gecode::@593::NNF::@62::@63 b
For binary nodes (and, or, eqv)
std::function< double(const Space &home, double w, double b)> BranchTbl
Tie-break limit function.
Definition: var.hpp:48
void wait(Home home, FloatVar x, std::function< void(Space &home)> c)
Execute c when x becomes assigned.
Definition: exec.cpp:39
Class for CHB management.
Definition: chb.hpp:46
unsigned int size(I &i)
Size of all ranges of range iterator i.
Reification specification.
Definition: int.hh:876
bool l
Whether to try the lower or upper half first.
Definition: float.hh:1467
FloatVal cosh(const FloatVal &x)
Definition: val.hpp:464
Trace filters.
Definition: filter.hpp:133
FloatNum pi_half_lower(void)
Return lower bound of .
Definition: num.hpp:37
FloatValBranch FLOAT_VAL_SPLIT_MIN(void)
Select values not greater than mean of smallest and largest value.
Definition: val.hpp:55
const int * pi[]
Definition: photo.cpp:14262
std::function< void(Space &home, unsigned int a, FloatVar x, int i, FloatNumBranch nl)> FloatBranchCommit
Branch commit function type for float variables.
Definition: float.hh:1496
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
Definition: set.hh:767
FloatVarBranch FLOAT_VAR_AFC_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count with decay factor d.
Definition: var.hpp:127
FloatNum atanh_up(FloatNum x)
Return upper bound of hyperbolic arctangent of x (domain: )
With largest accumulated failure count divided by domain size.
Definition: float.hh:1693
void asin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
FloatVarBranch FLOAT_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking)
Definition: var.hpp:112
ViewTracer< Float::FloatView > FloatTracer
Tracer for float variables.
Definition: float.hh:2048
With smallest CHB Q-score divided by domain size.
Definition: float.hh:1696
Select values not greater than mean of smallest and largest value.
Definition: float.hh:1824
Floating point rounding policy.
Definition: float.hh:154
Random (uniform, for tie breaking)
Definition: float.hh:1673
FloatNum tan_up(FloatNum x)
Return upper bound of tangent of x (domain: )
Equality ( )
Definition: float.hh:1069
Recording CHB for float variables.
Definition: float.hh:1607
FloatNum atan_up(FloatNum x)
Return upper bound of arctangent of x (domain: )
Float view for float variables.
Definition: view.hpp:52
FloatVarBranch FLOAT_VAR_SIZE_MIN(BranchTbl tbl)
Select variable with smallest domain size.
Definition: var.hpp:207
union Gecode::@593::NNF::@62 u
Union depending on nodetype t.
Greater ( )
Definition: float.hh:1074
Boolean integer variables.
Definition: int.hh:512
FloatVarBranch FLOAT_VAR_MIN_MAX(BranchTbl tbl)
Select variable with largest min.
Definition: var.hpp:192
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition: set.hh:767
void check(const FloatVal &n, const char *l)
Check whether float n is a valid number, otherwise throw out of limits exception with information l...
Definition: limits.hpp:44
const int v[7]
Definition: distinct.cpp:259
Propagator for recording view trace information.
Definition: recorder.hpp:59
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:67
FloatNum cos_up(FloatNum x)
Return upper bound of cosine of x (domain: )
void cos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Trace delta information for float variables.
Definition: float.hh:2014
FloatNum acosh_up(FloatNum x)
Return upper bound of hyperbolic arccosine of x (domain: )
Post propagator for SetVar SetOpType SetVar y
Definition: set.hh:767
Value branching information.
Definition: val.hpp:41
Trace done events.
Definition: recorder.hpp:47
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:127
void relax(Home home, const FloatVarArgs &x, const FloatVarArgs &sx, Rnd r, double p)
Definition: relax.cpp:57
const double base
Base for geometric restart sequence.
Definition: search.hh:126
Float value type.
Definition: float.hh:334
FloatVal operator*(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:200
Variable branching information.
Definition: var.hpp:55
FloatNum atan_down(FloatNum x)
Return lower bound of arctangent of x (domain: )
Rounding(void)
Default constructor (configures full rounding mode)
Definition: rounding.hpp:37
Generic domain change information to be supplied to advisors.
Definition: core.hpp:203
FloatNum sub_down(FloatNum x, FloatNum y)
Return lower bound of x minus y (domain: )
boost::numeric::interval_lib::rounded_arith_opp< FloatNum > RoundingBase
Rounding Base class (optimized version)
Definition: float.hh:145
Select median value of the upper part.
Definition: float.hh:1879
FloatNum acosh_down(FloatNum x)
Return lower bound of hyperbolic arccosine of x (domain: )
void tan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
With smallest accumulated failure count.
Definition: float.hh:1678
Select
Which value selection.
Definition: float.hh:1877
Select s
Which variable to select.
Definition: float.hh:1701
bool operator>=(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:277
FloatVal acosh(const FloatVal &x)
Definition: val.hpp:476
FloatVarBranch FLOAT_VAR_AFC_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count with decay factor d.
Definition: var.hpp:137
Integer variables.
Definition: int.hh:371
FloatNum div_down(FloatNum x, FloatNum y)
Return lower bound of x divided by y (domain: )
FloatNum exp_up(FloatNum x)
Return upper bound of exponential of x (domain: )
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Definition: rel.cpp:43
FloatNum acos_up(FloatNum x)
Return upper bound of arccossine of x (domain: )
std::function< bool(const Space &home, FloatVar x, int i)> FloatBranchFilter
Branch filter function type for float variables.
Definition: float.hh:1442
With largest degree divided by domain size.
Definition: float.hh:1691
FloatVarBranch FLOAT_VAR_ACTION_MIN(double d, BranchTbl tbl)
Select variable with lowest action with decay factor d.
Definition: var.hpp:147
FloatVal atanh(const FloatVal &x)
Definition: val.hpp:480
FloatVal asinh(const FloatVal &x)
Definition: val.hpp:472
FloatVarBranch FLOAT_VAR_CHB_MIN(BranchTbl tbl)
Select variable with lowest CHB Q-score.
Definition: var.hpp:167
Which values to select for assignment.
Definition: float.hh:1874
boost::numeric::interval< FloatNum, boost::numeric::interval_lib::policies< R, P > > FloatValImpType
Implementation type for float value.
Definition: float.hh:423
Delta information const Delta & d
Definition: float.hh:2019
Trace fail events.
Definition: recorder.hpp:46
Post propagator for SetVar x
Definition: set.hh:767
FloatNum cosh_up(FloatNum x)
Return upper bound of hyperbolic cosine of x (domain: )
Trace fixpoint events.
Definition: recorder.hpp:45
FloatNum exp_down(FloatNum x)
Return lower bound of exponential of x (domain: )
FloatAssign FLOAT_ASSIGN(FloatBranchVal v, FloatBranchCommit c)
Definition: assign.hpp:70
void trace(Home home, const FloatVarArgs &x, TraceFilter tf, int te, FloatTracer &t)
Create a tracer for float variables.
Definition: trace.cpp:39
Select median value of the lower part.
Definition: float.hh:1878
Float variables.
Definition: float.hh:870
bool operator>(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:260
FloatVarBranch FLOAT_VAR_MIN_MIN(BranchTbl tbl)
Select variable with smallest min.
Definition: var.hpp:187
FloatNum sinh_down(FloatNum x)
Return lower bound of hyperbolic sine of x (domain: )
FloatNum sub_up(FloatNum x, FloatNum y)
Return upper bound of x minus y (domain: )
std::function< void(const Space &home, const Brancher &b, unsigned int a, FloatVar x, int i, const FloatNumBranch &n, std::ostream &o)> FloatVarValPrint
Function type for explaining branching alternatives for float variables.
Definition: float.hh:1657
bool operator<(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:226
bool operator<=(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:243
With largest action divided by domain size.
Definition: float.hh:1695
FloatNum add_up(FloatNum x, FloatNum y)
Return upper bound of x plus y (domain: )
Gecode toplevel namespace
Argument array for variables.
Definition: array.hpp:61
void sin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
FloatNum acos_down(FloatNum x)
Return lower bound of arccosine of x (domain: )
Class for action management.
Definition: action.hpp:42
FloatVarBranch FLOAT_VAR_ACTION_SIZE_MAX(double d, BranchTbl tbl)
Select variable with largest action divided by domain size with decay factor d.
Definition: var.hpp:257
Random number generator.
Definition: rnd.hpp:42
FloatVarBranch FLOAT_VAR_AFC_SIZE_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count divided by domain size with decay factor d...
Definition: var.hpp:237
void acos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void exp(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
FloatNum pi_lower(void)
Return lower bound of .
Definition: num.hpp:45
FloatNum mul_up(FloatNum x, FloatNum y)
Return upper bound of x times y (domain: )
void assign(Home home, const FloatVarArgs &x, FloatAssign fa, FloatBranchFilter bf, FloatVarValPrint vvp)
Assign all x with value selection vals.
Definition: branch.cpp:111
FloatVarBranch FLOAT_VAR_MAX_MAX(BranchTbl tbl)
Select variable with largest max.
Definition: var.hpp:202
FloatVal tanh(const FloatVal &x)
Definition: val.hpp:468
Home class for posting propagators
Definition: core.hpp:853
FloatVarBranch FLOAT_VAR_MERIT_MAX(FloatBranchMerit bm, BranchTbl tbl)
Select variable with highest merit according to branch merit function bm.
Definition: var.hpp:107
double tbl(const Gecode::Space &, double w, double b)
Test function for tie-break limit function.
Definition: branch.cpp:61
FloatVarBranch FLOAT_VAR_ACTION_MAX(double d, BranchTbl tbl)
Select variable with highest action with decay factor d.
Definition: var.hpp:157
double FloatNum
Floating point number base type.
Definition: float.hh:106
FloatVarBranch FLOAT_VAR_MAX_MIN(BranchTbl tbl)
Select variable with smallest max.
Definition: var.hpp:197
Shared array with arbitrary number of elements.
FloatVarBranch FLOAT_VAR_DEGREE_SIZE_MAX(BranchTbl tbl)
Select variable with largest degree divided by domain size.
Definition: var.hpp:222
~Rounding(void)
Destructor (restores previous rounding mode)
Definition: rounding.hpp:41
std::function< FloatNumBranch(const Space &home, FloatVar x, int i)> FloatBranchVal
Branch value function type for float variables.
Definition: float.hh:1481
struct Gecode::@593::NNF::@62::@64 a
For atomic nodes.
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
Definition: bool.cpp:39
FloatNum median(FloatNum x, FloatNum y)
Return median of x and y (domain: )
Definition: rounding.hpp:44
std::function< double(const Space &home, FloatVar x, int i)> FloatBranchMerit
Branch merit function type for float variables.
Definition: float.hh:1455
void atan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
FloatNum sin_down(FloatNum x)
Return lower bound of sine of x (domain: )
Recording AFC information for float variables.
Definition: float.hh:1509
FloatNum tan_down(FloatNum x)
Return lower bound of tangent of x (domain: )
FloatNum pi_upper(void)
Return upper bound of .
Definition: num.hpp:49
FloatVarBranch FLOAT_VAR_CHB_MAX(BranchTbl tbl)
Select variable with highest CHB Q-score.
Definition: var.hpp:177