Drake
RandomGenerator Class Reference

Defines Drake's canonical implementation of the UniformRandomBitGenerator C++ concept (as well as a few conventional extras beyond the concept, e.g., seeds). More...

#include <drake/common/random.h>

Public Types

using result_type = std::mt19937::result_type
 

Public Member Functions

 RandomGenerator ()=default
 
 RandomGenerator (result_type value)
 
result_type operator() ()
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 RandomGenerator (const RandomGenerator &)=default
 
RandomGeneratoroperator= (const RandomGenerator &)=default
 
 RandomGenerator (RandomGenerator &&)=default
 
RandomGeneratoroperator= (RandomGenerator &&)=default
 

Static Public Member Functions

static constexpr result_type min ()
 
static constexpr result_type max ()
 

Static Public Attributes

static constexpr result_type default_seed = std::mt19937::default_seed
 

Detailed Description

Defines Drake's canonical implementation of the UniformRandomBitGenerator C++ concept (as well as a few conventional extras beyond the concept, e.g., seeds).

This uses the 32-bit Mersenne Twister mt19937 by Matsumoto and Nishimura, 1998. For more information, see https://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine

Member Typedef Documentation

◆ result_type

using result_type = std::mt19937::result_type

Constructor & Destructor Documentation

◆ RandomGenerator() [1/4]

RandomGenerator ( const RandomGenerator )
default

◆ RandomGenerator() [2/4]

RandomGenerator ( RandomGenerator &&  )
default

◆ RandomGenerator() [3/4]

RandomGenerator ( )
default

◆ RandomGenerator() [4/4]

RandomGenerator ( result_type  value)
explicit

Member Function Documentation

◆ max()

static constexpr result_type max ( )
static

◆ min()

static constexpr result_type min ( )
static

◆ operator()()

result_type operator() ( )

◆ operator=() [1/2]

RandomGenerator& operator= ( const RandomGenerator )
default

◆ operator=() [2/2]

RandomGenerator& operator= ( RandomGenerator &&  )
default

Member Data Documentation

◆ default_seed

constexpr RandomGenerator::result_type default_seed = std::mt19937::default_seed
static

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