+
+def eigenvalues(symmat):
+ """
+ Return the eigenvalues of the given symmetric real matrix.
+
+ Parameters
+ ----------
+
+ symmat : matrix
+ The real symmetric matrix whose eigenvalues you want.
+
+ Returns
+ -------
+
+ list of float
+ A list of the eigenvalues (in no particular order) of ``symmat``.
+
+ Raises
+ ------
+
+ TypeError
+ If the input matrix is not symmetric.
+
+ Examples
+ --------
+
+ >>> A = matrix([[2,1],[1,2]], tc='d')
+ >>> eigenvalues(A)
+ [1.0, 3.0]
+
+ If the input matrix is not symmetric, it may not have real
+ eigenvalues, and we don't know what to do::
+
+ >>> A = matrix([[1,2],[3,4]])
+ >>> eigenvalues(A)
+ Traceback (most recent call last):
+ ...
+ TypeError: input must be a symmetric real matrix
+
+ """
+ if not norm(symmat.trans() - symmat) < options.ABS_TOL:
+ # Ensure that ``symmat`` is symmetric (and thus square).
+ raise TypeError('input must be a symmetric real matrix')
+
+ domain_dim = symmat.size[0]
+ eigs = matrix(0, (domain_dim, 1), tc='d')
+ syev(symmat, eigs)
+ return list(eigs)
+
+