Author: bugman Date: Wed May 29 14:44:47 2013 New Revision: 19769 URL: http://svn.gna.org/viewcvs/relax?rev=19769&view=rev Log: Merged revisions 19768 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r19768 | bugman | 2013-05-29 14:28:48 +0200 (Wed, 29 May 2013) | 7 lines Added the ability for specific analyses to override the optimisation constraint algorithm. The default is still the 'Method of Multipliers', but if the constraint_algorithm() method returns a different string, then that will be used to select the algorithm. This allows the 'Log Barrier' method in minfx to be used. ........ Modified: branches/relax_disp/ (props changed) branches/relax_disp/pipe_control/minimise.py branches/relax_disp/specific_analyses/api_base.py branches/relax_disp/specific_analyses/setup.py Propchange: branches/relax_disp/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Wed May 29 14:44:47 2013 @@ -1,1 +1,1 @@ -/trunk:1-19745 +/trunk:1-19768 Modified: branches/relax_disp/pipe_control/minimise.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/pipe_control/minimise.py?rev=19769&r1=19768&r2=19769&view=diff ============================================================================== --- branches/relax_disp/pipe_control/minimise.py (original) +++ branches/relax_disp/pipe_control/minimise.py Wed May 29 14:44:47 2013 @@ -173,7 +173,10 @@ # Re-package the minimisation algorithm, options, and constraints for the generic_minimise() calls within the specific code. if constraints: min_options = [min_algor] - min_algor = 'Method of Multipliers' + + # Determine the constraint algorithm to use. + fn = specific_analyses.setup.get_specific_fn('constraint_algorithm', cdp.pipe_type) + min_algor = fn() else: min_options = [] if line_search != None: Modified: branches/relax_disp/specific_analyses/api_base.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/api_base.py?rev=19769&r1=19768&r2=19769&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/api_base.py (original) +++ branches/relax_disp/specific_analyses/api_base.py Wed May 29 14:44:47 2013 @@ -122,6 +122,23 @@ # Not implemented. raise RelaxImplementError('calculate') + + + def constraint_algorithm(self): + """Return the optimisation constraint algorithm, defaulting to the Method of Multipliers. + + This can return one of: + + - 'Method of Multipliers', + - 'Log barrier'. + + + @return: The constraint algorithm to use (one of 'Method of Multipliers' or 'Log barrier'). + @rtype: str + """ + + # The default. + return 'Method of Multipliers' def create_mc_data(self, data_id=None): Modified: branches/relax_disp/specific_analyses/setup.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/setup.py?rev=19769&r1=19768&r2=19769&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/setup.py (original) +++ branches/relax_disp/specific_analyses/setup.py Wed May 29 14:44:47 2013 @@ -82,6 +82,10 @@ if eqi == 'calculate': function = inst.calculate + # Optimisation constraint algorithm override. + if eqi == 'constraint_algorithm': + function = inst.constraint_algorithm + # Create Monte Carlo data function. if eqi == 'create_mc_data': function = inst.create_mc_data