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

Refactor GRBupdatemodel calls #552

Merged
merged 10 commits into from Mar 26, 2024
19 changes: 10 additions & 9 deletions src/MOI_wrapper/MOI_wrapper.jl
Expand Up @@ -1038,6 +1038,7 @@
# We throw away name_to_constraint_index so we will rebuild VariableIndex
# constraint names without v.
model.name_to_constraint_index = nothing
# _require_update(model, model_change = true)
torressa marked this conversation as resolved.
Show resolved Hide resolved
_update_if_necessary(model, force = true)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only update remaining for variable deletion as is needed for the test_Buffered_deletion_test case (linked earlier)

return
end
Expand All @@ -1055,7 +1056,7 @@
# We throw away name_to_constraint_index so we will rebuild VariableIndex
# constraint names without v.
model.name_to_constraint_index = nothing
_update_if_necessary(model, force = true)
_require_update(model, model_change = true)
return
end

Expand Down Expand Up @@ -1565,7 +1566,7 @@
end
info.upper_bound_if_bounded = NaN
model.name_to_constraint_index = nothing
_update_if_necessary(model)
_require_update(model, attribute_change = true)
return
end

Expand Down Expand Up @@ -1680,7 +1681,7 @@
end
info.lower_bound_if_bounded = NaN
model.name_to_constraint_index = nothing
_update_if_necessary(model)
_require_update(model, attribute_change = true)
return
end

Expand All @@ -1696,7 +1697,7 @@
info.bound = _NONE
info.upper_bound_if_bounded = info.lower_bound_if_bounded = NaN
model.name_to_constraint_index = nothing
_update_if_necessary(model)
_require_update(model, attribute_change = true)
return
end

Expand All @@ -1712,7 +1713,7 @@
info.bound = _NONE
info.upper_bound_if_bounded = info.lower_bound_if_bounded = NaN
model.name_to_constraint_index = nothing
_update_if_necessary(model)
_require_update(model, attribute_change = true)
return
end

Expand Down Expand Up @@ -1860,7 +1861,7 @@
_check_ret(model, ret)
info.type = GRB_CONTINUOUS
model.name_to_constraint_index = nothing
_update_if_necessary(model)
_require_update(model, attribute_change = true)
return
end

Expand Down Expand Up @@ -1898,7 +1899,7 @@
_check_ret(model, ret)
info.type = GRB_CONTINUOUS
model.name_to_constraint_index = nothing
_update_if_necessary(model)
_require_update(model, attribute_change = true)

Check warning on line 1902 in src/MOI_wrapper/MOI_wrapper.jl

View check run for this annotation

Codecov / codecov/patch

src/MOI_wrapper/MOI_wrapper.jl#L1902

Added line #L1902 was not covered by tests
return
end

Expand Down Expand Up @@ -1946,7 +1947,7 @@
_check_ret(model, ret)
info.type = GRB_CONTINUOUS
model.name_to_constraint_index = nothing
_update_if_necessary(model)
_require_update(model, attribute_change = true)
return
end

Expand Down Expand Up @@ -2000,7 +2001,7 @@
_check_ret(model, ret)
info.type = GRB_CONTINUOUS
model.name_to_constraint_index = nothing
_update_if_necessary(model)
_require_update(model, attribute_change = true)
return
end

Expand Down Expand Up @@ -2592,7 +2593,7 @@
return isempty(searchsorted(cs_values, pair.first))
end
model.name_to_constraint_index = nothing
_update_if_necessary(model, force = true)

Check warning on line 2596 in src/MOI_wrapper/MOI_wrapper.jl

View check run for this annotation

Codecov / codecov/patch

src/MOI_wrapper/MOI_wrapper.jl#L2596

Added line #L2596 was not covered by tests
return
end

Expand Down Expand Up @@ -3503,7 +3504,7 @@
Ref{Cdouble}(chg.new_coefficient),
)
_check_ret(model, ret)
_require_update(model, model_change = true)

Check warning on line 3507 in src/MOI_wrapper/MOI_wrapper.jl

View check run for this annotation

Codecov / codecov/patch

src/MOI_wrapper/MOI_wrapper.jl#L3507

Added line #L3507 was not covered by tests
return
end

Expand Down