Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Protect against weird bounds combinations #30

Merged
merged 1 commit into from
Jun 26, 2018
Merged

Protect against weird bounds combinations #30

merged 1 commit into from
Jun 26, 2018

Conversation

joaquimg
Copy link
Member

Fixes #21

There are a few test fails, two main kinds:

  1. adding multiple constraints of the same type, which will be blocked by this.

  2. ordered indices, we could add a version fo that ignoring SingleVariable constraints
    For all the linquad solvers these constraints are special...

@joaquimg joaquimg requested a review from odow June 20, 2018 02:19
setvariablebound!(m, v, set)
m.last_constraint_reference += 1
ref = SVCI{S}(m.last_constraint_reference)
ref = SVCI(v, set)
Copy link
Member

@odow odow Jun 20, 2018

Choose a reason for hiding this comment

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

Doesn't this impact the requirement to return constraints in the order that they were created?

sort(collect(keys(constrdict(m, CI{F,S}(UInt(0))))), by=x->x.value)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes it does.
I am proposing that this rule is not applied to Single variable constraints since we only have one of each - since they are tied to the variable reference they will be unique...

Copy link
Member Author

Choose a reason for hiding this comment

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

the well ordering on variables will keep these in some fixed order

Copy link
Member

Choose a reason for hiding this comment

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

I see the issue with http://www.juliaopt.org/MathOptInterface.jl/latest/apireference.html#MathOptInterface.ListOfConstraintIndices. We definitely want the constraint indices to be tied to the variable indices for bound-type constraints. On the other hand, we should be consistent with how constraints work across all classes of constraints. What about using an OrderedSet to maintain the list of constraints in the order they're added?

@joaquimg joaquimg merged commit 6f0fdd6 into master Jun 26, 2018
joaquimg added a commit that referenced this pull request Jun 26, 2018
Alternative protection for weird bound combination (temp replace for #30)
This was referenced Jun 27, 2018
@odow odow deleted the jg/addsinvar branch August 6, 2018 19:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants