Generated on Thu Mar 16 2017 03:24:14 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  * Last modified:
14  * $Date: 2016-10-25 12:52:26 +0200 (Tue, 25 Oct 2016) $ by $Author: schulte $
15  * $Revision: 15233 $
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 
132 
133 #if defined(_MSC_VER) && (defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP > 0)))
134 
135  /*
136  * This is used for the MSVC compiler for x64 or x86 with SSE enabled.
137  *
138  */
140  typedef gecode_boost::numeric::interval_lib::rounded_arith_std<FloatNum>
141  RoundingBase;
142 
143 #else
144 
146  typedef gecode_boost::numeric::interval_lib::rounded_arith_opp<FloatNum>
148 
149 #endif
150 
156  class Rounding : public RoundingBase {
157  public:
159 
160  Rounding(void);
163  ~Rounding(void);
165 
167 
189 
191 
199 
200 #ifdef GECODE_HAS_MPFR
201 
212 
214 
228 
230 
244 
246 
260 
262 
276 #endif
277  };
278 
279 }}
280 
281 #include <gecode/float/rounding.hpp>
282 
283 namespace Gecode { namespace Float {
284 
289  bool subset(const FloatVal& x, const FloatVal& y);
294  bool proper_subset(const FloatVal& x, const FloatVal& y);
299  bool overlap(const FloatVal& x, const FloatVal& y);
300 
305  FloatVal intersect(const FloatVal& x, const FloatVal& y);
310  FloatVal hull(const FloatVal& x, const FloatVal& y);
315  FloatVal hull(const FloatVal& x, const FloatNum& y);
320  FloatVal hull(const FloatNum& x, const FloatVal& y);
325  FloatVal hull(const FloatNum& x, const FloatNum& y);
326 
327 }}
328 
329 namespace Gecode {
330 
336  class FloatVal {
337  friend FloatVal operator +(const FloatVal& x);
338  friend FloatVal operator -(const FloatVal& x);
339  friend FloatVal operator +(const FloatVal& x, const FloatVal& y);
340  friend FloatVal operator +(const FloatVal& x, const FloatNum& y);
341  friend FloatVal operator +(const FloatNum& x, const FloatVal& y);
342  friend FloatVal operator -(const FloatVal& x, const FloatVal& y);
343  friend FloatVal operator -(const FloatVal& x, const FloatNum& y);
344  friend FloatVal operator -(const FloatNum& x, const FloatVal& y);
345  friend FloatVal operator *(const FloatVal& x, const FloatVal& y);
346  friend FloatVal operator *(const FloatVal& x, const FloatNum& y);
347  friend FloatVal operator *(const FloatNum& x, const FloatVal& y);
348  friend FloatVal operator /(const FloatVal& x, const FloatVal& y);
349  friend FloatVal operator /(const FloatVal& x, const FloatNum& y);
350  friend FloatVal operator /(const FloatNum& x, const FloatVal& y);
351 
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  friend bool operator <=(const FloatVal& x, const FloatVal& y);
356  friend bool operator <=(const FloatVal& x, const FloatNum& y);
357  friend bool operator <=(const FloatNum& x, const FloatVal& y);
358  friend bool operator >(const FloatVal& x, const FloatVal& y);
359  friend bool operator >(const FloatVal& x, const FloatNum& y);
360  friend bool operator >(const FloatNum& x, const FloatVal& y);
361  friend bool operator >=(const FloatVal& x, const FloatVal& y);
362  friend bool operator >=(const FloatVal& x, const FloatNum& y);
363  friend bool operator >=(const FloatNum& x, const FloatVal& y);
364  friend bool operator ==(const FloatVal& x, const FloatVal& y);
365  friend bool operator ==(const FloatVal& x, const FloatNum& y);
366  friend bool operator ==(const FloatNum& x, const FloatVal& y);
367  friend bool operator !=(const FloatVal& x, const FloatVal& y);
368  friend bool operator !=(const FloatVal& x, const FloatNum& y);
369  friend bool operator !=(const FloatNum& x, const FloatVal& y);
370 
371  template<class Char, class Traits>
372  friend std::basic_ostream<Char,Traits>&
373  operator <<(std::basic_ostream<Char,Traits>& os, const FloatVal& x);
374 
375  friend FloatVal abs(const FloatVal& x);
376  friend FloatVal sqrt(const FloatVal& x);
377  friend FloatVal sqr(const FloatVal& x);
378  friend FloatVal pow(const FloatVal& x, int n);
379  friend FloatVal nroot(const FloatVal& x, int n);
380 
381  friend FloatVal max(const FloatVal& x, const FloatVal& y);
382  friend FloatVal max(const FloatVal& x, const FloatNum& y);
383  friend FloatVal max(const FloatNum& x, const FloatVal& y);
384  friend FloatVal min(const FloatVal& x, const FloatVal& y);
385  friend FloatVal min(const FloatVal& x, const FloatNum& y);
386  friend FloatVal min(const FloatNum& x, const FloatVal& y);
387 
388 #ifdef GECODE_HAS_MPFR
389  friend FloatVal exp(const FloatVal& x);
390  friend FloatVal log(const FloatVal& x);
391  friend FloatVal fmod(const FloatVal& x, const FloatVal& y);
392  friend FloatVal fmod(const FloatVal& x, const FloatNum& y);
393  friend FloatVal fmod(const FloatNum& x, const FloatVal& y);
394  friend FloatVal sin(const FloatVal& x);
395  friend FloatVal cos(const FloatVal& x);
396  friend FloatVal tan(const FloatVal& x);
397  friend FloatVal asin(const FloatVal& x);
398  friend FloatVal acos(const FloatVal& x);
399  friend FloatVal atan(const FloatVal& x);
400  friend FloatVal sinh(const FloatVal& x);
401  friend FloatVal cosh(const FloatVal& x);
402  friend FloatVal tanh(const FloatVal& x);
403  friend FloatVal asinh(const FloatVal& x);
404  friend FloatVal acosh(const FloatVal& x);
405  friend FloatVal atanh(const FloatVal& x);
406 #endif
407 
408  friend bool Float::subset(const FloatVal& x, const FloatVal& y);
409  friend bool Float::proper_subset(const FloatVal& x, const FloatVal& y);
410  friend bool Float::overlap(const FloatVal& x, const FloatVal& y);
411  friend FloatVal Float::intersect(const FloatVal& x, const FloatVal& y);
412  friend FloatVal Float::hull(const FloatVal& x, const FloatVal& y);
413  friend FloatVal Float::hull(const FloatVal& x, const FloatNum& y);
414  friend FloatVal Float::hull(const FloatNum& x, const FloatVal& y);
415  friend FloatVal Float::hull(const FloatNum& x, const FloatNum& y);
416  protected:
418  typedef gecode_boost::numeric::interval_lib::save_state<Float::Rounding> R;
420  typedef gecode_boost::numeric::interval_lib::checking_strict<FloatNum> P;
422  typedef gecode_boost::numeric::interval
423  <FloatNum,
424  gecode_boost::numeric::interval_lib::policies<R, P> >
429  explicit FloatVal(const FloatValImpType& i);
430  public:
432 
433  FloatVal(void);
436  FloatVal(const FloatNum& n);
438  FloatVal(const FloatNum& l, const FloatNum& u);
440  FloatVal(const FloatVal& v);
441 
443  FloatVal& operator =(const FloatNum& n);
445  FloatVal& operator =(const FloatVal& v);
446 
448  void assign(FloatNum const &l, FloatNum const &u);
450 
452 
453  FloatNum min(void) const;
456  FloatNum max(void) const;
458  FloatNum size(void) const;
460  FloatNum med(void) const;
462 
464 
465  bool tight(void) const;
468  bool singleton(void) const;
470  bool in(FloatNum n) const;
472  bool zero_in(void) const;
474 
476 
477  static FloatVal hull(FloatNum x, FloatNum y);
480  static FloatVal pi_half(void);
482  static FloatVal pi(void);
484  static FloatVal pi_twice(void);
486 
488 
489  FloatVal& operator +=(const FloatNum& n);
492  FloatVal& operator -=(const FloatNum& n);
494  FloatVal& operator *=(const FloatNum& n);
496  FloatVal& operator /=(const FloatNum& n);
498  FloatVal& operator +=(const FloatVal& v);
500  FloatVal& operator -=(const FloatVal& v);
502  FloatVal& operator *=(const FloatVal& v);
504  FloatVal& operator /=(const FloatVal& v);
506  };
507 
512  FloatVal operator +(const FloatVal& x);
517  FloatVal operator -(const FloatVal& x);
518 
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& x, const FloatVal& y);
568  FloatVal operator /(const FloatVal& x, const FloatVal& y);
573  FloatVal operator /(const FloatVal& x, const FloatNum& y);
578  FloatVal operator /(const FloatNum& r, const FloatVal& x);
579 
584  bool operator <(const FloatVal& x, const FloatVal& y);
589  bool operator <(const FloatVal& x, const FloatNum& y);
594  bool operator <(const FloatNum& x, const FloatVal& y);
595 
600  bool operator <=(const FloatVal& x, const FloatVal& y);
605  bool operator <=(const FloatVal& x, const FloatNum& y);
610  bool operator <=(const FloatNum& x, const FloatVal& y);
611 
616  bool operator >(const FloatVal& x, const FloatVal& y);
621  bool operator >(const FloatVal& x, const FloatNum& y);
626  bool operator >(const FloatNum& x, const FloatVal& y);
627 
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);
647  bool operator ==(const FloatVal& x, const FloatVal& y);
652  bool operator ==(const FloatVal& x, const FloatNum& y);
657  bool operator ==(const FloatNum& x, const FloatVal& y);
658 
663  bool operator !=(const FloatVal& x, const FloatVal& y);
668  bool operator !=(const FloatVal& x, const FloatNum& y);
673  bool operator !=(const FloatNum& x, const FloatVal& y);
674 
679  template<class Char, class Traits>
680  std::basic_ostream<Char,Traits>&
681  operator <<(std::basic_ostream<Char,Traits>& os, const FloatVal& x);
682 
687  FloatVal abs(const FloatVal& x);
692  FloatVal sqrt(const FloatVal& x);
697  FloatVal sqr(const FloatVal& x);
702  FloatVal pow(const FloatVal& x, int n);
707  FloatVal nroot(const FloatVal& x, int n);
708 
713  FloatVal max(const FloatVal& x, const FloatVal& y);
718  FloatVal max(const FloatVal& x, const FloatNum& y);
723  FloatVal max(const FloatNum& x, const FloatVal& y);
728  FloatVal min(const FloatVal& x, const FloatVal& y);
733  FloatVal min(const FloatVal& x, const FloatNum& y);
738  FloatVal min(const FloatNum& x, const FloatVal& y);
739 
740 #ifdef GECODE_HAS_MPFR
741  /* transcendental functions: exp, log */
746  FloatVal exp(const FloatVal& x);
751  FloatVal log(const FloatVal& x);
752 
757  FloatVal fmod(const FloatVal& x, const FloatVal& y);
762  FloatVal fmod(const FloatVal& x, const FloatNum& y);
767  FloatVal fmod(const FloatNum& x, const FloatVal& y);
768 
773  FloatVal sin(const FloatVal& x);
778  FloatVal cos(const FloatVal& x);
783  FloatVal tan(const FloatVal& x);
788  FloatVal asin(const FloatVal& x);
793  FloatVal acos(const FloatVal& x);
798  FloatVal atan(const FloatVal& x);
799 
804  FloatVal sinh(const FloatVal& x);
809  FloatVal cosh(const FloatVal& x);
814  FloatVal tanh(const FloatVal& x);
819  FloatVal asinh(const FloatVal& x);
824  FloatVal acosh(const FloatVal& x);
829  FloatVal atanh(const FloatVal& x);
830 
831 #endif
832 
833 }
834 
835 #include <gecode/float/val.hpp>
836 
837 namespace Gecode { namespace Float {
838 
844  namespace Limits {
848  const FloatNum min = -max;
850  bool valid(const FloatVal& n);
852  void check(const FloatVal& n, const char* l);
853  }
854 
855 }}
856 
857 #include <gecode/float/limits.hpp>
858 
859 #include <gecode/float/var-imp.hpp>
860 
861 namespace Gecode {
862 
863  namespace Float {
864  class FloatView;
865  }
866 
872  class FloatVar : public VarImpVar<Float::FloatVarImp> {
873  friend class FloatVarArray;
874  friend class FloatVarArgs;
875  private:
883  void _init(Space& home, FloatNum min, FloatNum max);
884  public:
886 
887  FloatVar(void);
890  FloatVar(const FloatVar& y);
892  FloatVar(const Float::FloatView& y);
906 
908 
909  FloatVal domain(void) const;
912  FloatNum min(void) const;
914  FloatNum max(void) const;
916  FloatNum med(void) const;
918  FloatNum size(void) const;
926  FloatVal val(void) const;
927 
929 
931 
932  bool in(const FloatVal& n) const;
935  };
936 
941  template<class Char, class Traits>
942  std::basic_ostream<Char,Traits>&
943  operator <<(std::basic_ostream<Char,Traits>& os, const FloatVar& x);
944 }
945 
946 #include <gecode/float/view.hpp>
948 
949 namespace Gecode {
950 
952  class FloatValArgs : public ArgArray<FloatVal> {
953  public:
955 
956  FloatValArgs(void);
959  explicit FloatValArgs(int n);
963  FloatValArgs(const std::vector<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) : VarArgArray<FloatVar>(n) {}
992  FloatVarArgs(const std::vector<FloatVar>& a) : VarArgArray<FloatVar>(a) {}
994  template<class InputIterator>
995  FloatVarArgs(InputIterator first, InputIterator last)
996  : VarArgArray<FloatVar>(first,last) {}
1009  FloatVarArgs(Space& home, int n, FloatNum min, FloatNum max);
1011  };
1013 
1029  class FloatVarArray : public VarArray<FloatVar> {
1030  public:
1032 
1033  FloatVarArray(void);
1036  FloatVarArray(Space& home, int n);
1038  FloatVarArray(const FloatVarArray& a);
1040  FloatVarArray(Space& home, const FloatVarArgs& a);
1053  FloatVarArray(Space& home, int n, FloatNum min, FloatNum max);
1055  };
1056 
1057 }
1058 
1059 #include <gecode/float/array.hpp>
1060 
1061 namespace Gecode {
1062 
1074  };
1075 
1083  GECODE_FLOAT_EXPORT void
1085  dom(Home home, FloatVar x, FloatVal n);
1087  GECODE_FLOAT_EXPORT void
1088  dom(Home home, const FloatVarArgs& x, FloatVal n);
1090  GECODE_FLOAT_EXPORT void
1091  dom(Home home, FloatVar x, FloatNum l, FloatNum m);
1093  GECODE_FLOAT_EXPORT void
1094  dom(Home home, const FloatVarArgs& x, FloatNum l, FloatNum u);
1096  GECODE_FLOAT_EXPORT void
1097  dom(Home home, FloatVar x, FloatVal n, Reify r);
1099  GECODE_FLOAT_EXPORT void
1100  dom(Home home, FloatVar x, FloatNum l, FloatNum u, Reify r);
1102  GECODE_FLOAT_EXPORT void
1103  dom(Home home, FloatVar x, FloatVar d);
1105  GECODE_FLOAT_EXPORT void
1106  dom(Home home, const FloatVarArgs& x, const FloatVarArgs& d);
1108 
1117  GECODE_FLOAT_EXPORT void
1118  rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1);
1122  GECODE_FLOAT_EXPORT void
1123  rel(Home home, FloatVar x, FloatRelType frt, FloatVal c);
1127  GECODE_FLOAT_EXPORT void
1128  rel(Home home, FloatVar x, FloatRelType frt, FloatVal c, Reify r);
1132  GECODE_FLOAT_EXPORT void
1133  rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1, Reify r);
1137  GECODE_FLOAT_EXPORT void
1138  rel(Home home, const FloatVarArgs& x, FloatRelType frt, FloatVal c);
1142  GECODE_FLOAT_EXPORT void
1143  rel(Home home, const FloatVarArgs& x, FloatRelType frt, FloatVar y);
1144 
1145 }
1146 
1147 
1148 namespace Gecode {
1149 
1158  GECODE_FLOAT_EXPORT void
1159  min(Home home, FloatVar x0, FloatVar x1, FloatVar x2);
1163  GECODE_FLOAT_EXPORT void
1164  min(Home home, const FloatVarArgs& x, FloatVar y);
1167  GECODE_FLOAT_EXPORT void
1168  max(Home home, FloatVar x0, FloatVar x1, FloatVar x2);
1172  GECODE_FLOAT_EXPORT void
1173  max(Home home, const FloatVarArgs& x, FloatVar y);
1174 
1177  GECODE_FLOAT_EXPORT void
1178  abs(Home home, FloatVar x0, FloatVar x1);
1179 
1182  GECODE_FLOAT_EXPORT void
1183  mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2);
1184 
1187  GECODE_FLOAT_EXPORT void
1188  sqr(Home home, FloatVar x0, FloatVar x1);
1189 
1192  GECODE_FLOAT_EXPORT void
1193  sqrt(Home home, FloatVar x0, FloatVar x1);
1194 
1197  GECODE_FLOAT_EXPORT void
1198  pow(Home home, FloatVar x0, int n, FloatVar x1);
1199 
1202  GECODE_FLOAT_EXPORT void
1203  nroot(Home home, FloatVar x0, int n, FloatVar x1);
1204 
1207  GECODE_FLOAT_EXPORT void
1208  div(Home home, FloatVar x0, FloatVar x1, FloatVar x2);
1209 #ifdef GECODE_HAS_MPFR
1210 
1212  GECODE_FLOAT_EXPORT void
1213  exp(Home home, FloatVar x0, FloatVar x1);
1216  GECODE_FLOAT_EXPORT void
1217  log(Home home, FloatVar x0, FloatVar x1);
1220  GECODE_FLOAT_EXPORT void
1221  pow(Home home, FloatNum base, FloatVar x0, FloatVar x1);
1224  GECODE_FLOAT_EXPORT void
1225  log(Home home, FloatNum base, FloatVar x0, FloatVar x1);
1228  GECODE_FLOAT_EXPORT void
1229  asin(Home home, FloatVar x0, FloatVar x1);
1232  GECODE_FLOAT_EXPORT void
1233  sin(Home home, FloatVar x0, FloatVar x1);
1236  GECODE_FLOAT_EXPORT void
1237  acos(Home home, FloatVar x0, FloatVar x1);
1240  GECODE_FLOAT_EXPORT void
1241  cos(Home home, FloatVar x0, FloatVar x1);
1244  GECODE_FLOAT_EXPORT void
1245  atan(Home home, FloatVar x0, FloatVar x1);
1248  GECODE_FLOAT_EXPORT void
1249  tan(Home home, FloatVar x0, FloatVar x1);
1251 #endif
1252 
1260  GECODE_FLOAT_EXPORT void
1261  linear(Home home, const FloatVarArgs& x,
1262  FloatRelType frt, FloatNum c);
1266  GECODE_FLOAT_EXPORT void
1267  linear(Home home, const FloatVarArgs& x,
1268  FloatRelType frt, FloatVar y);
1272  GECODE_FLOAT_EXPORT void
1273  linear(Home home, const FloatVarArgs& x,
1274  FloatRelType frt, FloatNum c, Reify r);
1278  GECODE_FLOAT_EXPORT void
1279  linear(Home home, const FloatVarArgs& x,
1280  FloatRelType frt, FloatVar y, Reify r);
1287  GECODE_FLOAT_EXPORT void
1288  linear(Home home, const FloatValArgs& a, const FloatVarArgs& x,
1289  FloatRelType frt, FloatNum c);
1296  GECODE_FLOAT_EXPORT void
1297  linear(Home home, const FloatValArgs& a, const FloatVarArgs& x,
1298  FloatRelType frt, FloatVar y);
1305  GECODE_FLOAT_EXPORT void
1306  linear(Home home, const FloatValArgs& a, const FloatVarArgs& x,
1307  FloatRelType frt, FloatNum c, Reify r);
1314  GECODE_FLOAT_EXPORT void
1315  linear(Home home, const FloatValArgs& a, const FloatVarArgs& x,
1316  FloatRelType frt, FloatVar y, Reify r);
1317 
1318 
1324  GECODE_FLOAT_EXPORT void
1326  channel(Home home, FloatVar x0, IntVar x1);
1328  GECODE_FLOAT_EXPORT void
1329  channel(Home home, IntVar x0, FloatVar x1);
1331  GECODE_FLOAT_EXPORT void
1332  channel(Home home, FloatVar x0, BoolVar x1);
1334  GECODE_FLOAT_EXPORT void
1335  channel(Home home, BoolVar x0, FloatVar x1);
1337 
1338 
1347  GECODE_FLOAT_EXPORT void
1349  wait(Home home, FloatVar x, void (*c)(Space& home));
1351  GECODE_FLOAT_EXPORT void
1352  wait(Home home, const FloatVarArgs& x, void (*c)(Space& home));
1354 
1355 }
1356 
1357 namespace Gecode {
1358 
1372  typedef bool (*FloatBranchFilter)(const Space& home, FloatVar x, int i);
1373 
1384  typedef double (*FloatBranchMerit)(const Space& home, FloatVar x, int i);
1385 
1392  public:
1396  bool l;
1397  };
1398 
1409  typedef FloatNumBranch (*FloatBranchVal)(const Space& home, FloatVar x, int i);
1410 
1422  typedef void (*FloatBranchCommit)(Space& home, unsigned int a,
1423  FloatVar x, int i, FloatNumBranch nl);
1424 
1425 }
1426 
1428 
1429 namespace Gecode {
1430 
1436  class FloatAFC : public AFC {
1437  public:
1445  FloatAFC(void);
1447  FloatAFC(const FloatAFC& a);
1449  FloatAFC& operator =(const FloatAFC& a);
1451  FloatAFC(Home home, const FloatVarArgs& x, double d=1.0);
1459  void init(Home home, const FloatVarArgs& x, double d=1.0);
1460  };
1461 
1462 }
1463 
1464 #include <gecode/float/branch/afc.hpp>
1465 
1466 namespace Gecode {
1467 
1473  class FloatActivity : public Activity {
1474  public:
1482  FloatActivity(void);
1484  FloatActivity(const FloatActivity& a);
1486  FloatActivity& operator =(const FloatActivity& a);
1496  FloatActivity(Home home, const FloatVarArgs& x, double d=1.0,
1497  FloatBranchMerit bm=NULL);
1509  GECODE_FLOAT_EXPORT void
1510  init(Home home, const FloatVarArgs& x, double d=1.0,
1511  FloatBranchMerit bm=NULL);
1512  };
1513 
1514 }
1515 
1517 
1518 namespace Gecode {
1519 
1521  typedef void (*FloatVarValPrint)(const Space &home, const Brancher& b,
1522  unsigned int a,
1523  FloatVar x, int i, const FloatNumBranch& n,
1524  std::ostream& o);
1525 
1526 }
1527 
1528 namespace Gecode {
1529 
1535  class FloatVarBranch : public VarBranch {
1536  public:
1538  enum Select {
1539  SEL_NONE = 0,
1560  SEL_ACTIVITY_SIZE_MAX
1561  };
1562  protected:
1565  public:
1567  FloatVarBranch(void);
1569  FloatVarBranch(Rnd r);
1573  FloatVarBranch(Select s, double, BranchTbl t);
1581  Select select(void) const;
1583  void expand(Home home, const FloatVarArgs& x);
1584  };
1585 
1586 
1605  FloatVarBranch FLOAT_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=NULL);
1609  FloatVarBranch FLOAT_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=NULL);
1653 
1654 }
1655 
1656 #include <gecode/float/branch/var.hpp>
1657 
1658 namespace Gecode {
1659 
1665  class FloatValBranch : public ValBranch {
1666  public:
1668  enum Select {
1672  SEL_VAL_COMMIT
1673  };
1674  protected:
1677  public:
1679  FloatValBranch(Select s = SEL_SPLIT_MIN);
1681  FloatValBranch(Rnd r);
1685  Select select(void) const;
1686  };
1687 
1707 
1708 }
1709 
1710 #include <gecode/float/branch/val.hpp>
1711 
1712 namespace Gecode {
1713 
1719  class FloatAssign : public ValBranch {
1720  public:
1722  enum Select {
1726  SEL_VAL_COMMIT
1727  };
1728  protected:
1731  public:
1733  FloatAssign(Select s = SEL_MIN);
1735  FloatAssign(Rnd r);
1739  Select select(void) const;
1740  };
1741 
1760 
1761 }
1762 
1764 
1765 namespace Gecode {
1766 
1772  GECODE_FLOAT_EXPORT void
1773  branch(Home home, const FloatVarArgs& x,
1774  FloatVarBranch vars, FloatValBranch vals,
1775  FloatBranchFilter bf=NULL,
1776  FloatVarValPrint vvp=NULL);
1782  GECODE_FLOAT_EXPORT void
1783  branch(Home home, const FloatVarArgs& x,
1785  FloatBranchFilter bf=NULL,
1786  FloatVarValPrint vvp=NULL);
1792  GECODE_FLOAT_EXPORT void
1793  branch(Home home, FloatVar x, FloatValBranch vals,
1794  FloatVarValPrint vvp=NULL);
1795 
1801  GECODE_FLOAT_EXPORT void
1802  assign(Home home, const FloatVarArgs& x, FloatAssign vals,
1803  FloatBranchFilter fbf=NULL,
1804  FloatVarValPrint vvp=NULL);
1810  GECODE_FLOAT_EXPORT void
1811  assign(Home home, FloatVar x, FloatAssign vals,
1812  FloatVarValPrint vvp=NULL);
1814 
1815 }
1816 
1817 namespace Gecode {
1818 
1819  /*
1820  * \brief Relaxed assignment of variables in \a x from values in \a sx
1821  *
1822  * The variables in \a x are assigned values from the assigned variables
1823  * in the solution \a sx with a relaxation probability \a p. That is,
1824  * if \$fp=0.1\f$ approximately 10% of the variables in \a x will be
1825  * assigned a value from \a sx.
1826  *
1827  * The random numbers are generated from the generator \a r. At least
1828  * one variable will not be assigned: in case the relaxation attempt
1829  * would suggest that all variables should be assigned, a single
1830  * variable will be selected randomly to remain unassigned.
1831  *
1832  * Throws an exception of type Float::ArgumentSizeMismatch, if \a x and
1833  * \a sx are of different size.
1834  *
1835  * Throws an exception of type Float::OutOfLimits, if \a p is not between
1836  * \a 0.0 and \a 1.0.
1837  *
1838  * \ingroup TaskModeFloat
1839  */
1840  GECODE_FLOAT_EXPORT void
1841  relax(Home home, const FloatVarArgs& x, const FloatVarArgs& sx,
1842  Rnd r, double p);
1843 
1844 }
1845 
1847 
1848 namespace Gecode {
1849 
1860  protected:
1864  const Delta& d;
1865  public:
1867 
1870  const Delta& d);
1872 
1874  FloatNum min(void) const;
1877  FloatNum max(void) const;
1879  };
1880 
1881 }
1882 
1884 
1886 
1887 namespace Gecode {
1888 
1899 
1904  class GECODE_FLOAT_EXPORT StdFloatTracer : public FloatTracer {
1905  protected:
1907  std::ostream& os;
1908  public:
1910  StdFloatTracer(std::ostream& os0 = std::cerr);
1912  virtual void init(const Space& home, const FloatTraceRecorder& t);
1914  virtual void prune(const Space& home, const FloatTraceRecorder& t,
1915  const ExecInfo& ei, int i, FloatTraceDelta& d);
1917  virtual void fix(const Space& home, const FloatTraceRecorder& t);
1919  virtual void done(const Space& home, const FloatTraceRecorder& t);
1921  static StdFloatTracer def;
1922  };
1923 
1924 
1929  GECODE_FLOAT_EXPORT void
1930  trace(Home home, const FloatVarArgs& x,
1931  TraceFilter tf,
1932  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_DONE),
1933  FloatTracer& t = StdFloatTracer::def);
1938  void
1939  trace(Home home, const FloatVarArgs& x,
1940  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_DONE),
1941  FloatTracer& t = StdFloatTracer::def);
1942 
1943 }
1944 
1945 #include <gecode/float/trace.hpp>
1946 
1947 #endif
1948 
1949 // IFDEF: GECODE_HAS_FLOAT_VARS
1950 // STATISTICS: float-post
1951 
#define GECODE_FLOAT_EXPORT
Definition: float.hh:70
FloatNum pi_half_upper(void)
Return upper bound of .
Definition: num.hpp:45
Select values greater than mean of smallest and largest value.
Definition: float.hh:1670
FloatVal operator-(const FloatVal &x)
Definition: val.hpp:172
With smallest degree divided by domain size.
Definition: float.hh:1555
SetExpr singleton(const LinIntExpr &e)
Singleton expression.
Definition: set-expr.cpp:694
Passing float arguments.
Definition: float.hh:952
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
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:1668
Combine variable selection criteria for tie-breaking.
FloatVarArgs(int n)
Allocate array with n elements.
Definition: float.hh:986
Which values to select for branching first.
Definition: float.hh:1665
TraceRecorder< Float::FloatView > FloatTraceRecorder
TraceRecorder for float variables.
Definition: float.hh:1898
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:992
With smallest domain size.
Definition: float.hh:1553
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
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:988
bool valid(const FloatVal &n)
Return whether float n is a valid number.
Definition: limits.hpp:43
With largest domain size.
Definition: float.hh:1554
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
With smallest accumulated failure count divided by domain size.
Definition: float.hh:1557
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 .
Definition: arithmetic.cpp:151
void trace(Home home, const FloatVarArgs &x, TraceFilter tf, int te, FloatTracer &t)
Create a tracer for float variables.
Definition: trace.cpp:43
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:1409
const FloatNum max
Largest allowed float value.
Definition: float.hh:846
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
Disequality ( )
Definition: float.hh:1069
FloatAssign FLOAT_ASSIGN_MAX(void)
Select median value of the upper part.
Definition: assign.hpp:64
FloatNum tanh_down(FloatNum x)
Return lower bound of hyperbolic tangent of x (domain: )
Less or equal ( )
Definition: float.hh:1070
FloatVal fmod(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:426
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
Passing float variables.
Definition: float.hh:979
With smallest degree.
Definition: float.hh:1543
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Definition: arithmetic.cpp:126
bool overlap(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:502
Select median value of a randomly chosen part.
Definition: float.hh:1725
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Definition: arithmetic.cpp:117
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
Select s
Which value to select.
Definition: float.hh:1676
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:1384
bool(* FloatBranchFilter)(const Space &home, FloatVar x, int i)
Branch filter function type for float variables.
Definition: float.hh:1372
FloatVal hull(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:511
FloatNum sqrt_down(FloatNum x)
Return lower bound of square root of x (domain: )
With largest accumulated failure count.
Definition: float.hh:1546
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:1535
gecode_boost::numeric::interval_lib::checking_strict< FloatNum > P
Used checking policy.
Definition: float.hh:420
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
Select values randomly which are not greater or not smaller than mean of largest and smallest value...
Definition: float.hh:1671
Less ( )
Definition: float.hh:1071
Select
Which variable selection.
Definition: float.hh:1538
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: )
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:425
FloatValBranch FLOAT_VAL(FloatBranchVal v, FloatBranchCommit c)
Definition: val.hpp:74
Trace init events.
Float variable array.
Definition: float.hh:1029
Computation spaces.
Definition: core.hpp:1672
ExecStatus prune(Space &home, ViewArray< VX > &x, ConstIntView)
Definition: rel.hpp:257
FloatVarBranch FLOAT_VAR_NONE(void)
Select first unassigned variable.
Definition: var.hpp:92
void(* FloatVarValPrint)(const Space &home, const Brancher &b, 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:1521
Select s
Which value to select.
Definition: float.hh:1730
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:427
std::string expand(Gecode::IntRelType irt)
Expand relation to abbreviation.
Definition: mm-count.cpp:48
FloatNum pi_twice_lower(void)
Return lower bound of .
Definition: num.hpp:57
Gecode::FloatVal c(-8, 8)
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:43
Trace prune events.
Greater or equal ( )
Definition: float.hh:1072
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
struct Gecode::@554::NNF::@60::@62 a
For atomic nodes.
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:236
Standard float variable tracer.
Definition: float.hh:1904
bool proper_subset(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:498
Gecode::IntArgs i(4, 1, 2, 3, 4)
Base-class for branchers.
Definition: core.hpp:1364
FloatNum n
The middle value for branching.
Definition: float.hh:1394
Class for AFC (accumulated failure count) management.
Definition: afc.hpp:44
FloatNum asin_down(FloatNum x)
Return lower bound of arcsine of x (domain: )
void assign(Home home, const FloatVarArgs &x, FloatAssign fa, FloatBranchFilter bf, FloatVarValPrint vvp)
Assign all x with value selection vals.
Definition: branch.cpp:113
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: )
Argument array for non-primitive types.
Definition: array.hpp:727
FloatVarArgs(const VarArray< FloatVar > &a)
Initialize from variable array a (copy elements)
Definition: float.hh:990
FloatAssign FLOAT_ASSIGN_RND(Rnd r)
Select median value of a randomly chosen part.
Definition: assign.hpp:69
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
union Gecode::@554::NNF::@60 u
Union depending on nodetype t.
FloatVarBranch FLOAT_VAR_DEGREE_MIN(BranchTbl tbl)
Select variable with smallest degree.
Definition: var.hpp:114
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:1391
FloatVal operator+(const FloatVal &x)
Definition: val.hpp:168
NNF * r
Right subtree.
Definition: bool-expr.cpp:246
Propagator for recording trace information.
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:103
FloatRelType
Relation types for floats.
Definition: float.hh:1067
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
New view Float::FloatView n
Definition: float.hh:1862
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: )
Output stream to use std::ostream & os
Definition: float.hh:1907
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:110
unsigned int size(I &i)
Size of all ranges of range iterator i.
Reification specification.
Definition: int.hh:855
bool l
Whether to try the lower or upper half first.
Definition: float.hh:1396
FloatVal cosh(const FloatVal &x)
Definition: val.hpp:468
Trace filters.
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
const int * pi[]
Definition: photo.cpp:14266
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: )
Execution information.
Definition: core.hpp:957
With largest accumulated failure count divided by domain size.
Definition: float.hh:1558
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
Select values not greater than mean of smallest and largest value.
Definition: float.hh:1669
FloatVarArgs(InputIterator first, InputIterator last)
Initialize from InputIterator first and last.
Definition: float.hh:995
Floating point rounding policy.
Definition: float.hh:156
Random (uniform, for tie breaking)
Definition: float.hh:1540
FloatNum tan_up(FloatNum x)
Return upper bound of tangent of x (domain: )
Equality ( )
Definition: float.hh:1068
Recording activities for float variables.
Definition: float.hh:1473
FloatNum atan_up(FloatNum x)
Return upper bound of arctangent of x (domain: )
Float view for float variables.
Definition: view.hpp:56
With smallest activity divided by domain size.
Definition: float.hh:1559
Greater ( )
Definition: float.hh:1073
Boolean integer variables.
Definition: int.hh:492
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
const int v[7]
Definition: distinct.cpp:263
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:75
FloatNum cos_up(FloatNum x)
Return upper bound of cosine of x (domain: )
void cos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:196
Trace delta information for float variables.
Definition: float.hh:1859
FloatNum acosh_up(FloatNum x)
Return upper bound of hyperbolic arccosine of x (domain: )
Value branching information.
Definition: branch-val.hpp:44
Trace done events.
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:135
void relax(Home home, const FloatVarArgs &x, const FloatVarArgs &sx, Rnd r, double p)
Definition: relax.cpp:61
const double base
Base for geometric restart sequence.
Definition: search.hh:122
Float value type.
Definition: float.hh:336
FloatVal operator*(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:204
Variable branching information.
Definition: branch-var.hpp:55
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
Generic domain change information to be supplied to advisors.
Definition: core.hpp:277
FloatNum sub_down(FloatNum x, FloatNum y)
Return lower bound of x minus y (domain: )
Select median value of the upper part.
Definition: float.hh:1724
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
With smallest accumulated failure count.
Definition: float.hh:1545
Select
Which value selection.
Definition: float.hh:1722
Select s
Which variable to select.
Definition: float.hh:1564
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
Integer variables.
Definition: int.hh:351
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: )
With largest degree divided by domain size.
Definition: float.hh:1556
FloatVal atanh(const FloatVal &x)
Definition: val.hpp:484
FloatVal asinh(const FloatVal &x)
Definition: val.hpp:476
gecode_boost::numeric::interval_lib::rounded_arith_opp< FloatNum > RoundingBase
Rounding Base class (optimized version)
Definition: float.hh:147
Which values to select for assignment.
Definition: float.hh:1719
Delta information const Delta & d
Definition: float.hh:1864
Tracer that process trace information.
Definition: tracer.hpp:55
FloatNum cosh_up(FloatNum x)
Return upper bound of hyperbolic cosine of x (domain: )
Trace fixpoint events.
FloatNum exp_down(FloatNum x)
Return lower bound of exponential of x (domain: )
FloatAssign FLOAT_ASSIGN(FloatBranchVal v, FloatBranchCommit c)
Definition: assign.hpp:74
gecode_boost::numeric::interval_lib::save_state< Float::Rounding > R
Used rounding policies.
Definition: float.hh:418
Select median value of the lower part.
Definition: float.hh:1723
Float variables.
Definition: float.hh:872
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: )
bool operator<(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:230
bool operator==(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:298
bool operator<=(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:247
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
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: )
Random number generator.
Definition: rnd.hpp:46
FloatVarBranch FLOAT_VAR_ACTIVITY_MIN(double d, BranchTbl tbl)
Select variable with lowest activity with decay factor d.
Definition: var.hpp:144
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
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: )
struct Gecode::@554::NNF::@60::@61 b
For binary nodes (and, or, eqv)
FloatVal tanh(const FloatVal &x)
Definition: val.hpp:472
Home class for posting propagators
Definition: core.hpp:905
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
Tracer< Float::FloatView > FloatTracer
Tracer for float variables.
Definition: float.hh:1893
Shared array with arbitrary number of elements.
~Rounding(void)
Destructor (restores previous rounding mode)
Definition: rounding.hpp:45
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
FloatNum median(FloatNum x, FloatNum y)
Return median of x and y (domain: )
Definition: rounding.hpp:48
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: )
Recording AFC information for float variables.
Definition: float.hh:1436
FloatNum tan_down(FloatNum x)
Return lower bound of tangent of x (domain: )
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:1422
FloatVarBranch FLOAT_VAR_SIZE_MIN(BranchTbl tbl)
Select variable with smallest domain size.
Definition: var.hpp:184
double(* BranchTbl)(const Space &home, double w, double b)
Tie-break limit function.
Definition: branch-var.hpp:49