@defun
def eigsy(ctx, A, eigvals_only = False, overwrite_a = False):

    if not overwrite_a:
        A = A.copy()

    d = ctx.zeros(A.rows, 1)
    e = ctx.zeros(A.rows, 1)

    if eigvals_only:
        r_sy_tridiag(ctx, A, d, e, calc_ev = False)
        tridiag_eigen(ctx, d, e, False)
        return d
    else:
        r_sy_tridiag(ctx, A, d, e, calc_ev = True)
        tridiag_eigen(ctx, d, e, A)
        return (d, A)
This routine solves the (ordinary) eigenvalue problem for a real symmetric
dataset/ETHPy150Open fredrik-johansson/mpmath/mpmath/matrices/eigen_symmetric.py/eigsy