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 #ifndef _CSP_CACHES_WeightedDegrees_H
00031 #define _CSP_CACHES_WeightedDegrees_H
00032
00033
00034 CSP_NAMESPACE_BEGIN(csp);
00035 CSP_NAMESPACE_BEGIN(caches);
00036
00037
00045 class CSP_API WeightedDegrees
00046 {
00047 public:
00049 WeightedDegrees() {}
00050
00060 ulonglong weightedDegree(const Variable& variable);
00061
00068 void updateWeightedDegree(const Variable& variable);
00069
00071 void clear() { m_weightedDegrees.clear(); }
00072
00074 bool empty() { return m_weightedDegrees.empty(); }
00075
00076 private:
00078 WeightedDegrees(const WeightedDegrees&);
00079
00081 WeightedDegrees& operator=(const WeightedDegrees&);
00082
00084 typedef hash_map<const Variable*, ulonglong> vd_type;
00085
00087 vd_type m_weightedDegrees;
00088 };
00089
00090
00091 CSP_NAMESPACE_END(cache);
00092 CSP_NAMESPACE_END(csp);
00093
00094
00095 #endif // _CSP_CACHES_WeightedDegrees_H
00096
00097
00098
00099