C++ Mathematical Expression Toolkit (ExprTk) release
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
rnd_01< T > Struct Template Referencefinal
Inheritance diagram for rnd_01< T >:
[legend]
Collaboration diagram for rnd_01< T >:
[legend]

Public Member Functions

 rnd_01 ()
 
operator() () override
 
 rnd_01 ()
 
operator() ()
 
 rnd_01 ()
 
operator() ()
 
 rnd_01 ()
 
operator() ()
 
 rnd_01 ()
 
operator() ()
 
 rnd_01 ()
 
operator() ()
 
 rnd_01 ()
 
operator() ()
 
- Public Member Functions inherited from exprtk::ifunction< T >
 ifunction (const std::size_t &pc)
 
virtual ~ifunction ()
 
virtual T operator() (const T &)
 
virtual T operator() (const T &, const T &)
 
virtual T operator() (const T &, const T &, const T &)
 
virtual T operator() (const T &, const T &, const T &, const T &)
 
virtual T operator() (const T &, const T &, const T &, const T &, const T &)
 
virtual T operator() (const T &, const T &, const T &, const T &, const T &, const T &)
 
virtual T operator() (const T &, const T &, const T &, const T &, const T &, const T &, const T &)
 
virtual T operator() (const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &)
 
virtual T operator() (const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &)
 
virtual T operator() (const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &)
 
virtual T operator() (const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &)
 
virtual T operator() (const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &)
 
virtual T operator() (const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &)
 
virtual T operator() (const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &)
 
virtual T operator() (const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &)
 
virtual T operator() (const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &)
 
virtual T operator() (const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &)
 
virtual T operator() (const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &)
 
virtual T operator() (const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &)
 
virtual T operator() (const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &)
 
- Public Member Functions inherited from exprtk::function_traits
 function_traits ()
 
bool & allow_zero_parameters ()
 
bool & has_side_effects ()
 
std::size_t & min_num_args ()
 
std::size_t & max_num_args ()
 

Public Attributes

std::mt19937 generator
 
std::uniform_real_distribution< T > distribution {T(0),T(1)}
 
- Public Attributes inherited from exprtk::ifunction< T >
std::size_t param_count
 

Detailed Description

template<typename T>
struct rnd_01< T >

Definition at line 32 of file exprtk_game_of_life.cpp.

Constructor & Destructor Documentation

◆ rnd_01() [1/7]

template<typename T >
rnd_01< T >::rnd_01 ( )
inline

Definition at line 36 of file exprtk_game_of_life.cpp.

38 {
39 std::random_device device;
40 std::array<unsigned int,std::mt19937::state_size> seed;
41 std::generate_n(seed.data(), seed.size(), std::ref(device));
42 std::seed_seq seq(std::begin(seed), std::end(seed));
43 generator.seed(seq);
44 }
std::mt19937 generator

References rnd_01< T >::generator.

◆ rnd_01() [2/7]

template<typename T >
rnd_01< T >::rnd_01 ( )
inline

Definition at line 33 of file exprtk_montecarlo_e.cpp.

34 { ::srand(static_cast<unsigned int>(time(NULL))); }

◆ rnd_01() [3/7]

template<typename T >
rnd_01< T >::rnd_01 ( )
inline

Definition at line 33 of file exprtk_montecarlo_pi.cpp.

34 { ::srand(static_cast<unsigned int>(time(NULL))); }

◆ rnd_01() [4/7]

template<typename T >
rnd_01< T >::rnd_01 ( )
inline

Definition at line 66 of file exprtk_mpfr_repl.cpp.

67 { ::srand(static_cast<unsigned int>(time(NULL))); }

◆ rnd_01() [5/7]

template<typename T >
rnd_01< T >::rnd_01 ( )
inline

Definition at line 64 of file exprtk_repl.cpp.

65 { ::srand(static_cast<unsigned int>(time(NULL))); }

◆ rnd_01() [6/7]

template<typename T >
rnd_01< T >::rnd_01 ( )
inline

Definition at line 33 of file exprtk_simple_example_17.cpp.

34 { ::srand(static_cast<unsigned int>(time(NULL))); }

◆ rnd_01() [7/7]

template<typename T >
rnd_01< T >::rnd_01 ( )
inline

Definition at line 33 of file exprtk_wiener_process_pi.cpp.

34 { ::srand(static_cast<unsigned int>(time(NULL))); }

Member Function Documentation

◆ operator()() [1/7]

template<typename T >
T rnd_01< T >::operator() ( )
inlinevirtual

Reimplemented from exprtk::ifunction< T >.

Definition at line 36 of file exprtk_montecarlo_e.cpp.

37 {
38 // Note: Do not use this in production
39 // Result is in the interval [0,1)
40 return T(::rand() / T(RAND_MAX + 1.0));
41 }

◆ operator()() [2/7]

template<typename T >
T rnd_01< T >::operator() ( )
inlinevirtual

Reimplemented from exprtk::ifunction< T >.

Definition at line 36 of file exprtk_montecarlo_pi.cpp.

37 {
38 // Note: Do not use this in production
39 // Result is in the interval [0,1)
40 return T(::rand() / T(RAND_MAX + 1.0));
41 }

◆ operator()() [3/7]

template<typename T >
T rnd_01< T >::operator() ( )
inlinevirtual

Reimplemented from exprtk::ifunction< T >.

Definition at line 69 of file exprtk_mpfr_repl.cpp.

70 {
71 // Note: Do not use this in production
72 // Result is in the interval [0,1)
73 return T(::rand() / T(RAND_MAX + 1.0));
74 }

◆ operator()() [4/7]

template<typename T >
T rnd_01< T >::operator() ( )
inlinevirtual

Reimplemented from exprtk::ifunction< T >.

Definition at line 67 of file exprtk_repl.cpp.

68 {
69 // Note: Do not use this in production
70 // Result is in the interval [0,1)
71 return T(::rand() / T(RAND_MAX + 1.0));
72 }

◆ operator()() [5/7]

template<typename T >
T rnd_01< T >::operator() ( )
inlinevirtual

Reimplemented from exprtk::ifunction< T >.

Definition at line 36 of file exprtk_simple_example_17.cpp.

37 {
38 // Note: Do not use this in production
39 // Result is in the interval [0,1)
40 return T(::rand() / T(RAND_MAX + 1.0));
41 }

◆ operator()() [6/7]

template<typename T >
T rnd_01< T >::operator() ( )
inlinevirtual

Reimplemented from exprtk::ifunction< T >.

Definition at line 36 of file exprtk_wiener_process_pi.cpp.

37 {
38 // Note: Do not use this in production
39 // Result is in the interval [0,1)
40 return T(::rand() / T(RAND_MAX + 1.0));
41 }

◆ operator()() [7/7]

template<typename T >
T rnd_01< T >::operator() ( )
inlineoverridevirtual

Reimplemented from exprtk::ifunction< T >.

Definition at line 46 of file exprtk_game_of_life.cpp.

47 {
48 return distribution(generator);
49 }
std::uniform_real_distribution< T > distribution

References rnd_01< T >::distribution, and rnd_01< T >::generator.

Member Data Documentation

◆ distribution

template<typename T >
std::uniform_real_distribution<T> rnd_01< T >::distribution {T(0),T(1)}

Definition at line 52 of file exprtk_game_of_life.cpp.

52{T(0),T(1)};

Referenced by rnd_01< T >::operator()().

◆ generator

template<typename T >
std::mt19937 rnd_01< T >::generator

Definition at line 51 of file exprtk_game_of_life.cpp.

Referenced by rnd_01< T >::operator()(), and rnd_01< T >::rnd_01().


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