Xoroshiro128+¶
Scalar¶
namespace pxart {
struct xoroshiro128plus;
using xrsr128p = xoroshiro128plus;
}
Include Scheme¶
#include <pxart/xoroshiro128plus.hpp>
Member Types¶
using uint_type = uint64_t;
using result_type = uint_type;
Member Functions¶
Construction and Seeding¶
xoroshiro128plus();
xoroshiro128plus(uint_type x, uint_type y);
template <typename RNG>
constexpr explicit xoroshiro128plus(RNG&& rng);
Generation¶
constexpr auto operator()() noexcept;
constexpr void jump() noexcept;
constexpr void long_jump() noexcept;
Characteristics¶
static constexpr auto min() noexcept;
static constexpr auto max() noexcept;
Example¶
#include <iomanip>
#include <iostream>
#include <random>
//
#include <pxart/uniform.hpp>
#include <pxart/xoroshiro128plus.hpp>
using namespace std;
int main() {
// Properly initialize pxart PRNG.
pxart::xrsr128p rng{std::random_device{}};
// Print some uniformly distributed random numbers.
for (size_t i = 0; i < 10; ++i)
cout << setw(20) << pxart::uniform<float>(rng) << '\n';
}
Last update: January 18, 2021