Skip to contents

Computes eigenvalues and eigenvectors of a real symmetric matrix by dispatching to the active backend via eigen with symmetric = TRUE.

Usage

eigh(x)

Arguments

x

A real symmetric numeric matrix, adgeMatrix, or other object accepted by eigen.

Value

A list with components values (numeric vector of eigenvalues in ascending order) and vectors (numeric matrix whose columns are the corresponding eigenvectors).

See also

Examples

S <- crossprod(matrix(rnorm(25), nrow = 5))
ev <- eigh(adgeMatrix(S))
length(ev$values)
#> [1] 5