mailr4636 - /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 11, 2008 - 11:43:
Author: bugman
Date: Fri Jan 11 11:43:46 2008
New Revision: 4636

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

The param_vector structure is now passed into the function as it is no longer 
stored in self.


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=4636&r1=4635&r2=4636&view=diff
==============================================================================
--- branches/N_state_model/specific_fns/n_state_model.py (original)
+++ branches/N_state_model/specific_fns/n_state_model.py Fri Jan 11 11:43:46 
2008
@@ -77,7 +77,7 @@
         self.minimise(min_algor='grid', constraints=constraints, 
verbosity=verbosity, sim_index=sim_index)
 
 
-    def linear_constraints(self):
+    def linear_constraints(self, param_vector):
         """Function for setting up the linear constraint matrices A and b.
 
         Standard notation
@@ -111,14 +111,16 @@
         This example is for a 3-state model.
 
 
-        @return:    The matrices A and b.
-        @rtype:     tuple of len 2 of a numpy matrix and numpy array
+        @param param_vector:    The array of parameter names.
+        @type param_vector:     array of str
+        @return:                The matrices A and b.
+        @rtype:                 tuple of len 2 of a numpy matrix and numpy 
array
         """
 
         # Initialisation (0..j..m).
         A = []
         b = []
-        n = len(self.param_vector)
+        n = len(param_vector)
         zero_array = zeros(n, float64)
         i = 0
         j = 0
@@ -187,7 +189,7 @@
 
         # Linear constraints.
         if constraints:
-            A, b = self.linear_constraints()
+            A, b = self.linear_constraints(param_vector)
 
         # Set up the class instance containing the target function.
         model = N_state_opt()




Related Messages


Powered by MHonArc, Updated Fri Jan 11 12:00:25 2008