Generated on Thu Apr 5 2018 19:44:19 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$ by $Author$
15  * $Revision$
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 <functional>
50 
51 #include <gecode/kernel.hh>
52 #include <gecode/int.hh>
53 
54 /*
55  * Configure linking
56  *
57  */
58 #if !defined(GECODE_STATIC_LIBS) && \
59  (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
60 
61 #ifdef GECODE_BUILD_FLOAT
62 #define GECODE_FLOAT_EXPORT __declspec( dllexport )
63 #else
64 #define GECODE_FLOAT_EXPORT __declspec( dllimport )
65 #endif
66 
67 #else
68 
69 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
70 #define GECODE_FLOAT_EXPORT __attribute__ ((visibility("default")))
71 #else
72 #define GECODE_FLOAT_EXPORT
73 #endif
74 
75 #endif
76 
77 // Configure auto-linking
78 #ifndef GECODE_BUILD_FLOAT
79 #define GECODE_LIBRARY_NAME "Float"
81 #endif
82 
83 // Include interval implementation
84 #include <boost/numeric/interval.hpp>
85 
98 
100 
101 namespace Gecode {
102 
110  typedef double FloatNum;
111 
113  FloatNum pi_half_lower(void);
115  FloatNum pi_half_upper(void);
117  FloatNum pi_lower(void);
119  FloatNum pi_upper(void);
121  FloatNum pi_twice_lower(void);
123  FloatNum pi_twice_upper(void);
124 
125  // Forward declaration
126  class FloatVal;
127 
128 }
129 
130 #include <gecode/float/num.hpp>
131 
132 namespace Gecode { namespace Float {
133 
134 
135 #if defined(_MSC_VER) && (defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP > 0)))
136 
137  /*
138  * This is used for the MSVC compiler for x64 or x86 with SSE enabled.
139  *
140  */
142  typedef boost::numeric::interval_lib::rounded_arith_std<FloatNum>
143  RoundingBase;
144 
145 #else
146 
148  typedef boost::numeric::interval_lib::rounded_arith_opp<FloatNum>
150 
151 #endif
152 
158  class Rounding : public RoundingBase {
159  public:
161 
162  Rounding(void);
165  ~Rounding(void);
167 
169 
191 
193 
201 
202 #ifdef GECODE_HAS_MPFR
203 
214 
216 
230 
232 
246 
248 
262 
264 
278 #endif
279  };
280 
281 }}
282 
283 #include <gecode/float/rounding.hpp>
284 
285 namespace Gecode { namespace Float {
286 
291  bool subset(const FloatVal& x, const FloatVal& y);
296  bool proper_subset(const FloatVal& x, const FloatVal& y);
301  bool overlap(const FloatVal& x, const FloatVal& y);
302 
307  FloatVal intersect(const FloatVal& x, const FloatVal& y);
312  FloatVal hull(const FloatVal& x, const FloatVal& y);
317  FloatVal hull(const FloatVal& x, const FloatNum& y);
322  FloatVal hull(const FloatNum& x, const FloatVal& y);
327  FloatVal hull(const FloatNum& x, const FloatNum& y);
328 
329 }}
330 
331 namespace Gecode {
332 
338  class FloatVal {
339  friend FloatVal operator +(const FloatVal& x);
340  friend FloatVal operator -(const FloatVal& x);
341  friend FloatVal operator +(const FloatVal& x, const FloatVal& y);
342  friend FloatVal operator +(const FloatVal& x, const FloatNum& y);
343  friend FloatVal operator +(const FloatNum& x, const FloatVal& y);
344  friend FloatVal operator -(const FloatVal& x, const FloatVal& y);
345  friend FloatVal operator -(const FloatVal& x, const FloatNum& y);
346  friend FloatVal operator -(const FloatNum& x, const FloatVal& y);
347  friend FloatVal operator *(const FloatVal& x, const FloatVal& y);
348  friend FloatVal operator *(const FloatVal& x, const FloatNum& y);
349  friend FloatVal operator *(const FloatNum& x, const FloatVal& y);
350  friend FloatVal operator /(const FloatVal& x, const FloatVal& y);
351  friend FloatVal operator /(const FloatVal& x, const FloatNum& y);
352  friend FloatVal operator /(const FloatNum& x, const FloatVal& y);
353 
354  friend bool operator <(const FloatVal& x, const FloatVal& y);
355  friend bool operator <(const FloatVal& x, const FloatNum& y);
356  friend bool operator <(const FloatNum& x, const FloatVal& y);
357  friend bool operator <=(const FloatVal& x, const FloatVal& y);
358  friend bool operator <=(const FloatVal& x, const FloatNum& y);
359  friend bool operator <=(const FloatNum& x, const FloatVal& y);
360  friend bool operator >(const FloatVal& x, const FloatVal& y);
361  friend bool operator >(const FloatVal& x, const FloatNum& y);
362  friend bool operator >(const FloatNum& x, const FloatVal& y);
363  friend bool operator >=(const FloatVal& x, const FloatVal& y);
364  friend bool operator >=(const FloatVal& x, const FloatNum& y);
365  friend bool operator >=(const FloatNum& x, const FloatVal& y);
366  friend bool operator ==(const FloatVal& x, const FloatVal& y);
367  friend bool operator ==(const FloatVal& x, const FloatNum& y);
368  friend bool operator ==(const FloatNum& x, const FloatVal& y);
369  friend bool operator !=(const FloatVal& x, const FloatVal& y);
370  friend bool operator !=(const FloatVal& x, const FloatNum& y);
371  friend bool operator !=(const FloatNum& x, const FloatVal& y);
372 
373  template<class Char, class Traits>
374  friend std::basic_ostream<Char,Traits>&
375  operator <<(std::basic_ostream<Char,Traits>& os, const FloatVal& x);
376 
377  friend FloatVal abs(const FloatVal& x);
378  friend FloatVal sqrt(const FloatVal& x);
379  friend FloatVal sqr(const FloatVal& x);
380  friend FloatVal pow(const FloatVal& x, int n);
381  friend FloatVal nroot(const FloatVal& x, int n);
382 
383  friend FloatVal max(const FloatVal& x, const FloatVal& y);
384  friend FloatVal max(const FloatVal& x, const FloatNum& y);
385  friend FloatVal max(const FloatNum& x, const FloatVal& y);
386  friend FloatVal min(const FloatVal& x, const FloatVal& y);
387  friend FloatVal min(const FloatVal& x, const FloatNum& y);
388  friend FloatVal min(const FloatNum& x, const FloatVal& y);
389 
390 #ifdef GECODE_HAS_MPFR
391  friend FloatVal exp(const FloatVal& x);
392  friend FloatVal log(const FloatVal& x);
393  friend FloatVal fmod(const FloatVal& x, const FloatVal& y);
394  friend FloatVal fmod(const FloatVal& x, const FloatNum& y);
395  friend FloatVal fmod(const FloatNum& x, const FloatVal& y);
396  friend FloatVal sin(const FloatVal& x);
397  friend FloatVal cos(const FloatVal& x);
398  friend FloatVal tan(const FloatVal& x);
399  friend FloatVal asin(const FloatVal& x);
400  friend FloatVal acos(const FloatVal& x);
401  friend FloatVal atan(const FloatVal& x);
402  friend FloatVal sinh(const FloatVal& x);
403  friend FloatVal cosh(const FloatVal& x);
404  friend FloatVal tanh(const FloatVal& x);
405  friend FloatVal asinh(const FloatVal& x);
406  friend FloatVal acosh(const FloatVal& x);
407  friend FloatVal atanh(const FloatVal& x);
408 #endif
409 
410  friend bool Float::subset(const FloatVal& x, const FloatVal& y);
411  friend bool Float::proper_subset(const FloatVal& x, const FloatVal& y);
412  friend bool Float::overlap(const FloatVal& x, const FloatVal& y);
413  friend FloatVal Float::intersect(const FloatVal& x, const FloatVal& y);
414  friend FloatVal Float::hull(const FloatVal& x, const FloatVal& y);
415  friend FloatVal Float::hull(const FloatVal& x, const FloatNum& y);
416  friend FloatVal Float::hull(const FloatNum& x, const FloatVal& y);
417  friend FloatVal Float::hull(const FloatNum& x, const FloatNum& y);
418  protected:
420  typedef boost::numeric::interval_lib::save_state<Float::Rounding> R;
422  typedef boost::numeric::interval_lib::checking_strict<FloatNum> P;
424  typedef boost::numeric::interval
425  <FloatNum,
426  boost::numeric::interval_lib::policies<R, P> >
431  explicit FloatVal(const FloatValImpType& i);
432  public:
434 
435  FloatVal(void);
438  FloatVal(const FloatNum& n);
440  FloatVal(const FloatNum& l, const FloatNum& u);
442  FloatVal(const FloatVal& v);
443 
445  FloatVal& operator =(const FloatNum& n);
447  FloatVal& operator =(const FloatVal& v);
448 
450  void assign(FloatNum const &l, FloatNum const &u);
452 
454 
455  FloatNum min(void) const;
458  FloatNum max(void) const;
460  FloatNum size(void) const;
462  FloatNum med(void) const;
464 
466 
467  bool tight(void) const;
470  bool singleton(void) const;
472  bool in(FloatNum n) const;
474  bool zero_in(void) const;
476 
478 
479  static FloatVal hull(FloatNum x, FloatNum y);
482  static FloatVal pi_half(void);
484  static FloatVal pi(void);
486  static FloatVal pi_twice(void);
488 
490 
491  FloatVal& operator +=(const FloatNum& n);
494  FloatVal& operator -=(const FloatNum& n);
496  FloatVal& operator *=(const FloatNum& n);
498  FloatVal& operator /=(const FloatNum& n);
500  FloatVal& operator +=(const FloatVal& v);
502  FloatVal& operator -=(const FloatVal& v);
504  FloatVal& operator *=(const FloatVal& v);
506  FloatVal& operator /=(const FloatVal& v);
508  };
509 
514  FloatVal operator +(const FloatVal& x);
519  FloatVal operator -(const FloatVal& x);
520 
525  FloatVal operator +(const FloatVal& x, const FloatVal& y);
530  FloatVal operator +(const FloatVal& x, const FloatNum& y);
535  FloatVal operator +(const FloatNum& x, const FloatVal& y);
540  FloatVal operator -(const FloatVal& x, const FloatVal& y);
545  FloatVal operator -(const FloatVal& x, const FloatNum& y);
550  FloatVal operator -(const FloatNum& x, const FloatVal& y);
555  FloatVal operator *(const FloatVal& x, const FloatVal& y);
560  FloatVal operator *(const FloatVal& x, const FloatNum& y);
565  FloatVal operator *(const FloatNum& x, const FloatVal& y);
570  FloatVal operator /(const FloatVal& x, const FloatVal& y);
575  FloatVal operator /(const FloatVal& x, const FloatNum& y);
580  FloatVal operator /(const FloatNum& r, const FloatVal& x);
581 
586  bool operator <(const FloatVal& x, const FloatVal& y);
591  bool operator <(const FloatVal& x, const FloatNum& y);
596  bool operator <(const FloatNum& x, const FloatVal& y);
597 
602  bool operator <=(const FloatVal& x, const FloatVal& y);
607  bool operator <=(const FloatVal& x, const FloatNum& y);
612  bool operator <=(const FloatNum& x, const FloatVal& y);
613 
618  bool operator >(const FloatVal& x, const FloatVal& y);
623  bool operator >(const FloatVal& x, const FloatNum& y);
628  bool operator >(const FloatNum& x, const FloatVal& y);
629 
634  bool operator >=(const FloatVal& x, const FloatVal& y);
639  bool operator >=(const FloatVal& x, const FloatNum& y);
644  bool operator >=(const FloatNum& x, const FloatVal& y);
649  bool operator ==(const FloatVal& x, const FloatVal& y);
654  bool operator ==(const FloatVal& x, const FloatNum& y);
659  bool operator ==(const FloatNum& x, const FloatVal& y);
660 
665  bool operator !=(const FloatVal& x, const FloatVal& y);
670  bool operator !=(const FloatVal& x, const FloatNum& y);
675  bool operator !=(const FloatNum& x, const FloatVal& y);
676 
681  template<class Char, class Traits>
682  std::basic_ostream<Char,Traits>&
683  operator <<(std::basic_ostream<Char,Traits>& os, const FloatVal& x);
684 
689  FloatVal abs(const FloatVal& x);
694  FloatVal sqrt(const FloatVal& x);
699  FloatVal sqr(const FloatVal& x);
704  FloatVal pow(const FloatVal& x, int n);
709  FloatVal nroot(const FloatVal& x, int n);
710 
715  FloatVal max(const FloatVal& x, const FloatVal& y);
720  FloatVal max(const FloatVal& x, const FloatNum& y);
725  FloatVal max(const FloatNum& x, const FloatVal& y);
730  FloatVal min(const FloatVal& x, const FloatVal& y);
735  FloatVal min(const FloatVal& x, const FloatNum& y);
740  FloatVal min(const FloatNum& x, const FloatVal& y);
741 
742 #ifdef GECODE_HAS_MPFR
743  /* transcendental functions: exp, log */
748  FloatVal exp(const FloatVal& x);
753  FloatVal log(const FloatVal& x);
754 
759  FloatVal fmod(const FloatVal& x, const FloatVal& y);
764  FloatVal fmod(const FloatVal& x, const FloatNum& y);
769  FloatVal fmod(const FloatNum& x, const FloatVal& y);
770 
775  FloatVal sin(const FloatVal& x);
780  FloatVal cos(const FloatVal& x);
785  FloatVal tan(const FloatVal& x);
790  FloatVal asin(const FloatVal& x);
795  FloatVal acos(const FloatVal& x);
800  FloatVal atan(const FloatVal& x);
801 
806  FloatVal sinh(const FloatVal& x);
811  FloatVal cosh(const FloatVal& x);
816  FloatVal tanh(const FloatVal& x);
821  FloatVal asinh(const FloatVal& x);
826  FloatVal acosh(const FloatVal& x);
831  FloatVal atanh(const FloatVal& x);
832 
833 #endif
834 
835 }
836 
837 #include <gecode/float/val.hpp>
838 
839 namespace Gecode { namespace Float {
840 
846  namespace Limits {
850  const FloatNum min = -max;
852  bool valid(const FloatVal& n);
854  void check(const FloatVal& n, const char* l);
855  }
856 
857 }}
858 
859 #include <gecode/float/limits.hpp>
860 
861 #include <gecode/float/var-imp.hpp>
862 
863 namespace Gecode {
864 
865  namespace Float {
866  class FloatView;
867  }
868 
874  class FloatVar : public VarImpVar<Float::FloatVarImp> {
875  friend class FloatVarArray;
876  friend class FloatVarArgs;
877  private:
885  void _init(Space& home, FloatNum min, FloatNum max);
886  public:
888 
889  FloatVar(void);
892  FloatVar(const FloatVar& y);
894  FloatVar(const Float::FloatView& y);
908 
910 
911  FloatVal domain(void) const;
914  FloatNum min(void) const;
916  FloatNum max(void) const;
918  FloatNum med(void) const;
920  FloatNum size(void) const;
928  FloatVal val(void) const;
929 
931 
933 
934  bool in(const FloatVal& n) const;
937  };
938 
943  template<class Char, class Traits>
944  std::basic_ostream<Char,Traits>&
945  operator <<(std::basic_ostream<Char,Traits>& os, const FloatVar& x);
946 }
947 
948 #include <gecode/float/view.hpp>
950 
951 namespace Gecode {
952 
954  class FloatValArgs : public ArgArray<FloatVal> {
955  public:
957 
958  FloatValArgs(void);
961  explicit FloatValArgs(int n);
965  FloatValArgs(const std::vector<FloatVal>& x);
967  template<class InputIterator>
968  FloatValArgs(InputIterator first, InputIterator last);
970  FloatValArgs(int n, const FloatVal* e);
973 
976  static FloatValArgs create(int n, FloatVal start, int inc=1);
978  };
979 
981  class FloatVarArgs : public VarArgArray<FloatVar> {
982  public:
984 
985  FloatVarArgs(void) {}
988  explicit FloatVarArgs(int n) : VarArgArray<FloatVar>(n) {}
994  FloatVarArgs(const std::vector<FloatVar>& a) : VarArgArray<FloatVar>(a) {}
996  template<class InputIterator>
997  FloatVarArgs(InputIterator first, InputIterator last)
998  : VarArgArray<FloatVar>(first,last) {}
1011  FloatVarArgs(Space& home, int n, FloatNum min, FloatNum max);
1013  };
1015 
1031  class FloatVarArray : public VarArray<FloatVar> {
1032  public:
1034 
1035  FloatVarArray(void);
1038  FloatVarArray(Space& home, int n);
1040  FloatVarArray(const FloatVarArray& a);
1042  FloatVarArray(Space& home, const FloatVarArgs& a);
1055  FloatVarArray(Space& home, int n, FloatNum min, FloatNum max);
1057  };
1058 
1059 }
1060 
1061 #include <gecode/float/array.hpp>
1062 
1063 namespace Gecode {
1064 
1076  };
1077 
1085  GECODE_FLOAT_EXPORT void
1087  dom(Home home, FloatVar x, FloatVal n);
1089  GECODE_FLOAT_EXPORT void
1090  dom(Home home, const FloatVarArgs& x, FloatVal n);
1092  GECODE_FLOAT_EXPORT void
1093  dom(Home home, FloatVar x, FloatNum l, FloatNum m);
1095  GECODE_FLOAT_EXPORT void
1096  dom(Home home, const FloatVarArgs& x, FloatNum l, FloatNum u);
1098  GECODE_FLOAT_EXPORT void
1099  dom(Home home, FloatVar x, FloatVal n, Reify r);
1101  GECODE_FLOAT_EXPORT void
1102  dom(Home home, FloatVar x, FloatNum l, FloatNum u, Reify r);
1104  GECODE_FLOAT_EXPORT void
1105  dom(Home home, FloatVar x, FloatVar d);
1107  GECODE_FLOAT_EXPORT void
1108  dom(Home home, const FloatVarArgs& x, const FloatVarArgs& d);
1110 
1119  GECODE_FLOAT_EXPORT void
1120  rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1);
1124  GECODE_FLOAT_EXPORT void
1125  rel(Home home, FloatVar x, FloatRelType frt, FloatVal c);
1129  GECODE_FLOAT_EXPORT void
1130  rel(Home home, FloatVar x, FloatRelType frt, FloatVal c, Reify r);
1134  GECODE_FLOAT_EXPORT void
1135  rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1, Reify r);
1139  GECODE_FLOAT_EXPORT void
1140  rel(Home home, const FloatVarArgs& x, FloatRelType frt, FloatVal c);
1144  GECODE_FLOAT_EXPORT void
1145  rel(Home home, const FloatVarArgs& x, FloatRelType frt, FloatVar y);
1152  GECODE_FLOAT_EXPORT void
1153  ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z);
1154 
1155 }
1156 
1157 
1158 namespace Gecode {
1159 
1168  GECODE_FLOAT_EXPORT void
1169  min(Home home, FloatVar x0, FloatVar x1, FloatVar x2);
1173  GECODE_FLOAT_EXPORT void
1174  min(Home home, const FloatVarArgs& x, FloatVar y);
1177  GECODE_FLOAT_EXPORT void
1178  max(Home home, FloatVar x0, FloatVar x1, FloatVar x2);
1182  GECODE_FLOAT_EXPORT void
1183  max(Home home, const FloatVarArgs& x, FloatVar y);
1184 
1187  GECODE_FLOAT_EXPORT void
1188  abs(Home home, FloatVar x0, FloatVar x1);
1189 
1192  GECODE_FLOAT_EXPORT void
1193  mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2);
1194 
1197  GECODE_FLOAT_EXPORT void
1198  sqr(Home home, FloatVar x0, FloatVar x1);
1199 
1202  GECODE_FLOAT_EXPORT void
1203  sqrt(Home home, FloatVar x0, FloatVar x1);
1204 
1207  GECODE_FLOAT_EXPORT void
1208  pow(Home home, FloatVar x0, int n, FloatVar x1);
1209 
1212  GECODE_FLOAT_EXPORT void
1213  nroot(Home home, FloatVar x0, int n, FloatVar x1);
1214 
1217  GECODE_FLOAT_EXPORT void
1218  div(Home home, FloatVar x0, FloatVar x1, FloatVar x2);
1219 #ifdef GECODE_HAS_MPFR
1220 
1222  GECODE_FLOAT_EXPORT void
1223  exp(Home home, FloatVar x0, FloatVar x1);
1226  GECODE_FLOAT_EXPORT void
1227  log(Home home, FloatVar x0, FloatVar x1);
1230  GECODE_FLOAT_EXPORT void
1231  pow(Home home, FloatNum base, FloatVar x0, FloatVar x1);
1234  GECODE_FLOAT_EXPORT void
1235  log(Home home, FloatNum base, FloatVar x0, FloatVar x1);
1238  GECODE_FLOAT_EXPORT void
1239  asin(Home home, FloatVar x0, FloatVar x1);
1242  GECODE_FLOAT_EXPORT void
1243  sin(Home home, FloatVar x0, FloatVar x1);
1246  GECODE_FLOAT_EXPORT void
1247  acos(Home home, FloatVar x0, FloatVar x1);
1250  GECODE_FLOAT_EXPORT void
1251  cos(Home home, FloatVar x0, FloatVar x1);
1254  GECODE_FLOAT_EXPORT void
1255  atan(Home home, FloatVar x0, FloatVar x1);
1258  GECODE_FLOAT_EXPORT void
1259  tan(Home home, FloatVar x0, FloatVar x1);
1261 #endif
1262 
1277  GECODE_FLOAT_EXPORT void
1278  linear(Home home, const FloatVarArgs& x,
1279  FloatRelType frt, FloatVal c);
1290  GECODE_FLOAT_EXPORT void
1291  linear(Home home, const FloatVarArgs& x,
1292  FloatRelType frt, FloatVar y);
1303  GECODE_FLOAT_EXPORT void
1304  linear(Home home, const FloatVarArgs& x,
1305  FloatRelType frt, FloatVal c, Reify r);
1316  GECODE_FLOAT_EXPORT void
1317  linear(Home home, const FloatVarArgs& x,
1318  FloatRelType frt, FloatVar y, Reify r);
1331  GECODE_FLOAT_EXPORT void
1332  linear(Home home, const FloatValArgs& a, const FloatVarArgs& x,
1333  FloatRelType frt, FloatVal c);
1347  GECODE_FLOAT_EXPORT void
1348  linear(Home home, const FloatValArgs& a, const FloatVarArgs& x,
1349  FloatRelType frt, FloatVar y);
1363  GECODE_FLOAT_EXPORT void
1364  linear(Home home, const FloatValArgs& a, const FloatVarArgs& x,
1365  FloatRelType frt, FloatVal c, Reify r);
1379  GECODE_FLOAT_EXPORT void
1380  linear(Home home, const FloatValArgs& a, const FloatVarArgs& x,
1381  FloatRelType frt, FloatVar y, Reify r);
1382 
1383 
1389  GECODE_FLOAT_EXPORT void
1391  channel(Home home, FloatVar x0, IntVar x1);
1393  void
1394  channel(Home home, IntVar x0, FloatVar x1);
1396  GECODE_FLOAT_EXPORT void
1397  channel(Home home, FloatVar x0, BoolVar x1);
1399  void
1400  channel(Home home, BoolVar x0, FloatVar x1);
1402 
1403 }
1404 
1405 #include <gecode/float/channel.hpp>
1406 
1407 namespace Gecode {
1408 
1417  GECODE_FLOAT_EXPORT void
1419  wait(Home home, FloatVar x, std::function<void(Space& home)> c);
1421  GECODE_FLOAT_EXPORT void
1422  wait(Home home, const FloatVarArgs& x, std::function<void(Space& home)> c);
1424 
1425 }
1426 
1427 namespace Gecode {
1428 
1442  typedef std::function<bool(const Space& home, FloatVar x, int i)>
1444 
1455  typedef std::function<double(const Space& home, FloatVar x, int i)>
1457 
1464  public:
1468  bool l;
1469  };
1470 
1481  typedef std::function<FloatNumBranch(const Space& home, FloatVar x, int i)>
1483 
1495  typedef std::function<void(Space& home, unsigned int a,
1496  FloatVar x, int i, FloatNumBranch nl)>
1498 
1499 }
1500 
1502 
1503 namespace Gecode {
1504 
1510  class FloatAFC : public AFC {
1511  public:
1519  FloatAFC(void);
1521  FloatAFC(const FloatAFC& a);
1523  FloatAFC& operator =(const FloatAFC& a);
1531  FloatAFC(Home home, const FloatVarArgs& x, double d=1.0, bool share=true);
1542  void init(Home home, const FloatVarArgs& x, double d=1.0, bool share=true);
1543  };
1544 
1545 }
1546 
1547 #include <gecode/float/branch/afc.hpp>
1548 
1549 namespace Gecode {
1550 
1556  class FloatAction : public Action {
1557  public:
1565  FloatAction(void);
1567  FloatAction(const FloatAction& a);
1569  FloatAction& operator =(const FloatAction& a);
1579  FloatAction(Home home, const FloatVarArgs& x, double d=1.0,
1580  FloatBranchMerit bm=nullptr);
1592  GECODE_FLOAT_EXPORT void
1593  init(Home home, const FloatVarArgs& x, double d=1.0,
1594  FloatBranchMerit bm=nullptr);
1595  };
1596 
1597 }
1598 
1600 
1601 namespace Gecode {
1602 
1608  class FloatCHB : public CHB {
1609  public:
1617  FloatCHB(void);
1619  FloatCHB(const FloatCHB& chb);
1621  FloatCHB& operator =(const FloatCHB& chb);
1631  FloatCHB(Home home, const FloatVarArgs& x, FloatBranchMerit bm=nullptr);
1643  GECODE_FLOAT_EXPORT void
1644  init(Home home, const FloatVarArgs& x, FloatBranchMerit bm=nullptr);
1645  };
1646 
1647 }
1648 
1649 #include <gecode/float/branch/chb.hpp>
1650 
1651 namespace Gecode {
1652 
1654  typedef std::function<void(const Space &home, const Brancher& b,
1655  unsigned int a,
1656  FloatVar x, int i, const FloatNumBranch& n,
1657  std::ostream& o)>
1659 
1660 }
1661 
1662 namespace Gecode {
1663 
1669  class FloatVarBranch : public VarBranch<FloatVar> {
1670  public:
1672  enum Select {
1673  SEL_NONE = 0,
1698  SEL_CHB_SIZE_MAX
1699  };
1700  protected:
1703  public:
1705  FloatVarBranch(void);
1707  FloatVarBranch(Rnd r);
1711  FloatVarBranch(Select s, double, BranchTbl t);
1721  Select select(void) const;
1723  void expand(Home home, const FloatVarArgs& x);
1724  };
1725 
1726 
1745  FloatVarBranch FLOAT_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr);
1749  FloatVarBranch FLOAT_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr);
1753  FloatVarBranch FLOAT_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr);
1757  FloatVarBranch FLOAT_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr);
1785  FloatVarBranch FLOAT_VAR_AFC_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr);
1789  FloatVarBranch FLOAT_VAR_AFC_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr);
1809 
1810 }
1811 
1812 #include <gecode/float/branch/var.hpp>
1813 
1814 namespace Gecode {
1815 
1821  class FloatValBranch : public ValBranch<FloatVar> {
1822  public:
1824  enum Select {
1828  SEL_VAL_COMMIT
1829  };
1830  protected:
1833  public:
1835  FloatValBranch(Select s = SEL_SPLIT_MIN);
1837  FloatValBranch(Rnd r);
1841  Select select(void) const;
1842  };
1843 
1863 
1864 }
1865 
1866 #include <gecode/float/branch/val.hpp>
1867 
1868 namespace Gecode {
1869 
1875  class FloatAssign : public ValBranch<FloatVar> {
1876  public:
1878  enum Select {
1882  SEL_VAL_COMMIT
1883  };
1884  protected:
1887  public:
1889  FloatAssign(Select s = SEL_MIN);
1891  FloatAssign(Rnd r);
1895  Select select(void) const;
1896  };
1897 
1916 
1917 }
1918 
1920 
1921 namespace Gecode {
1922 
1928  GECODE_FLOAT_EXPORT void
1929  branch(Home home, const FloatVarArgs& x,
1930  FloatVarBranch vars, FloatValBranch vals,
1931  FloatBranchFilter bf=nullptr,
1932  FloatVarValPrint vvp=nullptr);
1938  GECODE_FLOAT_EXPORT void
1939  branch(Home home, const FloatVarArgs& x,
1941  FloatBranchFilter bf=nullptr,
1942  FloatVarValPrint vvp=nullptr);
1948  GECODE_FLOAT_EXPORT void
1949  branch(Home home, FloatVar x, FloatValBranch vals,
1950  FloatVarValPrint vvp=nullptr);
1951 
1957  GECODE_FLOAT_EXPORT void
1958  assign(Home home, const FloatVarArgs& x, FloatAssign vals,
1959  FloatBranchFilter bf=nullptr,
1960  FloatVarValPrint vvp=nullptr);
1966  GECODE_FLOAT_EXPORT void
1967  assign(Home home, FloatVar x, FloatAssign vals,
1968  FloatVarValPrint vvp=nullptr);
1970 
1971 }
1972 
1973 namespace Gecode {
1974 
1975  /*
1976  * \brief Relaxed assignment of variables in \a x from values in \a sx
1977  *
1978  * The variables in \a x are assigned values from the assigned variables
1979  * in the solution \a sx with a relaxation probability \a p. That is,
1980  * if \$fp=0.1\f$ approximately 10% of the variables in \a x will be
1981  * assigned a value from \a sx.
1982  *
1983  * The random numbers are generated from the generator \a r. At least
1984  * one variable will not be assigned: in case the relaxation attempt
1985  * would suggest that all variables should be assigned, a single
1986  * variable will be selected randomly to remain unassigned.
1987  *
1988  * Throws an exception of type Float::ArgumentSizeMismatch, if \a x and
1989  * \a sx are of different size.
1990  *
1991  * Throws an exception of type Float::OutOfLimits, if \a p is not between
1992  * \a 0.0 and \a 1.0.
1993  *
1994  * \ingroup TaskModeFloat
1995  */
1996  GECODE_FLOAT_EXPORT void
1997  relax(Home home, const FloatVarArgs& x, const FloatVarArgs& sx,
1998  Rnd r, double p);
1999 
2000 }
2001 
2003 
2004 namespace Gecode {
2005 
2016  protected:
2020  const Delta& d;
2021  public:
2023 
2026  const Delta& d);
2028 
2030  FloatNum min(void) const;
2033  FloatNum max(void) const;
2035  };
2036 
2037 }
2038 
2040 
2042 
2043 namespace Gecode {
2044 
2055 
2060  class GECODE_FLOAT_EXPORT StdFloatTracer : public FloatTracer {
2061  protected:
2063  std::ostream& os;
2064  public:
2066  StdFloatTracer(std::ostream& os0 = std::cerr);
2068  virtual void init(const Space& home, const FloatTraceRecorder& t);
2070  virtual void prune(const Space& home, const FloatTraceRecorder& t,
2071  const ViewTraceInfo& vti, int i, FloatTraceDelta& d);
2073  virtual void fix(const Space& home, const FloatTraceRecorder& t);
2075  virtual void fail(const Space& home, const FloatTraceRecorder& t);
2077  virtual void done(const Space& home, const FloatTraceRecorder& t);
2079  static StdFloatTracer def;
2080  };
2081 
2082 
2087  GECODE_FLOAT_EXPORT void
2088  trace(Home home, const FloatVarArgs& x,
2089  TraceFilter tf,
2090  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
2091  FloatTracer& t = StdFloatTracer::def);
2096  void
2097  trace(Home home, const FloatVarArgs& x,
2098  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
2099  FloatTracer& t = StdFloatTracer::def);
2100 
2101 }
2102 
2103 #include <gecode/float/trace.hpp>
2104 
2105 #endif
2106 
2107 // IFDEF: GECODE_HAS_FLOAT_VARS
2108 // STATISTICS: float-post
2109 
boost::numeric::interval_lib::checking_strict< FloatNum > P
Used checking policy.
Definition: float.hh:422
#define GECODE_FLOAT_EXPORT
Definition: float.hh:72
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:1826
FloatVal operator-(const FloatVal &x)
Definition: val.hpp:172
With smallest degree divided by domain size.
Definition: float.hh:1691
SetExpr singleton(const LinIntExpr &e)
Singleton expression.
Definition: set-expr.cpp:694
Passing float arguments.
Definition: float.hh:954
FloatVarBranch FLOAT_VAR_CHB_SIZE_MIN(BranchTbl tbl)
Select variable with smallest CHB Q-score divided by domain size.
Definition: var.hpp:271
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: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:1824
Tracer that process view trace information.
Definition: tracer.hpp:55
Combine variable selection criteria for tie-breaking.
Definition: tiebreak.hpp:42
FloatVarArgs(int n)
Allocate array with n elements.
Definition: float.hh:988
Which values to select for branching first.
Definition: float.hh:1821
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:92
FloatVarArgs(const std::vector< FloatVar > &a)
Initialize from vector a.
Definition: float.hh:994
With smallest domain size.
Definition: float.hh:1689
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: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:990
bool valid(const FloatVal &n)
Return whether float n is a valid number.
Definition: limits.hpp:43
With largest domain size.
Definition: float.hh:1690
FloatNum cosh_down(FloatNum x)
Return lower bound of hyperbolic cosine of x (domain: )
View trace information.
Definition: core.hpp:898
bool subset(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:494
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
With smallest accumulated failure count divided by domain size.
Definition: float.hh:1693
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:45
const FloatNum max
Largest allowed float value.
Definition: float.hh:848
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:281
FloatVal operator/(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:217
Disequality ( )
Definition: float.hh:1071
ViewTraceRecorder< Float::FloatView > FloatTraceRecorder
Trace recorder for float variables.
Definition: float.hh:2054
FloatAssign FLOAT_ASSIGN_MAX(void)
Select median value of the upper part.
Definition: assign.hpp:64
Recording actions for float variables.
Definition: float.hh:1556
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:126
Less or equal ( )
Definition: float.hh:1072
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:53
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:45
Passing float variables.
Definition: float.hh:981
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:231
With smallest degree.
Definition: float.hh:1677
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Definition: arithmetic.cpp:122
boost::numeric::interval_lib::save_state< Float::Rounding > R
Used rounding policies.
Definition: float.hh:420
bool overlap(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:502
Select median value of a randomly chosen part.
Definition: float.hh:1881
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Definition: arithmetic.cpp:113
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:1832
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Definition: dom.cpp:44
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatVal c)
Post propagator for .
Definition: linear.cpp:45
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:1680
FloatNum asin_up(FloatNum x)
Return upper bound of arcsine of x (domain: )
Which variable to select for branching.
Definition: float.hh:1669
Select values randomly which are not greater or not smaller than mean of largest and smallest value...
Definition: float.hh:1827
Less ( )
Definition: float.hh:1073
Select
Which variable selection.
Definition: float.hh:1672
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:1684
FloatValBranch FLOAT_VAL(FloatBranchVal v, FloatBranchCommit c)
Definition: val.hpp:74
Trace init events.
Definition: recorder.hpp:47
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:251
Float variable array.
Definition: float.hh:1031
Computation spaces.
Definition: core.hpp:1668
ExecStatus prune(Space &home, ViewArray< VX > &x, ConstIntView)
Definition: rel.hpp:268
FloatVarBranch FLOAT_VAR_NONE(void)
Select first unassigned variable.
Definition: var.hpp:101
FloatVarBranch FLOAT_VAR_DEGREE_MIN(BranchTbl tbl)
Select variable with smallest degree.
Definition: var.hpp:121
FloatVarBranch FLOAT_VAR_MERIT_MIN(FloatBranchMerit bm, BranchTbl tbl)
Select variable with least merit according to branch merit function bm.
Definition: var.hpp:106
Select s
Which value to select.
Definition: float.hh:1886
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
With smallest action divided by domain size.
Definition: float.hh:1695
Gecode::IntSet d(v, 7)
FloatValImpType x
Implementation of float value.
Definition: float.hh:429
std::string expand(Gecode::IntRelType irt)
Expand relation to abbreviation.
Definition: mm-count.cpp:48
With lowest CHB Q-score.
Definition: float.hh:1683
FloatNum pi_twice_lower(void)
Return lower bound of .
Definition: num.hpp:57
Gecode::FloatVal c(-8, 8)
Trace prune events.
Definition: recorder.hpp:48
Greater or equal ( )
Definition: float.hh:1074
FloatVarBranch FLOAT_VAR_SIZE_MAX(BranchTbl tbl)
Select variable with largest domain size.
Definition: var.hpp:216
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:236
Standard float variable tracer.
Definition: float.hh:2060
bool proper_subset(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:498
FloatVarBranch FLOAT_VAR_DEGREE_SIZE_MIN(BranchTbl tbl)
Select variable with smallest degree divided by domain size.
Definition: var.hpp:221
Gecode::IntArgs i(4, 1, 2, 3, 4)
Base-class for branchers.
Definition: core.hpp:1368
FloatNum n
The middle value for branching.
Definition: float.hh:1466
Class for AFC (accumulated failure count) management.
Definition: afc.hpp:44
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: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:715
FloatVarArgs(const VarArray< FloatVar > &a)
Initialize from variable array a (copy elements)
Definition: float.hh:992
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
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:1463
FloatVal operator+(const FloatVal &x)
Definition: val.hpp:168
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:99
FloatRelType
Relation types for floats.
Definition: float.hh:1069
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:2018
FloatNum cos_down(FloatNum x)
Return lower bound of cosine of x (domain: )
Output stream to use std::ostream & os
Definition: float.hh:2063
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:106
std::function< double(const Space &home, double w, double b)> BranchTbl
Tie-break limit function.
Definition: var.hpp:52
void wait(Home home, FloatVar x, std::function< void(Space &home)> c)
Execute c when x becomes assigned.
Definition: exec.cpp:43
Class for CHB management.
Definition: chb.hpp:50
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:1468
FloatVal cosh(const FloatVal &x)
Definition: val.hpp:468
Trace filters.
Definition: filter.hpp:137
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
union Gecode::@585::NNF::@62 u
Union depending on nodetype t.
const int * pi[]
Definition: photo.cpp:14266
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:1497
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
Definition: set.hh:769
FloatVarBranch FLOAT_VAR_AFC_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count with decay factor d.
Definition: var.hpp:131
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:1694
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:116
ViewTracer< Float::FloatView > FloatTracer
Tracer for float variables.
Definition: float.hh:2049
With smallest CHB Q-score divided by domain size.
Definition: float.hh:1697
Select values not greater than mean of smallest and largest value.
Definition: float.hh:1825
FloatVarArgs(InputIterator first, InputIterator last)
Initialize from InputIterator first and last.
Definition: float.hh:997
Floating point rounding policy.
Definition: float.hh:158
Random (uniform, for tie breaking)
Definition: float.hh:1674
FloatNum tan_up(FloatNum x)
Return upper bound of tangent of x (domain: )
Equality ( )
Definition: float.hh:1070
Recording CHB for float variables.
Definition: float.hh:1608
FloatNum atan_up(FloatNum x)
Return upper bound of arctangent of x (domain: )
Float view for float variables.
Definition: view.hpp:56
FloatVarBranch FLOAT_VAR_SIZE_MIN(BranchTbl tbl)
Select variable with smallest domain size.
Definition: var.hpp:211
Greater ( )
Definition: float.hh:1075
Boolean integer variables.
Definition: int.hh:492
FloatVarBranch FLOAT_VAR_MIN_MAX(BranchTbl tbl)
Select variable with largest min.
Definition: var.hpp:196
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition: set.hh:769
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
Propagator for recording view trace information.
Definition: recorder.hpp:63
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:71
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:2015
FloatNum acosh_up(FloatNum x)
Return upper bound of hyperbolic arccosine of x (domain: )
Post propagator for SetVar SetOpType SetVar y
Definition: set.hh:769
Value branching information.
Definition: val.hpp:45
Trace done events.
Definition: recorder.hpp:51
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:131
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:128
Float value type.
Definition: float.hh:338
FloatVal operator*(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:204
Variable branching information.
Definition: var.hpp:59
FloatNum atan_down(FloatNum x)
Return lower bound of arctangent of x (domain: )
Rounding(void)
Default constructor (configures full rounding mode)
Definition: rounding.hpp:41
Generic domain change information to be supplied to advisors.
Definition: core.hpp:205
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:149
Select median value of the upper part.
Definition: float.hh:1880
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:1679
Select
Which value selection.
Definition: float.hh:1878
Select s
Which variable to select.
Definition: float.hh:1702
bool operator>=(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:281
FloatVal acosh(const FloatVal &x)
Definition: val.hpp:480
FloatVarBranch FLOAT_VAR_AFC_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count with decay factor d.
Definition: var.hpp:141
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: )
std::function< bool(const Space &home, FloatVar x, int i)> FloatBranchFilter
Branch filter function type for float variables.
Definition: float.hh:1443
With largest degree divided by domain size.
Definition: float.hh:1692
FloatVarBranch FLOAT_VAR_ACTION_MIN(double d, BranchTbl tbl)
Select variable with lowest action with decay factor d.
Definition: var.hpp:151
FloatVal atanh(const FloatVal &x)
Definition: val.hpp:484
FloatVal asinh(const FloatVal &x)
Definition: val.hpp:476
FloatVarBranch FLOAT_VAR_CHB_MIN(BranchTbl tbl)
Select variable with lowest CHB Q-score.
Definition: var.hpp:171
Which values to select for assignment.
Definition: float.hh:1875
boost::numeric::interval< FloatNum, boost::numeric::interval_lib::policies< R, P > > FloatValImpType
Implementation type for float value.
Definition: float.hh:427
Delta information const Delta & d
Definition: float.hh:2020
Trace fail events.
Definition: recorder.hpp:50
Post propagator for SetVar x
Definition: set.hh:769
FloatNum cosh_up(FloatNum x)
Return upper bound of hyperbolic cosine of x (domain: )
Trace fixpoint events.
Definition: recorder.hpp:49
FloatNum exp_down(FloatNum x)
Return lower bound of exponential of x (domain: )
FloatAssign FLOAT_ASSIGN(FloatBranchVal v, FloatBranchCommit c)
Definition: assign.hpp:74
void trace(Home home, const FloatVarArgs &x, TraceFilter tf, int te, FloatTracer &t)
Create a tracer for float variables.
Definition: trace.cpp:43
Select median value of the lower part.
Definition: float.hh:1879
Float variables.
Definition: float.hh:874
bool operator>(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:264
FloatVarBranch FLOAT_VAR_MIN_MIN(BranchTbl tbl)
Select variable with smallest min.
Definition: var.hpp:191
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:1658
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
With largest action divided by domain size.
Definition: float.hh:1696
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 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:46
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:261
Random number generator.
Definition: rnd.hpp:46
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:241
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:49
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:115
FloatVarBranch FLOAT_VAR_MAX_MAX(BranchTbl tbl)
Select variable with largest max.
Definition: var.hpp:206
FloatVal tanh(const FloatVal &x)
Definition: val.hpp:472
Home class for posting propagators
Definition: core.hpp:846
FloatVarBranch FLOAT_VAR_MERIT_MAX(FloatBranchMerit bm, BranchTbl tbl)
Select variable with highest merit according to branch merit function bm.
Definition: var.hpp:111
double tbl(const Gecode::Space &, double w, double b)
Test function for tie-break limit function.
Definition: branch.cpp:65
FloatVarBranch FLOAT_VAR_ACTION_MAX(double d, BranchTbl tbl)
Select variable with highest action with decay factor d.
Definition: var.hpp:161
double FloatNum
Floating point number base type.
Definition: float.hh:110
FloatVarBranch FLOAT_VAR_MAX_MIN(BranchTbl tbl)
Select variable with smallest max.
Definition: var.hpp:201
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:226
~Rounding(void)
Destructor (restores previous rounding mode)
Definition: rounding.hpp:45
std::function< FloatNumBranch(const Space &home, FloatVar x, int i)> FloatBranchVal
Branch value function type for float variables.
Definition: float.hh:1482
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
Definition: bool.cpp:43
FloatNum median(FloatNum x, FloatNum y)
Return median of x and y (domain: )
Definition: rounding.hpp:48
std::function< double(const Space &home, FloatVar x, int i)> FloatBranchMerit
Branch merit function type for float variables.
Definition: float.hh:1456
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:1510
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
FloatVarBranch FLOAT_VAR_CHB_MAX(BranchTbl tbl)
Select variable with highest CHB Q-score.
Definition: var.hpp:181