[Numpy-svn] r4527 - trunk/numpy/random/mtrand

numpy-svn at scipy.org numpy-svn at scipy.org
Mon Dec 3 01:39:51 EST 2007


Author: rkern
Date: 2007-12-03 00:39:46 -0600 (Mon, 03 Dec 2007)
New Revision: 4527

Modified:
   trunk/numpy/random/mtrand/distributions.c
Log:
BUG: fix incorrect ordering of the 'good' and 'bad' objects in the hypergeometric distribution.

Modified: trunk/numpy/random/mtrand/distributions.c
===================================================================
--- trunk/numpy/random/mtrand/distributions.c	2007-12-02 12:12:11 UTC (rev 4526)
+++ trunk/numpy/random/mtrand/distributions.c	2007-12-03 06:39:46 UTC (rev 4527)
@@ -742,7 +742,7 @@
         if (K == 0) break;
     }
     Z = (long)(d2 - Y);
-    if (bad > good) Z = sample - Z;
+    if (good > bad) Z = sample - Z;
     return Z;
 }
 
@@ -795,7 +795,7 @@
     }
     
     /* this is a correction to HRUA* by Ivan Frohne in rv.py */
-    if (bad > good) Z = m - Z;
+    if (good > bad) Z = m - Z;
     
     /* another fix from rv.py to allow sample to exceed popsize/2 */
     if (m < sample) Z = bad - Z;




More information about the Numpy-svn mailing list