mailr5117 - /1.3/generic_fns/monte_carlo.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on March 21, 2008 - 13:49:
Author: bugman
Date: Fri Mar 21 13:49:16 2008
New Revision: 5117

URL: http://svn.gna.org/viewcvs/relax?rev=5117&view=rev
Log:
Fix for bug #11004 (https://gna.org/bugs/?11004).

The division by zero is now caught and avoided, but this bug has been 
triggered by a deeper problem
which is likely to uncover additional bugs.


Modified:
    1.3/generic_fns/monte_carlo.py

Modified: 1.3/generic_fns/monte_carlo.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/monte_carlo.py?rev=5117&r1=5116&r2=5117&view=diff
==============================================================================
--- 1.3/generic_fns/monte_carlo.py (original)
+++ 1.3/generic_fns/monte_carlo.py Fri Mar 21 13:49:16 2008
@@ -226,7 +226,10 @@
                         Xsum = Xsum + param_array[i]
 
                     # Calculate the mean parameter value for all simulations.
-                    Xav = Xsum / float(n)
+                    if n == 0:
+                        Xav = 0
+                    else:
+                        Xav = Xsum / float(n)
 
                     # Calculate the sum part of the standard deviation.
                     sd = 0.0




Related Messages


Powered by MHonArc, Updated Fri Mar 21 14:20:12 2008