ModelSpace
All Classes Namespaces Functions Variables Enumerations 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 >:
Collaboration 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.
 
operator() ()
 

Public Attributes

clockwerk::DataIO< T > min = clockwerk::DataIO<T>(this, "min")
 The mean of the random output. Can be get/set.
 
clockwerk::DataIO< T > max = clockwerk::DataIO<T>(this, "max")
 The standard deviation of the random output. Can be get/set.
 

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

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