We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6067a4f commit cd8026bCopy full SHA for cd8026b
1 file changed
src/Utilities/distance_to_set.jl
@@ -557,3 +557,14 @@ function distance_to_set(
557
eigvals .= min.(zero(T), eigvals)
558
return LinearAlgebra.norm(eigvals, 2)
559
end
560
+
561
+function distance_to_set(
562
+ x::AbstractVector{T},
563
+ set::MOI.VectorNonlinearOracle,
564
+) where {T<:Real}
565
+ _check_dimension(x, set)
566
+ y = zeros(set.output_dimension)
567
+ set.eval_f(y, x)
568
+ point = clamp.(y, set.l, set.u)
569
+ return LinearAlgebra.norm(y .- point, 2)
570
+end
0 commit comments