mailr8748 - /1.3/specific_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 February 05, 2009 - 18:40:
Author: bugman
Date: Thu Feb  5 18:40:49 2009
New Revision: 8748

URL: http://svn.gna.org/viewcvs/relax?rev=8748&view=rev
Log:
The __linear_constraints() method now handles the N-state models without 
probabilities.


Modified:
    1.3/specific_fns/n_state_model.py

Modified: 1.3/specific_fns/n_state_model.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/specific_fns/n_state_model.py?rev=8748&r1=8747&r2=8748&view=diff
==============================================================================
--- 1.3/specific_fns/n_state_model.py (original)
+++ 1.3/specific_fns/n_state_model.py Thu Feb  5 18:40:49 2009
@@ -356,28 +356,30 @@
         i = pop_start
         j = 0
 
-        # Loop over the prob parameters (N - 1, because the sum of pc is 1).
-        for k in xrange(cdp.N - 1):
-            # 0 <= pc <= 1.
+        # Probability parameters.
+        if cdp.model in ['2-domain', 'population']:
+            # Loop over the prob parameters (N - 1, because the sum of pc is 
1).
+            for k in xrange(cdp.N - 1):
+                # 0 <= pc <= 1.
+                A.append(zero_array * 0.0)
+                A.append(zero_array * 0.0)
+                A[j][i] = 1.0
+                A[j+1][i] = -1.0
+                b.append(0.0)
+                b.append(-1.0 / scaling_matrix[i, i])
+                j = j + 2
+
+                # Increment i.
+                i = i + 1
+
+            # Add the inequalities for pN.
             A.append(zero_array * 0.0)
             A.append(zero_array * 0.0)
-            A[j][i] = 1.0
-            A[j+1][i] = -1.0
+            for i in xrange(pop_start, self.param_num()):
+                A[-2][i] = -1.0
+                A[-1][i] = 1.0
+            b.append(-1.0 / scaling_matrix[i, i])
             b.append(0.0)
-            b.append(-1.0 / scaling_matrix[i, i])
-            j = j + 2
-
-            # Increment i.
-            i = i + 1
-
-        # Add the inequalities for pN.
-        A.append(zero_array * 0.0)
-        A.append(zero_array * 0.0)
-        for i in xrange(pop_start, self.param_num()):
-            A[-2][i] = -1.0
-            A[-1][i] = 1.0
-        b.append(-1.0 / scaling_matrix[i, i])
-        b.append(0.0)
 
         # Convert to numpy data structures.
         A = array(A, float64)




Related Messages


Powered by MHonArc, Updated Thu Feb 05 19:00:03 2009