mailr11338 - /1.3/specific_fns/frame_order.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on July 22, 2010 - 18:26:
Author: bugman
Date: Thu Jul 22 18:26:42 2010
New Revision: 11338

URL: http://svn.gna.org/viewcvs/relax?rev=11338&view=rev
Log:
Limit arrays are now sent into the minfx generic interface for limiting 
simulated annealing.


Modified:
    1.3/specific_fns/frame_order.py

Modified: 1.3/specific_fns/frame_order.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/specific_fns/frame_order.py?rev=11338&r1=11337&r2=11338&view=diff
==============================================================================
--- 1.3/specific_fns/frame_order.py (original)
+++ 1.3/specific_fns/frame_order.py Thu Jul 22 18:26:42 2010
@@ -59,6 +59,21 @@
         self.overfit_deselect = self._overfit_deselect_dummy
         self.return_conversion_factor = self._return_no_conversion_factor
         self.set_param_values = self._set_param_values_global
+
+
+    def _assemble_limit_arrays(self):
+        """Assemble and return the limit vectors.
+
+        @return:    The lower and upper limit vectors.
+        @rtype:     numpy rank-1 array, numpy rank-1 array
+        """
+
+        # Init.
+        lower = zeros(len(cdp.params), float64)
+        upper = 2.0*pi * ones(len(cdp.params), float64)
+
+        # Return the arrays.
+        return lower, upper
 
 
     def _assemble_param_vector(self):
@@ -1035,6 +1050,9 @@
             # Throw a warning.
             warn(RelaxWarning("Constraints are as of yet not implemented - 
turning this option off."))
 
+        # Simulated annealing constraints.
+        lower, upper = self._assemble_limit_arrays()
+
         # Assemble the parameter vector.
         param_vector = self._assemble_param_vector()
 
@@ -1050,7 +1068,7 @@
 
         # Minimisation.
         else:
-            results = generic_minimise(func=target.func, args=(), 
x0=param_vector, min_algor=min_algor, min_options=min_options, 
func_tol=func_tol, grad_tol=grad_tol, maxiter=max_iterations, 
full_output=True, print_flag=verbosity)
+            results = generic_minimise(func=target.func, args=(), 
x0=param_vector, min_algor=min_algor, min_options=min_options, 
func_tol=func_tol, grad_tol=grad_tol, maxiter=max_iterations, l=lower, 
u=upper, full_output=True, print_flag=verbosity)
 
         # Unpack the results.
         self._unpack_opt_results(results, sim_index)




Related Messages


Powered by MHonArc, Updated Fri Jul 23 01:40:02 2010