Wikunia / ConstraintSolver.jl

ConstraintSolver in Julia: Blog posts ->
https://opensourc.es/blog/constraint-solver-1
MIT License
136 stars 14 forks source link

1D element constraint for constant arrays #196

Closed Wikunia closed 2 years ago

Wikunia commented 3 years ago

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)