diff --git a/ql/math/randomnumbers/burley2020sobolrsg.cpp b/ql/math/randomnumbers/burley2020sobolrsg.cpp index f395a788d3e..ec441ee21b7 100644 --- a/ql/math/randomnumbers/burley2020sobolrsg.cpp +++ b/ql/math/randomnumbers/burley2020sobolrsg.cpp @@ -19,6 +19,7 @@ #include #include +#include namespace QuantLib { @@ -136,7 +137,8 @@ namespace QuantLib { nested_uniform_scramble(integerSequence_[i], static_cast(seed)); } } while (i < dimensionality_); - ++nextSequenceCounter_; + QL_REQUIRE(++nextSequenceCounter_ != 0, + "Burley2020SobolRsg::nextIn32Sequence(): period exceeded"); return integerSequence_; }