Skip to content

Commit bee135b

Browse files
committed
Even more vals fun
1 parent 81f058b commit bee135b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/implementations/svd.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,14 @@ function svd_compact!(A, USVᴴ, alg::DiagonalAlgorithm)
270270
end
271271
function svd_vals!(A::AbstractMatrix, S, alg::DiagonalAlgorithm)
272272
check_input(svd_vals!, A, S, alg)
273+
m, n = size(A)
274+
minmn = min(m, n)
275+
if minmn == 0
276+
one!(U)
277+
zero!(S)
278+
one!(Vᴴ)
279+
return USVᴴ
280+
end
273281
Ad = diagview(A)
274282
S .= abs.(Ad)
275283
sort!(S; rev = true)

0 commit comments

Comments
 (0)