Skip to content

eigs

sparse · scripts/sparse/eigs.m

d = eigs (A)
d = eigs (A, k)
d = eigs (A, k, sigma)
d = eigs (A, k, sigma, opts)
d = eigs (A, B, k, sigma, opts)
d = eigs (Afun, n, ...)
[V, D] = eigs (...)
[V, D, flag] = eigs (...)

A few eigenvalues (and eigenvectors) of a large or sparse matrix: k
eigenvalues of A*v = lambda*B*v selected by sigma, which is one of
   "lm" "largestabs" (default), "sm" "smallestabs", "la" "largestreal",
   "sa" "smallestreal", "lr", "sr", "be" "bothendsreal", "li", "si",
or a numeric scalar (the eigenvalues closest to it).  Afun, if given
instead of a matrix, returns A*x (A\x when sigma is numeric or "sm");
n is then the size of the problem.  opts is a struct with the optional
fields tol, maxit, p, v0, issym, isreal, cholB, fail and disp.

Small problems are solved densely; larger ones by a restarted Krylov
method (Krylov-Schur): Lanczos-type for symmetric/Hermitian problems and
Arnoldi-type otherwise, with shift-and-invert for numeric sigma and "sm".