Skip to content

Commit

Permalink
Fix RotatedSecondOrderCone NormedEpigraphDistance (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Oct 23, 2023
1 parent dc93010 commit 60ee2d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/distance_sets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ function distance_to_set(::DefaultDistance, v, s::Union{MOI.NormInfinityCone, MO
return distance_to_set(EpigraphViolationDistance(), v, s)
end

function distance_to_set(::NormedEpigraphDistance{p}, v::AbstractVector{<:Real}, s::MOI.RotatedSecondOrderCone) where {p}
function distance_to_set(::NormedEpigraphDistance{p}, v::AbstractVector{T}, s::MOI.RotatedSecondOrderCone) where {p,T<:Real}
_check_dimension(v, s)
t = v[1]
u = v[2]
xs = @view(v[3:end])
return LinearAlgebra.norm(
(max(-t, zero(t)), max(-u, zero(u)), max(LinearAlgebra.dot(xs,xs) - 2 * t * u)),
(max(-t, zero(T)), max(-u, zero(T)), max(LinearAlgebra.dot(xs,xs) - 2 * t * u, zero(T))),
p,
)
end
Expand Down

0 comments on commit 60ee2d2

Please sign in to comment.