Skip to content

Commit

Permalink
Fix bug in relax_integrality (#2666)
Browse files Browse the repository at this point in the history
If solvers don't support querying start values, relax_integrality
will error. In practice, the start value isn't used.
  • Loading branch information
odow authored Aug 20, 2021
1 parent 36933b6 commit 0975852
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/variables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1244,10 +1244,15 @@ function _info_from_variable(v::VariableRef)
ub = has_ub ? upper_bound(v) : Inf
has_fix = is_fixed(v)
fixed_value = has_fix ? fix_value(v) : NaN
start_or_nothing = start_value(v)
has_start = !(start_or_nothing isa Nothing)
start = has_start ? start_or_nothing : NaN
has_start = start !== Nothing
has_start, start = false, NaN
if MOI.supports(
backend(owner_model(v)),
MOI.VariablePrimalStart(),
MOI.VariableIndex,
)
start = start_value(v)
has_start = start !== nothing
end
binary = is_binary(v)
integer = is_integer(v)
return VariableInfo(
Expand Down

0 comments on commit 0975852

Please sign in to comment.