Skip to content

Commit

Permalink
add check whether sequence length is exhausted
Browse files Browse the repository at this point in the history
  • Loading branch information
pcaspers committed Nov 12, 2023
1 parent 0f621e7 commit 265b60b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ql/math/randomnumbers/burley2020sobolrsg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <ql/math/randomnumbers/burley2020sobolrsg.hpp>
#include <ql/math/randomnumbers/mt19937uniformrng.hpp>
#include <ql/errors.hpp>

namespace QuantLib {

Expand Down Expand Up @@ -136,7 +137,8 @@ namespace QuantLib {
nested_uniform_scramble(integerSequence_[i], static_cast<std::uint32_t>(seed));
}
} while (i < dimensionality_);
++nextSequenceCounter_;
QL_REQUIRE(++nextSequenceCounter_ != 0,
"Burley2020SobolRsg::nextIn32Sequence(): period exceeded");
return integerSequence_;
}

Expand Down

0 comments on commit 265b60b

Please sign in to comment.