Hello!
I wonder how to add a SOS2 constraint with JuMP for a variable which is defined over a DenseAxisArray or SparseAxisArray? For example:
using JuMP
mymod = Model();
#sets
node = ["n1", "n2", "n3"]
#declare variables
@variable(mymod, r[node], lower_bound = 0)
print(r)
#add sos2 constraint
@constraint(mymod, q_1, r in SOS2([1.0, 2.0, 3.0]) )
The error I get is:
ERROR: LoadError: At /home/user/data/julia/testsos.jl:15: @constraint(mymod, q_1, r[:] in SOS2([1.0, 2.0, 3.0]))
: unable to add the constraint because we don’t recognize 1-dimensional DenseAxisArray{VariableRef,1,…} with index sets:
Dimension 1, [“n1”, “n2”, “n3”]
And data, a 3-element Array{VariableRef,1}:
r[n1]
r[n2]
r[n3] as a valid JuMP function.