// points inside a radius of 0.9)
for (int i=0; i<1000; i++)
{
- double r = sqrt(random_value<double>(.9));
+ double r = sqrt(.9*random_value<double>());
double phi = 2*3.14*(1.0*Testing::rand()/RAND_MAX);
double x = r*cos(phi);
double y = r*sin(phi);
// Get a uniformly distributed random value between min and max
template<typename T=double>
-T random_value(const T &min, const T &max)
+T random_value(const T &min=0, const T &max=1)
{
return min+(max-min)*(Testing::rand()/static_cast<T>(RAND_MAX));
}
-// Same as above, but allows one to leave 0 as a default minimum value,
-// and specify only the maximum
-template<typename T=double>
-T random_value(const T &max=1)
-{
- return random_value<T>(static_cast<T>(0), max);
-}
-
-
-
// Construct a uniformly distributed random point, with each coordinate
// between min and max
template<int dim>