support-values.hh
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 #ifndef __GECODE_INT_SUPPORT_VALUES_HH__
00039 #define __GECODE_INT_SUPPORT_VALUES_HH__
00040
00041 #include <gecode/int.hh>
00042
00043 namespace Gecode { namespace Int {
00044
00051 template<class View, class A>
00052 class SupportValues {
00053 private:
00055 A& a;
00057 static const unsigned int bpui = sizeof(unsigned int) * 8;
00059 class RangePos {
00060 public:
00061 int min;
00062 unsigned int pos;
00063 };
00065 class Unsupported {
00066 private:
00068 RangePos* rp;
00070 unsigned int p;
00072 SupportValues& sv;
00074 void find(void);
00075 public:
00077
00078
00079 Unsupported(SupportValues& sv0);
00081
00083
00084
00085 bool operator ()(void) const;
00087 void operator ++(void);
00089
00091
00092
00093 int val(void) const;
00095 };
00096
00098 View x;
00100 unsigned int sz;
00102 unsigned int* bits;
00104 RangePos* rp_fst;
00106 RangePos* rp_lst;
00108 RangePos* rp;
00110 int v;
00112 int max;
00113
00115 void set(unsigned int i);
00117 bool bit(unsigned int i) const;
00119 bool _support(int n);
00120 public:
00122 SupportValues(A& a, View x);
00124 ~SupportValues(void);
00125
00127
00128
00129 void reset(void);
00131 bool operator ()(void) const;
00133 void operator ++(void);
00135
00137
00138
00139 int val(void) const;
00141
00143
00144
00145 void support(void);
00147 bool support(int n);
00149 bool support(double n);
00151 ModEvent tell(Space& home);
00153 };
00154
00155 }}
00156
00157 #include <gecode/int/support-values.hpp>
00158
00159 #endif
00160
00161
00162