Wikunia / ConstraintSolver.jl

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

1D element constraint for variable arrays #198

Open Wikunia opened 3 years ago

Wikunia commented 3 years ago

This is the third of several issues for the element constraint. (See #196 and #197 ) It's also the more formal issue for #195 and #164

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

@variable(m, 1 <= c[1:7] <= 10, Int)
@variable(m, 1 <= idx <= 7, Int)
@constraint(m, c[idx] == 5)