MCPcopy Create free account
hub / github.com/Gecode/gecode / minVal

Function minVal

gecode/int/distinct/cbs.hpp:103–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101
102 template<class View>
103 forceinline
104 ValToUpdate::ValToUpdate(const ViewArray<View>& x,
105 int minDomVal, int maxDomVal, Region& r)
106 : minVal(minDomVal) {
107 unsigned int width = maxDomVal - minDomVal + 1;
108 mincUpdate = r.alloc<double>(width);
109 std::fill(mincUpdate, mincUpdate + width, 1);
110 liangUpdate = r.alloc<double>(width);
111 std::fill(liangUpdate, liangUpdate + width, 1);
112
113 for (int i=0; i<x.size(); i++) {
114 if (x[i].assigned()) continue;
115 size_t s = x[i].size();
116 for (ViewValues<View> val(x[i]); val(); ++val) {
117 int idx = val.val() - minVal;
118 mincUpdate[idx] *= getMincFactor(s-1) / getMincFactor(s);
119 liangUpdate[idx] *= getLiangBaiFactor(i, s-1) / getLiangBaiFactor(i, s);
120 }
121 }
122 }
123
124 forceinline double
125 ValToUpdate::getMincUpdate(int val, unsigned int varSize) const {

Callers

nothing calls this directly

Calls 5

getMincFactorFunction · 0.85
getLiangBaiFactorFunction · 0.85
sizeMethod · 0.45
assignedMethod · 0.45
valMethod · 0.45

Tested by

no test coverage detected