mailr19823 - /branches/relax_disp/specific_analyses/relax_disp/parameters.py


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

Header


Content

Posted by edward on May 31, 2013 - 12:09:
Author: bugman
Date: Fri May 31 12:09:52 2013
New Revision: 19823

URL: http://svn.gna.org/viewcvs/relax?rev=19823&view=rev
Log:
Fixes for the dispersion linear_constraints() function.

The indices were being incorrectly handled - the i and k index should be one 
and the same parameter
index.


Modified:
    branches/relax_disp/specific_analyses/relax_disp/parameters.py

Modified: branches/relax_disp/specific_analyses/relax_disp/parameters.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/parameters.py?rev=19823&r1=19822&r2=19823&view=diff
==============================================================================
--- branches/relax_disp/specific_analyses/relax_disp/parameters.py (original)
+++ branches/relax_disp/specific_analyses/relax_disp/parameters.py Fri May 31 
12:09:52 2013
@@ -451,16 +451,15 @@
     b = []
     n = param_num(spins=spins)
     zero_array = zeros(n, float64)
-    i = 0
     j = 0
 
     # The R2eff model.
     if cdp.model == MODEL_R2EFF:
         # Only use the parameters of the first spin of the cluster.
         spin = spins[0]
-        for k in range(len(spin.params)):
+        for i in range(n):
             # Effective transversal relaxation rate.
-            if spin.params[k] == 'r2eff':
+            if spin.params[i] == 'r2eff':
                 A.append(zero_array * 0.0)
                 A.append(zero_array * 0.0)
                 A[j][i] = 1.0
@@ -480,9 +479,9 @@
     else:
         # Only use the parameters of the first spin of the cluster.
         spin = spins[0]
-        for k in range(len(spin.params)):
+        for i in range(n):
             # The transversal relaxation rates (0 <= r2 <= 200).
-            if spin.params[k] in ['r2', 'r2a']:
+            if spin.params[i] in ['r2', 'r2a']:
                 A.append(zero_array * 0.0)
                 A.append(zero_array * 0.0)
                 A[j][i] = 1.0
@@ -492,7 +491,7 @@
                 j += 2
 
             # The population of state A (pA >= 0 and pA >= pB).
-            elif spin.params[k] == 'pA':
+            elif spin.params[i] == 'pA':
                 A.append(zero_array * 0.0)
                 A.append(zero_array * 0.0)
                 A[j][i] = 1.0
@@ -502,28 +501,25 @@
                 j += 2
 
             # The pA.pB.dw**2/wH**2 parameter (phi_ex >= 0).
-            elif spin.params[k] == 'phi_ex':
+            elif spin.params[i] == 'phi_ex':
                 A.append(zero_array * 0.0)
                 A[j][i] = 1.0
                 b.append(0.0)
                 j += 1
 
             # Chemical exchange difference (dw >= 0).
-            elif spin.params[k] == 'dw':
+            elif spin.params[i] == 'dw':
                 A.append(zero_array * 0.0)
                 A[j][i] = 1.0
                 b.append(0.0)
                 j += 1
 
             # Exchange rates (k >= 0).
-            elif spin.params[k] in ['kex', 'ka']:
+            elif spin.params[i] in ['kex', 'ka']:
                 A.append(zero_array * 0.0)
                 A[j][i] = 1.0
                 b.append(0.0)
                 j += 1
-
-            # Increment i.
-            i += 1
 
     # Convert to numpy data structures.
     A = array(A, float64)




Related Messages


Powered by MHonArc, Updated Fri May 31 12:40:01 2013