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

ensure_integer_bounds #8

Merged
merged 6 commits into from
Dec 23, 2020
Merged

ensure_integer_bounds #8

merged 6 commits into from
Dec 23, 2020

Conversation

BochuanBob
Copy link
Contributor

Added a function to ensure the bounds of integer variables to be integral.

src/lp/ensure_integer_bounds.jl Outdated Show resolved Hide resolved
src/presolve.jl Outdated Show resolved Hide resolved
src/presolve.jl Outdated Show resolved Hide resolved
src/presolve.jl Outdated Show resolved Hide resolved
test/runtests.jl Outdated Show resolved Hide resolved
src/presolve.jl Outdated Show resolved Hide resolved
test/lp/ensure_integer_bounds.jl Outdated Show resolved Hide resolved
Comment on lines 17 to 18
varTypes = [MathOptPresolve.GENERAL_INTEGER, MathOptPresolve.CONTINUOUS,
MathOptPresolve.BINARY]
Copy link
Owner

Choose a reason for hiding this comment

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

How come varTypes only has 3 elements and we're not getting an error when loading the problem?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is indeed odd, would have thought this would catch it:

if var_types !== nothing
nvar == length(var_types) || error("")
end

Copy link
Collaborator

Choose a reason for hiding this comment

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

Did we figure out why this is happening?

Copy link
Owner

Choose a reason for hiding this comment

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

IDK

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the first version, the test function wasn't called in runtests.jl.

test/lp/ensure_integer_bounds.jl Outdated Show resolved Hide resolved
src/presolve.jl Outdated Show resolved Hide resolved
src/lp/ensure_integer_bounds.jl Outdated Show resolved Hide resolved
src/presolve.jl Outdated Show resolved Hide resolved
Comment on lines 17 to 18
varTypes = [MathOptPresolve.GENERAL_INTEGER, MathOptPresolve.CONTINUOUS,
MathOptPresolve.BINARY]
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is indeed odd, would have thought this would catch it:

if var_types !== nothing
nvar == length(var_types) || error("")
end

src/mip/ensure_integer_bounds.jl Outdated Show resolved Hide resolved
src/mip/ensure_integer_bounds.jl Outdated Show resolved Hide resolved
src/mip/ensure_integer_bounds.jl Outdated Show resolved Hide resolved
Copy link
Owner

@mtanneau mtanneau left a comment

Choose a reason for hiding this comment

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

As far as naming goes, I would prefer something in the likes of "Round integer bounds", following, e.g., the convention in this paper

src/mip/ensure_integer_bounds.jl Outdated Show resolved Hide resolved
src/mip/ensure_integer_bounds.jl Outdated Show resolved Hide resolved
src/presolve.jl Outdated Show resolved Hide resolved
src/presolve.jl Show resolved Hide resolved
Copy link
Collaborator

@joehuchette joehuchette left a comment

Choose a reason for hiding this comment

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

LGTM

src/presolve.jl Outdated Show resolved Hide resolved
test/mip/round_integer_bounds.jl Outdated Show resolved Hide resolved
test/mip/round_integer_bounds.jl Outdated Show resolved Hide resolved
@joehuchette
Copy link
Collaborator

@BochuanBob there are merge conflicts now that #7 landed. Thankfully, looks like they should be easy to fix. Can you fixup the PR? We can switch to the apply! interface in a separate PR, I think.

@codecov-io
Copy link

codecov-io commented Dec 23, 2020

Codecov Report

Merging #8 (e87677d) into master (68530b4) will increase coverage by 1.39%.
The diff coverage is 81.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #8      +/-   ##
==========================================
+ Coverage   45.17%   46.56%   +1.39%     
==========================================
  Files          12       13       +1     
  Lines         870      902      +32     
==========================================
+ Hits          393      420      +27     
- Misses        477      482       +5     
Impacted Files Coverage Δ
src/presolve.jl 45.28% <57.14%> (+0.66%) ⬆️
src/mip/round_integer_bounds.jl 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 68530b4...e87677d. Read the comment docs.

@joehuchette joehuchette merged commit ab77d9e into mtanneau:master Dec 23, 2020
@joehuchette
Copy link
Collaborator

Thanks, @BochuanBob, nice work!

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

Successfully merging this pull request may close these issues.

4 participants