#NEWLINE# def fun( self , x , * args ) : #NEWLINE# #INDENT# self . nfev += 1 #NEWLINE# i = atleast_2d ( arange ( 1.0 , ( self . N + 1 ) ) ) . T #NEWLINE# inner = ( cos ( x ) + ( i * ( ( 1 - cos ( x ) ) - sin ( self ) ) ) ) #NEWLINE# return sum ( ( ( self . N - sum ( inner , axis = 1 ) ) ** 2 ) )