1 #ifndef VIENNACL_TOOLS_RANDOM_HPP
2 #define VIENNACL_TOOLS_RANDOM_HPP
43 template<
typename NumericT>
56 template<
typename NumericT>
65 while (std::fabs(u) <= 0 || u >=
NumericT(1))
66 u =
static_cast<NumericT>(double(rand()) / double(RAND_MAX));
69 while (std::fabs(v) <= 0 || v >=
NumericT(1))
70 v = static_cast<NumericT>(
double(rand()) / double(RAND_MAX));
72 return mean_ + sigma_ * std::sqrt(
NumericT(-2) * std::log(u)) * std::cos(
NumericT(6.28318530717958647692) * v);
Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.