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 b7b88cc commit 109ab3dCopy full SHA for 109ab3d
src/Utilities/distance_to_set.jl
@@ -542,5 +542,6 @@ function distance_to_set(
542
# The Frobenius norm of `A` which is Euclidean
543
# norm of the vector of eigenvalues.
544
eigvals = LinearAlgebra.eigvals(_reshape(x, set))
545
- return sqrt(sum(min.(zero(T), eigvals).^2))
+ neg_eigvals = min.(zero(T), eigvals)
546
+ return LinearAlgebra.norm(neg_eigvals, 2)
547
end
0 commit comments