Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion error in Loadproblem! #238

Open
ivanrudnick opened this issue Feb 10, 2020 · 1 comment
Open

Assertion error in Loadproblem! #238

ivanrudnick opened this issue Feb 10, 2020 · 1 comment

Comments

@ivanrudnick
Copy link

ivanrudnick commented Feb 10, 2020

I am trying to run and optimization problem using Gurobi with JuMP 0.18. However the model fails with the following error:

Assertion error: rowub[i]< posinf
in solve at JuMP\I7whV\src\solvers.jl:150
in #solve#105 at JuMP\I7whV\src\solvers.jl:168
in #build at base\none
in #build#108 at JuMP\I7whV\src\solvers.jl:373
in loadproblem! at Gurobi\TX8tY\srcMPB_wrapper.jl:161

I have been trying to find the cause behind this error without any success. The error is being triggered in the following script:

  rangeconstrs = sum((rowlb .!= rowub) .& (rowlb .> neginf) .& (rowub .< posinf))
  if rangeconstrs > 0
      @warn("Julia Gurobi interface doesn't properly support range " *
            "(two-sided) constraints. See Gurobi.jl issue #14")
      add_rangeconstrs!(m.inner, float(A), float(rowlb), float(rowub))
      # A work around for the additional slack variables introduced and the
      # reformulation bug warning
      append!(obj, zeros(rangeconstrs))
  else
      b = Array{Float64}(undef, length(rowlb))
      senses = Array{Cchar}(undef, length(rowlb))
      for i in 1:length(rowlb)
          if rowlb[i] == rowub[i]
              senses[i] = '='
              b[i] = rowlb[i]
          elseif rowlb[i] > neginf
              senses[i] = '>'
              b[i] = rowlb[i]
          else
              @assert rowub[i] < posinf
              senses[i] = '<'
              b[i] = rowub[i]
          end
      end
      add_constrs!(m.inner, float(A), senses, b)
  end

Thank you

Edit(odow): formatting

@odow
Copy link
Member

odow commented Feb 10, 2020

Are you passing a constraint with a lower-bound of -Inf and an upper-bound of Inf?

Is there any reason to use JuMP 0.18? We'd recommend that you upgrade to JuMP 0.20.

p.s.: In future, questions like this are better asked on the Discourse forum. It's easier to help if you read the first post of this PSA and provide a minimal working example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants