mailr9244 - /1.3/maths_fns/n_state_model.py


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

Header


Content

Posted by edward on July 15, 2009 - 19:20:
Author: bugman
Date: Wed Jul 15 19:20:10 2009
New Revision: 9244

URL: http://svn.gna.org/viewcvs/relax?rev=9244&view=rev
Log:
Fix for the N-state model when N = 1.


Modified:
    1.3/maths_fns/n_state_model.py

Modified: 1.3/maths_fns/n_state_model.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/maths_fns/n_state_model.py?rev=9244&r1=9243&r2=9244&view=diff
==============================================================================
--- 1.3/maths_fns/n_state_model.py (original)
+++ 1.3/maths_fns/n_state_model.py Wed Jul 15 19:20:10 2009
@@ -302,6 +302,9 @@
                             # Change the error to one (to avoid zero 
division).
                             self.pcs_sigma_ij[i, j] = 1.0
 
+            # The probability array (all structures have initial equal 
probability).
+            self.probs = ones(self.N, float64) / self.N
+
             # PCS function, gradient, and Hessian matrices.
             self.deltaij_theta = zeros((self.num_align, self.num_spins), 
float64)
             self.ddeltaij_theta = zeros((self.total_num_params, 
self.num_align, self.num_spins), float64)
@@ -319,9 +322,6 @@
 
         # Pure tensor optimisation overrides.
         if model == 'fixed':
-            # The probability array (all structures have equal probability).
-            self.probs = ones(self.N, float64) / self.N
-
             # The probs are unpacked by self.func in the population model, 
so just override that function.
             self.func = self.func_tensor_opt
 
@@ -554,7 +554,8 @@
         chi2_sum = 0.0
 
         # Unpack the probabilities (located at the end of the parameter 
array).
-        self.probs = params[-(self.N-1):]
+        if self.N > 1:
+            self.probs = params[-(self.N-1):]
 
         # Loop over each alignment.
         for i in xrange(self.num_align):




Related Messages


Powered by MHonArc, Updated Wed Jul 15 20:20:05 2009