| 200 | } |
| 201 | |
| 202 | int |
| 203 | GroupProbElem::get_random_single_prob(int orig_val, std::vector<unsigned int> &invalid_vals) |
| 204 | { |
| 205 | // we won't change val if it's disallowed before |
| 206 | if (orig_val == 0) { |
| 207 | return orig_val; |
| 208 | } |
| 209 | if (is_equal_) { |
| 210 | bool p = rnd_flipcoin(50); |
| 211 | return (p ? 1 : 0); |
| 212 | } |
| 213 | else { |
| 214 | VectorFilter f(invalid_vals); |
| 215 | return rnd_upto(101, &f); |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | void |
| 220 | GroupProbElem::initialize(Probabilities *impl, const std::map<ProbName, int> pairs) |
nothing calls this directly
no test coverage detected