Skip to content

Commit

Permalink
fix condition in svd
Browse files Browse the repository at this point in the history
  • Loading branch information
lpawela committed Aug 10, 2021
1 parent 650c672 commit 1d21a95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/linear_algebra_ext.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function LinearAlgebra.svd(A::AbstractMatrix, Dcut::Int, args...)
d = diag(U)
ph = d ./ abs.(d)
for i eachindex(ph)
@inbounds ph[i] = ifelse(isapprox(ph[i], 0, atol=1e-14), 1, ph[i])
@inbounds ph[i] = ifelse(isapprox(d[i], 0, atol=1e-14), 1, ph[i])
end
return U * Diagonal(ph), Σ, V * Diagonal(ph)
end

2 comments on commit 1d21a95

@lpawela
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/42534

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.3 -m "<description of version>" 1d21a955fa6a77739113dfdf8ec9325ec3f6d107
git push origin v0.1.3

Please sign in to comment.