Random_MSWS.hpp
A versatile and non-patterned pseudo-random-number generator. Status: RELEASE.
This file is part of Empirical, https://github.com/devosoft/Empirical Copyright (C) 2025 Michigan State University MIT Software license; see doc/LICENSE.md
Defines
-
INCLUDE_EMP_MATH_RANDOM_MSWS_HPP_GUARD
-
struct Random_MSWS
- #include <Random_MSWS.hpp>
Middle Square Weyl Sequence: A solid 32-bit pseudo-random-number engine generator. https://arxiv.org/abs/1704.00358 Based on: https://en.wikipedia.org/wiki/Middle-square_method
Public Functions
-
inline uint32_t Get() noexcept
Return a 32-bit Random number.
-
inline uint64_t Get64() noexcept
Return a 64-bit Random number.
-
inline void ResetSeed(const uint64_t seed) noexcept
Starts a new sequence of pseudo random numbers. Seed is guaranteed > 0.
-
inline uint32_t Get() noexcept