6 #ifndef OPENANN_UTIL_RANDOM_H_
7 #define OPENANN_UTIL_RANDOM_H_
65 return (
T) rand() / (
T) RAND_MAX * range + min;
86 return std::sqrt(
T(-2) * std::log(
generate(
T(),
T(1)))) *
103 for(
int i = 0; i < n; i++)
110 std::random_shuffle(result.begin(), result.end());
116 const double* end = matrix.data() + matrix.rows() * matrix.cols();
117 for(
double* p = matrix.data(); p < end; p++)
118 *p = sampleNormalDistribution<double>() * stdDev;
124 #endif // OPENANN_UTIL_RANDOM_H_