#39 #40 git add for last commit

This commit is contained in:
toni
2017-11-15 17:46:06 +01:00
parent c8063bc862
commit 95a5c8f34f
49 changed files with 4661 additions and 0 deletions

27
math/random/Normal.h Normal file
View File

@@ -0,0 +1,27 @@
#ifndef K_MATH_RND_NORMAL_H
#define K_MATH_RND_NORMAL_H
namespace Random {
/**
* provides some common functions
* for handling normal-distributed random numbers
*/
class Normal {
public:
/** get normal-distributed random number for given mu/sigma */
static double get(double mu, double sigma) {
static std::random_device rd;
static std::mt19937 gen(rd());
std::normal_distribution<> d(mu, sigma);
return d(gen);
}
};
}
#endif // K_MATH_RND_NORMAL_H