ModelSpace
Documentation for ModelSpace models and classes.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
modelspace::UniformRandom< T > Class Template Reference

Class to generate random numbers according to uniform distribution. More...

#include <UniformRandom.hpp>

Inheritance diagram for modelspace::UniformRandom< T >:

Public Member Functions

 UniformRandom (T set_min, T set_max, unsigned int seed=0)
 Constructor for the normal random distribution. More...
 
 ~UniformRandom ()
 
operator() ()
 

Public Attributes

clockwerk::DataIO< T > min = clockwerk::DataIO<T>(this, "min")
 The min of the uniform distribution output. Can be get/set. More...
 
clockwerk::DataIO< T > max = clockwerk::DataIO<T>(this, "max")
 The max of the uniform distribution output. Can be get/set. More...
 
clockwerk::DataIO< int > seed = clockwerk::DataIO<int>(this, "seed")
 The seed of the uniform distribution output. Can be get/set. More...
 

Protected Attributes

std::mt19937 _engine
 
std::uniform_real_distribution< double > _distribution
 

Detailed Description

template<typename T>
class modelspace::UniformRandom< T >

Class to generate random numbers according to uniform distribution.

This function generates a random uniform distribution draw according to the mt19937 engine and a std::uniform_distribution. It produces random numbers according to the min, max, and seed set in the constructor. Min and max may be modified via standard setters mean and std.

If numbers are entered backwards, will flip them

Constructor & Destructor Documentation

◆ UniformRandom()

template<typename T >
modelspace::UniformRandom< T >::UniformRandom ( set_min,
set_max,
unsigned int  seed = 0 
)

Constructor for the normal random distribution.

Parameters
set_minThe minimum value in the distribution
set_maxThe maximum value in the distribution
seedSeed for the RNG – Defaults to zero

◆ ~UniformRandom()

template<typename T >
modelspace::UniformRandom< T >::~UniformRandom ( )
inline

Member Function Documentation

◆ operator()()

template<typename T >
T modelspace::UniformRandom< T >::operator()

Member Data Documentation

◆ _distribution

template<typename T >
std::uniform_real_distribution<double> modelspace::UniformRandom< T >::_distribution
protected

◆ _engine

template<typename T >
std::mt19937 modelspace::UniformRandom< T >::_engine
protected

◆ max

template<typename T >
clockwerk::DataIO<T> modelspace::UniformRandom< T >::max = clockwerk::DataIO<T>(this, "max")

The max of the uniform distribution output. Can be get/set.

◆ min

template<typename T >
clockwerk::DataIO<T> modelspace::UniformRandom< T >::min = clockwerk::DataIO<T>(this, "min")

The min of the uniform distribution output. Can be get/set.

◆ seed

template<typename T >
clockwerk::DataIO<int> modelspace::UniformRandom< T >::seed = clockwerk::DataIO<int>(this, "seed")

The seed of the uniform distribution output. Can be get/set.


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