Skip to content

Commit e014d0e

Browse files
committed
merge some defaultsupdate docstrings
1 parent 9d04ffb commit e014d0e

1 file changed

Lines changed: 32 additions & 14 deletions

File tree

src/interface/decompositions.jl

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,15 @@ default_householder_driver(::Type{<:Base.ReshapedArray{T, N, A}}) where {T, N, A
104104
Algorithm type to denote the algorithm for computing the eigenvalue decomposition of a Hermitian matrix,
105105
or the singular value decomposition of a general matrix using the divide-and-conquer algorithm.
106106
107+
The optional `driver` symbol can be used to choose between different implementations of this algorithm.
107108
The `fixgauge` keyword can be used to toggle whether or not to fix the gauge of the eigen or singular vectors, see also [`gaugefix!`](@ref).
108109
"""
109110
@algdef DivideAndConquer
110111

111112
"""
112113
SafeDivideAndConquer(; [driver], kwargs...)
113114
114-
Algorithm type to denote the algorithm for computing the eigenvalue decomposition of a Hermitian matrix,
115+
Algorithm type to for computing the eigenvalue decomposition of a Hermitian matrix,
115116
or the singular value decomposition of a general matrix using the divide-and-conquer algorithm,
116117
with an additional fallback to the standard QR iteration algorithm in case the former fails to converge.
117118
@@ -128,15 +129,35 @@ See also [`DivideAndConquer`](@ref) and [`QRIteration`](@ref).
128129
@algdef SafeDivideAndConquer
129130

130131
"""
131-
QRIteration(; [driver], kwargs...)
132+
QRIteration(; [driver], fixgauge = true)
132133
133-
Algorithm type to denote the algorithm for computing the eigenvalue decomposition of a Hermitian matrix,
134+
Algorithm type for computing the eigenvalue decomposition of a Hermitian matrix,
134135
or the singular value decomposition of a general matrix via QR iteration.
135136
137+
The optional `driver` symbol can be used to choose between different implementations of this algorithm.
136138
The `fixgauge` keyword can be used to toggle whether or not to fix the gauge of the eigen or singular vectors, see also [`gaugefix!`](@ref).
137139
"""
138140
@algdef QRIteration
141+
142+
"""
143+
Bisection(; [driver], fixgauge::Bool = true)
144+
145+
Algorithm type for computing the eigenvalue decomposition of a Hermitian matrix,
146+
or the singular value decomposition of a general matrix via the bisection algorithm.
147+
148+
The optional `driver` symbol can be used to choose between different implementations of this algorithm.
149+
The `fixgauge` keyword can be used to toggle whether or not to fix the gauge of the eigen or singular vectors, see also [`gaugefix!`](@ref).
150+
"""
139151
@algdef Bisection
152+
153+
"""
154+
Jacobi(; [driver], fixgauge = true)
155+
156+
Algorithm type for computing the singular value decomposition of a general matrix using the Jacobi algorithm.
157+
158+
The optional `driver` symbol can be used to choose between different implementations of this algorithm.
159+
The `fixgauge` keyword can be used to toggle whether or not to fix the gauge of the eigen or singular vectors, see also [`gaugefix!`](@ref).
160+
"""
140161
@algdef Jacobi
141162

142163
"""
@@ -146,31 +167,28 @@ Algorithm type to denote the algorithm for computing the singular value decompos
146167
matrix via Halley's iterative algorithm for the polar decomposition followed by the Hermitian
147168
eigenvalue decomposition of the positive definite factor.
148169
149-
The `fixgauge` keyword can be used to toggle whether or not to fix the gauge of the singular vectors,
150-
see also [`gaugefix!`](@ref).
170+
The optional `driver` symbol can be used to choose between different implementations of this algorithm.
171+
The `fixgauge` keyword can be used to toggle whether or not to fix the gauge of the eigen or singular vectors, see also [`gaugefix!`](@ref).
151172
"""
152173
@algdef SVDPolar
153174

154-
for f in (:safe_divide_and_conquer, :divide_and_conquer, :qr_iteration, :bisection, :jacobi)
175+
for f in (:safe_divide_and_conquer, :divide_and_conquer, :qr_iteration, :bisection, :jacobi, :svd_polar)
155176
default_f_driver = Symbol(:default_, f, :_driver)
156177
@eval begin
157178
$default_f_driver(A) = $default_f_driver(typeof(A))
158179
$default_f_driver(::Type) = Native()
159180

160-
$default_f_driver(::Type{A}) where {A <: YALAPACK.MaybeBlasMat} = LAPACK()
181+
if f !== :svd_polar
182+
$default_f_driver(::Type{A}) where {A <: YALAPACK.MaybeBlasMat} = LAPACK()
183+
# note: StridedVector fallback is needed for handling reshaped parent types
184+
$default_f_driver(::Type{A}) where {A <: StridedVector{<:BlasFloat}} = LAPACK()
185+
end
161186

162-
# note: StridedVector fallback is needed for handling reshaped parent types
163-
$default_f_driver(::Type{A}) where {A <: StridedVector{<:BlasFloat}} = LAPACK()
164187
$default_f_driver(::Type{<:SubArray{T, N, A}}) where {T, N, A} = $default_f_driver(A)
165188
$default_f_driver(::Type{<:Base.ReshapedArray{T, N, A}}) where {T, N, A} = $default_f_driver(A)
166189
end
167190
end
168191

169-
default_svd_polar_driver(A) = default_svd_polar_driver(typeof(A))
170-
default_svd_polar_driver(::Type) = Native()
171-
default_svd_polar_driver(::Type{<:SubArray{T, N, A}}) where {T, N, A} = default_svd_polar_driver(A)
172-
default_svd_polar_driver(::Type{<:Base.ReshapedArray{T, N, A}}) where {T, N, A} = default_svd_polar_driver(A)
173-
174192
# General Eigenvalue Decomposition
175193
# -------------------------------
176194
"""

0 commit comments

Comments
 (0)