'ellipsoid test objective function with "constraints"'

def elliconstraint(self, x, cfac=100000000.0, tough=True, cond=1000000.0):

    N = len(x)
    f = sum(((cond ** (np.arange(N)[(-1)::(-1)] / (N - 1))) * (x ** 2)))
    cvals = ((x[0] + 1), ((x[0] + 1) + (100 * x[1])), ((x[0] + 1) - (100 * x[1])))
    if tough:
        f += (cfac * sum((max(0, c) for c in cvals)))
    else:
        f += (cfac * sum(((max(0, (c + 0.001)) ** 2) for c in cvals)))
    return f
