24 static long int random() {
28 static void srandom(
unsigned int seed) {
46 mgx_EXPORT
void sran(
unsigned int seed);
51 mgx_EXPORT
double ran(
double M);
55 mgx_EXPORT
long double ran(
long double M);
59 mgx_EXPORT
float ran(
float M);
64 template <
typename T>
double ran(T M) {
65 return ran(
double(M));
74 for(
size_t i = 0; i < dim; ++i)
75 result[i] =
ran(V[i]);
85 mgx_EXPORT
double gaussRan(
double mean,
double sigma);
98 for(
size_t i = 0; i < dim; ++i)
99 result[i] = gaussRan(mean[i], sigma[i]);
106 mgx_EXPORT
long int ranInt();
111 template <
typename T> T ranInt()
113 long int i = ranInt();
123 for(
size_t i = 0; i < dim; ++i)
124 result[i] = ranInt<T>();
132 return ranInt<dim, long int>();
138 mgx_EXPORT
long int ranInt(
long int n);
147 for(
size_t i = 0; i < dim; ++i)
148 result[i] = ranInt<T>(n[i]);
mgx_EXPORT double ran(double M)
Generate a random number uniformely distributed between 0 and M.
mgx_EXPORT void sran(unsigned int seed)
Initialize the random number generator.
mgx_EXPORT unsigned int sran_time()
Initialize the random number with the current time of the day (in microsecond)
mgx_EXPORT long int ranInt()
Returns a random number between 0 and RAND_MAX.
Definition: Random.hpp:111
This namespace contains all the API of MorphoGraphX.
Definition: Assert.hpp:26
Namespace containing all the utility classes.
Definition: Vector.hpp:47
mgx_EXPORT double gaussRan(double mean, double sigma)
Generate a random number with gaussian distribution.
Defines the Vector class template This file is shared by cuda, do not include headers that nvcc can't...