Commit 58b74aff authored by chbauman's avatar chbauman
Browse files

Merge branch 'master' of gitlab.ethz.ch:stefanow/tmcmc

parents f84ca2fe 1b2a3918
......@@ -111,10 +111,10 @@ inline static numeric_t prior(const ThetaVector & theta){
/// Does the resampling
inline static void resample(const WeightVector & weights, CountVector & resample_count){
resample_count.setZero();
std::discrete_distribution<int> dist(weights.data(), weights.data() + weights.size());
#pragma omp parallel for
std::discrete_distribution<index_t> dist(weights.data(), weights.data() + weights.size());
#pragma omp parallel for schedule(static)
for(index_t i = 0; i < weights.size(); ++i){
numeric_t idx = dist(GEN);
index_t idx = dist(GEN);
#pragma omp atomic
resample_count(idx)++;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment