Generated on Sat Jun 2 2018 07:17:44 for Gecode by doxygen 1.8.13
float.hh
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Christian Schulte <schulte@gecode.org>
5  * Guido Tack <tack@gecode.org>
6  * Vincent Barichard <Vincent.Barichard@univ-angers.fr>
7  *
8  * Copyright:
9  * Christian Schulte, 2002
10  * Guido Tack, 2004
11  * Vincent Barichard, 2012
12  *
13  * This file is part of Gecode, the generic constraint
14  * development environment:
15  * http://www.gecode.org
16  *
17  * Permission is hereby granted, free of charge, to any person obtaining
18  * a copy of this software and associated documentation files (the
19  * "Software"), to deal in the Software without restriction, including
20  * without limitation the rights to use, copy, modify, merge, publish,
21  * distribute, sublicense, and/or sell copies of the Software, and to
22  * permit persons to whom the Software is furnished to do so, subject to
23  * the following conditions:
24  *
25  * The above copyright notice and this permission notice shall be
26  * included in all copies or substantial portions of the Software.
27  *
28  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35  *
36  */
37 
38 #ifndef __GECODE_FLOAT_HH__
39 #define __GECODE_FLOAT_HH__
40 
41 #include <climits>
42 #include <cfloat>
43 #include <iostream>
44 
45 #include <functional>
46 
47 #include <gecode/kernel.hh>
48 #include <gecode/int.hh>
49 
50 /*
51  * Configure linking
52  *
53  */
54 #if !defined(GECODE_STATIC_LIBS) && \
55  (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
56 
57 #ifdef GECODE_BUILD_FLOAT
58 #define GECODE_FLOAT_EXPORT __declspec( dllexport )
59 #else
60 #define GECODE_FLOAT_EXPORT __declspec( dllimport )
61 #endif
62 
63 #else
64 
65 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
66 #define GECODE_FLOAT_EXPORT __attribute__ ((visibility("default")))
67 #else
68 #define GECODE_FLOAT_EXPORT
69 #endif
70 
71 #endif
72 
73 // Configure auto-linking
74 #ifndef GECODE_BUILD_FLOAT
75 #define GECODE_LIBRARY_NAME "Float"
77 #endif
78 
79 // Include interval implementation
80 #include <boost/numeric/interval.hpp>
81 
94 
96 
97 namespace Gecode {
98 
106  typedef double FloatNum;
107 
109  FloatNum pi_half_lower(void);
111  FloatNum pi_half_upper(void);
113  FloatNum pi_lower(void);
115  FloatNum pi_upper(void);
117  FloatNum pi_twice_lower(void);
119  FloatNum pi_twice_upper(void);
120 
121  // Forward declaration
122  class FloatVal;
123 
124 }
125 
126 #include <gecode/float/num.hpp>
127 
128 namespace Gecode { namespace Float {
129 
130 
131 #if defined(_MSC_VER) && (defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP > 0)))
132 
133  /*
134  * This is used for the MSVC compiler for x64 or x86 with SSE enabled.
135  *
136  */
138  typedef boost::numeric::interval_lib::rounded_arith_std<FloatNum>
139  RoundingBase;
140 
141 #else
142 
144  typedef boost::numeric::interval_lib::rounded_arith_opp<FloatNum>
146 
147 #endif
148 
154  class Rounding : public RoundingBase {
155  public:
157 
158  Rounding(void);
161  ~Rounding(void);
163 
165 
187 
189 
197 
198 #ifdef GECODE_HAS_MPFR
199 
210 
212 
226 
228 
242 
244 
258 
260 
274 #endif
275  };
276 
277 }}
278 
279 #include <gecode/float/rounding.hpp>
280 
281 namespace Gecode { namespace Float {
282 
287  bool subset(const FloatVal& x, const FloatVal& y);
292  bool proper_subset(const FloatVal& x, const FloatVal& y);
297  bool overlap(const FloatVal& x, const FloatVal& y);
298 
303  FloatVal intersect(const FloatVal& x, const FloatVal& y);
308  FloatVal hull(const FloatVal& x, const FloatVal& y);
313  FloatVal hull(const FloatVal& x, const FloatNum& y);
318  FloatVal hull(const FloatNum& x, const FloatVal& y);
323  FloatVal hull(const FloatNum& x, const FloatNum& y);
324 
325 }}
326 
327 namespace Gecode {
328 
334  class FloatVal {
335  friend FloatVal operator +(const FloatVal& x);
336  friend FloatVal operator -(const FloatVal& x);
337  friend FloatVal operator +(const FloatVal& x, const FloatVal& y);
338  friend FloatVal operator +(const FloatVal& x, const FloatNum& y);
339  friend FloatVal operator +(const FloatNum& x, const FloatVal& y);
340  friend FloatVal operator -(const FloatVal& x, const FloatVal& y);
341  friend FloatVal operator -(const FloatVal& x, const FloatNum& y);
342  friend FloatVal operator -(const FloatNum& x, const FloatVal& y);
343  friend FloatVal operator *(const FloatVal& x, const FloatVal& y);
344  friend FloatVal operator *(const FloatVal& x, const FloatNum& y);
345  friend FloatVal operator *(const FloatNum& x, const FloatVal& y);
346  friend FloatVal operator /(const FloatVal& x, const FloatVal& y);
347  friend FloatVal operator /(const FloatVal& x, const FloatNum& y);
348  friend FloatVal operator /(const FloatNum& x, const FloatVal& y);
349 
350  friend bool operator <(const FloatVal& x, const FloatVal& y);
351  friend bool operator <(const FloatVal& x, const FloatNum& y);
352  friend bool operator <(const FloatNum& x, const FloatVal& y);
353  friend bool operator <=(const FloatVal& x, const FloatVal& y);
354  friend bool operator <=(const FloatVal& x, const FloatNum& y);
355  friend bool operator <=(const FloatNum& x, const FloatVal& y);
356  friend bool operator >(const FloatVal& x, const FloatVal& y);
357  friend bool operator >(const FloatVal& x, const FloatNum& y);
358  friend bool operator >(const FloatNum& x, const FloatVal& y);
359  friend bool operator >=(const FloatVal& x, const FloatVal& y);
360  friend bool operator >=(const FloatVal& x, const FloatNum& y);
361  friend bool operator >=(const FloatNum& x, const FloatVal& y);
362  friend bool operator ==(const FloatVal& x, const FloatVal& y);
363  friend bool operator ==(const FloatVal& x, const FloatNum& y);
364  friend bool operator ==(const FloatNum& x, const FloatVal& y);
365  friend bool operator !=(const FloatVal& x, const FloatVal& y);
366  friend bool operator !=(const FloatVal& x, const FloatNum& y);
367  friend bool operator !=(const FloatNum& x, const FloatVal& y);
368 
369  template<class Char, class Traits>
370  friend std::basic_ostream<Char,Traits>&
371  operator <<(std::basic_ostream<Char,Traits>& os, const FloatVal& x);
372 
373  friend FloatVal abs(const FloatVal& x);
374  friend FloatVal sqrt(const FloatVal& x);
375  friend FloatVal sqr(const FloatVal& x);
376  friend FloatVal pow(const FloatVal& x, int n);
377  friend FloatVal nroot(const FloatVal& x, int n);
378 
379  friend FloatVal max(const FloatVal& x, const FloatVal& y);
380  friend FloatVal max(const FloatVal& x, const FloatNum& y);
381  friend FloatVal max(const FloatNum& x, const FloatVal& y);
382  friend FloatVal min(const FloatVal& x, const FloatVal& y);
383  friend FloatVal min(const FloatVal& x, const FloatNum& y);
384  friend FloatVal min(const FloatNum& x, const FloatVal& y);
385 
386 #ifdef GECODE_HAS_MPFR
387  friend FloatVal exp(const FloatVal& x);
388  friend FloatVal log(const FloatVal& x);
389  friend FloatVal fmod(const FloatVal& x, const FloatVal& y);
390  friend FloatVal fmod(const FloatVal& x, const FloatNum& y);
391  friend FloatVal fmod(const FloatNum& x, const FloatVal& y);
392  friend FloatVal sin(const FloatVal& x);
393  friend FloatVal cos(const FloatVal& x);
394  friend FloatVal tan(const FloatVal& x);
395  friend FloatVal asin(const FloatVal& x);
396  friend FloatVal acos(const FloatVal& x);
397  friend FloatVal atan(const FloatVal& x);
398  friend FloatVal sinh(const FloatVal& x);
399  friend FloatVal cosh(const FloatVal& x);
400  friend FloatVal tanh(const FloatVal& x);
401  friend FloatVal asinh(const FloatVal& x);
402  friend FloatVal acosh(const FloatVal& x);
403  friend FloatVal atanh(const FloatVal& x);
404 #endif
405 
406  friend bool Float::subset(const FloatVal& x, const FloatVal& y);
407  friend bool Float::proper_subset(const FloatVal& x, const FloatVal& y);
408  friend bool Float::overlap(const FloatVal& x, const FloatVal& y);
409  friend FloatVal Float::intersect(const FloatVal& x, const FloatVal& y);
410  friend FloatVal Float::hull(const FloatVal& x, const FloatVal& y);
411  friend FloatVal Float::hull(const FloatVal& x, const FloatNum& y);
412  friend FloatVal Float::hull(const FloatNum& x, const FloatVal& y);
413  friend FloatVal Float::hull(const FloatNum& x, const FloatNum& y);
414  protected:
416  typedef boost::numeric::interval_lib::save_state<Float::Rounding> R;
418  typedef boost::numeric::interval_lib::checking_strict<FloatNum> P;
420  typedef boost::numeric::interval
421  <FloatNum,
422  boost::numeric::interval_lib::policies<R, P> >
427  explicit FloatVal(const FloatValImpType& i);
428  public:
430 
431  FloatVal(void);
434  FloatVal(const FloatNum& n);
436  FloatVal(const FloatNum& l, const FloatNum& u);
438  FloatVal(const FloatVal& v);
439 
441  FloatVal& operator =(const FloatNum& n);
443  FloatVal& operator =(const FloatVal& v);
444 
446  void assign(FloatNum const &l, FloatNum const &u);
448 
450 
451  FloatNum min(void) const;
454  FloatNum max(void) const;
456  FloatNum size(void) const;
458  FloatNum med(void) const;
460 
462 
463  bool tight(void) const;
466  bool singleton(void) const;
468  bool in(FloatNum n) const;
470  bool zero_in(void) const;
472 
474 
475  static FloatVal hull(FloatNum x, FloatNum y);
478  static FloatVal pi_half(void);
480  static FloatVal pi(void);
482  static FloatVal pi_twice(void);
484 
486 
487  FloatVal& operator +=(const FloatNum& n);
490  FloatVal& operator -=(const FloatNum& n);
492  FloatVal& operator *=(const FloatNum& n);
494  FloatVal& operator /=(const FloatNum& n);
496  FloatVal& operator +=(const FloatVal& v);
498  FloatVal& operator -=(const FloatVal& v);
500  FloatVal& operator *=(const FloatVal& v);
502  FloatVal& operator /=(const FloatVal& v);
504  };
505 
510  FloatVal operator +(const FloatVal& x);
515  FloatVal operator -(const FloatVal& x);
516 
521  FloatVal operator +(const FloatVal& x, const FloatVal& y);
526  FloatVal operator +(const FloatVal& x, const FloatNum& y);
531  FloatVal operator +(const FloatNum& x, const FloatVal& y);
536  FloatVal operator -(const FloatVal& x, const FloatVal& y);
541  FloatVal operator -(const FloatVal& x, const FloatNum& y);
546  FloatVal operator -(const FloatNum& x, const FloatVal& y);
551  FloatVal operator *(const FloatVal& x, const FloatVal& y);
556  FloatVal operator *(const FloatVal& x, const FloatNum& y);
561  FloatVal operator *(const FloatNum& x, const FloatVal& y);
566  FloatVal operator /(const FloatVal& x, const FloatVal& y);
571  FloatVal operator /(const FloatVal& x, const FloatNum& y);
576  FloatVal operator /(const FloatNum& r, const FloatVal& x);
577 
582  bool operator <(const FloatVal& x, const FloatVal& y);
587  bool operator <(const FloatVal& x, const FloatNum& y);
592  bool operator <(const FloatNum& x, const FloatVal& y);
593 
598  bool operator <=(const FloatVal& x, const FloatVal& y);
603  bool operator <=(const FloatVal& x, const FloatNum& y);
608  bool operator <=(const FloatNum& x, const FloatVal& y);
609 
614  bool operator >(const FloatVal& x, const FloatVal& y);
619  bool operator >(const FloatVal& x, const FloatNum& y);
624  bool operator >(const FloatNum& x, const FloatVal& y);
625 
630  bool operator >=(const FloatVal& x, const FloatVal& y);
635  bool operator >=(const FloatVal& x, const FloatNum& y);
640  bool operator >=(const FloatNum& x, const FloatVal& y);
645  bool operator ==(const FloatVal& x, const FloatVal& y);
650  bool operator ==(const FloatVal& x, const FloatNum& y);
655  bool operator ==(const FloatNum& x, const FloatVal& y);
656 
661  bool operator !=(const FloatVal& x, const FloatVal& y);
666  bool operator !=(const FloatVal& x, const FloatNum& y);
671  bool operator !=(const FloatNum& x, const FloatVal& y);
672 
677  template<class Char, class Traits>
678  std::basic_ostream<Char,Traits>&
679  operator <<(std::basic_ostream<Char,Traits>& os, const FloatVal& x);
680 
685  FloatVal abs(const FloatVal& x);
690  FloatVal sqrt(const FloatVal& x);
695  FloatVal sqr(const FloatVal& x);
700  FloatVal pow(const FloatVal& x, int n);
705  FloatVal nroot(const FloatVal& x, int n);
706 
711  FloatVal max(const FloatVal& x, const FloatVal& y);
716  FloatVal max(const FloatVal& x, const FloatNum& y);
721  FloatVal max(const FloatNum& x, const FloatVal& y);
726  FloatVal min(const FloatVal& x, const FloatVal& y);
731  FloatVal min(const FloatVal& x, const FloatNum& y);
736  FloatVal min(const FloatNum& x, const FloatVal& y);
737 
738 #ifdef GECODE_HAS_MPFR
739  /* transcendental functions: exp, log */
744  FloatVal exp(const FloatVal& x);
749  FloatVal log(const FloatVal& x);
750 
755  FloatVal fmod(const FloatVal& x, const FloatVal& y);
760  FloatVal fmod(const FloatVal& x, const FloatNum& y);
765  FloatVal fmod(const FloatNum& x, const FloatVal& y);
766 
771  FloatVal sin(const FloatVal& x);
776  FloatVal cos(const FloatVal& x);
781  FloatVal tan(const FloatVal& x);
786  FloatVal asin(const FloatVal& x);
791  FloatVal acos(const FloatVal& x);
796  FloatVal atan(const FloatVal& x);
797 
802  FloatVal sinh(const FloatVal& x);
807  FloatVal cosh(const FloatVal& x);
812  FloatVal tanh(const FloatVal& x);
817  FloatVal asinh(const FloatVal& x);
822  FloatVal acosh(const FloatVal& x);
827  FloatVal atanh(const FloatVal& x);
828 
829 #endif
830 
831 }
832 
833 #include <gecode/float/val.hpp>
834 
835 namespace Gecode { namespace Float {
836 
842  namespace Limits {
846  const FloatNum min = -max;
848  bool valid(const FloatVal& n);
850  void check(const FloatVal& n, const char* l);
851  }
852 
853 }}
854 
855 #include <gecode/float/limits.hpp>
856 
857 #include <gecode/float/var-imp.hpp>
858 
859 namespace Gecode {
860 
861  namespace Float {
862  class FloatView;
863  }
864 
870  class FloatVar : public VarImpVar<Float::FloatVarImp> {
871  friend class FloatVarArray;
872  friend class FloatVarArgs;
873  private:
881  void _init(Space& home, FloatNum min, FloatNum max);
882  public:
884 
885  FloatVar(void);
888  FloatVar(const FloatVar& y);
890  FloatVar(const Float::FloatView& y);
904 
906 
907  FloatVal domain(void) const;
910  FloatNum min(void) const;
912  FloatNum max(void) const;
914  FloatNum med(void) const;
916  FloatNum size(void) const;
924  FloatVal val(void) const;
925 
927 
929 
930  bool in(const FloatVal& n) const;
933  };
934 
939  template<class Char, class Traits>
940  std::basic_ostream<Char,Traits>&
941  operator <<(std::basic_ostream<Char,Traits>& os, const FloatVar& x);
942 }
943 
944 #include <gecode/float/view.hpp>
946 
947 namespace Gecode {
948 
950  class FloatValArgs : public ArgArray<FloatVal> {
951  public:
953 
954  FloatValArgs(void);
957  explicit FloatValArgs(int n);
961  FloatValArgs(const std::vector<FloatVal>& x);
963  template<class InputIterator>
964  FloatValArgs(InputIterator first, InputIterator last);
966  FloatValArgs(int n, const FloatVal* e);
969 
972  static FloatValArgs create(int n, FloatVal start, int inc=1);
974  };
975 
977  class FloatVarArgs : public VarArgArray<FloatVar> {
978  public:
980 
981  FloatVarArgs(void) {}
984  explicit FloatVarArgs(int n) : VarArgArray<FloatVar>(n) {}
990  FloatVarArgs(const std::vector<FloatVar>& a) : VarArgArray<FloatVar>(a) {}
992  template<class InputIterator>
993  FloatVarArgs(InputIterator first, InputIterator last)
994  : VarArgArray<FloatVar>(first,last) {}
1007  FloatVarArgs(Space& home, int n, FloatNum min, FloatNum max);
1009  };
1011 
1027  class FloatVarArray : public VarArray<FloatVar> {
1028  public:
1030 
1031  FloatVarArray(void);
1034  FloatVarArray(Space& home, int n);
1036  FloatVarArray(const FloatVarArray& a);
1038  FloatVarArray(Space& home, const FloatVarArgs& a);
1051  FloatVarArray(Space& home, int n, FloatNum min, FloatNum max);
1053  };
1054 
1055 }
1056 
1057 #include <gecode/float/array.hpp>
1058 
1059 namespace Gecode {
1060 
1072  };
1073 
1081  GECODE_FLOAT_EXPORT void
1083  dom(Home home, FloatVar x, FloatVal n);
1085  GECODE_FLOAT_EXPORT void
1086  dom(Home home, const FloatVarArgs& x, FloatVal n);
1088  GECODE_FLOAT_EXPORT void
1089  dom(Home home, FloatVar x, FloatNum l, FloatNum m);
1091  GECODE_FLOAT_EXPORT void
1092  dom(Home home, const FloatVarArgs& x, FloatNum l, FloatNum u);
1094  GECODE_FLOAT_EXPORT void
1095  dom(Home home, FloatVar x, FloatVal n, Reify r);
1097  GECODE_FLOAT_EXPORT void
1098  dom(Home home, FloatVar x, FloatNum l, FloatNum u, Reify r);
1100  GECODE_FLOAT_EXPORT void
1101  dom(Home home, FloatVar x, FloatVar d);
1103  GECODE_FLOAT_EXPORT void
1104  dom(Home home, const FloatVarArgs& x, const FloatVarArgs& d);
1106 
1115  GECODE_FLOAT_EXPORT void
1116  rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1);
1120  GECODE_FLOAT_EXPORT void
1121  rel(Home home, FloatVar x, FloatRelType frt, FloatVal c);
1125  GECODE_FLOAT_EXPORT void
1126  rel(Home home, FloatVar x, FloatRelType frt, FloatVal c, Reify r);
1130  GECODE_FLOAT_EXPORT void
1131  rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1, Reify r);
1135  GECODE_FLOAT_EXPORT void
1136  rel(Home home, const FloatVarArgs& x, FloatRelType frt, FloatVal c);
1140  GECODE_FLOAT_EXPORT void
1141  rel(Home home, const FloatVarArgs& x, FloatRelType frt, FloatVar y);
1148  GECODE_FLOAT_EXPORT void
1149  ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z);
1150 
1151 }
1152 
1153 
1154 namespace Gecode {
1155 
1164  GECODE_FLOAT_EXPORT void
1165  min(Home home, FloatVar x0, FloatVar x1, FloatVar x2);
1169  GECODE_FLOAT_EXPORT void
1170  min(Home home, const FloatVarArgs& x, FloatVar y);
1173  GECODE_FLOAT_EXPORT void
1174  max(Home home, FloatVar x0, FloatVar x1, FloatVar x2);
1178  GECODE_FLOAT_EXPORT void
1179  max(Home home, const FloatVarArgs& x, FloatVar y);
1180 
1183  GECODE_FLOAT_EXPORT void
1184  abs(Home home, FloatVar x0, FloatVar x1);
1185 
1188  GECODE_FLOAT_EXPORT void
1189  mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2);
1190 
1193  GECODE_FLOAT_EXPORT void
1194  sqr(Home home, FloatVar x0, FloatVar x1);
1195 
1198  GECODE_FLOAT_EXPORT void
1199  sqrt(Home home, FloatVar x0, FloatVar x1);
1200 
1203  GECODE_FLOAT_EXPORT void
1204  pow(Home home, FloatVar x0, int n, FloatVar x1);
1205 
1208  GECODE_FLOAT_EXPORT void
1209  nroot(Home home, FloatVar x0, int n, FloatVar x1);
1210 
1213  GECODE_FLOAT_EXPORT void
1214  div(Home home, FloatVar x0, FloatVar x1, FloatVar x2);
1215 #ifdef GECODE_HAS_MPFR
1216 
1218  GECODE_FLOAT_EXPORT void
1219  exp(Home home, FloatVar x0, FloatVar x1);
1222  GECODE_FLOAT_EXPORT void
1223  log(Home home, FloatVar x0, FloatVar x1);
1226  GECODE_FLOAT_EXPORT void
1227  pow(Home home, FloatNum base, FloatVar x0, FloatVar x1);
1230  GECODE_FLOAT_EXPORT void
1231  log(Home home, FloatNum base, FloatVar x0, FloatVar x1);
1234  GECODE_FLOAT_EXPORT void
1235  asin(Home home, FloatVar x0, FloatVar x1);
1238  GECODE_FLOAT_EXPORT void
1239  sin(Home home, FloatVar x0, FloatVar x1);
1242  GECODE_FLOAT_EXPORT void
1243  acos(Home home, FloatVar x0, FloatVar x1);
1246  GECODE_FLOAT_EXPORT void
1247  cos(Home home, FloatVar x0, FloatVar x1);
1250  GECODE_FLOAT_EXPORT void
1251  atan(Home home, FloatVar x0, FloatVar x1);
1254  GECODE_FLOAT_EXPORT void
1255  tan(Home home, FloatVar x0, FloatVar x1);
1257 #endif
1258 
1273  GECODE_FLOAT_EXPORT void
1274  linear(Home home, const FloatVarArgs& x,
1275  FloatRelType frt, FloatVal c);
1286  GECODE_FLOAT_EXPORT void
1287  linear(Home home, const FloatVarArgs& x,
1288  FloatRelType frt, FloatVar y);
1299  GECODE_FLOAT_EXPORT void
1300  linear(Home home, const FloatVarArgs& x,
1301  FloatRelType frt, FloatVal c, Reify r);
1312  GECODE_FLOAT_EXPORT void
1313  linear(Home home, const FloatVarArgs& x,
1314  FloatRelType frt, FloatVar y, Reify r);
1327  GECODE_FLOAT_EXPORT void
1328  linear(Home home, const FloatValArgs& a, const FloatVarArgs& x,
1329  FloatRelType frt, FloatVal c);
1343  GECODE_FLOAT_EXPORT void
1344  linear(Home home, const FloatValArgs& a, const FloatVarArgs& x,
1345  FloatRelType frt, FloatVar y);
1359  GECODE_FLOAT_EXPORT void
1360  linear(Home home, const FloatValArgs& a, const FloatVarArgs& x,
1361  FloatRelType frt, FloatVal c, Reify r);
1375  GECODE_FLOAT_EXPORT void
1376  linear(Home home, const FloatValArgs& a, const FloatVarArgs& x,
1377  FloatRelType frt, FloatVar y, Reify r);
1378 
1379 
1385  GECODE_FLOAT_EXPORT void
1387  channel(Home home, FloatVar x0, IntVar x1);
1389  void
1390  channel(Home home, IntVar x0, FloatVar x1);
1392  GECODE_FLOAT_EXPORT void
1393  channel(Home home, FloatVar x0, BoolVar x1);
1395  void
1396  channel(Home home, BoolVar x0, FloatVar x1);
1398 
1399 }
1400 
1401 #include <gecode/float/channel.hpp>
1402 
1403 namespace Gecode {
1404 
1413  GECODE_FLOAT_EXPORT void
1415  wait(Home home, FloatVar x, std::function<void(Space& home)> c);
1417  GECODE_FLOAT_EXPORT void
1418  wait(Home home, const FloatVarArgs& x, std::function<void(Space& home)> c);
1420 
1421 }
1422 
1423 namespace Gecode {
1424 
1438  typedef std::function<bool(const Space& home, FloatVar x, int i)>
1440 
1451  typedef std::function<double(const Space& home, FloatVar x, int i)>
1453 
1460  public:
1464  bool l;
1465  };
1466 
1477  typedef std::function<FloatNumBranch(const Space& home, FloatVar x, int i)>
1479 
1491  typedef std::function<void(Space& home, unsigned int a,
1492  FloatVar x, int i, FloatNumBranch nl)>
1494 
1495 }
1496 
1498 
1499 namespace Gecode {
1500 
1506  class FloatAFC : public AFC {
1507  public:
1515  FloatAFC(void);
1517  FloatAFC(const FloatAFC& a);
1519  FloatAFC& operator =(const FloatAFC& a);
1527  FloatAFC(Home home, const FloatVarArgs& x, double d=1.0, bool share=true);
1538  void init(Home home, const FloatVarArgs& x, double d=1.0, bool share=true);
1539  };
1540 
1541 }
1542 
1543 #include <gecode/float/branch/afc.hpp>
1544 
1545 namespace Gecode {
1546 
1552  class FloatAction : public Action {
1553  public:
1561  FloatAction(void);
1563  FloatAction(const FloatAction& a);
1565  FloatAction& operator =(const FloatAction& a);
1575  FloatAction(Home home, const FloatVarArgs& x, double d=1.0,
1576  FloatBranchMerit bm=nullptr);
1588  GECODE_FLOAT_EXPORT void
1589  init(Home home, const FloatVarArgs& x, double d=1.0,
1590  FloatBranchMerit bm=nullptr);
1591  };
1592 
1593 }
1594 
1596 
1597 namespace Gecode {
1598 
1604  class FloatCHB : public CHB {
1605  public:
1613  FloatCHB(void);
1615  FloatCHB(const FloatCHB& chb);
1617  FloatCHB& operator =(const FloatCHB& chb);
1627  FloatCHB(Home home, const FloatVarArgs& x, FloatBranchMerit bm=nullptr);
1639  GECODE_FLOAT_EXPORT void
1640  init(Home home, const FloatVarArgs& x, FloatBranchMerit bm=nullptr);
1641  };
1642 
1643 }
1644 
1645 #include <gecode/float/branch/chb.hpp>
1646 
1647 namespace Gecode {
1648 
1650  typedef std::function<void(const Space &home, const Brancher& b,
1651  unsigned int a,
1652  FloatVar x, int i, const FloatNumBranch& n,
1653  std::ostream& o)>
1655 
1656 }
1657 
1658 namespace Gecode {
1659 
1665  class FloatVarBranch : public VarBranch<FloatVar> {
1666  public:
1668  enum Select {
1669  SEL_NONE = 0,
1694  SEL_CHB_SIZE_MAX
1695  };
1696  protected:
1699  public:
1701  FloatVarBranch(void);
1703  FloatVarBranch(Rnd r);
1707  FloatVarBranch(Select s, double, BranchTbl t);
1717  Select select(void) const;
1719  void expand(Home home, const FloatVarArgs& x);
1720  };
1721 
1722 
1741  FloatVarBranch FLOAT_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr);
1745  FloatVarBranch FLOAT_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr);
1749  FloatVarBranch FLOAT_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr);
1753  FloatVarBranch FLOAT_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr);
1781  FloatVarBranch FLOAT_VAR_AFC_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr);
1785  FloatVarBranch FLOAT_VAR_AFC_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr);
1805 
1806 }
1807 
1808 #include <gecode/float/branch/var.hpp>
1809 
1810 namespace Gecode {
1811 
1817  class FloatValBranch : public ValBranch<FloatVar> {
1818  public:
1820  enum Select {
1824  SEL_VAL_COMMIT
1825  };
1826  protected:
1829  public:
1831  FloatValBranch(Select s = SEL_SPLIT_MIN);
1833  FloatValBranch(Rnd r);
1837  Select select(void) const;
1838  };
1839 
1859 
1860 }
1861 
1862 #include <gecode/float/branch/val.hpp>
1863 
1864 namespace Gecode {
1865 
1871  class FloatAssign : public ValBranch<FloatVar> {
1872  public:
1874  enum Select {
1878  SEL_VAL_COMMIT
1879  };
1880  protected:
1883  public:
1885  FloatAssign(Select s = SEL_MIN);
1887  FloatAssign(Rnd r);
1891  Select select(void) const;
1892  };
1893 
1912 
1913 }
1914 
1916 
1917 namespace Gecode {
1918 
1924  GECODE_FLOAT_EXPORT void
1925  branch(Home home, const FloatVarArgs& x,
1926  FloatVarBranch vars, FloatValBranch vals,
1927  FloatBranchFilter bf=nullptr,
1928  FloatVarValPrint vvp=nullptr);
1934  GECODE_FLOAT_EXPORT void
1935  branch(Home home, const FloatVarArgs& x,
1937  FloatBranchFilter bf=nullptr,
1938  FloatVarValPrint vvp=nullptr);
1944  GECODE_FLOAT_EXPORT void
1945  branch(Home home, FloatVar x, FloatValBranch vals,
1946  FloatVarValPrint vvp=nullptr);
1947 
1953  GECODE_FLOAT_EXPORT void
1954  assign(Home home, const FloatVarArgs& x, FloatAssign vals,
1955  FloatBranchFilter bf=nullptr,
1956  FloatVarValPrint vvp=nullptr);
1962  GECODE_FLOAT_EXPORT void
1963  assign(Home home, FloatVar x, FloatAssign vals,
1964  FloatVarValPrint vvp=nullptr);
1966 
1967 }
1968 
1969 namespace Gecode {
1970 
1971  /*
1972  * \brief Relaxed assignment of variables in \a x from values in \a sx
1973  *
1974  * The variables in \a x are assigned values from the assigned variables
1975  * in the solution \a sx with a relaxation probability \a p. That is,
1976  * if \$fp=0.1\f$ approximately 10% of the variables in \a x will be
1977  * assigned a value from \a sx.
1978  *
1979  * The random numbers are generated from the generator \a r. At least
1980  * one variable will not be assigned: in case the relaxation attempt
1981  * would suggest that all variables should be assigned, a single
1982  * variable will be selected randomly to remain unassigned.
1983  *
1984  * Throws an exception of type Float::ArgumentSizeMismatch, if \a x and
1985  * \a sx are of different size.
1986  *
1987  * Throws an exception of type Float::OutOfLimits, if \a p is not between
1988  * \a 0.0 and \a 1.0.
1989  *
1990  * \ingroup TaskModeFloat
1991  */
1992  GECODE_FLOAT_EXPORT void
1993  relax(Home home, const FloatVarArgs& x, const FloatVarArgs& sx,
1994  Rnd r, double p);
1995 
1996 }
1997 
1999 
2000 namespace Gecode {
2001 
2012  protected:
2016  const Delta& d;
2017  public:
2019 
2022  const Delta& d);
2024 
2026  FloatNum min(void) const;
2029  FloatNum max(void) const;
2031  };
2032 
2033 }
2034 
2036 
2038 
2039 namespace Gecode {
2040 
2051 
2056  class GECODE_FLOAT_EXPORT StdFloatTracer : public FloatTracer {
2057  protected:
2059  std::ostream& os;
2060  public:
2062  StdFloatTracer(std::ostream& os0 = std::cerr);
2064  virtual void init(const Space& home, const FloatTraceRecorder& t);
2066  virtual void prune(const Space& home, const FloatTraceRecorder& t,
2067  const ViewTraceInfo& vti, int i, FloatTraceDelta& d);
2069  virtual void fix(const Space& home, const FloatTraceRecorder& t);
2071  virtual void fail(const Space& home, const FloatTraceRecorder& t);
2073  virtual void done(const Space& home, const FloatTraceRecorder& t);
2075  static StdFloatTracer def;
2076  };
2077 
2078 
2083  GECODE_FLOAT_EXPORT void
2084  trace(Home home, const FloatVarArgs& x,
2085  TraceFilter tf,
2086  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
2087  FloatTracer& t = StdFloatTracer::def);
2092  void
2093  trace(Home home, const FloatVarArgs& x,
2094  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
2095  FloatTracer& t = StdFloatTracer::def);
2096 
2097 }
2098 
2099 #include <gecode/float/trace.hpp>
2100 
2101 #endif
2102 
2103 // IFDEF: GECODE_HAS_FLOAT_VARS
2104 // STATISTICS: float-post
2105 
boost::numeric::interval_lib::checking_strict< FloatNum > P
Used checking policy.
Definition: float.hh:418
#define GECODE_FLOAT_EXPORT
Definition: float.hh:68
FloatNum pi_half_upper(void)
Return upper bound of .
Definition: num.hpp:41
Select values greater than mean of smallest and largest value.
Definition: float.hh:1822
FloatVal operator-(const FloatVal &x)
Definition: val.hpp:168
With smallest degree divided by domain size.
Definition: float.hh:1687
SetExpr singleton(const LinIntExpr &e)
Singleton expression.
Definition: set-expr.cpp:690
Passing float arguments.
Definition: float.hh:950
FloatVarBranch FLOAT_VAR_CHB_SIZE_MIN(BranchTbl tbl)
Select variable with smallest CHB Q-score divided by domain size.
Definition: var.hpp:267
FloatNum atanh_down(FloatNum x)
Return lower bound of hyperbolic arctangent of x (domain: )
FloatNum tanh_up(FloatNum x)
Return upper bound of hyperbolic tangent of x (domain: )
Variables as interfaces to variable implementations.
Definition: var.hpp:47
NodeType t
Type of node.
Definition: bool-expr.cpp:230
FloatNum add_down(FloatNum x, FloatNum y)
Return lower bound of x plus y (domain: )
FloatNum asinh_down(FloatNum x)
Return lower bound of hyperbolic arcsine of x (domain: )
Select
Which value selection.
Definition: float.hh:1820
Tracer that process view trace information.
Definition: tracer.hpp:51
Combine variable selection criteria for tie-breaking.
Definition: tiebreak.hpp:38
FloatVarArgs(int n)
Allocate array with n elements.
Definition: float.hh:984
Which values to select for branching first.
Definition: float.hh:1817
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:88
FloatVarArgs(const std::vector< FloatVar > &a)
Initialize from vector a.
Definition: float.hh:990
With smallest domain size.
Definition: float.hh:1685
FloatNum div_up(FloatNum x, FloatNum y)
Return upper bound of x divided y (domain: )
FloatNum mul_down(FloatNum x, FloatNum y)
Return lower bound of x times y (domain: )
FloatValBranch FLOAT_VAL_SPLIT_MAX(void)
Select values greater than mean of smallest and largest value.
Definition: val.hpp:60
NNF * l
Left subtree.
Definition: bool-expr.cpp:240
FloatVarArgs(const FloatVarArgs &a)
Initialize from variable argument array a (copy elements)
Definition: float.hh:986
bool valid(const FloatVal &n)
Return whether float n is a valid number.
Definition: limits.hpp:39
With largest domain size.
Definition: float.hh:1686
FloatNum cosh_down(FloatNum x)
Return lower bound of hyperbolic cosine of x (domain: )
View trace information.
Definition: core.hpp:905
bool subset(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:490
void branch(Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatValBranch vals, FloatBranchFilter bf, FloatVarValPrint vvp)
Branch over x with variable selection vars and value selection vals.
Definition: branch.cpp:39
With smallest accumulated failure count divided by domain size.
Definition: float.hh:1689
FloatNum asinh_up(FloatNum x)
Return upper bound of hyperbolic arcsine of x (domain: )
void log(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Definition: channel.cpp:41
const FloatNum max
Largest allowed float value.
Definition: float.hh:844
FloatNum int_down(FloatNum x)
Return next downward-rounded integer of x (domain: )
FloatVarBranch FLOAT_VAR_CHB_SIZE_MAX(BranchTbl tbl)
Select variable with largest CHB Q-score divided by domain size.
Definition: var.hpp:277
FloatVal operator/(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:213
Disequality ( )
Definition: float.hh:1067
ViewTraceRecorder< Float::FloatView > FloatTraceRecorder
Trace recorder for float variables.
Definition: float.hh:2050
FloatAssign FLOAT_ASSIGN_MAX(void)
Select median value of the upper part.
Definition: assign.hpp:60
Recording actions for float variables.
Definition: float.hh:1552
FloatNum tanh_down(FloatNum x)
Return lower bound of hyperbolic tangent of x (domain: )
FloatVarBranch FLOAT_VAR_DEGREE_MAX(BranchTbl tbl)
Select variable with largest degree.
Definition: var.hpp:122
Less or equal ( )
Definition: float.hh:1068
FloatVal fmod(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:422
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:49
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:41
Passing float variables.
Definition: float.hh:977
FloatVarBranch FLOAT_VAR_AFC_SIZE_MIN(double d, BranchTbl tbl)
Select variable with smalllest accumulated failure count divided by domain size with decay factor d...
Definition: var.hpp:227
With smallest degree.
Definition: float.hh:1673
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Definition: arithmetic.cpp:118
boost::numeric::interval_lib::save_state< Float::Rounding > R
Used rounding policies.
Definition: float.hh:416
bool overlap(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:498
Select median value of a randomly chosen part.
Definition: float.hh:1877
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Definition: arithmetic.cpp:109
FloatAssign FLOAT_ASSIGN_MIN(void)
Select median value of the lower part.
Definition: assign.hpp:55
Select s
Which value to select.
Definition: float.hh:1828
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Definition: dom.cpp:40
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatVal c)
Post propagator for .
Definition: linear.cpp:41
FloatVal hull(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:507
FloatNum sqrt_down(FloatNum x)
Return lower bound of square root of x (domain: )
With largest accumulated failure count.
Definition: float.hh:1676
FloatNum asin_up(FloatNum x)
Return upper bound of arcsine of x (domain: )
Which variable to select for branching.
Definition: float.hh:1665
Select values randomly which are not greater or not smaller than mean of largest and smallest value...
Definition: float.hh:1823
Less ( )
Definition: float.hh:1069
Select
Which variable selection.
Definition: float.hh:1668
FloatNum sinh_up(FloatNum x)
Return upper bound of hyperbolic sine of x (domain: )
FloatNum sqrt_up(FloatNum x)
Return upper bound of square root of x (domain: )
With highest CHB Q-score.
Definition: float.hh:1680
FloatValBranch FLOAT_VAL(FloatBranchVal v, FloatBranchCommit c)
Definition: val.hpp:70
Trace init events.
Definition: recorder.hpp:43
FloatVarBranch FLOAT_VAR_ACTION_SIZE_MIN(double d, BranchTbl tbl)
Select variable with smallest action divided by domain size with decay factor d.
Definition: var.hpp:247
Float variable array.
Definition: float.hh:1027
Computation spaces.
Definition: core.hpp:1701
ExecStatus prune(Space &home, ViewArray< VX > &x, ConstIntView)
Definition: rel.hpp:264
FloatVarBranch FLOAT_VAR_NONE(void)
Select first unassigned variable.
Definition: var.hpp:97
FloatVarBranch FLOAT_VAR_DEGREE_MIN(BranchTbl tbl)
Select variable with smallest degree.
Definition: var.hpp:117
FloatVarBranch FLOAT_VAR_MERIT_MIN(FloatBranchMerit bm, BranchTbl tbl)
Select variable with least merit according to branch merit function bm.
Definition: var.hpp:102
Select s
Which value to select.
Definition: float.hh:1882
FloatValBranch FLOAT_VAL_SPLIT_RND(Rnd r)
Select values randomly which are not greater or not smaller than mean of largest and smallest value...
Definition: val.hpp:65
With smallest action divided by domain size.
Definition: float.hh:1691
Gecode::IntSet d(v, 7)
FloatValImpType x
Implementation of float value.
Definition: float.hh:425
std::string expand(Gecode::IntRelType irt)
Expand relation to abbreviation.
Definition: mm-count.cpp:44
With lowest CHB Q-score.
Definition: float.hh:1679
FloatNum pi_twice_lower(void)
Return lower bound of .
Definition: num.hpp:53
Gecode::FloatVal c(-8, 8)
Trace prune events.
Definition: recorder.hpp:44
Greater or equal ( )
Definition: float.hh:1070
FloatVarBranch FLOAT_VAR_SIZE_MAX(BranchTbl tbl)
Select variable with largest domain size.
Definition: var.hpp:212
FloatNum log_down(FloatNum x)
Return lower bound of logarithm of x (domain: )
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:232
Standard float variable tracer.
Definition: float.hh:2056
bool proper_subset(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:494
FloatVarBranch FLOAT_VAR_DEGREE_SIZE_MIN(BranchTbl tbl)
Select variable with smallest degree divided by domain size.
Definition: var.hpp:217
Gecode::IntArgs i(4, 1, 2, 3, 4)
Base-class for branchers.
Definition: core.hpp:1401
FloatNum n
The middle value for branching.
Definition: float.hh:1462
Class for AFC (accumulated failure count) management.
Definition: afc.hpp:40
FloatNum asin_down(FloatNum x)
Return lower bound of arcsine of x (domain: )
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:234
FloatNum sin_up(FloatNum x)
Return upper bound of sine of x (domain: )
FloatNum int_up(FloatNum x)
Return next upward-rounded integer of x (domain: )
Argument array for non-primitive types.
Definition: array.hpp:711
FloatVarArgs(const VarArray< FloatVar > &a)
Initialize from variable array a (copy elements)
Definition: float.hh:988
FloatAssign FLOAT_ASSIGN_RND(Rnd r)
Select median value of a randomly chosen part.
Definition: assign.hpp:65
FloatVal sinh(const FloatVal &x)
Definition: val.hpp:460
FloatNum pi_twice_upper(void)
Return upper bound of .
Definition: num.hpp:57
FloatVal intersect(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:503
Value description class for branching.
Definition: float.hh:1459
FloatVal operator+(const FloatVal &x)
Definition: val.hpp:164
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:95
FloatRelType
Relation types for floats.
Definition: float.hh:1065
FloatNum log_up(FloatNum x)
Return upper bound of logarithm of x (domain: )
bool operator!=(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:317
New view Float::FloatView n
Definition: float.hh:2014
FloatNum cos_down(FloatNum x)
Return lower bound of cosine of x (domain: )
Output stream to use std::ostream & os
Definition: float.hh:2059
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:102
std::function< double(const Space &home, double w, double b)> BranchTbl
Tie-break limit function.
Definition: var.hpp:48
void wait(Home home, FloatVar x, std::function< void(Space &home)> c)
Execute c when x becomes assigned.
Definition: exec.cpp:39
Class for CHB management.
Definition: chb.hpp:46
unsigned int size(I &i)
Size of all ranges of range iterator i.
Reification specification.
Definition: int.hh:851
bool l
Whether to try the lower or upper half first.
Definition: float.hh:1464
FloatVal cosh(const FloatVal &x)
Definition: val.hpp:464
Trace filters.
Definition: filter.hpp:133
FloatNum pi_half_lower(void)
Return lower bound of .
Definition: num.hpp:37
FloatValBranch FLOAT_VAL_SPLIT_MIN(void)
Select values not greater than mean of smallest and largest value.
Definition: val.hpp:55
union Gecode::@585::NNF::@62 u
Union depending on nodetype t.
const int * pi[]
Definition: photo.cpp:14262
std::function< void(Space &home, unsigned int a, FloatVar x, int i, FloatNumBranch nl)> FloatBranchCommit
Branch commit function type for float variables.
Definition: float.hh:1493
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
Definition: set.hh:765
FloatVarBranch FLOAT_VAR_AFC_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count with decay factor d.
Definition: var.hpp:127
FloatNum atanh_up(FloatNum x)
Return upper bound of hyperbolic arctangent of x (domain: )
With largest accumulated failure count divided by domain size.
Definition: float.hh:1690
void asin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
FloatVarBranch FLOAT_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking)
Definition: var.hpp:112
ViewTracer< Float::FloatView > FloatTracer
Tracer for float variables.
Definition: float.hh:2045
With smallest CHB Q-score divided by domain size.
Definition: float.hh:1693
Select values not greater than mean of smallest and largest value.
Definition: float.hh:1821
FloatVarArgs(InputIterator first, InputIterator last)
Initialize from InputIterator first and last.
Definition: float.hh:993
Floating point rounding policy.
Definition: float.hh:154
Random (uniform, for tie breaking)
Definition: float.hh:1670
FloatNum tan_up(FloatNum x)
Return upper bound of tangent of x (domain: )
Equality ( )
Definition: float.hh:1066
Recording CHB for float variables.
Definition: float.hh:1604
FloatNum atan_up(FloatNum x)
Return upper bound of arctangent of x (domain: )
Float view for float variables.
Definition: view.hpp:52
FloatVarBranch FLOAT_VAR_SIZE_MIN(BranchTbl tbl)
Select variable with smallest domain size.
Definition: var.hpp:207
Greater ( )
Definition: float.hh:1071
Boolean integer variables.
Definition: int.hh:488
FloatVarBranch FLOAT_VAR_MIN_MAX(BranchTbl tbl)
Select variable with largest min.
Definition: var.hpp:192
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition: set.hh:765
void check(const FloatVal &n, const char *l)
Check whether float n is a valid number, otherwise throw out of limits exception with information l...
Definition: limits.hpp:44
const int v[7]
Definition: distinct.cpp:259
Propagator for recording view trace information.
Definition: recorder.hpp:59
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:67
FloatNum cos_up(FloatNum x)
Return upper bound of cosine of x (domain: )
void cos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
struct Gecode::@585::NNF::@62::@63 b
For binary nodes (and, or, eqv)
Trace delta information for float variables.
Definition: float.hh:2011
FloatNum acosh_up(FloatNum x)
Return upper bound of hyperbolic arccosine of x (domain: )
Post propagator for SetVar SetOpType SetVar y
Definition: set.hh:765
Value branching information.
Definition: val.hpp:41
Trace done events.
Definition: recorder.hpp:47
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:127
void relax(Home home, const FloatVarArgs &x, const FloatVarArgs &sx, Rnd r, double p)
Definition: relax.cpp:57
const double base
Base for geometric restart sequence.
Definition: search.hh:124
Float value type.
Definition: float.hh:334
FloatVal operator*(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:200
Variable branching information.
Definition: var.hpp:55
FloatNum atan_down(FloatNum x)
Return lower bound of arctangent of x (domain: )
Rounding(void)
Default constructor (configures full rounding mode)
Definition: rounding.hpp:37
Generic domain change information to be supplied to advisors.
Definition: core.hpp:203
FloatNum sub_down(FloatNum x, FloatNum y)
Return lower bound of x minus y (domain: )
boost::numeric::interval_lib::rounded_arith_opp< FloatNum > RoundingBase
Rounding Base class (optimized version)
Definition: float.hh:145
Select median value of the upper part.
Definition: float.hh:1876
FloatNum acosh_down(FloatNum x)
Return lower bound of hyperbolic arccosine of x (domain: )
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
void tan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
With smallest accumulated failure count.
Definition: float.hh:1675
Select
Which value selection.
Definition: float.hh:1874
Select s
Which variable to select.
Definition: float.hh:1698
bool operator>=(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:277
FloatVal acosh(const FloatVal &x)
Definition: val.hpp:476
FloatVarBranch FLOAT_VAR_AFC_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count with decay factor d.
Definition: var.hpp:137
Integer variables.
Definition: int.hh:347
FloatNum div_down(FloatNum x, FloatNum y)
Return lower bound of x divided by y (domain: )
FloatNum exp_up(FloatNum x)
Return upper bound of exponential of x (domain: )
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Definition: rel.cpp:43
FloatNum acos_up(FloatNum x)
Return upper bound of arccossine of x (domain: )
std::function< bool(const Space &home, FloatVar x, int i)> FloatBranchFilter
Branch filter function type for float variables.
Definition: float.hh:1439
With largest degree divided by domain size.
Definition: float.hh:1688
FloatVarBranch FLOAT_VAR_ACTION_MIN(double d, BranchTbl tbl)
Select variable with lowest action with decay factor d.
Definition: var.hpp:147
FloatVal atanh(const FloatVal &x)
Definition: val.hpp:480
FloatVal asinh(const FloatVal &x)
Definition: val.hpp:472
FloatVarBranch FLOAT_VAR_CHB_MIN(BranchTbl tbl)
Select variable with lowest CHB Q-score.
Definition: var.hpp:167
Which values to select for assignment.
Definition: float.hh:1871
boost::numeric::interval< FloatNum, boost::numeric::interval_lib::policies< R, P > > FloatValImpType
Implementation type for float value.
Definition: float.hh:423
Delta information const Delta & d
Definition: float.hh:2016
Trace fail events.
Definition: recorder.hpp:46
Post propagator for SetVar x
Definition: set.hh:765
FloatNum cosh_up(FloatNum x)
Return upper bound of hyperbolic cosine of x (domain: )
Trace fixpoint events.
Definition: recorder.hpp:45
FloatNum exp_down(FloatNum x)
Return lower bound of exponential of x (domain: )
FloatAssign FLOAT_ASSIGN(FloatBranchVal v, FloatBranchCommit c)
Definition: assign.hpp:70
void trace(Home home, const FloatVarArgs &x, TraceFilter tf, int te, FloatTracer &t)
Create a tracer for float variables.
Definition: trace.cpp:39
Select median value of the lower part.
Definition: float.hh:1875
Float variables.
Definition: float.hh:870
bool operator>(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:260
FloatVarBranch FLOAT_VAR_MIN_MIN(BranchTbl tbl)
Select variable with smallest min.
Definition: var.hpp:187
FloatNum sinh_down(FloatNum x)
Return lower bound of hyperbolic sine of x (domain: )
FloatNum sub_up(FloatNum x, FloatNum y)
Return upper bound of x minus y (domain: )
std::function< void(const Space &home, const Brancher &b, unsigned int a, FloatVar x, int i, const FloatNumBranch &n, std::ostream &o)> FloatVarValPrint
Function type for explaining branching alternatives for float variables.
Definition: float.hh:1654
bool operator<(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:226
bool operator==(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:294
bool operator<=(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:243
With largest action divided by domain size.
Definition: float.hh:1692
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:49
void sin(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
FloatNum acos_down(FloatNum x)
Return lower bound of arccosine of x (domain: )
Class for action management.
Definition: action.hpp:42
FloatVarBranch FLOAT_VAR_ACTION_SIZE_MAX(double d, BranchTbl tbl)
Select variable with largest action divided by domain size with decay factor d.
Definition: var.hpp:257
Random number generator.
Definition: rnd.hpp:42
FloatVarBranch FLOAT_VAR_AFC_SIZE_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count divided by domain size with decay factor d...
Definition: var.hpp:237
void acos(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void exp(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
FloatNum pi_lower(void)
Return lower bound of .
Definition: num.hpp:45
FloatNum mul_up(FloatNum x, FloatNum y)
Return upper bound of x times y (domain: )
void assign(Home home, const FloatVarArgs &x, FloatAssign fa, FloatBranchFilter bf, FloatVarValPrint vvp)
Assign all x with value selection vals.
Definition: branch.cpp:111
FloatVarBranch FLOAT_VAR_MAX_MAX(BranchTbl tbl)
Select variable with largest max.
Definition: var.hpp:202
FloatVal tanh(const FloatVal &x)
Definition: val.hpp:468
Home class for posting propagators
Definition: core.hpp:853
FloatVarBranch FLOAT_VAR_MERIT_MAX(FloatBranchMerit bm, BranchTbl tbl)
Select variable with highest merit according to branch merit function bm.
Definition: var.hpp:107
double tbl(const Gecode::Space &, double w, double b)
Test function for tie-break limit function.
Definition: branch.cpp:61
FloatVarBranch FLOAT_VAR_ACTION_MAX(double d, BranchTbl tbl)
Select variable with highest action with decay factor d.
Definition: var.hpp:157
double FloatNum
Floating point number base type.
Definition: float.hh:106
FloatVarBranch FLOAT_VAR_MAX_MIN(BranchTbl tbl)
Select variable with smallest max.
Definition: var.hpp:197
Shared array with arbitrary number of elements.
FloatVarBranch FLOAT_VAR_DEGREE_SIZE_MAX(BranchTbl tbl)
Select variable with largest degree divided by domain size.
Definition: var.hpp:222
~Rounding(void)
Destructor (restores previous rounding mode)
Definition: rounding.hpp:41
std::function< FloatNumBranch(const Space &home, FloatVar x, int i)> FloatBranchVal
Branch value function type for float variables.
Definition: float.hh:1478
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
Definition: bool.cpp:39
FloatNum median(FloatNum x, FloatNum y)
Return median of x and y (domain: )
Definition: rounding.hpp:44
std::function< double(const Space &home, FloatVar x, int i)> FloatBranchMerit
Branch merit function type for float variables.
Definition: float.hh:1452
void atan(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
FloatNum sin_down(FloatNum x)
Return lower bound of sine of x (domain: )
Recording AFC information for float variables.
Definition: float.hh:1506
FloatNum tan_down(FloatNum x)
Return lower bound of tangent of x (domain: )
FloatNum pi_upper(void)
Return upper bound of .
Definition: num.hpp:49
FloatVarBranch FLOAT_VAR_CHB_MAX(BranchTbl tbl)
Select variable with highest CHB Q-score.
Definition: var.hpp:177