]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fixed Denis' comments.
authorLuca Heltai <luca.heltai@sissa.it>
Wed, 22 Nov 2017 15:40:29 +0000 (16:40 +0100)
committerLuca Heltai <luca.heltai@sissa.it>
Wed, 22 Nov 2017 15:40:54 +0000 (16:40 +0100)
tests/bits/joa_1.cc
tests/tests.h

index 52d17ea02467c81bdcab2a897fd90074dfba91aa..a7deae98e9aa886da4da81d88feb2f07c1d5939d 100644 (file)
@@ -1068,7 +1068,7 @@ void LaplaceProblem<dim>::run ()
   // 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);
index 2301fe6ab16cd01966dcded8ccd839cd8e91105f..80db3b4a6522bba70f07fec9a04b89208bed752a 100644 (file)
@@ -191,23 +191,13 @@ namespace Testing
 
 // 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>

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.