Helios Engine 0.1.0
A modular ECS based data-oriented C++23 game engine
 
Loading...
Searching...
No Matches
random.hpp File Reference
#include <helios/core_pch.hpp>
#include <helios/core/utils/common_traits.hpp>
#include <concepts>
#include <cstdint>
#include <functional>
#include <limits>
#include <random>
#include <type_traits>

Go to the source code of this file.

Classes

class  helios::RandomGenerator< Engine >
 Random number utilities with a user-provided engine. More...
 

Namespaces

namespace  helios
 

Concepts

concept  helios::RandomEngine
 Concept for random number engines compatible with std distributions.
 
concept  helios::Distribution
 Concept for standard-like distributions.
 

Typedefs

using helios::DefaultRandomEngine = std::mt19937_64
 Default engine type used by random utilities.
 
using helios::FastRandomEngine = std::minstd_rand
 Fast but lower-quality engine type used by random utilities.
 
using helios::DefaultRandomGenerator = RandomGenerator< DefaultRandomEngine >
 Convenience alias for a generator using the default-quality engine.
 
using helios::FastRandomGeneratorType = RandomGenerator< FastRandomEngine >
 Convenience alias for a generator using the fast engine.
 

Functions

uint64_t helios::RandomDeviceSeed ()
 Internal helper to obtain seed from std::random_device.
 
DefaultRandomEngine helios::MakeDefaultEngine ()
 Creates a default-quality random engine seeded with std::random_device.
 
FastRandomEngine helios::MakeFastEngine ()
 Creates a fast linear random engine seeded with std::random_device.
 
DefaultRandomEnginehelios::DefaultEngine ()
 Thread-local default-quality engine.
 
FastRandomEnginehelios::FastEngineInstance ()
 Thread-local fast engine.
 
DefaultRandomGeneratorhelios::RandomDefault ()
 Provides access to a thread-local default-quality random generator.
 
FastRandomGeneratorTypehelios::RandomFast ()
 Provides access to a thread-local fast random generator.
 
template<utils::ArithmeticTrait T>
helios::RandomValue ()
 Convenience function to generate a default-distribution value using the default engine.
 
template<utils::ArithmeticTrait T, utils::ArithmeticTrait U>
auto helios::RandomValueFromRange (T min, U max) -> std::common_type_t< T, U >
 Convenience function to generate a value in range using the default engine.
 
template<utils::ArithmeticTrait T>
helios::RandomFastValue ()
 Convenience function to generate a default-distribution value using the fast engine.
 
template<utils::ArithmeticTrait T, utils::ArithmeticTrait U>
auto helios::RandomFastValueFromRange (T min, U max) -> std::common_type_t< T, U >
 Convenience function to generate a value in range using the fast engine.