#NEWLINE# def _update( self , x , f , dx , df , dx_norm , df_norm ) : #NEWLINE# #INDENT# if ( self . M == 0 ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# self . dx . append ( dx ) #NEWLINE# self . df . append ( df ) #NEWLINE# while ( len ( self . dx ) > self . M ) : #NEWLINE# #INDENT# self . dx . pop ( 0 ) #NEWLINE# self . df . pop ( 0 ) #NEWLINE# #UNINDENT# n = len ( self . dx ) #NEWLINE# a = np . zeros ( ( n , n ) , dtype = f . dtype ) #NEWLINE# for i in xrange ( n ) : #NEWLINE# #INDENT# for j in xrange ( i , n ) : #NEWLINE# #INDENT# if ( i == j ) : #NEWLINE# #INDENT# wd = ( self . w0 ** 2 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# wd = 0 #NEWLINE# #UNINDENT# a [ ( i , j ) ] = ( ( 1 + wd ) * vdot ( self . df [ i ] , self . df [ j ] ) ) #NEWLINE# #UNINDENT# #UNINDENT# a += np . triu ( a , 1 ) . T . conj ( ) #NEWLINE# self . a = a