Julia Vscode new version issue with JuMP

afazevedo
Wed, 15 Jul 2020 15:47:33 +0000
Optimization (Mathematical)

I’m having a problem with SparsesAxisArray JuMP on Julia for Vscode.
When I use @variable with this condition below, it reproduces an error

using Gurobi, JuMP

model = Model(Gurobi.Optimizer)

n = 5
V = 1:n
V0= 1:n+1

@variable(model, x[i in V0, j in V; i != j], Bin) #this not work

Defines: JuMP.Containers.SparseAxisArray{VariableRef,2,Tuple{Int64,Int64}} with 25 entries:
but in the end, reproduces:

Internal Error: ERROR: MethodError: no method matching size(::JuMP.Containers.SparseAxisArray{VariableRef,2,Tuple{Int64,Int64}})
Closest candidates are:
  size(::AbstractArray{T,N}, ::Any) where {T, N} at abstractarray.jl:38
  size(::BitArray{1}) at bitarray.jl:99
  size(::BitArray{1}, ::Integer) at bitarray.jl:103

I figured out that if i return to previous version 0.15.40 of Julia package on Vscode, this code works perfectly. Any suggestions?

Thanks in advance!

5 posts - 4 participants