We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36e9840 commit 9fab19cCopy full SHA for 9fab19c
src/svd.jl
@@ -133,7 +133,7 @@ end
133
134
# count positive singular values S ≥ given tolerances, S assumed sorted
135
function _count_svdvals(S, atol::Real, rtol::Real)
136
- tol = isempty(S) ? atol : max(rtol*S[1], atol)
+ tol = max(rtol * (isempty(S) ? zero(eltype(S)) : S[1]), atol)
137
return iszero(S[1]) ? 0 : searchsortedlast(S, tol, rev=true)
138
end
139
0 commit comments