Skip to content

Commit

Permalink
fix set iterators
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoPannetier committed Feb 13, 2024
1 parent ce60603 commit d6aba0d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,14 +413,17 @@ set<int> convertStringToPatches(const string& str, const int& nb_rnd_patches, co
std::sample(
existingPatches.begin(),
existingPatches.end(),
patches.begin(),
nb_rnd_patches,
std::inserter(patches, patches.end()),
nb_rnd_patches,
pRandom->getRNG()
);
}
} else if (str == "all") {
// Copy all patches into sampled patches
for (int pch : existingPatches) patches.insert(pch);
std::copy(existingPatches.begin(),
existingPatches.end(),
std::inserter(patches, patches.end())
);
} else {
// comma-separated list of patches
stringstream ss(str);
Expand Down

0 comments on commit d6aba0d

Please sign in to comment.