parameters: (cs)
return_statement: return roots
docstring: Compute the roots of a Hermite series.
  
      Return the roots (a.k.a "zeros") of the Hermite series represented by
      `cs`, which is the sequence of coefficients from lowest order "term"
      to highest, e.g., [1,2,3] is the series ``L_0 + 2*L_1 + 3*L_2``.
  
      Parameters
      ----------
      cs : array_like
          1-d array of Hermite series coefficients ordered from low to high.
  
      Returns
      -------
      out : ndarray
          Array of the roots.  If all the roots are real, then so is the
          dtype of ``out``; otherwise, ``out``'s dtype is complex.
  
      See Also
      --------
      polyroots
      chebroots
  
      Notes
      -----
      Algorithm(s) used:
  
      Remember: because the Hermite series basis set is different from the
      "standard" basis set, the results of this function *may* not be what
      one is expecting.
  
      Examples
      --------
      >>> from numpy.polynomial.hermite_e import hermeroots, hermefromroots
      >>> coef = hermefromroots([-1, 0, 1])
      >>> coef
      array([ 0.,  2.,  0.,  1.])
      >>> hermeroots(coef)
      array([-1.,  0.,  1.])
docstring_summary: Compute the roots of a Hermite series.
docstring_tokens: Compute the roots of a Hermite series .
function: def hermeroots(cs):
      """
      Compute the roots of a Hermite series.
  
      Return the roots (a.k.a "zeros") of the Hermite series represented by
      `cs`, which is the sequence of coefficients from lowest order "term"
      to highest, e.g., [1,2,3] is the series ``L_0 + 2*L_1 + 3*L_2``.
  
      Parameters
      ----------
      cs : array_like
          1-d array of Hermite series coefficients ordered from low to high.
  
      Returns
      -------
      out : ndarray
          Array of the roots.  If all the roots are real, then so is the
          dtype of ``out``; otherwise, ``out``'s dtype is complex.
  
      See Also
      --------
      polyroots
      chebroots
  
      Notes
      -----
      Algorithm(s) used:
  
      Remember: because the Hermite series basis set is different from the
      "standard" basis set, the results of this function *may* not be what
      one is expecting.
  
      Examples
      --------
      >>> from numpy.polynomial.hermite_e import hermeroots, hermefromroots
      >>> coef = hermefromroots([-1, 0, 1])
      >>> coef
      array([ 0.,  2.,  0.,  1.])
      >>> hermeroots(coef)
      array([-1.,  0.,  1.])
  
      """
      # cs is a trimmed copy
      [cs] = pu.as_series([cs])
      if len(cs) <= 1 :
          return np.array([], dtype=cs.dtype)
      if len(cs) == 2 :
          return np.array([-.5*cs[0]/cs[1]])
  
      n = len(cs) - 1
      cs /= cs[-1]
      cmat = np.zeros((n,n), dtype=cs.dtype)
      cmat[1, 0] = 1
      for i in range(1, n):
          cmat[i - 1, i] = i
          if i != n - 1:
              cmat[i + 1, i] = 1
          else:
              cmat[:, i] -= cs[:-1]
      roots = la.eigvals(cmat)
      roots.sort()
      return roots
function_tokens: def hermeroots ( cs ) : # cs is a trimmed copy [ cs ] = pu . as_series ( [ cs ] ) if len ( cs ) <= 1 : return np . array ( [ ] , dtype = cs . dtype ) if len ( cs ) == 2 : return np . array ( [ - .5 * cs [ 0 ] / cs [ 1 ] ] ) n = len ( cs ) - 1 cs /= cs [ - 1 ] cmat = np . zeros ( ( n , n ) , dtype = cs . dtype ) cmat [ 1 , 0 ] = 1 for i in range ( 1 , n ) : cmat [ i - 1 , i ] = i if i != n - 1 : cmat [ i + 1 , i ] = 1 else : cmat [ : , i ] -= cs [ : - 1 ] roots = la . eigvals ( cmat ) roots . sort ( ) return roots