def _make_complex_eigvecs(w, vin, dtype):
 v = numpy.array(vin, dtype=dtype)
 m = (w.imag > 0)
 m[:(-1)] |= (w.imag[1:] < 0)
 for i in flatnonzero(m):
  v.imag[:, i] = vin[:, (i + 1)]
  conj(v[:, i], v[:, (i + 1)])
 return v

def _make_complex_eigvecs ( w , vin , dtype ) : v = numpy . array ( vin , dtype = dtype ) m = ( w . imag > 0 ) m [ : ( - 1 ) ] |= ( w . imag [ 1 : ] < 0 ) for i in flatnonzero ( m ) : v . imag [ : , i ] = vin [ : , ( i + 1 ) ] conj ( v [ : , i ] , v [ : , ( i + 1 ) ] ) return v
produce complex-valued eigenvectors from lapack dggev real-valued output .