(self, objectivefx, **kwargs)
return result
Optimize a given function f over a domain.

        The optimizer class supports interruption. If during the optimization ctrl+c is pressed, the last best point is
        returned.
        
        The actual optimization routine is implemented in _optimize, to be implemented in subclasses.

        :param objectivefx: callable, taking one argument: a 2D numpy array. The number of columns correspond to the 
            dimensionality of the input domain.
        :return: OptimizeResult reporting the results.
Optimize a given function f over a domain.
Optimize a given function f over a domain .
def optimize(self, objectivefx, **kwargs):
        """
        Optimize a given function f over a domain.

        The optimizer class supports interruption. If during the optimization ctrl+c is pressed, the last best point is
        returned.
        
        The actual optimization routine is implemented in _optimize, to be implemented in subclasses.

        :param objectivefx: callable, taking one argument: a 2D numpy array. The number of columns correspond to the 
            dimensionality of the input domain.
        :return: OptimizeResult reporting the results.
        """
        objective = ObjectiveWrapper(objectivefx, **self._wrapper_args)
        try:
            result = self._optimize(objective, **kwargs)
        except KeyboardInterrupt:
            result = OptimizeResult(x=objective._previous_x,
                                    success=False,
                                    message="Caught KeyboardInterrupt, returning last good value.")
        result.x = np.atleast_2d(result.x)
        result.nfev = objective.counter
        return result
def optimize ( self , objectivefx , * * kwargs ) : objective = ObjectiveWrapper ( objectivefx , * * self . _wrapper_args ) try : result = self . _optimize ( objective , * * kwargs ) except KeyboardInterrupt : result = OptimizeResult ( x = objective . _previous_x , success = False , message = "Caught KeyboardInterrupt, returning last good value." ) result . x = np . atleast_2d ( result . x ) result . nfev = objective . counter return result