Skip to content

Commit

Permalink
Add missing convert
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Aug 24, 2024
1 parent c3f1803 commit fd75bf7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/constraints/all_different.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ function Base.convert(
return MOIAllDifferent(T[], MOI.dimension(set))
end

function Base.convert(
::Type{MOI.AllDifferent},
set::MOIAllDifferent,
)
if !isempty(set.vals)
throw(InexactError(:convert, MOI.AllDifferent, set))
end
return MOI.AllDifferent(MOI.dimension(set))
end

"""
Global constraint ensuring that all the values of a given configuration are unique.
Expand Down

0 comments on commit fd75bf7

Please sign in to comment.