MT Core (C++)
Core library for replacing C++ standard in project usage
Loading...
Searching...
No Matches
random.hpp File Reference
#include <cmath>
#include <limits>
#include "mtcore/alloc.hpp"
#include "mtcore/colls/result.hpp"
#include "mtcore/core.hpp"
#include <cstdint>
Include dependency graph for random.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mtcore::PrngState
 Internal PRNG state. More...
 
struct  mtcore::PrngVTable
 V-Table for PRNG Designed for having a simple PRNG implementation. More...
 
struct  mtcore::Prng
 Represents a Pseudo Random Number Generator. More...
 

Namespaces

namespace  mtcore
 Core library for C++ with Zig-related functionality.
 

Typedefs

using mtcore::SeedError = int
 Seeding errors can vary differently, using an int to indicate the error code.
 

Enumerations

enum class  mtcore::Mt19937_64Error { mtcore::Mt19937_64Error::ALLOCATION_FAILED , mtcore::Mt19937_64Error::MT19937_BAD_INIT }
 Errors that can happen when making a Mersenne Twister. More...
 

Functions

Prng mtcore::tinymt_init (uint64_t seed) noexcept
 Initializes a PRNG based on the TinyMT variant of Mersenne Twister.
 
Prng mtcore::lcg_init (uint64_t seed) noexcept
 Initializes a Linear Congruential Generator NOTE: THIS IS NOT A GOOD PRNG (it's essentially rand())
 
Result< Prng, Mt19937_64Errormtcore::mt19937_64 (Allocator *alloc, uint64_t seed) noexcept
 Initializes a Mersenne Twister 19937-64 algorithm Note: This does require allocated memory.