Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for MOI.EqualTo{Bool} #59

Merged
merged 2 commits into from
Jan 31, 2024
Merged

Add support for MOI.EqualTo{Bool} #59

merged 2 commits into from
Jan 31, 2024

Conversation

odow
Copy link
Member

@odow odow commented Jan 31, 2024

Closes #58

Copy link

codecov bot commented Jan 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (01bc0f7) 97.45% compared to head (1df0a13) 97.45%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #59   +/-   ##
=======================================
  Coverage   97.45%   97.45%           
=======================================
  Files           3        3           
  Lines         471      471           
=======================================
  Hits          459      459           
  Misses         12       12           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@odow
Copy link
Member Author

odow commented Jan 31, 2024

This now works:

julia> using JuMP, MiniZinc

julia> model = GenericModel{Int}(() -> MiniZinc.Optimizer{Int}("chuffed"));

julia> @variable(model, 1 <= x[1:3] <= 3);

julia> @constraint(model, x in MOI.AllDifferent(3));

julia> @constraint(model, x[1] == 2 || x[3] == 2 := true)
(x[1] == 2) || (x[3] == 2) = true

julia> @objective(model, Max, sum(i * x[i] for i in 1:3));

julia> optimize!(model)

julia> value.(x)
3-element Vector{Int64}:
 2
 1
 3

@odow odow merged commit ae53ede into master Jan 31, 2024
7 checks passed
@odow odow deleted the od/EqualTo{Bool} branch January 31, 2024 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Support EqualTo{Bool}
1 participant