| 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 { |
nothing calls this directly
no test coverage detected