Wikunia / ConstraintSolver.jl

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

2D element constraint for constant arrays #197

Open Wikunia opened 3 years ago

Wikunia commented 3 years ago

This is the second of several issues for the element constraint. (See #196 )

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

c = rand(1:100, (5, 5))
@variable(m, 1 <= idx <= 5, Int)
@variable(m, 1 <= idy <= 5, Int)
@constraint(m, c[idx, idy] == 5)