I have a vector ( Vector{VariableRef}
) :
@variable(model,v[1:2583)])
I want to choose some indices by means of irreversible_indices
which I get it’s type as Vector{Int64}
but when I try to run this :
v[irreversible_indices]
this is the error:
BoundsError: attempt to access 2583-element Vector{VariableRef} at index [[0, 1, 4, 5, 6, 7, 8, 9, 10, 12 … 2571, 2572, 2574, 2576, 2577, 2578, 2579, 2580, 2581, 2582]]
or if I try like this :
@constraint(model,[j in irreversible_indices],v[j]>=0)
error:
BoundsError: attempt to access 2583-element Vector{VariableRef} at index [0]
however if I print elements of irreversible_indices
the result is like 0, 1, 5, 6 ,… not [0], [1], [5]…
what is wrong here???