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.
- B
- The right hand side positive definite matrix in a generalized Eigen problem.
- k
- The number of Eigen values/vectors to compute (default: 6).
- 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.
- 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).
Outputs
- d
- Eigenvalue vector.
- V
- Eigen vector matrix.
- D
- Eigenvalue diagonal 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.