parameters: (a, UPLO='L')
return_statement: return w.astype(result_t)
docstring: Compute the eigenvalues of a Hermitian or real symmetric matrix.
  
      Main difference from eigh: the eigenvectors are not computed.
  
      Parameters
      ----------
      a : array_like, shape (M, M)
          A complex- or real-valued matrix whose eigenvalues are to be
          computed.
      UPLO : {'L', 'U'}, optional
          Specifies whether the calculation is done with the lower triangular
          part of `a` ('L', default) or the upper triangular part ('U').
  
      Returns
      -------
      w : ndarray, shape (M,)
          The eigenvalues, not necessarily ordered, each repeated according to
          its multiplicity.
  
      Raises
      ------
      LinAlgError
          If the eigenvalue computation does not converge.
  
      See Also
      --------
      eigh : eigenvalues and eigenvectors of symmetric/Hermitian arrays.
      eigvals : eigenvalues of general real or complex arrays.
      eig : eigenvalues and right eigenvectors of general real or complex
            arrays.
  
      Notes
      -----
      This is a simple interface to the LAPACK routines dsyevd and zheevd
      that sets those routines' flags to return only the eigenvalues of
      real symmetric and complex Hermitian arrays, respectively.
  
      Examples
      --------
      >>> from numpy import linalg as LA
      >>> a = np.array([[1, -2j], [2j, 5]])
      >>> LA.eigvalsh(a)
      array([ 0.17157288+0.j,  5.82842712+0.j])
docstring_summary: Compute the eigenvalues of a Hermitian or real symmetric matrix.
docstring_tokens: Compute the eigenvalues of a Hermitian or real symmetric matrix .
function: def eigvalsh(a, UPLO='L'):
      """
      Compute the eigenvalues of a Hermitian or real symmetric matrix.
  
      Main difference from eigh: the eigenvectors are not computed.
  
      Parameters
      ----------
      a : array_like, shape (M, M)
          A complex- or real-valued matrix whose eigenvalues are to be
          computed.
      UPLO : {'L', 'U'}, optional
          Specifies whether the calculation is done with the lower triangular
          part of `a` ('L', default) or the upper triangular part ('U').
  
      Returns
      -------
      w : ndarray, shape (M,)
          The eigenvalues, not necessarily ordered, each repeated according to
          its multiplicity.
  
      Raises
      ------
      LinAlgError
          If the eigenvalue computation does not converge.
  
      See Also
      --------
      eigh : eigenvalues and eigenvectors of symmetric/Hermitian arrays.
      eigvals : eigenvalues of general real or complex arrays.
      eig : eigenvalues and right eigenvectors of general real or complex
            arrays.
  
      Notes
      -----
      This is a simple interface to the LAPACK routines dsyevd and zheevd
      that sets those routines' flags to return only the eigenvalues of
      real symmetric and complex Hermitian arrays, respectively.
  
      Examples
      --------
      >>> from numpy import linalg as LA
      >>> a = np.array([[1, -2j], [2j, 5]])
      >>> LA.eigvalsh(a)
      array([ 0.17157288+0.j,  5.82842712+0.j])
  
      """
      UPLO = asbytes(UPLO)
      a, wrap = _makearray(a)
      _assertRank2(a)
      _assertSquareness(a)
      t, result_t = _commonType(a)
      real_t = _linalgRealType(t)
      a = _fastCopyAndTranspose(t, a)
      a = _to_native_byte_order(a)
      n = a.shape[0]
      liwork = 5*n+3
      iwork = zeros((liwork,), fortran_int)
      if isComplexType(t):
          lapack_routine = lapack_lite.zheevd
          w = zeros((n,), real_t)
          lwork = 1
          work = zeros((lwork,), t)
          lrwork = 1
          rwork = zeros((lrwork,), real_t)
          results = lapack_routine(_N, UPLO, n, a, n, w, work, -1,
                                   rwork, -1, iwork, liwork,  0)
          lwork = int(abs(work[0]))
          work = zeros((lwork,), t)
          lrwork = int(rwork[0])
          rwork = zeros((lrwork,), real_t)
          results = lapack_routine(_N, UPLO, n, a, n, w, work, lwork,
                                  rwork, lrwork, iwork, liwork,  0)
      else:
          lapack_routine = lapack_lite.dsyevd
          w = zeros((n,), t)
          lwork = 1
          work = zeros((lwork,), t)
          results = lapack_routine(_N, UPLO, n, a, n, w, work, -1,
                                   iwork, liwork, 0)
          lwork = int(work[0])
          work = zeros((lwork,), t)
          results = lapack_routine(_N, UPLO, n, a, n, w, work, lwork,
                                   iwork, liwork, 0)
      if results['info'] > 0:
          raise LinAlgError, 'Eigenvalues did not converge'
      return w.astype(result_t)
function_tokens: def eigvalsh ( a , UPLO = 'L' ) : UPLO = asbytes ( UPLO ) a , wrap = _makearray ( a ) _assertRank2 ( a ) _assertSquareness ( a ) t , result_t = _commonType ( a ) real_t = _linalgRealType ( t ) a = _fastCopyAndTranspose ( t , a ) a = _to_native_byte_order ( a ) n = a . shape [ 0 ] liwork = 5 * n + 3 iwork = zeros ( ( liwork , ) , fortran_int ) if isComplexType ( t ) : lapack_routine = lapack_lite . zheevd w = zeros ( ( n , ) , real_t ) lwork = 1 work = zeros ( ( lwork , ) , t ) lrwork = 1 rwork = zeros ( ( lrwork , ) , real_t ) results = lapack_routine ( _N , UPLO , n , a , n , w , work , - 1 , rwork , - 1 , iwork , liwork , 0 ) lwork = int ( abs ( work [ 0 ] ) ) work = zeros ( ( lwork , ) , t ) lrwork = int ( rwork [ 0 ] ) rwork = zeros ( ( lrwork , ) , real_t ) results = lapack_routine ( _N , UPLO , n , a , n , w , work , lwork , rwork , lrwork , iwork , liwork , 0 ) else : lapack_routine = lapack_lite . dsyevd w = zeros ( ( n , ) , t ) lwork = 1 work = zeros ( ( lwork , ) , t ) results = lapack_routine ( _N , UPLO , n , a , n , w , work , - 1 , iwork , liwork , 0 ) lwork = int ( work [ 0 ] ) work = zeros ( ( lwork , ) , t ) results = lapack_routine ( _N , UPLO , n , a , n , w , work , lwork , iwork , liwork , 0 ) if results [ 'info' ] > 0 : raise LinAlgError , 'Eigenvalues did not converge' return w . astype ( result_t )