Serious bugfix in Random::gamma()
authoralpar
Thu, 03 Apr 2008 12:06:48 +0000
changeset 2599b9905565d185
parent 2598 71f4bd3a9ae8
child 2600 e5530c0a018c
Serious bugfix in Random::gamma()
Backport from hg b6bede534255
lemon/random.h
     1.1 --- a/lemon/random.h	Tue Mar 25 16:28:06 2008 +0000
     1.2 +++ b/lemon/random.h	Thu Apr 03 12:06:48 2008 +0000
     1.3 @@ -802,7 +802,7 @@
     1.4  	    nu=V0*std::exp(-xi);
     1.5  	  }
     1.6        } while(nu>std::pow(xi,delta-1.0)*std::exp(-xi));
     1.7 -      return theta*(xi-gamma(int(std::floor(k))));
     1.8 +      return theta*(xi+gamma(int(std::floor(k))));
     1.9      }
    1.10      
    1.11