PCG32¶
Scalar¶
namespace pxart {
struct pcg32;
}
Include Scheme¶
#include <pxart/pcg32.hpp>
Member Types¶
using uint_type = uint64_t;
using result_type = uint32_t;
Member Functions¶
Construction and Seeding¶
constexpr pcg32();
template <typename RNG>
constexpr explicit pcg32(RNG&& rng);
Generation¶
constexpr result_type operator()() noexcept;
Example¶
#include <iomanip>
#include <iostream>
#include <random>
//
#include <pxart/pcg32.hpp>
#include <pxart/uniform.hpp>
using namespace std;
int main() {
// Properly initialize pxart PRNG.
pxart::pcg32 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