78
80
return function(xopt), xopt, 1, time.time() - t0
79
81
template = "\tNumber of function evaluations = %d; current F = %f"
81
83
def _callback(fcalls, x, fval, delta):
83
_callback(1, xopt, function(xopt), None)
85
show_remaining(remaining, -fval, delta, fcalls)
86
88
for i in range((self.max_restarts + 1)):
87
89
(xopt, fval, iterations, func_calls, warnflag) = self._minimise(
88
function, xopt, disp=show_progress, callback=_callback,
90
function, xopt, disp=False, callback=_callback,
89
91
ftol=self.ftol, full_output=True,
90
92
maxfun=self.max_evaluations)
91
93
xopt = numpy.atleast_1d(xopt) # unsqueeze incase only one param