def rosen(x):
 x = asarray(x)
 r = numpy.sum(((100.0 * ((x[1:] - (x[:(-1)] ** 2.0)) ** 2.0)) + ((1 - x[:(-1)]) ** 2.0)), axis=0)
 return r

def rosen ( x ) : x = asarray ( x ) r = numpy . sum ( ( ( 100.0 * ( ( x [ 1 : ] - ( x [ : ( - 1 ) ] ** 2.0 ) ) ** 2.0 ) ) + ( ( 1 - x [ : ( - 1 ) ] ) ** 2.0 ) ) , axis = 0 ) return r
the rosenbrock function .