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 420cf53 commit b7b88ccCopy full SHA for b7b88cc
src/Utilities/distance_to_set.jl
@@ -541,7 +541,6 @@ function distance_to_set(
541
# so it's the Frobenius norm.
542
# The Frobenius norm of `A` which is Euclidean
543
# norm of the vector of eigenvalues.
544
- return √sum(LinearAlgebra.eigvals(_reshape(x, set))) do λ
545
- min(λ, zero(T))^2
546
- end
+ eigvals = LinearAlgebra.eigvals(_reshape(x, set))
+ return sqrt(sum(min.(zero(T), eigvals).^2))
547
end
0 commit comments