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

Try to handle single-variable constraints as bounds #27

Open
rdeits opened this issue Sep 29, 2017 · 1 comment
Open

Try to handle single-variable constraints as bounds #27

rdeits opened this issue Sep 29, 2017 · 1 comment

Comments

@rdeits
Copy link
Owner

rdeits commented Sep 29, 2017

This should probably work:

@variable(m, x)
@constraint(m -1 <= x <= 1)
@switch(
(x <= 0) => 0,
(x >= 0) => 1)

but currently fails because x has a constraint but no actual bounds.

@rdeits
Copy link
Owner Author

rdeits commented Sep 29, 2017

The workaround is to actually call setlowerbound() and setupperbound() instead of trying to do that with @constraint

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

No branches or pull requests

1 participant