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

Do we need 5 >= x >= 1 #517

Closed
IainNZ opened this issue Aug 9, 2015 · 8 comments
Closed

Do we need 5 >= x >= 1 #517

IainNZ opened this issue Aug 9, 2015 · 8 comments

Comments

@IainNZ
Copy link
Collaborator

IainNZ commented Aug 9, 2015

We support @defVar(m, 5 >= x >= 1), but I'm not sure we really should. I'd be in favour of just making it an error.

@joehuchette
Copy link
Contributor

It is a bit inconsistent that

julia> @addConstraint(m, 5 >= x >= 1)
ERROR: in @addConstraint (5 >= x >= 1): only ranged rows of the form lb <= expr <= ub are supported.

doesn't work.

@mlubin
Copy link
Member

mlubin commented Aug 9, 2015

I'm not a big fan of the syntax, but not sure if we need to break things now if this is how some people prefer to write down variable bounds.

@IainNZ
Copy link
Collaborator Author

IainNZ commented Aug 9, 2015

I don't even think its documented, I think it was added in one of the @defVar refactors just because it was possible.

@mlubin
Copy link
Member

mlubin commented Aug 9, 2015

@yeesian seems to use this syntax in his examples

@IainNZ
Copy link
Collaborator Author

IainNZ commented Aug 9, 2015

Yeah but that guys crazy ;)

@mlubin
Copy link
Member

mlubin commented Aug 9, 2015

We'd at least have to deprecate for a version cycle. The syntax is rough on the eyes but it's still clear and easy to understand. We don't have the corresponding syntax for two-sided constraints because variables with upper and lower bounds are much more common than two-sided constraints.
Here's the original commit: a1d0c87

@yeesian
Copy link
Contributor

yeesian commented Aug 9, 2015

@yeesian seems to use this syntax in his examples

Oops, did I? I don't mind changing the examples (if any).

@yeesian
Copy link
Contributor

yeesian commented Aug 9, 2015

Hah yeah, whoops, caught in the act, lol. I can submit a PR to change them though. Don't let them be a showstopper (for longer-term sanity).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants