mailr11259 - /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 June 29, 2010 - 12:00:
Author: bugman
Date: Tue Jun 29 12:00:09 2010
New Revision: 11259

URL: http://svn.gna.org/viewcvs/relax?rev=11259&view=rev
Log:
Fixed for the N-state model target functions for when there is nothing to 
optimisise.


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=11259&r1=11258&r2=11259&view=diff
==============================================================================
--- 1.3/maths_fns/n_state_model.py (original)
+++ 1.3/maths_fns/n_state_model.py Tue Jun 29 12:00:09 2010
@@ -191,7 +191,6 @@
         # The flexible population or equal probability N-state models.
         elif model in ['population', 'fixed']:
             # Fixed alignment tensors.
-            self.tensor_opt = True
             if full_tensors != None:
                 # The optimisation flag.
                 self.tensor_opt = False
@@ -204,6 +203,22 @@
                 self.A = zeros((self.num_tensors, 3, 3), float64)
                 for i in range(self.num_tensors):
                     to_tensor(self.A[i], self.full_tensors[5*i:5*i+5])
+
+            # Optimised alignment tensors.
+            else:
+                # The optimisation flag.
+                self.tensor_opt = True
+
+                # Alignment tensor function and gradient matrices.
+                self.A = zeros((self.num_align, 3, 3), float64)
+                self.dA = zeros((5, 3, 3), float64)
+
+                # The alignment tensor gradients don't change, so 
pre-calculate them.
+                dAi_dAxx(self.dA[0])
+                dAi_dAyy(self.dA[1])
+                dAi_dAxy(self.dA[2])
+                dAi_dAxz(self.dA[3])
+                dAi_dAyz(self.dA[4])
 
             # Set the RDC and PCS flags (indicating the presence of data).
             self.rdc_flag = True
@@ -262,17 +277,6 @@
                     # Missing errors.
                     self.rdc_sigma_ij = ones((self.num_align, 
self.num_spins), float64)
 
-            # Alignment tensor function and gradient matrices.
-            self.A = zeros((self.num_align, 3, 3), float64)
-            self.dA = zeros((5, 3, 3), float64)
-
-            # The alignment tensor gradients don't change, so pre-calculate 
them.
-            dAi_dAxx(self.dA[0])
-            dAi_dAyy(self.dA[1])
-            dAi_dAxy(self.dA[2])
-            dAi_dAxz(self.dA[3])
-            dAi_dAyz(self.dA[4])
-
             # Missing data matrices (RDC).
             if self.rdc_flag:
                 self.missing_Dij = zeros((self.num_align, self.num_spins), 
float64)
@@ -756,7 +760,8 @@
         # Loop over each alignment.
         for i in xrange(self.num_align):
             # Create tensor i from the parameters.
-            to_tensor(self.A[i], params[5*i:5*i + 5])
+            if self.tensor_opt:
+                to_tensor(self.A[i], params[5*i:5*i + 5])
 
             # Loop over the spin systems j.
             for j in xrange(self.num_spins):




Related Messages


Powered by MHonArc, Updated Tue Jun 29 12:40:01 2010