'Rosenbrock test objective function'

def rosen(self, x, alpha=100.0):

    x = ([x] if np.isscalar(x[0]) else x)
    f = [sum(((alpha * (((x[:(-1)] ** 2) - x[1:]) ** 2)) + ((1.0 - x[:(-1)]) ** 2))) for x in x]
    return (f if (len(f) > 1) else f[0])
