You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Because of #6721 it is necessary to specify the parameters explicitly here.
281
+
282
+
"""
283
+
eigfact(A::Union{SymTridiagonal, Hermitian, Symmetric}, irange::UnitRange) -> Eigen
284
+
285
+
Computes the eigenvalue decomposition of `A`, returning an `Eigen` factorization object `F`
286
+
which contains the eigenvalues in `F[:values]` and the eigenvectors in the columns of the
287
+
matrix `F[:vectors]`. (The `k`th eigenvector can be obtained from the slice `F[:vectors][:, k]`.)
288
+
289
+
The following functions are available for `Eigen` objects: [`inv`](@ref), [`det`](@ref), and [`isposdef`](@ref).
290
+
291
+
The `UnitRange` `irange` specifies indices of the sorted eigenvalues to search for.
292
+
293
+
!!! note
294
+
If `irange` is not `1:n`, where `n` is the dimension of `A`, then the returned factorization
295
+
will be a *truncated* factorization.
296
+
"""
281
297
eigfact{T1<:Real,T2}(A::RealHermSymComplexHerm{T1,T2}, irange::UnitRange) = (T =eltype(A); S =promote_type(Float32, typeof(zero(T)/norm(one(T)))); eigfact!(S != T ?convert(AbstractMatrix{S}, A) :copy(A), irange))
# Because of #6721 it is necessary to specify the parameters explicitly here.
289
320
eigvals{T1<:Real,T2}(A::RealHermSymComplexHerm{T1,T2}) = (T =eltype(A); S =promote_type(Float32, typeof(zero(T)/norm(one(T)))); eigvals!(S != T ?convert(AbstractMatrix{S}, A) :copy(A)))
Returns the eigenvalues of `A`. It is possible to calculate only a subset of the
334
+
eigenvalues by specifying a `UnitRange` `irange` covering indices of the sorted eigenvalues,
335
+
e.g. the 2nd to 8th eigenvalues.
336
+
337
+
```jldoctest
338
+
julia> A = SymTridiagonal([1.; 2.; 1.], [2.; 3.])
339
+
3×3 SymTridiagonal{Float64}:
340
+
1.0 2.0 ⋅
341
+
2.0 2.0 3.0
342
+
⋅ 3.0 1.0
343
+
344
+
julia> eigvals(A, 2:2)
345
+
1-element Array{Float64,1}:
346
+
1.0
347
+
348
+
julia> eigvals(A)
349
+
3-element Array{Float64,1}:
350
+
-2.14005
351
+
1.0
352
+
5.14005
353
+
```
354
+
"""
293
355
eigvals{T1<:Real,T2}(A::RealHermSymComplexHerm{T1,T2}, irange::UnitRange) = (T =eltype(A); S =promote_type(Float32, typeof(zero(T)/norm(one(T)))); eigvals!(S != T ?convert(AbstractMatrix{S}, A) :copy(A), irange))
0 commit comments