Skip to content

Instantly share code, notes, and snippets.

@dfilimon
Created March 29, 2013 11:07
Show Gist options
  • Save dfilimon/5270234 to your computer and use it in GitHub Desktop.
Save dfilimon/5270234 to your computer and use it in GitHub Desktop.
ConcurrentModificationException from Multinomial
// Re-weight everything according to the minimum distance to a seed.
for (int currSeedIndex : seedSelector) {
WeightedVector curr = datapoints.get(currSeedIndex);
double newWeight = nextSeed.getWeight() * distanceMeasure.distance(nextSeed, curr);
if (newWeight < seedSelector.getWeight(currSeedIndex)) {
seedSelector.set(currSeedIndex, newWeight);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment