def Mat.eigh
import bend-blas-lapack@0.0.0.1/mat.bend as Matimport Base
import bend-blas-lapack@0.0.0.1/lapack.bend as L
310# the eigenvalues ascending and the eigenvectors as the rows of the Mat
311def Mat.eigh(+n: Nat, a: Mat<n, n>) -> IO(Result<&1, &1, U32 & String, Vec<n> & Mat<n, n>>):
312 MatA{x} = a
313 IO.bind(Result<&1, &1, U32 & String, Array<F32> & Array<F32>>, Result<&1, &1, U32 & String, Vec<n> & Mat<n, n>>, L.Lapack.ssyev(U32.from_nat(n), x), r => Mat.eigh.wrap(n, r))