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
Copy file name to clipboardExpand all lines: src/svd.jl
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ end
19
19
20
20
functionsvdIter!(B::Bidiagonal{T}, n1, n2, shift, U =nothing, Vᴴ =nothing) where T<:Real
21
21
22
-
ifistriu(B)
22
+
ifB.uplo ==='U'
23
23
24
24
d = B.dv
25
25
e = B.ev
@@ -71,7 +71,7 @@ end
71
71
# See LAWN 3
72
72
functionsvdDemmelKahan!(B::Bidiagonal{T}, n1, n2, U =nothing, Vᴴ =nothing) where T<:Real
73
73
74
-
ifistriu(B)
74
+
ifB.uplo ==='U'
75
75
76
76
d = B.dv
77
77
e = B.ev
@@ -137,7 +137,7 @@ function __svd!(B::Bidiagonal{T}, U = nothing, Vᴴ = nothing; tol = 100eps(T),
137
137
fudge = n
138
138
thresh = tol*σ⁻
139
139
140
-
ifistriu(B)
140
+
ifB.uplo ==='U'
141
141
whiletrue
142
142
143
143
# Search for biggest index for non-zero off diagonal value in e
@@ -252,7 +252,7 @@ function bidiagonalize!(A::AbstractMatrix)
252
252
253
253
if m >= n
254
254
# tall case: upper bidiagonal
255
-
for i =1:min(m, n)
255
+
for i in1:min(m, n)
256
256
x =view(A, i:m, i)
257
257
τi = LinearAlgebra.reflector!(x)
258
258
push!(τl, τi)
@@ -271,7 +271,7 @@ function bidiagonalize!(A::AbstractMatrix)
271
271
returnBidiagonalFactorization{eltype(bd),typeof(bd.dv),typeof(A),typeof(τl)}(bd, A, τl, τr)
272
272
else
273
273
# wide case: lower bidiagonal
274
-
for i =1:min(m, n)
274
+
for i in1:min(m, n)
275
275
x =view(A, i, i:n)
276
276
conj!(x)
277
277
τi = LinearAlgebra.reflector!(x)
@@ -299,7 +299,7 @@ function Base.getproperty(F::BidiagonalFactorization, s::Symbol)
299
299
R =getfield(F, :reflectors)
300
300
τl =getfield(F, :τl)
301
301
τr =getfield(F, :τr)
302
-
ifistriu(BD)
302
+
ifBD.uplo ==='U'
303
303
if s ===:leftQ
304
304
return LinearAlgebra.QRPackedQ(R, τl)
305
305
elseif s ===:rightQ
@@ -559,13 +559,13 @@ function LinearAlgebra.svd!(A::StridedMatrix{T};
559
559
# |x x x x x| |O O O| | x x| |O O O O O|
560
560
561
561
_B = BF.bidiagonal
562
-
B =istriu(_B)? _B :Bidiagonal(_B.dv, _B.ev, :U)
562
+
B =_B.uplo ==='U'? _B :Bidiagonal(_B.dv, _B.ev, :U)
563
563
564
564
# Compute the SVD of the bidiagonal matrix B
565
565
F =_svd!(B, tol = tol, debug = debug)
566
566
567
567
# Form the matrices U and Vᴴ by combining the singular vector matrices of the bidiagonal SVD with the Householder reflectors from the bidiagonal factorization.
0 commit comments