mailr4741 - /branches/N_state_model/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 January 15, 2008 - 14:20:
Author: bugman
Date: Tue Jan 15 14:20:57 2008
New Revision: 4741

URL: http://svn.gna.org/viewcvs/relax?rev=4741&view=rev
Log:
Updated the N_state_opt.__init__() method to place its args into the class 
instance namespace.


Modified:
    branches/N_state_model/maths_fns/n_state_model.py

Modified: branches/N_state_model/maths_fns/n_state_model.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/N_state_model/maths_fns/n_state_model.py?rev=4741&r1=4740&r2=4741&view=diff
==============================================================================
--- branches/N_state_model/maths_fns/n_state_model.py (original)
+++ branches/N_state_model/maths_fns/n_state_model.py Tue Jan 15 14:20:57 2008
@@ -24,11 +24,29 @@
 class N_state_opt:
     """Class containing the target function of the optimisation of the 
N-state model."""
 
-    def __init__(self):
+    def __init__(self, init_params=None, red_data=None, red_errors=None):
         """Set up the class instance for optimisation.
 
-        All constant data required for the N-state model should be 
initialised here.
+        All constant data required for the N-state model are initialised 
here.
+
+
+        @param init_params:     The initial parameter values.  Optimisation 
must start at some
+                                point!
+        @type init_params:      numpy float64 array
+        @param red_data:        An array of the {Sxx, Syy, Sxy, Sxz, Syz} 
values for all reduced
+                                tensors.  The format is [Sxx1, Syy1, Sxy1, 
Sxz1, Syz1, Sxx2, Syy2,
+                                Sxy2, Sxz2, Syz2, ..., Sxxn, Syyn, Sxyn, 
Sxzn, Syzn]
+        @type red_data:         numpy float64 array
+        @param red_errors:      An array of the {Sxx, Syy, Sxy, Sxz, Syz} 
errors for all reduced
+                                tensors.  The array format is the same as 
for red_data.
+        @type red_errors:       numpy float64 array
         """
+
+        # Place the data into the class instance namespace.
+        self.params = 1.0 * init_params    # Force a copy of the data to be 
stored.
+        self.total_num_params = len(init_params)
+        self.red_data = red_data
+        self.red_errors = red_errors
 
 
     def func(self, params):




Related Messages


Powered by MHonArc, Updated Tue Jan 15 14:40:09 2008