Generated on Sat Feb 7 2015 02:01:14 for Gecode by doxygen 1.8.9.1
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  * Last modified:
14  * $Date: 2014-10-03 15:34:37 +0200 (Fri, 03 Oct 2014) $ by $Author: schulte $
15  * $Revision: 14241 $
16  *
17  * This file is part of Gecode, the generic constraint
18  * development environment:
19  * http://www.gecode.org
20  *
21  * Permission is hereby granted, free of charge, to any person obtaining
22  * a copy of this software and associated documentation files (the
23  * "Software"), to deal in the Software without restriction, including
24  * without limitation the rights to use, copy, modify, merge, publish,
25  * distribute, sublicense, and/or sell copies of the Software, and to
26  * permit persons to whom the Software is furnished to do so, subject to
27  * the following conditions:
28  *
29  * The above copyright notice and this permission notice shall be
30  * included in all copies or substantial portions of the Software.
31  *
32  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
33  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
34  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
35  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
36  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
37  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
38  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39  *
40  */
41 
42 #ifndef __GECODE_FLOAT_HH__
43 #define __GECODE_FLOAT_HH__
44 
45 #include <climits>
46 #include <cfloat>
47 #include <iostream>
48 
49 #include <gecode/kernel.hh>
50 #include <gecode/int.hh>
51 
52 /*
53  * Configure linking
54  *
55  */
56 #if !defined(GECODE_STATIC_LIBS) && \
57  (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
58 
59 #ifdef GECODE_BUILD_FLOAT
60 #define GECODE_FLOAT_EXPORT __declspec( dllexport )
61 #else
62 #define GECODE_FLOAT_EXPORT __declspec( dllimport )
63 #endif
64 
65 #else
66 
67 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
68 #define GECODE_FLOAT_EXPORT __attribute__ ((visibility("default")))
69 #else
70 #define GECODE_FLOAT_EXPORT
71 #endif
72 
73 #endif
74 
75 // Configure auto-linking
76 #ifndef GECODE_BUILD_FLOAT
77 #define GECODE_LIBRARY_NAME "Float"
79 #endif
80 
81 // Include interval implementation
82 #include <gecode/third-party/boost/numeric/interval.hpp>
83 
96 
98 
99 namespace Gecode {
100 
108  typedef double FloatNum;
109 
111  FloatNum pi_half_lower(void);
113  FloatNum pi_half_upper(void);
115  FloatNum pi_lower(void);
117  FloatNum pi_upper(void);
119  FloatNum pi_twice_lower(void);
121  FloatNum pi_twice_upper(void);
122 
123  // Forward declaration
124  class FloatVal;
125 
126 }
127 
128 #include <gecode/float/num.hpp>
129 
130 namespace Gecode { namespace Float {
131 
137  class Rounding :
138  public gecode_boost::numeric::interval_lib::rounded_arith_opp<FloatNum> {
139  protected:
141  typedef gecode_boost::numeric::interval_lib::rounded_arith_opp<FloatNum> Base;
142  public:
144 
145  Rounding(void);
148  ~Rounding(void);
150 
152 
174 
176 
184 
185 #ifdef GECODE_HAS_MPFR
186 
197 
199 
213 
215 
229 
231 
245 
247 
261 #endif
262  };
263 
264 }}
265 
266 #include <gecode/float/rounding.hpp>
267 
268 namespace Gecode { namespace Float {
269 
274  bool subset(const FloatVal& x, const FloatVal& y);
279  bool proper_subset(const FloatVal& x, const FloatVal& y);
284  bool overlap(const FloatVal& x, const FloatVal& y);
285 
290  FloatVal intersect(const FloatVal& x, const FloatVal& y);
295  FloatVal hull(const FloatVal& x, const FloatVal& y);
300  FloatVal hull(const FloatVal& x, const FloatNum& y);
305  FloatVal hull(const FloatNum& x, const FloatVal& y);
310  FloatVal hull(const FloatNum& x, const FloatNum& y);
311 
312 }}
313 
314 namespace Gecode {
315 
321  class FloatVal {
322  friend FloatVal operator +(const FloatVal& x);
323  friend FloatVal operator -(const FloatVal& x);
324  friend FloatVal operator +(const FloatVal& x, const FloatVal& y);
325  friend FloatVal operator +(const FloatVal& x, const FloatNum& y);
326  friend FloatVal operator +(const FloatNum& x, const FloatVal& y);
327  friend FloatVal operator -(const FloatVal& x, const FloatVal& y);
328  friend FloatVal operator -(const FloatVal& x, const FloatNum& y);
329  friend FloatVal operator -(const FloatNum& x, const FloatVal& y);
330  friend FloatVal operator *(const FloatVal& x, const FloatVal& y);
331  friend FloatVal operator *(const FloatVal& x, const FloatNum& y);
332  friend FloatVal operator *(const FloatNum& x, const FloatVal& y);
333  friend FloatVal operator /(const FloatVal& x, const FloatVal& y);
334  friend FloatVal operator /(const FloatVal& x, const FloatNum& y);
335  friend FloatVal operator /(const FloatNum& x, const FloatVal& y);
336 
337  friend bool operator <(const FloatVal& x, const FloatVal& y);
338  friend bool operator <(const FloatVal& x, const FloatNum& y);
339  friend bool operator <(const FloatNum& x, const FloatVal& y);
340  friend bool operator <=(const FloatVal& x, const FloatVal& y);
341  friend bool operator <=(const FloatVal& x, const FloatNum& y);
342  friend bool operator <=(const FloatNum& x, const FloatVal& y);
343  friend bool operator >(const FloatVal& x, const FloatVal& y);
344  friend bool operator >(const FloatVal& x, const FloatNum& y);
345  friend bool operator >(const FloatNum& x, const FloatVal& y);
346  friend bool operator >=(const FloatVal& x, const FloatVal& y);
347  friend bool operator >=(const FloatVal& x, const FloatNum& y);
348  friend bool operator >=(const FloatNum& x, const FloatVal& y);
349  friend bool operator ==(const FloatVal& x, const FloatVal& y);
350  friend bool operator ==(const FloatVal& x, const FloatNum& y);
351  friend bool operator ==(const FloatNum& x, const FloatVal& y);
352  friend bool operator !=(const FloatVal& x, const FloatVal& y);
353  friend bool operator !=(const FloatVal& x, const FloatNum& y);
354  friend bool operator !=(const FloatNum& x, const FloatVal& y);
355 
356  template<class Char, class Traits>
357  friend std::basic_ostream<Char,Traits>&
358  operator <<(std::basic_ostream<Char,Traits>& os, const FloatVal& x);
359 
360  friend FloatVal abs(const FloatVal& x);
361  friend FloatVal sqrt(const FloatVal& x);
362  friend FloatVal sqr(const FloatVal& x);
363  friend FloatVal pow(const FloatVal& x, int n);
364  friend FloatVal nroot(const FloatVal& x, int n);
365 
366  friend FloatVal max(const FloatVal& x, const FloatVal& y);
367  friend FloatVal max(const FloatVal& x, const FloatNum& y);
368  friend FloatVal max(const FloatNum& x, const FloatVal& y);
369  friend FloatVal min(const FloatVal& x, const FloatVal& y);
370  friend FloatVal min(const FloatVal& x, const FloatNum& y);
371  friend FloatVal min(const FloatNum& x, const FloatVal& y);
372 
373 #ifdef GECODE_HAS_MPFR
374  friend FloatVal exp(const FloatVal& x);
375  friend FloatVal log(const FloatVal& x);
376  friend FloatVal fmod(const FloatVal& x, const FloatVal& y);
377  friend FloatVal fmod(const FloatVal& x, const FloatNum& y);
378  friend FloatVal fmod(const FloatNum& x, const FloatVal& y);
379  friend FloatVal sin(const FloatVal& x);
380  friend FloatVal cos(const FloatVal& x);
381  friend FloatVal tan(const FloatVal& x);
382  friend FloatVal asin(const FloatVal& x);
383  friend FloatVal acos(const FloatVal& x);
384  friend FloatVal atan(const FloatVal& x);
385  friend FloatVal sinh(const FloatVal& x);
386  friend FloatVal cosh(const FloatVal& x);
387  friend FloatVal tanh(const FloatVal& x);
388  friend FloatVal asinh(const FloatVal& x);
389  friend FloatVal acosh(const FloatVal& x);
390  friend FloatVal atanh(const FloatVal& x);
391 #endif
392 
393  friend bool Float::subset(const FloatVal& x, const FloatVal& y);
394  friend bool Float::proper_subset(const FloatVal& x, const FloatVal& y);
395  friend bool Float::overlap(const FloatVal& x, const FloatVal& y);
396  friend FloatVal Float::intersect(const FloatVal& x, const FloatVal& y);
397  friend FloatVal Float::hull(const FloatVal& x, const FloatVal& y);
398  friend FloatVal Float::hull(const FloatVal& x, const FloatNum& y);
399  friend FloatVal Float::hull(const FloatNum& x, const FloatVal& y);
400  friend FloatVal Float::hull(const FloatNum& x, const FloatNum& y);
401  protected:
403  typedef gecode_boost::numeric::interval_lib::save_state<Float::Rounding> R;
405  typedef gecode_boost::numeric::interval_lib::checking_strict<FloatNum> P;
407  typedef gecode_boost::numeric::interval
408  <FloatNum,
409  gecode_boost::numeric::interval_lib::policies<R, P> >
414  explicit FloatVal(const FloatValImpType& i);
415  public:
417 
418  FloatVal(void);
421  FloatVal(const FloatNum& n);
423  FloatVal(const FloatNum& l, const FloatNum& u);
425  FloatVal(const FloatVal& v);
426 
428  FloatVal& operator =(const FloatNum& n);
430  FloatVal& operator =(const FloatVal& v);
431 
433  void assign(FloatNum const &l, FloatNum const &u);
435 
437 
438  FloatNum min(void) const;
441  FloatNum max(void) const;
443  FloatNum size(void) const;
445  FloatNum med(void) const;
447 
449 
450  bool tight(void) const;
453  bool singleton(void) const;
455  bool in(FloatNum n) const;
457  bool zero_in(void) const;
459 
461 
462  static FloatVal hull(FloatNum x, FloatNum y);
465  static FloatVal pi_half(void);
467  static FloatVal pi(void);
469  static FloatVal pi_twice(void);
471 
473 
474  FloatVal& operator +=(const FloatNum& n);
477  FloatVal& operator -=(const FloatNum& n);
479  FloatVal& operator *=(const FloatNum& n);
481  FloatVal& operator /=(const FloatNum& n);
483  FloatVal& operator +=(const FloatVal& v);
485  FloatVal& operator -=(const FloatVal& v);
487  FloatVal& operator *=(const FloatVal& v);
489  FloatVal& operator /=(const FloatVal& v);
491  };
492 
497  FloatVal operator +(const FloatVal& x);
502  FloatVal operator -(const FloatVal& x);
503 
508  FloatVal operator +(const FloatVal& x, const FloatVal& y);
513  FloatVal operator +(const FloatVal& x, const FloatNum& y);
518  FloatVal operator +(const FloatNum& x, const FloatVal& y);
523  FloatVal operator -(const FloatVal& x, const FloatVal& y);
528  FloatVal operator -(const FloatVal& x, const FloatNum& y);
533  FloatVal operator -(const FloatNum& x, const FloatVal& y);
538  FloatVal operator *(const FloatVal& x, const FloatVal& y);
543  FloatVal operator *(const FloatVal& x, const FloatNum& y);
548  FloatVal operator *(const FloatNum& x, const FloatVal& y);
553  FloatVal operator /(const FloatVal& x, const FloatVal& y);
558  FloatVal operator /(const FloatVal& x, const FloatNum& y);
563  FloatVal operator /(const FloatNum& r, const FloatVal& x);
564 
569  bool operator <(const FloatVal& x, const FloatVal& y);
574  bool operator <(const FloatVal& x, const FloatNum& y);
579  bool operator <(const FloatNum& x, const FloatVal& y);
580 
585  bool operator <=(const FloatVal& x, const FloatVal& y);
590  bool operator <=(const FloatVal& x, const FloatNum& y);
595  bool operator <=(const FloatNum& x, const FloatVal& y);
596 
601  bool operator >(const FloatVal& x, const FloatVal& y);
606  bool operator >(const FloatVal& x, const FloatNum& y);
611  bool operator >(const FloatNum& x, const FloatVal& y);
612 
617  bool operator >=(const FloatVal& x, const FloatVal& y);
622  bool operator >=(const FloatVal& x, const FloatNum& y);
627  bool operator >=(const FloatNum& x, const FloatVal& y);
632  bool operator ==(const FloatVal& x, const FloatVal& y);
637  bool operator ==(const FloatVal& x, const FloatNum& y);
642  bool operator ==(const FloatNum& x, const FloatVal& y);
643 
648  bool operator !=(const FloatVal& x, const FloatVal& y);
653  bool operator !=(const FloatVal& x, const FloatNum& y);
658  bool operator !=(const FloatNum& x, const FloatVal& y);
659 
664  template<class Char, class Traits>
665  std::basic_ostream<Char,Traits>&
666  operator <<(std::basic_ostream<Char,Traits>& os, const FloatVal& x);
667 
672  FloatVal abs(const FloatVal& x);
677  FloatVal sqrt(const FloatVal& x);
682  FloatVal sqr(const FloatVal& x);
687  FloatVal pow(const FloatVal& x, int n);
692  FloatVal nroot(const FloatVal& x, int n);
693 
698  FloatVal max(const FloatVal& x, const FloatVal& y);
703  FloatVal max(const FloatVal& x, const FloatNum& y);
708  FloatVal max(const FloatNum& x, const FloatVal& y);
713  FloatVal min(const FloatVal& x, const FloatVal& y);
718  FloatVal min(const FloatVal& x, const FloatNum& y);
723  FloatVal min(const FloatNum& x, const FloatVal& y);
724 
725 #ifdef GECODE_HAS_MPFR
726  /* transcendental functions: exp, log */
731  FloatVal exp(const FloatVal& x);
736  FloatVal log(const FloatVal& x);
737 
742  FloatVal fmod(const FloatVal& x, const FloatVal& y);
747  FloatVal fmod(const FloatVal& x, const FloatNum& y);
752  FloatVal fmod(const FloatNum& x, const FloatVal& y);
753 
758  FloatVal sin(const FloatVal& x);
763  FloatVal cos(const FloatVal& x);
768  FloatVal tan(const FloatVal& x);
773  FloatVal asin(const FloatVal& x);
778  FloatVal acos(const FloatVal& x);
783  FloatVal atan(const FloatVal& x);
784 
789  FloatVal sinh(const FloatVal& x);
794  FloatVal cosh(const FloatVal& x);
799  FloatVal tanh(const FloatVal& x);
804  FloatVal asinh(const FloatVal& x);
809  FloatVal acosh(const FloatVal& x);
814  FloatVal atanh(const FloatVal& x);
815 
816 #endif
817 
818 }
819 
820 #include <gecode/float/val.hpp>
821 
822 namespace Gecode { namespace Float {
823 
829  namespace Limits {
833  const FloatNum min = -max;
835  bool valid(const FloatVal& n);
837  void check(const FloatVal& n, const char* l);
838  }
839 
840 }}
841 
842 #include <gecode/float/limits.hpp>
843 
844 #include <gecode/float/var-imp.hpp>
845 
846 namespace Gecode {
847 
848  namespace Float {
849  class FloatView;
850  }
851 
857  class FloatVar : public VarImpVar<Float::FloatVarImp> {
858  friend class FloatVarArray;
859  friend class FloatVarArgs;
860  private:
868  void _init(Space& home, FloatNum min, FloatNum max);
869  public:
871 
872  FloatVar(void);
875  FloatVar(const FloatVar& y);
877  FloatVar(const Float::FloatView& y);
891 
893 
894  FloatVal domain(void) const;
897  FloatNum min(void) const;
899  FloatNum max(void) const;
901  FloatNum med(void) const;
903  FloatNum size(void) const;
911  FloatVal val(void) const;
912 
914 
916 
917  bool in(const FloatVal& n) const;
920  };
921 
926  template<class Char, class Traits>
927  std::basic_ostream<Char,Traits>&
928  operator <<(std::basic_ostream<Char,Traits>& os, const FloatVar& x);
929 }
930 
931 #include <gecode/float/view.hpp>
933 
934 namespace Gecode {
935 
937  class FloatValArgs : public PrimArgArray<FloatVal> {
938  public:
940 
941  FloatValArgs(void);
944  explicit FloatValArgs(int n);
948  FloatValArgs(const std::vector<FloatVal>& x);
950  template<class InputIterator>
951  FloatValArgs(InputIterator first, InputIterator last);
954  FloatValArgs(int n, int e0, ...);
956  FloatValArgs(int n, const FloatVal* e);
959 
961  static FloatValArgs create(int n, FloatVal start, int inc=1);
963  };
964 
966  class FloatVarArgs : public VarArgArray<FloatVar> {
967  public:
969 
970  FloatVarArgs(void) {}
973  explicit FloatVarArgs(int n) : VarArgArray<FloatVar>(n) {}
979  FloatVarArgs(const std::vector<FloatVar>& a) : VarArgArray<FloatVar>(a) {}
981  template<class InputIterator>
982  FloatVarArgs(InputIterator first, InputIterator last)
983  : VarArgArray<FloatVar>(first,last) {}
996  FloatVarArgs(Space& home, int n, FloatNum min, FloatNum max);
998  };
1000 
1016  class FloatVarArray : public VarArray<FloatVar> {
1017  public:
1019 
1020  FloatVarArray(void);
1023  FloatVarArray(Space& home, int n);
1025  FloatVarArray(const FloatVarArray& a);
1027  FloatVarArray(Space& home, const FloatVarArgs& a);
1040  FloatVarArray(Space& home, int n, FloatNum min, FloatNum max);
1042  };
1043 
1044 }
1045 
1046 #include <gecode/float/array.hpp>
1047 
1048 namespace Gecode {
1049 
1061  };
1062 
1070  GECODE_FLOAT_EXPORT void
1072  dom(Home home, FloatVar x, FloatVal n);
1074  GECODE_FLOAT_EXPORT void
1075  dom(Home home, const FloatVarArgs& x, FloatVal n);
1077  GECODE_FLOAT_EXPORT void
1078  dom(Home home, FloatVar x, FloatNum l, FloatNum m);
1080  GECODE_FLOAT_EXPORT void
1081  dom(Home home, const FloatVarArgs& x, FloatNum l, FloatNum u);
1083  GECODE_FLOAT_EXPORT void
1084  dom(Home home, FloatVar x, FloatVal n, Reify r);
1086  GECODE_FLOAT_EXPORT void
1087  dom(Home home, FloatVar x, FloatNum l, FloatNum u, Reify r);
1089  GECODE_FLOAT_EXPORT void
1090  dom(Home home, FloatVar x, FloatVar d);
1092  GECODE_FLOAT_EXPORT void
1093  dom(Home home, const FloatVarArgs& x, const FloatVarArgs& d);
1095 
1104  GECODE_FLOAT_EXPORT void
1105  rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1);
1109  GECODE_FLOAT_EXPORT void
1110  rel(Home home, FloatVar x, FloatRelType frt, FloatVal c);
1114  GECODE_FLOAT_EXPORT void
1115  rel(Home home, FloatVar x, FloatRelType frt, FloatVal c, Reify r);
1119  GECODE_FLOAT_EXPORT void
1120  rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1, Reify r);
1124  GECODE_FLOAT_EXPORT void
1125  rel(Home home, const FloatVarArgs& x, FloatRelType frt, FloatVal c);
1129  GECODE_FLOAT_EXPORT void
1130  rel(Home home, const FloatVarArgs& x, FloatRelType frt, FloatVar y);
1131 
1132 }
1133 
1134 
1135 namespace Gecode {
1136 
1145  GECODE_FLOAT_EXPORT void
1146  min(Home home, FloatVar x0, FloatVar x1, FloatVar x2);
1150  GECODE_FLOAT_EXPORT void
1151  min(Home home, const FloatVarArgs& x, FloatVar y);
1154  GECODE_FLOAT_EXPORT void
1155  max(Home home, FloatVar x0, FloatVar x1, FloatVar x2);
1159  GECODE_FLOAT_EXPORT void
1160  max(Home home, const FloatVarArgs& x, FloatVar y);
1161 
1164  GECODE_FLOAT_EXPORT void
1165  abs(Home home, FloatVar x0, FloatVar x1);
1166 
1169  GECODE_FLOAT_EXPORT void
1170  mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2);
1171 
1174  GECODE_FLOAT_EXPORT void
1175  sqr(Home home, FloatVar x0, FloatVar x1);
1176 
1179  GECODE_FLOAT_EXPORT void
1180  sqrt(Home home, FloatVar x0, FloatVar x1);
1181 
1184  GECODE_FLOAT_EXPORT void
1185  pow(Home home, FloatVar x0, int n, FloatVar x1);
1186 
1189  GECODE_FLOAT_EXPORT void
1190  nroot(Home home, FloatVar x0, int n, FloatVar x1);
1191 
1194  GECODE_FLOAT_EXPORT void
1195  div(Home home, FloatVar x0, FloatVar x1, FloatVar x2);
1196 #ifdef GECODE_HAS_MPFR
1197 
1199  GECODE_FLOAT_EXPORT void
1200  exp(Home home, FloatVar x0, FloatVar x1);
1203  GECODE_FLOAT_EXPORT void
1204  log(Home home, FloatVar x0, FloatVar x1);
1207  GECODE_FLOAT_EXPORT void
1208  pow(Home home, FloatNum base, FloatVar x0, FloatVar x1);
1211  GECODE_FLOAT_EXPORT void
1212  log(Home home, FloatNum base, FloatVar x0, FloatVar x1);
1215  GECODE_FLOAT_EXPORT void
1216  asin(Home home, FloatVar x0, FloatVar x1);
1219  GECODE_FLOAT_EXPORT void
1220  sin(Home home, FloatVar x0, FloatVar x1);
1223  GECODE_FLOAT_EXPORT void
1224  acos(Home home, FloatVar x0, FloatVar x1);
1227  GECODE_FLOAT_EXPORT void
1228  cos(Home home, FloatVar x0, FloatVar x1);
1231  GECODE_FLOAT_EXPORT void
1232  atan(Home home, FloatVar x0, FloatVar x1);
1235  GECODE_FLOAT_EXPORT void
1236  tan(Home home, FloatVar x0, FloatVar x1);
1238 #endif
1239 
1247  GECODE_FLOAT_EXPORT void
1248  linear(Home home, const FloatVarArgs& x,
1249  FloatRelType frt, FloatNum c);
1253  GECODE_FLOAT_EXPORT void
1254  linear(Home home, const FloatVarArgs& x,
1255  FloatRelType frt, FloatVar y);
1259  GECODE_FLOAT_EXPORT void
1260  linear(Home home, const FloatVarArgs& x,
1261  FloatRelType frt, FloatNum c, Reify r);
1265  GECODE_FLOAT_EXPORT void
1266  linear(Home home, const FloatVarArgs& x,
1267  FloatRelType frt, FloatVar y, Reify r);
1274  GECODE_FLOAT_EXPORT void
1275  linear(Home home, const FloatValArgs& a, const FloatVarArgs& x,
1276  FloatRelType frt, FloatNum c);
1283  GECODE_FLOAT_EXPORT void
1284  linear(Home home, const FloatValArgs& a, const FloatVarArgs& x,
1285  FloatRelType frt, FloatVar y);
1292  GECODE_FLOAT_EXPORT void
1293  linear(Home home, const FloatValArgs& a, const FloatVarArgs& x,
1294  FloatRelType frt, FloatNum c, Reify r);
1301  GECODE_FLOAT_EXPORT void
1302  linear(Home home, const FloatValArgs& a, const FloatVarArgs& x,
1303  FloatRelType frt, FloatVar y, Reify r);
1304 
1305 
1311  GECODE_FLOAT_EXPORT void
1313  channel(Home home, FloatVar x0, IntVar x1);
1315  GECODE_FLOAT_EXPORT void
1316  channel(Home home, IntVar x0, FloatVar x1);
1318 
1319 
1328  GECODE_FLOAT_EXPORT void
1330  wait(Home home, FloatVar x, void (*c)(Space& home));
1332  GECODE_FLOAT_EXPORT void
1333  wait(Home home, const FloatVarArgs& x, void (*c)(Space& home));
1335 
1336 }
1337 
1338 namespace Gecode {
1339 
1353  typedef bool (*FloatBranchFilter)(const Space& home, FloatVar x, int i);
1354 
1365  typedef double (*FloatBranchMerit)(const Space& home, FloatVar x, int i);
1366 
1373  public:
1377  bool l;
1378  };
1379 
1390  typedef FloatNumBranch (*FloatBranchVal)(const Space& home, FloatVar x, int i);
1391 
1403  typedef void (*FloatBranchCommit)(Space& home, unsigned int a,
1404  FloatVar x, int i, FloatNumBranch nl);
1405 
1406 }
1407 
1409 
1410 namespace Gecode {
1411 
1417  class FloatAFC : public AFC {
1418  public:
1426  FloatAFC(void);
1428  FloatAFC(const FloatAFC& a);
1430  FloatAFC& operator =(const FloatAFC& a);
1432  FloatAFC(Home home, const FloatVarArgs& x, double d=1.0);
1440  void init(Home, const FloatVarArgs& x, double d=1.0);
1441  };
1442 
1443 }
1444 
1445 #include <gecode/float/branch/afc.hpp>
1446 
1447 namespace Gecode {
1448 
1454  class FloatActivity : public Activity {
1455  public:
1463  FloatActivity(void);
1465  FloatActivity(const FloatActivity& a);
1477  FloatActivity(Home home, const FloatVarArgs& x, double d=1.0,
1478  FloatBranchMerit bm=NULL);
1490  GECODE_FLOAT_EXPORT void
1491  init(Home, const FloatVarArgs& x, double d=1.0,
1492  FloatBranchMerit bm=NULL);
1493  };
1494 
1495 }
1496 
1498 
1499 namespace Gecode {
1500 
1502  typedef void (*FloatVarValPrint)(const Space &home, const BrancherHandle& bh,
1503  unsigned int a,
1504  FloatVar x, int i, const FloatNumBranch& n,
1505  std::ostream& o);
1506 
1507 }
1508 
1509 namespace Gecode {
1510 
1516  class FloatVarBranch : public VarBranch {
1517  public:
1519  enum Select {
1520  SEL_NONE = 0,
1542  };
1543  protected:
1546  public:
1548  FloatVarBranch(void);
1550  FloatVarBranch(Rnd r);
1554  FloatVarBranch(Select s, double, BranchTbl t);
1562  Select select(void) const;
1564  void expand(Home home, const FloatVarArgs& x);
1565  };
1566 
1567 
1586  FloatVarBranch FLOAT_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=NULL);
1590  FloatVarBranch FLOAT_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=NULL);
1634 
1635 }
1636 
1637 #include <gecode/float/branch/var.hpp>
1638 
1639 namespace Gecode {
1640 
1646  class FloatValBranch : public ValBranch {
1647  public:
1649  enum Select {
1654  };
1655  protected:
1658  public:
1662  FloatValBranch(Rnd r);
1666  Select select(void) const;
1667  };
1668 
1688 
1689 }
1690 
1691 #include <gecode/float/branch/val.hpp>
1692 
1693 namespace Gecode {
1694 
1700  class FloatAssign : public ValBranch {
1701  public:
1703  enum Select {
1708  };
1709  protected:
1712  public:
1714  FloatAssign(Select s = SEL_MIN);
1716  FloatAssign(Rnd r);
1720  Select select(void) const;
1721  };
1722 
1741 
1742 }
1743 
1745 
1746 namespace Gecode {
1747 
1753  GECODE_FLOAT_EXPORT BrancherHandle
1754  branch(Home home, const FloatVarArgs& x,
1755  FloatVarBranch vars, FloatValBranch vals,
1756  FloatBranchFilter bf=NULL,
1757  FloatVarValPrint vvp=NULL);
1763  GECODE_FLOAT_EXPORT BrancherHandle
1764  branch(Home home, const FloatVarArgs& x,
1765  TieBreak<FloatVarBranch> vars, FloatValBranch vals,
1766  FloatBranchFilter bf=NULL,
1767  FloatVarValPrint vvp=NULL);
1773  GECODE_FLOAT_EXPORT BrancherHandle
1774  branch(Home home, FloatVar x, FloatValBranch vals,
1775  FloatVarValPrint vvp=NULL);
1776 
1782  GECODE_FLOAT_EXPORT BrancherHandle
1783  assign(Home home, const FloatVarArgs& x, FloatAssign vals,
1784  FloatBranchFilter fbf=NULL,
1785  FloatVarValPrint vvp=NULL);
1791  GECODE_FLOAT_EXPORT BrancherHandle
1792  assign(Home home, FloatVar x, FloatAssign vals,
1793  FloatVarValPrint vvp=NULL);
1795 
1796 }
1797 
1798 #endif
1799 
1800 // IFDEF: GECODE_HAS_FLOAT_VARS
1801 // STATISTICS: float-post
1802 
#define GECODE_FLOAT_EXPORT
Definition: float.hh:70
FloatNum pi_half_upper(void)
Return upper bound of .
Definition: num.hpp:45
FloatVal operator-(const FloatVal &x)
Definition: val.hpp:172
Passing float arguments.
Definition: float.hh:937
Select median value of the upper part.
Definition: float.hh:1705
FloatNum atanh_down(FloatNum x)
Return lower bound of hyperbolic arctangent of x (domain: )
FloatVarBranch FLOAT_VAR_DEGREE_MAX(BranchTbl tbl)
Select variable with largest degree.
Definition: var.hpp:119
FloatNum tanh_up(FloatNum x)
Return upper bound of hyperbolic tangent of x (domain: )
Variables as interfaces to variable implementations.
Definition: var.hpp:51
NodeType t
Type of node.
Definition: bool-expr.cpp:234
Select
Which value selection.
Definition: float.hh:1703
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: )
FloatVarArgs(int n)
Allocate array with n elements.
Definition: float.hh:973
Which values to select for branching first.
Definition: float.hh:1646
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:96
FloatVarArgs(const std::vector< FloatVar > &a)
Initialize from vector a.
Definition: float.hh:979
FloatNum div_up(FloatNum x, FloatNum y)
Return upper bound of x divided y (domain: )
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatNum c)
Post propagator for .
Definition: linear.cpp:45
FloatVarBranch(void)
Initialize with strategy SEL_NONE.
Definition: var.hpp:41
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:64
NNF * l
Left subtree.
Definition: bool-expr.cpp:244
FloatVarArgs(const FloatVarArgs &a)
Initialize from variable argument array a (copy elements)
Definition: float.hh:975
bool valid(const FloatVal &n)
Return whether float n is a valid number.
Definition: limits.hpp:43
void init(Home, const FloatVarArgs &x, double d=1.0, FloatBranchMerit bm=NULL)
Initialize for float variables x with decay factor d.
Definition: activity.cpp:49
FloatNum cosh_down(FloatNum x)
Return lower bound of hyperbolic cosine of x (domain: )
bool subset(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:494
FloatNum asinh_up(FloatNum x)
Return upper bound of hyperbolic arcsine of x (domain: )
FloatNum med(void) const
Return median of domain.
Definition: float.hpp:67
void log(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:151
friend bool operator>(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:264
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Definition: arithmetic.cpp:218
FloatNumBranch(* FloatBranchVal)(const Space &home, FloatVar x, int i)
Branch value function type for float variables.
Definition: float.hh:1390
const FloatNum max
Largest allowed float value.
Definition: float.hh:831
FloatNum int_down(FloatNum x)
Return next downward-rounded integer of x (domain: )
FloatVal operator/(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:217
With smallest accumulated failure count.
Definition: float.hh:1526
Disequality ( )
Definition: float.hh:1056
FloatAssign FLOAT_ASSIGN_MAX(void)
Select median value of the upper part.
Definition: assign.hpp:64
With smallest domain size.
Definition: float.hh:1534
FloatNum tanh_down(FloatNum x)
Return lower bound of hyperbolic tangent of x (domain: )
Argument array for primtive types.
Definition: array.hpp:640
friend FloatVal cosh(const FloatVal &x)
Definition: val.hpp:468
Less or equal ( )
Definition: float.hh:1057
FloatVal fmod(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:426
friend FloatVal exp(const FloatVal &x)
Definition: val.hpp:417
FloatVal & operator/=(const FloatNum &n)
Divide by n.
Definition: val.hpp:141
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:57
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:49
Handle for brancher.
Definition: core.hpp:1157
Passing float variables.
Definition: float.hh:966
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Definition: arithmetic.cpp:126
gecode_boost::numeric::interval_lib::rounded_arith_opp< FloatNum > Base
Base class.
Definition: float.hh:141
bool overlap(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:502
friend FloatVal sqr(const FloatVal &x)
Definition: val.hpp:377
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Definition: arithmetic.cpp:117
FloatActivity(void)
Construct as not yet initialized.
Definition: activity.hpp:41
FloatVar(void)
Default constructor.
Definition: float.hpp:48
FloatVarBranch FLOAT_VAR_DEGREE_SIZE_MAX(BranchTbl tbl)
Select variable with largest degree divided by domain size.
Definition: var.hpp:199
FloatAssign FLOAT_ASSIGN_MIN(void)
Select median value of the lower part.
Definition: assign.hpp:59
friend FloatVal sinh(const FloatVal &x)
Definition: val.hpp:464
Select s
Which value to select.
Definition: float.hh:1657
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Definition: dom.cpp:44
double(* FloatBranchMerit)(const Space &home, FloatVar x, int i)
Branch merit function type for float variables.
Definition: float.hh:1365
void expand(Home home, const FloatVarArgs &x)
Expand decay factor into AFC or activity.
Definition: var.hpp:74
Select
Which value selection.
Definition: float.hh:1649
bool(* FloatBranchFilter)(const Space &home, FloatVar x, int i)
Branch filter function type for float variables.
Definition: float.hh:1353
FloatVal hull(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:511
FloatNum size(void) const
Return size of domain (distance between maximum and minimum)
Definition: float.hpp:81
FloatNum sqrt_down(FloatNum x)
Return lower bound of square root of x (domain: )
friend FloatVal fmod(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:426
FloatVarBranch FLOAT_VAR_AFC_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count with decay factor d.
Definition: var.hpp:124
FloatNum asin_up(FloatNum x)
Return upper bound of arcsine of x (domain: )
Which variable to select for branching.
Definition: float.hh:1516
FloatVal & operator-=(const FloatNum &n)
Subtract by n.
Definition: val.hpp:133
gecode_boost::numeric::interval_lib::checking_strict< FloatNum > P
Used checking policy.
Definition: float.hh:405
FloatVarBranch FLOAT_VAR_ACTIVITY_SIZE_MAX(double d, BranchTbl tbl)
Select variable with largest activity divided by domain size with decay factor d. ...
Definition: var.hpp:234
Less ( )
Definition: float.hh:1058
static FloatVal pi_twice(void)
Return .
Definition: val.hpp:123
FloatNum sinh_up(FloatNum x)
Return upper bound of hyperbolic sine of x (domain: )
friend FloatVal acos(const FloatVal &x)
Definition: val.hpp:455
FloatNum sqrt_up(FloatNum x)
Return upper bound of square root of x (domain: )
friend FloatVal asin(const FloatVal &x)
Definition: val.hpp:451
FloatVarBranch FLOAT_VAR_ACTIVITY_MAX(double d, BranchTbl tbl)
Select variable with highest activity with decay factor d.
Definition: var.hpp:154
gecode_boost::numeric::interval< FloatNum, gecode_boost::numeric::interval_lib::policies< R, P > > FloatValImpType
Implementation type for float value.
Definition: float.hh:410
FloatValBranch FLOAT_VAL(FloatBranchVal v, FloatBranchCommit c)
Definition: val.hpp:74
Select median value of the lower part.
Definition: float.hh:1704
Float variable array.
Definition: float.hh:1016
Computation spaces.
Definition: core.hpp:1362
Select select(void) const
Return selection strategy.
Definition: assign.hpp:53
FloatVarBranch FLOAT_VAR_NONE(void)
Select first unassigned variable.
Definition: var.hpp:92
FloatVal(void)
Default constructor.
Definition: val.hpp:49
friend bool operator<=(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:247
FloatNum max(void) const
Return maximum of domain.
Definition: float.hpp:71
FloatActivity & operator=(const FloatActivity &a)
Assignment operator.
Definition: activity.hpp:48
static FloatVal hull(FloatNum x, FloatNum y)
Return hull of x and y.
Definition: val.hpp:109
Select s
Which value to select.
Definition: float.hh:1711
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:69
Gecode::IntSet d(v, 7)
FloatValImpType x
Implementation of float value.
Definition: float.hh:412
bool tight(void) const
Test whether float is tight.
Definition: val.hpp:91
FloatNum pi_twice_lower(void)
Return lower bound of .
Definition: num.hpp:57
Gecode::FloatVal c(-8, 8)
Greater or equal ( )
Definition: float.hh:1059
FloatNum log_down(FloatNum x)
Return lower bound of logarithm of x (domain: )
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:214
With smallest accumulated failure count divided by domain size.
Definition: float.hh:1538
bool singleton(void) const
Test whether float is a singleton.
Definition: val.hpp:96
bool proper_subset(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:498
const FloatNum min
Smallest allowed float value.
Definition: float.hh:833
Gecode::IntArgs i(4, 1, 2, 3, 4)
FloatNum n
The middle value for branching.
Definition: float.hh:1375
Class for AFC (accumulated failure count) management.
Definition: afc.hpp:44
FloatNum asin_down(FloatNum x)
Return lower bound of arcsine of x (domain: )
FloatVal domain(void) const
Return domain.
Definition: float.hpp:76
FloatNum med(void) const
Return median of float value.
Definition: val.hpp:86
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:238
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: )
Select values not greater than mean of smallest and largest value.
Definition: float.hh:1650
Select values randomly which are not greater or not smaller than mean of largest and smallest value...
Definition: float.hh:1652
FloatVarArgs(const VarArray< FloatVar > &a)
Initialize from variable array a (copy elements)
Definition: float.hh:977
FloatVal & operator*=(const FloatNum &n)
Multiply by n.
Definition: val.hpp:137
FloatAssign FLOAT_ASSIGN_RND(Rnd r)
Select median value of a randomly chosen part.
Definition: assign.hpp:69
With smallest degree.
Definition: float.hh:1524
FloatVal sinh(const FloatVal &x)
Definition: val.hpp:464
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:204
FloatVarBranch FLOAT_VAR_DEGREE_MIN(BranchTbl tbl)
Select variable with smallest degree.
Definition: var.hpp:114
Select select(void) const
Return selection strategy.
Definition: val.hpp:53
FloatNum min(void) const
Return lower bound.
Definition: val.hpp:74
FloatNum pi_twice_upper(void)
Return upper bound of .
Definition: num.hpp:61
FloatVal intersect(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:507
Value description class for branching.
Definition: float.hh:1372
friend bool operator==(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:298
FloatValArgs(void)
Allocate empty array.
Definition: array.hpp:48
FloatVal operator+(const FloatVal &x)
Definition: val.hpp:168
NNF * r
Right subtree.
Definition: bool-expr.cpp:246
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:103
FloatRelType
Relation types for floats.
Definition: float.hh:1054
FloatNum log_up(FloatNum x)
Return upper bound of logarithm of x (domain: )
bool operator!=(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:321
static FloatValArgs create(int n, FloatVal start, int inc=1)
Allocate array with n elements such that for all .
Definition: array.hpp:75
friend FloatVal cos(const FloatVal &x)
Definition: val.hpp:443
Select select(void) const
Return selection strategy.
Definition: var.hpp:69
FloatVarBranch FLOAT_VAR_DEGREE_SIZE_MIN(BranchTbl tbl)
Select variable with smallest degree divided by domain size.
Definition: var.hpp:194
FloatNum cos_down(FloatNum x)
Return lower bound of cosine of x (domain: )
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:110
bool l
Whether to try the lower or upper half first.
Definition: float.hh:1377
With smallest degree divided by domain size.
Definition: float.hh:1536
friend FloatVal nroot(const FloatVal &x, int n)
Definition: val.hpp:385
FloatVal cosh(const FloatVal &x)
Definition: val.hpp:468
FloatVarArray(void)
Default constructor (array of size 0)
Definition: array.hpp:83
friend FloatVal operator*(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:204
With largest accumulated failure count.
Definition: float.hh:1527
FloatNum pi_half_lower(void)
Return lower bound of .
Definition: num.hpp:41
FloatValBranch FLOAT_VAL_SPLIT_MIN(void)
Select values not greater than mean of smallest and largest value.
Definition: val.hpp:59
void(* VoidFunction)(void)
Base type for any function pointer.
Definition: cast.hpp:45
FloatVarBranch FLOAT_VAR_MERIT_MAX(FloatBranchMerit bm, BranchTbl tbl)
Select variable with highest merit according to branch merit function bm.
Definition: var.hpp:103
FloatNum atanh_up(FloatNum x)
Return upper bound of hyperbolic arctangent of x (domain: )
static FloatVal pi(void)
Return lower bound of .
Definition: val.hpp:118
FloatVal & operator=(const FloatNum &n)
Assignment operator.
Definition: val.hpp:60
friend FloatVal atanh(const FloatVal &x)
Definition: val.hpp:484
Random (uniform, for tie breaking)
Definition: float.hh:1521
int n
Number of variables (size)
Definition: array.hpp:89
Select
Which variable selection.
Definition: float.hh:1519
friend FloatVal tanh(const FloatVal &x)
Definition: val.hpp:472
FloatVarBranch FLOAT_VAR_MAX_MAX(BranchTbl tbl)
Select variable with largest max.
Definition: var.hpp:179
void asin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:175
FloatVarBranch FLOAT_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking)
Definition: var.hpp:109
FloatAFC(void)
Construct as not yet initialized.
Definition: afc.hpp:41
FloatVarArgs(InputIterator first, InputIterator last)
Initialize from InputIterator first and last.
Definition: float.hh:982
Floating point rounding policy.
Definition: float.hh:137
FloatNum tan_up(FloatNum x)
Return upper bound of tangent of x (domain: )
Equality ( )
Definition: float.hh:1055
Recording activities for float variables.
Definition: float.hh:1454
FloatNum atan_up(FloatNum x)
Return upper bound of arctangent of x (domain: )
Float view for float variables.
Definition: view.hpp:56
Greater ( )
Definition: float.hh:1060
FloatVal & operator+=(const FloatNum &n)
Increment by n.
Definition: val.hpp:129
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:48
union Gecode::@518::NNF::@57 u
Union depending on nodetype t.
const int v[7]
Definition: distinct.cpp:207
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:75
BrancherHandle bh
FloatNum cos_up(FloatNum x)
Return upper bound of cosine of x (domain: )
Select median value of a randomly chosen part.
Definition: float.hh:1706
void cos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:196
friend FloatVal asinh(const FloatVal &x)
Definition: val.hpp:476
bool in(const FloatVal &n) const
Test whether n is contained in domain.
Definition: float.hpp:86
FloatNum acosh_up(FloatNum x)
Return upper bound of hyperbolic arccosine of x (domain: )
friend FloatVal abs(const FloatVal &x)
Definition: val.hpp:369
Value branching information.
Definition: branch-val.hpp:44
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:135
Select value according to user-defined functions.
Definition: float.hh:1653
Float value type.
Definition: float.hh:321
FloatVal operator*(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:204
Variable branching information.
Definition: branch-var.hpp:55
BrancherHandle assign(Home home, const FloatVarArgs &x, FloatAssign fa, FloatBranchFilter bf, FloatVarValPrint vvp)
Assign all x with value selection vals.
Definition: branch.cpp:113
First unassigned.
Definition: float.hh:1520
FloatNum atan_down(FloatNum x)
Return lower bound of arctangent of x (domain: )
Node * x
Pointer to corresponding Boolean expression node.
Definition: bool-expr.cpp:253
FloatVarBranch FLOAT_VAR_MIN_MIN(BranchTbl tbl)
Select variable with smallest min.
Definition: var.hpp:164
Rounding(void)
Default constructor (configures full rounding mode)
Definition: rounding.hpp:41
FloatNum sub_down(FloatNum x, FloatNum y)
Return lower bound of x minus y (domain: )
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 .
Definition: arithmetic.cpp:210
FloatNum min(void) const
Return minimum of domain.
Definition: float.hpp:63
With smallest activity divided by domain size.
Definition: float.hh:1540
bool in(FloatNum n) const
Test whether n is included.
Definition: val.hpp:100
Select s
Which variable to select.
Definition: float.hh:1545
static FloatVal pi_half(void)
Return .
Definition: val.hpp:113
friend FloatVal tan(const FloatVal &x)
Definition: val.hpp:447
FloatVarBranch FLOAT_VAR_MAX_MIN(BranchTbl tbl)
Select variable with smallest max.
Definition: var.hpp:174
bool operator>=(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:281
FloatVal acosh(const FloatVal &x)
Definition: val.hpp:480
friend FloatVal operator+(const FloatVal &x)
Definition: val.hpp:168
FloatVal val(void) const
Return assigned value.
Definition: float.hpp:57
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:47
FloatNum acos_up(FloatNum x)
Return upper bound of arccossine of x (domain: )
bool zero_in(void) const
Test whether zero is included.
Definition: val.hpp:104
friend FloatVal acosh(const FloatVal &x)
Definition: val.hpp:480
FloatVal atanh(const FloatVal &x)
Definition: val.hpp:484
friend bool operator<(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:230
FloatVal asinh(const FloatVal &x)
Definition: val.hpp:476
friend FloatVal pow(const FloatVal &x, int n)
Definition: val.hpp:381
Which values to select for assignment.
Definition: float.hh:1700
FloatNum cosh_up(FloatNum x)
Return upper bound of hyperbolic cosine of x (domain: )
friend FloatVal sqrt(const FloatVal &x)
Definition: val.hpp:373
FloatNum exp_down(FloatNum x)
Return lower bound of exponential of x (domain: )
void assign(FloatNum const &l, FloatNum const &u)
Assign lower bound l and upper bound u.
Definition: val.hpp:69
FloatAssign FLOAT_ASSIGN(FloatBranchVal v, FloatBranchCommit c)
Definition: assign.hpp:74
int n
Number of elements.
Definition: array.hpp:524
With largest domain size.
Definition: float.hh:1535
FloatValBranch(Select s=SEL_SPLIT_MIN)
Initialize with selection strategy s.
Definition: val.hpp:41
gecode_boost::numeric::interval_lib::save_state< Float::Rounding > R
Used rounding policies.
Definition: float.hh:403
Float variables.
Definition: float.hh:857
With largest accumulated failure count divided by domain size.
Definition: float.hh:1539
void init(Home, const FloatVarArgs &x, double d=1.0)
Initialize for float variables x with decay factor d.
Definition: afc.hpp:58
bool operator>(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:264
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: )
friend FloatVal operator/(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:217
friend bool operator!=(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:321
bool operator<(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:230
bool operator==(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:298
With largest activity divided by domain size.
Definition: float.hh:1541
bool operator<=(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:247
FloatNum size(void) const
Return size of float value (distance between maximum and minimum)
Definition: val.hpp:82
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:53
friend FloatVal log(const FloatVal &x)
Definition: val.hpp:421
void wait(Home home, FloatVar x, void(*c)(Space &home))
Execute c when x becomes assigned.
Definition: exec.cpp:44
void sin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:182
FloatNum acos_down(FloatNum x)
Return lower bound of arccosine of x (domain: )
FloatVarArgs(void)
Allocate empty array.
Definition: float.hh:971
friend FloatVal sin(const FloatVal &x)
Definition: val.hpp:439
BrancherHandle 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:43
Select value according to user-defined functions.
Definition: float.hh:1707
Random number generator.
Definition: rnd.hpp:46
friend FloatVal atan(const FloatVal &x)
Definition: val.hpp:459
FloatVarBranch FLOAT_VAR_ACTIVITY_MIN(double d, BranchTbl tbl)
Select variable with lowest activity with decay factor d.
Definition: var.hpp:144
void(* FloatVarValPrint)(const Space &home, const BrancherHandle &bh, unsigned int a, FloatVar x, int i, const FloatNumBranch &n, std::ostream &o)
Function type for explaining branching alternatives for set variables.
Definition: float.hh:1502
FloatVarBranch FLOAT_VAR_ACTIVITY_SIZE_MIN(double d, BranchTbl tbl)
Select variable with smallest activity divided by domain size with decay factor d.
Definition: var.hpp:224
void acos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:189
Class for activity management.
Definition: activity.hpp:44
With largest degree divided by domain size.
Definition: float.hh:1537
void exp(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:144
FloatVarBranch FLOAT_VAR_SIZE_MAX(BranchTbl tbl)
Select variable with largest domain size.
Definition: var.hpp:189
FloatNum pi_lower(void)
Return lower bound of .
Definition: num.hpp:49
FloatNum mul_up(FloatNum x, FloatNum y)
Return upper bound of x times y (domain: )
FloatAFC & operator=(const FloatAFC &a)
Assignment operator.
Definition: afc.hpp:48
FloatVal tanh(const FloatVal &x)
Definition: val.hpp:472
Select values greater than mean of smallest and largest value.
Definition: float.hh:1651
Home class for posting propagators
Definition: core.hpp:717
FloatNum max(void) const
Return upper bound.
Definition: val.hpp:78
double tbl(const Gecode::Space &, double w, double b)
Test function for tie-break limit function.
Definition: branch.cpp:65
double FloatNum
Floating point number base type.
Definition: float.hh:108
FloatVarBranch FLOAT_VAR_MIN_MAX(BranchTbl tbl)
Select variable with largest min.
Definition: var.hpp:169
friend FloatVal operator-(const FloatVal &x)
Definition: val.hpp:172
Shared array with arbitrary number of elements.
~Rounding(void)
Destructor (restores previous rounding mode)
Definition: rounding.hpp:43
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
FloatVarBranch FLOAT_VAR_MERIT_MIN(FloatBranchMerit bm, BranchTbl tbl)
Select variable with least merit according to branch merit function bm.
Definition: var.hpp:97
FloatVarBranch FLOAT_VAR_AFC_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count with decay factor d.
Definition: var.hpp:134
FloatAssign(Select s=SEL_MIN)
Initialize with selection strategy s.
Definition: assign.hpp:41
FloatNum median(FloatNum x, FloatNum y)
Return median of x and y (domain: )
Definition: rounding.hpp:46
void atan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:203
FloatNum sin_down(FloatNum x)
Return lower bound of sine of x (domain: )
friend bool operator>=(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:281
Recording AFC information for float variables.
Definition: float.hh:1417
FloatNum tan_down(FloatNum x)
Return lower bound of tangent of x (domain: )
FloatVal * a
Element array.
Definition: array.hpp:528
FloatNum pi_upper(void)
Return upper bound of .
Definition: num.hpp:53
void(* FloatBranchCommit)(Space &home, unsigned int a, FloatVar x, int i, FloatNumBranch nl)
Branch commit function type for float variables.
Definition: float.hh:1403
FloatVarBranch FLOAT_VAR_SIZE_MIN(BranchTbl tbl)
Select variable with smallest domain size.
Definition: var.hpp:184
Rnd r
Random number generator.
Definition: branch-val.hpp:47
double(* BranchTbl)(const Space &home, double w, double b)
Tie-break limit function.
Definition: branch-var.hpp:49