var-imp.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 #include <cmath>
00046
00047 namespace Gecode { namespace Float {
00048
00049 class FloatVarImp;
00050
00052 class FloatDelta : public Delta {
00053 friend class FloatVarImp;
00054 private:
00055 FloatNum _min;
00056 FloatNum _max;
00057 public:
00059 FloatDelta(void);
00061 FloatDelta(FloatNum min, FloatNum max);
00062 private:
00064 FloatNum min(void) const;
00066 FloatNum max(void) const;
00067 };
00068
00069 }}
00070
00071 #include <gecode/float/var-imp/delta.hpp>
00072
00073 namespace Gecode { namespace Float {
00074
00080 class FloatVarImp : public FloatVarImpBase {
00081 protected:
00083 FloatVal dom;
00085 FloatVarImp(Space& home, bool share, FloatVarImp& x);
00086 public:
00088 FloatVarImp(Space& home, const FloatVal& d);
00089
00091
00092
00093 FloatVal domain(void) const;
00095 FloatNum min(void) const;
00097 FloatNum max(void) const;
00099 FloatVal val(void) const;
00101 FloatNum med(void) const;
00102
00104 FloatNum size(void) const;
00106
00108
00109
00110 bool assigned(void) const;
00111
00113 bool zero_in(void) const;
00115 bool in(FloatNum n) const;
00117 bool in(const FloatVal& n) const;
00119
00121
00122
00123 ModEvent eq(Space& home, FloatNum n);
00125 ModEvent eq(Space& home, const FloatVal& n);
00127 ModEvent lq(Space& home, FloatNum n);
00129 ModEvent lq(Space& home, const FloatVal& n);
00131 ModEvent gq(Space& home, FloatNum n);
00133 ModEvent gq(Space& home, const FloatVal& n);
00135
00137
00138
00146 GECODE_FLOAT_EXPORT void subscribe(Space& home, Propagator& p, PropCond pc, bool schedule=true);
00148 GECODE_FLOAT_EXPORT void reschedule(Space& home, Propagator& p, PropCond pc);
00157 GECODE_FLOAT_EXPORT void subscribe(Space& home, Advisor& a, bool fail);
00159
00161
00162
00163 static ModEventDelta med(ModEvent me);
00165
00166
00167 private:
00169 GECODE_FLOAT_EXPORT FloatVarImp* perform_copy(Space& home, bool share);
00170 public:
00172
00173
00174 FloatVarImp* copy(Space& home, bool share);
00176
00178
00179
00180 static FloatNum min(const Delta& d);
00182 static FloatNum max(const Delta& d);
00184 };
00185
00186 }}
00187
00188 #include <gecode/float/var-imp/float.hpp>
00189
00190
00191