| 199 | } |
| 200 | |
| 201 | void |
| 202 | UniqueRandomSubset (Vector<int> &uSet, int setSize, int poolSize, |
| 203 | bool printSet) |
| 204 | { |
| 205 | if(setSize > poolSize) { |
| 206 | Abort("**** Error in UniqueRandomSubset: setSize > poolSize."); |
| 207 | } |
| 208 | std::set<int> copySet; |
| 209 | uSet.clear(); |
| 210 | while(std::ssize(copySet) < setSize) { |
| 211 | int r = static_cast<int>(Random_int(poolSize)); |
| 212 | if(!copySet.contains(r)) { |
| 213 | copySet.insert(r); |
| 214 | uSet.push_back(r); |
| 215 | } |
| 216 | } |
| 217 | if(printSet) { |
| 218 | for(int i(0); i < uSet.size(); ++i) { |
| 219 | AllPrint() << "uSet[" << i << "] = " << uSet[i] << '\n'; |
| 220 | } |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | void ResetRandomSeed (ULong cpu_seed, ULong gpu_seed) |
| 225 | { |