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

1D element constraint for constant arrays #196

Closed
Wikunia opened this issue Dec 5, 2020 · 0 comments · Fixed by #213
Closed

1D element constraint for constant arrays #196

Wikunia opened this issue Dec 5, 2020 · 0 comments · Fixed by #213
Labels

Comments

@Wikunia
Copy link
Owner

Wikunia commented Dec 5, 2020

This is the first of several issues for the element constraint.

It would be great to index constant arrays with a variable like:

c = [1,2,3,7,9,10, 12]
@variable(m, 1 <= idx <= 7, Int)
@variable(m, 1 <= val <= 7, Int)
@constraint(m, c[idx] == val)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant