def hankel(c, r=None):
 c = np.asarray(c).ravel()
 if (r is None):
  r = np.zeros_like(c)
 else:
  r = np.asarray(r).ravel()
 vals = np.concatenate((c, r[1:]))
 (a, b) = np.ogrid[0:len(c), 0:len(r)]
 indx = (a + b)
 return vals[indx]

def hankel ( c , r = None ) : c = np . asarray ( c ) . ravel ( ) if ( r is None ) : r = np . zeros_like ( c ) else : r = np . asarray ( r ) . ravel ( ) vals = np . concatenate ( ( c , r [ 1 : ] ) ) ( a , b ) = np . ogrid [ 0 : len ( c ) , 0 : len ( r ) ] indx = ( a + b ) return vals [ indx ]
construct a hankel matrix .