eigs

A few eigenvalues of a large matrix.

Category: Mathematics > Linear Algebra

Syntax

d = eigs(A)

Returns the six largest-magnitude eigenvalues.

d = eigs(A, k)

Returns k eigenvalues.

d = eigs(A, k, sigma)

Chooses which: 'largestabs', 'smallestabs', 'largestreal', 'smallestreal', or the ones closest to a number sigma.

[V, D] = eigs(A, ...)

Also returns the eigenvectors.

Description

Computing every eigenvalue of an n-by-n matrix costs order n^3. When only a few are needed, for instance the dominant modes of a large system, eigs finds them with iterative methods that only need products with A.

For a small matrix eigs selects the same numbers that eig would give.

Input arguments

A
Square matrix, often large and sparse.
k
Number of eigenvalues wanted (default 6).
sigma
Selection rule: a keyword or a numeric shift.

Output arguments

d
Column vector of the selected eigenvalues.
V, D
Eigenvectors and diagonal eigenvalue matrix.

Example

Largest and smallest eigenvalues of diag(1:10)

A = diag(1:10);
eigs(A, 3)
eigs(A, 2, 'smallestabs')
Output
ans = 3×1

    10
     9
     8
ans = 2×1

     1
     2

See also

eig svds svd sparse