-
Notifications
You must be signed in to change notification settings - Fork 87
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
Indicator constraint support #709
Merged
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
049e4cb
first draft indicator cons
matbesancon a550983
fixed docstring
matbesancon d17ba8e
fixed LessThan
matbesancon 3bce12e
fix import
matbesancon 2ca54d9
last SmallerThan
matbesancon c3c2fa6
copy correct impl
matbesancon 6e57763
generic vec
matbesancon 9db213a
Revert "generic vec"
matbesancon 9c0e8b6
changed dim and doc
matbesancon 255c409
ActiveCond type parameter
matbesancon d741b61
enums + constraint
matbesancon 232d5bf
capital enum values
matbesancon f940ea8
relax type constraint on S
matbesancon 6ce7a65
latex escaping, naming
matbesancon 18e9168
explicit set name
matbesancon 8621773
test 1 indicator
matbesancon c10e1b9
penalized version
matbesancon e7bb25b
add reference, fixed doc, tests
matbesancon 4d889be
Merge branch 'master' into indicator-cons
matbesancon ab42f21
fix test formatting and errors
matbesancon 8da75e0
fix conflict
matbesancon d15fd9a
test in main, example usage
matbesancon 4bc4d9e
split tests
matbesancon 24af034
fix test 2
matbesancon f60c3c8
added test
matbesancon 1560400
remove unsupported tests, names
matbesancon 74836af
test passing
matbesancon e89d734
fix support
matbesancon d9565d6
fix style
matbesancon 3c0155e
copy implementation and test
matbesancon c7f926e
fix comments, added test for ACTIVE_ON_ZERO
matbesancon 9d85fee
test support indicator
matbesancon 82d3d56
explicit comment
matbesancon 01f8690
fix conflict
matbesancon caeb4c4
add mutable test
matbesancon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check that modifying the set in
s1
does not modify the set ins1_copy
. You will need a scalar set which is mutableThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we even have one? I understand the importance of testing it does not happen, but we are calling copy on the subtest, so if error there is, it's because
copy
is not properly implemented on itThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matbesancon
LessThan{BigInt}
is mutable becauseBigInt
is mutable. You call also create a dummy mutable coefficient type or a dummy mutable set just for the test.That's what we want to test. If you remove this copy on the subset, the tests still pass while they shouldn't
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blegat I played a bit with this idea. Fundamentally, this is breaking an assumption about numbers that will be everywhere in MOI, this PR doesn't change that.
BigInt
being mutable is just a constraint for their construction as far as I know, not supposed to be used.The implementation from
src/sets
:Is then false because it should check
isbits
on the setThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. We could defer the question of whether we should copy the field of EqualTo... to a separate issue.
Still you might be able to create a mutable abstract set with Float64 to test the fact we ce copy the set for IndicatorSet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blegat see issue #721, and tests added here for
IndicatorSet
copy