mailr4728 - /branches/N_state_model/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 January 15, 2008 - 11:41:
Author: bugman
Date: Tue Jan 15 11:40:59 2008
New Revision: 4728

URL: http://svn.gna.org/viewcvs/relax?rev=4728&view=rev
Log:
Updated the linear_constraints() method.

The looping over all model parameters is not necessary as constraints only 
apply to the probs.


Modified:
    branches/N_state_model/specific_fns/n_state_model.py

Modified: branches/N_state_model/specific_fns/n_state_model.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/N_state_model/specific_fns/n_state_model.py?rev=4728&r1=4727&r2=4728&view=diff
==============================================================================
--- branches/N_state_model/specific_fns/n_state_model.py (original)
+++ branches/N_state_model/specific_fns/n_state_model.py Tue Jan 15 11:40:59 
2008
@@ -127,18 +127,16 @@
         i = 0
         j = 0
 
-        # Loop over the parameters.
-        for k in xrange(len(cdp.params)):
-            # Probabilities.
-            if data.params[k] == 'pc':
-                # 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)
-                j = j + 2
+        # 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)
+            j = j + 2
 
             # Increment i.
             i = i + 1




Related Messages


Powered by MHonArc, Updated Tue Jan 15 12:00:26 2008