#NEWLINE# def make_D( x , order , mode ) : #NEWLINE# #INDENT# "\n    Make the LP equation D matrix (Da = d')\n    " #NEWLINE# L = ( len ( x ) - order ) #NEWLINE# if ( mode == 'f' ) : #NEWLINE# #INDENT# return scipy . linalg . hankel ( x [ : L ] , x [ ( L - 1 ) : ( - 1 ) ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( mode == 'b' ) : #NEWLINE# #INDENT# return scipy . linalg . hankel ( x [ 1 : ( L + 1 ) ] , x [ L : ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( "mode must be 'f' or 'b'" )