I wish to iterate over the variables contained in a JuMP.SparseAxisArray so that I can write out variable values using JuMP.value(var), where var is an entry in the array.
I would also like to obtain the value of the index of the variable. So far I’ve tried var.index and JuMP.index(var) just return an integer, rather than the index set I defined using the @variable macro.
I have the same question. Before update my JuMP version I was able to sweep the index of my variable easily, like:
for key in (sort!(collect(keys(var))))
but I cannot find another way to do it in JuMP 0.9. That’s really bad because my whole set of variables is multi-index (like, [“id”,“region”,“city”] and it’s very important to me be able to sweep the index in many parts of my code.