'Tests if a candidate solution at the global minimum.
The default test is
Parameters
x : sequence
The candidate vector for testing if the global minimum has been
reached. Must have ``len(x) == self.N``
tol : float
The evaluated function and known global minimum must differ by less
than this amount to be at a global minimum.
Returns
bool : is the candidate vector at the global minimum?'

def success(self, x, tol=1e-05):

    val = self.fun(asarray(x))
    if (abs((val - self.fglob)) < tol):
        return True
    if np.any((x > np.asfarray(self.bounds)[:, 1])):
        return False
    if np.any((x < np.asfarray(self.bounds)[:, 0])):
        return False
    if (val < self.fglob):
        raise ValueError('Found    a    lower    global    minimum', x, val, self.fglob)
    return False
