ConstraintSolver.jl icon indicating copy to clipboard operation
ConstraintSolver.jl copied to clipboard

2D element constraint for constant arrays

Open Wikunia opened this issue 5 years ago • 0 comments

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)

Wikunia avatar Dec 05 '20 16:12 Wikunia