Skip to content

Commit

Permalink
Merge pull request #81 from kjetil-lye/master
Browse files Browse the repository at this point in the history
Fixes to generating samples over multiple processes
  • Loading branch information
Kjetil Olsen Lye committed Dec 16, 2020
2 parents e2007f4 + 345f0d6 commit 711ed90
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions alsuq/src/generator/STLMersenne.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ real STLMersenne::generate(size_t component, size_t sample) {
}


if (generator.second / long(dimension) < long(sample) - 1) {
if (generator.second / long(dimension) < long(sample)) {


const auto samplesToBeAdded = (long(sample) - 1) * dimension -
const auto samplesToBeAdded = (long(sample)) * dimension -
generator.second;

ALSVINN_LOG(INFO, "(not matching sample) Discarding " << samplesToBeAdded <<
Expand All @@ -62,8 +62,8 @@ real STLMersenne::generate(size_t component, size_t sample) {
generator.second += samplesToBeAdded;
}

if (generator.second % long(dimension) < long(component) - 1) {
const auto samplesToBeAdded = long(component) - 1 - long(generator.second %
if (generator.second % long(dimension) < long(component)) {
const auto samplesToBeAdded = long(component) - long(generator.second %
dimension);
ALSVINN_LOG(INFO, "(not matching component) Discarding " << samplesToBeAdded <<
" samples"
Expand Down

0 comments on commit 711ed90

Please sign in to comment.