-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
Rational infinite constraints do not work anymore #2894
Comments
This is incorrect. We converted everything to We got rid of infinite bounds julia> using JuMP
julia> model = Model();
julia> @variable(model, 0 <= x <= Inf)
x
julia> has_upper_bound(x)
false so you can specify them, but they won't be passed to the solver. I'd have to dig into why the rationalize is throwing that error instead of something more informative. However, what does this even mean? julia> Rational{Int}(Inf)
1//0 Even if you could pass GLPK rational coefficients, I don't think you can pass |
Ah. The error is coming from julia> convert(Rational{Int}, NaN)
ERROR: InexactError: Int64(NaN)
Stacktrace:
[1] Int64
@ ./float.jl:723 [inlined]
[2] rationalize(#unused#::Type{Int64}, x::Float64, tol::Int64)
@ Base ./rational.jl:162
[3] #rationalize#184
@ ./rational.jl:217 [inlined]
[4] Rational
@ ./rational.jl:120 [inlined]
[5] convert(#unused#::Type{Rational{Int64}}, x::Float64)
@ Base ./number.jl:7
[6] top-level scope
@ REPL[38]:1 This method is incorrect if Lines 118 to 136 in 9b4847a
|
Thanks @odow for the quick fix! Do you mind releasing a new version? |
We'll probably wait a few more days before releasing 0.23.1. There are some in-progress PRs I'd like to get in first. I'd encourage you to remove the |
Sure, sounds good 👍 |
I noticed the following behavioral change in #2618:
In previous versions you could use solvers like
GLPK
withRational
numbers and infinite bounds:After the change in #2618, the last command fails because the bounds are now replaced by
NaN
and then in the end a call torationalize
fails:Indeed:
I would like to ask whether you consider bringing back the support for
Rational
inputs or whether users should rather avoid such cases instead.The text was updated successfully, but these errors were encountered: