[Lemon-commits] alpar: r3483 - lemon/trunk/lemon

Lemon SVN svn at lemon.cs.elte.hu
Thu Apr 3 14:06:49 CEST 2008


Author: alpar
Date: Thu Apr  3 14:06:48 2008
New Revision: 3483

Modified:
   lemon/trunk/lemon/random.h

Log:
Serious bugfix in Random::gamma()
Backport from hg b6bede534255

Modified: lemon/trunk/lemon/random.h
==============================================================================
--- lemon/trunk/lemon/random.h	(original)
+++ lemon/trunk/lemon/random.h	Thu Apr  3 14:06:48 2008
@@ -802,7 +802,7 @@
 	    nu=V0*std::exp(-xi);
 	  }
       } while(nu>std::pow(xi,delta-1.0)*std::exp(-xi));
-      return theta*(xi-gamma(int(std::floor(k))));
+      return theta*(xi+gamma(int(std::floor(k))));
     }
     
       



More information about the Lemon-commits mailing list