reference

This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.

of::random::Engine Class Reference

#include <ofRandomEngine.h>

Inheritance diagram for of::random::Engine:
of::utils::Singleton< Engine >

Public Member Functions

 Engine ()
 
auto & gen ()
 
void seed (unsigned long new_seed)
 passes a value to seed the mt19937 generator
 
auto is_deterministic () const
 

Additional Inherited Members

- Static Public Member Functions inherited from of::utils::Singleton< Engine >
static void construct (Args &&... args)
 
static Engine * instance ()
 
static void destruct ()
 
- Protected Member Functions inherited from of::utils::Singleton< Engine >
 Singleton ()=default
 
 Singleton (const Singleton &)=delete
 
 Singleton (Singleton &&) noexcept=delete
 
Singletonoperator= (const Singleton &)=delete
 
Singletonoperator= (Singleton &&) noexcept=delete
 
virtual ~Singleton ()=default
 

Detailed Description

An mt19937 instance wrapped in a singleton, with default non-deterministic seeding A balance is aimed between ease-of-use, and versatility, and minimize reliance on advanced concepts (e.g. the lib is templated, but default usage does not require template parameters) The goal is to have a centralized, thread-safe source of randomness that can be deterministic or not.

Constructor & Destructor Documentation

◆ Engine()

of::random::Engine::Engine ( )
inline

Member Function Documentation

◆ gen()

auto & of::random::Engine::gen ( )
inline

return the generator for use in random distributions or functions

Returns
a reference to the mt19937 generator

◆ is_deterministic()

auto of::random::Engine::is_deterministic ( ) const
inline
Returns
true or fall depending if the engine is deterministic

◆ seed()

void of::random::Engine::seed ( unsigned long  new_seed)
inline

passes a value to seed the mt19937 generator


The documentation for this class was generated from the following file: