eigfact(A,?,?,?,?)
.. eigfact(A,[irange,][vl,][vu,][permute=true,][scale=true]) -> Eigen
Computes the eigenvalue decomposition of ``A``, returning an ``Eigen``
factorization object ``F`` which contains the eigenvalues in ``F[:values]``
and the eigenvectors in the columns of the matrix ``F[:vectors]``.
(The ``k``\ th eigenvector can be obtained from the slice ``F[:vectors][:, k]``.)
The following functions are available for ``Eigen`` objects: ``inv``,
``det``.
If ``A`` is :class:`Symmetric`, :class:`Hermitian` or :class:`SymTridiagonal`,
it is possible to calculate only a subset of the eigenvalues by specifying
either a :class:`UnitRange` ``irange`` covering indices of the sorted
eigenvalues or a pair ``vl`` and ``vu`` for the lower and upper boundaries
of the eigenvalues.
For general nonsymmetric matrices it is possible to specify how the matrix
is balanced before the eigenvector calculation. The option ``permute=true``
permutes the matrix to become closer to upper triangular, and ``scale=true``
scales the matrix by its diagonal elements to make rows and columns more
equal in norm. The default is ``true`` for both options.Examples
The eigfact(A, B) function in Julia computes the generalized eigenvalue decomposition of matrices A and B. It returns a GeneralizedEigen factorization object F, which contains the generalized eigenvalues in F[:values] and the generalized eigenvectors in the columns of the matrix F[:vectors]. The k-th generalized eigenvector can be obtained from the slice F[:vectors][:, k].
Here are some examples of how to use the eigfact function:
-
Compute generalized eigenvalue decomposition:
julia> A = [1 2; 3 4]; julia> B = [5 6; 7 8]; julia> F = eigfact(A, B); julia> F[:values] 2-element Array{Complex{Float64},1}: -0.372281+0.0im 5.37228+0.0im julia> F[:vectors] 2×2 Array{Complex{Float64},2}: -0.823317+0.0im -0.415974-0.0im 0.567767+0.0im 0.909376+0.0imThis example computes the generalized eigenvalue decomposition of matrices
AandBand stores the result inF. The eigenvalues can be accessed usingF[:values]and the eigenvectors can be accessed usingF[:vectors]. - Access specific generalized eigenvectors:
julia> eigvec_1 = F[:vectors][:, 1] 2-element Array{Complex{Float64},1}: -0.8233165660600293 + 0.0im 0.5677672769869273 + 0.0imIn this example, we access the first generalized eigenvector by indexing
F[:vectors][:, 1].
Please note that the above examples assume that the matrices A and B have appropriate dimensions for the generalized eigenvalue decomposition.
See Also
abs2, beta, binomial, ceil, cell, cross, ctranspose, ctranspose!, cummin, cumprod, cumprod!, cumsum, cumsum!, cumsum_kbn, div, divrem, eigfact, eigfact!, eigmin, eps, erf, erfc, erfcinv, erfcx, erfi, erfinv, exp, exp10, exp2, expm1, exponent, factor, factorial, factorize, floor, gcd, invmod, log, log10, log1p, log2, logspace, max, min, mod, mod1, modf, next, nextpow, nextprod, num, primes, primesmask, prod, realmin, sqrt, sum!, sumabs, sumabs!, sumabs2, sumabs2!,User Contributed Notes
Add a Note
The format of note supported is markdown, use triple backtick to start and end a code block.