eigs

Partial Eigen decomposition of a matrix.

Syntax

d = eigs(A)

d = eigs(A,k)

d = eigs(A,k,sigma)

d = eigs(A,k,sigma,opts)

d = eigs(A,B,k)

d = eigs(A,B,k,sigma)

d = eigs(A,B,k,sigma,opts)

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

Inputs

A
The matrix to decompose.
Type: double | complex
Dimension: matrix
B
The right hand side positive definite matrix in a generalized Eigen problem.
Type: double
Dimension: matrix
k
The number of Eigen values/vectors to compute (default: 6).
Type: integer
Dimension: scalar
sigma
The available options are as follows:
'lm'
The largest eigenvalues.
'sm'
The smallest eigenvalues.
'lr'
The eigenvalues with the largest real part. Only for complex or asymmetric problems.
'sr'
The eigenvalues with the smallest real part. Only for complex or asymmetric problems.
'li'
The eigenvalues with the largest imaginary part. Only for complex or asymmetric problems.
'si'
The eigenvalues with the smallest imaginary part. Only for complex or asymmetric problems.
Type: scalar | string
opts
The available options are as follows:
maxit
The maximum number of iterations (default: 300).
p
The number of Lanzcos basis vectors used (default: min(n, max(2*k + 1, 20)), where n = size(A,1)). The allowed range is (k+1, n].
tol
The convergence tolerance (default: eps).
v0
The initial column vector for the algorithm (default: random).
Since Eigen vectors are only unique to within a sign, the signs will depend on the choice of v0.
Type: struct

Outputs

d
Eigenvalue vector.
vector
V
Eigen vector matrix.
matrix
D
Eigenvalue diagonal matrix.
matrix

Example

A = [190, 104, 38, 4; 104, 121, 48, 8; 38, 48, 58, 12; 4, 8, 12, 16];
[v,d] = eigs(A,2)
V = [Matrix] 4 x 2
-0.77131  -0.57451
-0.58025   0.46224
-0.25832   0.64583
-0.04083   0.19792
D = [Matrix] 2 x 2
281.17670   0.00000
  0.00000  62.22897

Comments

The function handle option for A as a linear operator is not currently available.

The scalar option for sigma is not currently available.