mailr4497 - /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 08, 2008 - 17:04:
Author: bugman
Date: Tue Jan  8 17:04:54 2008
New Revision: 4497

URL: http://svn.gna.org/viewcvs/relax?rev=4497&view=rev
Log:
Added the basic code for implementing optimisation of the N-state model.

The target function, the maths_fns code, doesn't yet exist though.


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=4497&r1=4496&r2=4497&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  8 17:04:54 
2008
@@ -25,6 +25,7 @@
 
 # relax module imports.
 from data import Data as relax_data_store
+from maths_fns.n_state_model import setup, func
 from specific_fns.base_class import Common_functions
 
 
@@ -95,6 +96,24 @@
         @type sim_index:        None or int
         """
 
+        # Set up the target function.
+        setup()
+
+        # Setup the minimisation algorithm when constraints are present.
+        if constraints and not match('^[Gg]rid', min_algor):
+            algor = min_options[0]
+        else:
+            algor = min_algor
+
+        # Minimisation.
+        if constraints:
+            results = generic_minimise(func=func, args=(), 
x0=self.param_vector, min_algor=min_algor, min_options=min_options, 
func_tol=func_tol, grad_tol=grad_tol, maxiter=max_iterations, A=A, b=b, 
full_output=1, print_flag=print_flag)
+        else:
+            results = generic_minimise(func=func, args=(), 
x0=self.param_vector, min_algor=min_algor, min_options=min_options, 
func_tol=func_tol, grad_tol=grad_tol, maxiter=max_iterations, full_output=1, 
print_flag=print_flag)
+        if results == None:
+            return
+        self.param_vector, self.func, self.iter_count, self.f_count, 
self.g_count, self.h_count, self.warning = results
+
 
     def return_data_name(self, name):
         """




Related Messages


Powered by MHonArc, Updated Tue Jan 08 17:20:09 2008