Skip to content

Commit 6cc0405

Browse files
authored
Backports release 1.12 (#1379)
Backported PRs: - [x] #1364 <!-- clarify eigen docstring --> - [x] #1363 <!-- Change default symmetriceigen algorithm back to RobustRepresentations --> Non-merged PRs with backport label: - [ ] #1365 <!-- Add docstring to the `rank(::QRPivoted)` method --> - [ ] #1305 <!-- Bounds-checking in triangular indexing branches -->
2 parents 7264a49 + 73ff52d commit 6cc0405

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

src/eigen.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ end
182182
eigen(A; permute::Bool=true, scale::Bool=true, sortby) -> Eigen
183183
184184
Compute the eigenvalue decomposition of `A`, returning an [`Eigen`](@ref) factorization object `F`
185-
which contains the eigenvalues in `F.values` and the eigenvectors in the columns of the
185+
which contains the eigenvalues in `F.values` and the normalized eigenvectors in the columns of the
186186
matrix `F.vectors`. This corresponds to solving an eigenvalue problem of the form
187187
`Ax = λx`, where `A` is a matrix, `x` is an eigenvector, and `λ` is an eigenvalue.
188188
(The `k`th eigenvector can be obtained from the slice `F.vectors[:, k]`.)

src/symmetriceigen.jl

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ eigencopy_oftype(A::Symmetric{<:Complex}, S) = copyto!(similar(parent(A), S), A)
1010
default_eigen_alg(A)
1111
1212
Return the default algorithm used to solve the eigensystem `A v = λ v` for a symmetric matrix `A`.
13-
Defaults to `LinearAlegbra.DivideAndConquer()`, which corresponds to the LAPACK function `LAPACK.syevd!`.
13+
Defaults to `LinearAlegbra.RobustRepresentations()`, which corresponds to the LAPACK function `LAPACK.syevr!`.
1414
"""
15-
default_eigen_alg(@nospecialize(A)) = DivideAndConquer()
15+
default_eigen_alg(@nospecialize(A)) = RobustRepresentations()
1616

1717
# Eigensolvers for symmetric and Hermitian matrices
1818
function eigen!(A::RealHermSymComplexHerm{<:BlasReal,<:StridedMatrix}; alg::Algorithm = default_eigen_alg(A), sortby::Union{Function,Nothing}=nothing)
@@ -31,15 +31,15 @@ end
3131
eigen(A::Union{Hermitian, Symmetric}; alg::LinearAlgebra.Algorithm = LinearAlgebra.default_eigen_alg(A)) -> Eigen
3232
3333
Compute the eigenvalue decomposition of `A`, returning an [`Eigen`](@ref) factorization object `F`
34-
which contains the eigenvalues in `F.values` and the eigenvectors in the columns of the
34+
which contains the eigenvalues in `F.values` and the orthonormal eigenvectors in the columns of the
3535
matrix `F.vectors`. (The `k`th eigenvector can be obtained from the slice `F.vectors[:, k]`.)
3636
3737
Iterating the decomposition produces the components `F.values` and `F.vectors`.
3838
3939
`alg` specifies which algorithm and LAPACK method to use for eigenvalue decomposition:
40-
- `alg = DivideAndConquer()` (default): Calls `LAPACK.syevd!`.
40+
- `alg = DivideAndConquer()`: Calls `LAPACK.syevd!`.
4141
- `alg = QRIteration()`: Calls `LAPACK.syev!`.
42-
- `alg = RobustRepresentations()`: Multiple relatively robust representations method, Calls `LAPACK.syevr!`.
42+
- `alg = RobustRepresentations()` (default): Multiple relatively robust representations method, Calls `LAPACK.syevr!`.
4343
4444
See James W. Demmel et al, SIAM J. Sci. Comput. 30, 3, 1508 (2008) for
4545
a comparison of the accuracy and performance of different algorithms.
@@ -76,7 +76,7 @@ eigen!(A::RealHermSymComplexHerm{<:BlasReal,<:StridedMatrix}, irange::UnitRange)
7676
eigen(A::Union{SymTridiagonal, Hermitian, Symmetric}, irange::UnitRange) -> Eigen
7777
7878
Compute the eigenvalue decomposition of `A`, returning an [`Eigen`](@ref) factorization object `F`
79-
which contains the eigenvalues in `F.values` and the eigenvectors in the columns of the
79+
which contains the eigenvalues in `F.values` and the orthonormal eigenvectors in the columns of the
8080
matrix `F.vectors`. (The `k`th eigenvector can be obtained from the slice `F.vectors[:, k]`.)
8181
8282
Iterating the decomposition produces the components `F.values` and `F.vectors`.
@@ -101,7 +101,7 @@ eigen!(A::RealHermSymComplexHerm{T,<:StridedMatrix}, vl::Real, vh::Real) where {
101101
eigen(A::Union{SymTridiagonal, Hermitian, Symmetric}, vl::Real, vu::Real) -> Eigen
102102
103103
Compute the eigenvalue decomposition of `A`, returning an [`Eigen`](@ref) factorization object `F`
104-
which contains the eigenvalues in `F.values` and the eigenvectors in the columns of the
104+
which contains the eigenvalues in `F.values` and the orthonormal eigenvectors in the columns of the
105105
matrix `F.vectors`. (The `k`th eigenvector can be obtained from the slice `F.vectors[:, k]`.)
106106
107107
Iterating the decomposition produces the components `F.values` and `F.vectors`.
@@ -140,14 +140,18 @@ end
140140
Return the eigenvalues of `A`.
141141
142142
`alg` specifies which algorithm and LAPACK method to use for eigenvalue decomposition:
143-
- `alg = DivideAndConquer()` (default): Calls `LAPACK.syevd!`.
143+
- `alg = DivideAndConquer()`: Calls `LAPACK.syevd!`.
144144
- `alg = QRIteration()`: Calls `LAPACK.syev!`.
145-
- `alg = RobustRepresentations()`: Multiple relatively robust representations method, Calls `LAPACK.syevr!`.
145+
- `alg = RobustRepresentations()` (default): Multiple relatively robust representations method, Calls `LAPACK.syevr!`.
146146
147147
See James W. Demmel et al, SIAM J. Sci. Comput. 30, 3, 1508 (2008) for
148148
a comparison of the accuracy and performance of different methods.
149149
150150
The default `alg` used may change in the future.
151+
152+
!!! compat "Julia 1.12"
153+
The `alg` keyword argument requires Julia 1.12 or later.
154+
151155
"""
152156
function eigvals(A::RealHermSymComplexHerm; alg::Algorithm = default_eigen_alg(A), sortby::Union{Function,Nothing}=nothing)
153157
S = eigtype(eltype(A))

0 commit comments

Comments
 (0)