Skip to content

Assertion error in Loadproblem! #238

Description

@ivanrudnick

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions