'Sphere (squared norm) test objective function'

def partsphere(self, x):

    self.counter += 1
    dim = len(x)
    x = array([x[(i % dim)] for i in range((2 * dim))])
    N = 8
    i = (self.counter % dim)
    f = sum((x[np.random.randint(dim, size=N)] ** 2))
    return f
