42 #ifndef __OPENFLUID_TOOLS_RANDOMNUMBERGENERATOR_HPP__
43 #define __OPENFLUID_TOOLS_RANDOMNUMBERGENERATOR_HPP__
51 #include <openfluid/ware/TypeDefs.hpp>
92 void init(
long int CustomSeed = -1);
109 template <
typename T>
110 std::vector<T>
rlnorm(
size_t N,
double Mean,
double Sd)
112 T Maxlnorm = std::exp(Mean - Sd * Sd);
113 std::vector<T> vec(N, Maxlnorm);
114 std::lognormal_distribution<T> Distribution(Mean, Sd);
118 v = Distribution(getGenerator());
138 template <
typename T>
139 std::vector<T>
rnorm(
size_t N,
double Mean,
double Sd)
141 std::vector<T> vec(N, Mean + Sd);
142 std::normal_distribution<T> Distribution(Mean, Sd);
145 v = Distribution(getGenerator());
165 template <
typename T>
166 std::vector<T>
runif(
size_t N, T V1, T V2)
168 std::vector<T> vec(N, 0.5 * V1 + 0.5 * V2);
171 std::uniform_real_distribution<T> Distribution(V1, V2);
174 v = Distribution(getGenerator());
199 template <
typename T>
200 std::vector<T>
irunif(
size_t N, T V1, T V2)
202 std::vector<T> vec(N, 0.5 * V1 + 0.5 * V2);
205 std::uniform_int_distribution<T> Distribution(V1, V2);
208 v = Distribution(getGenerator());
232 template <
typename T>
235 std::lognormal_distribution<T> Distribution(Mean, Sd);
236 return Distribution(getGenerator());
252 template <
typename T>
255 std::normal_distribution<T> Distribution(Mean, Sd);
256 return Distribution(getGenerator());
272 template <
typename T>
277 std::uniform_real_distribution<T> Distribution(V1, V2);
278 return Distribution(getGenerator());
299 template <
typename T>
304 std::uniform_int_distribution<T> Distribution(V1, V2);
305 return Distribution(getGenerator());
326 std::bernoulli_distribution Distribution(Probability);
327 return Distribution(getGenerator());
Definition: FrameworkException.hpp:51
#define OPENFLUID_API
Definition: dllexport.hpp:86
Definition: ApplicationException.hpp:47