Lowry
Lowry

Reputation: 55

julia/ JuMP: no method matching ndims

right now I want to get myself more familiar within the filed of linear programming using julia/JuMP. More specifically, I'm trying to implement the algorithm for benders decomposition. Since I'm stuck at certain parts, I wanted to look into other implementations which did similar before. Fortunately, I could find one in the official tutorial section of JuMP: https://jump.dev/JuMP.jl/stable/tutorials/Optimization%20concepts/benders_decomposition/

https://github.com/jump-dev/JuMP.jl/blob/master/docs/src/tutorials/Optimization%20concepts/benders_decomposition.jl

Unfortunately I can not execute it. It crashes within the first iteration:

with fm_current = 1.0e6
x_current = [0.0, 0.0]
ERROR: LoadError: MethodError: no method matching ndims(::AffExpr)
Closest candidates are:
  ndims(::GenericQuadExpr) at C:\Users\Laurenz\.julia\packages\JuMP\Xrr7O\src\quad_expr.jl:54
  ndims(::Base.Generator) at generator.jl:53
  ndims(::JuMP.Containers.VectorizedProductIterator) at C:\Users\Laurenz\.julia\packages\JuMP\Xrr7O\src\Containers\vectorized_product_iterator.jl:73
  ...
Stacktrace:

all of my julia packages are up to date.

It crashes within the MutableArithmetics.jl in this line:

Maybe someone has this code already running or could simply try to run it. Would be much appreciated! Thank you:)

Upvotes: 2

Views: 144

Answers (1)

Matěj Račinský
Matěj Račinský

Reputation: 1804

It works fine with julia 1.5.4 and following versions of packages

(jump_playground) pkg> st
Status `C:\Projects\jump_playground\Project.toml`
  [60bf3e95] GLPK v0.14.12
  [4076af6c] JuMP v0.21.9
  [8dfed614] Test

sometimes when you update versions of packages, you need to restart the julia REPL. Also, if you are using some much older version of julia or the package it may not work, in that case it's good to update using ] up.

Upvotes: 1

Related Questions