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

parse_one_operator_constraint: clash with parse_ternary_constraint when there are four arguments #2246

Closed
dourouc05 opened this issue Jun 4, 2020 · 1 comment
Milestone

Comments

@dourouc05
Copy link
Contributor

Following #2051, there is a new parse_one_operator_constraint extension point in JuMP. However, it is not called in a very specific situation: when the constraint looks like binpacking(a, b, c, d), i.e. when there is just a function call and four arguments. For instance, the current implementation works correctly with binpacking(a, b, collect(1:10), d).

In that case, JuMP jumps to parse_ternary_constraint(_error, vectorized, :binpacking, Val(a), b, Val(c), d). As neither a nor b are inequality signs, it directly generates an error.

I only found a hacky solution for this: in parse_ternary_constraint, intercept all error calls, ensure that there is no parse_one_operator_constraint to call. JuliaConstraints/JuCP.jl@acb90e3

An example to trigger this error: JuliaConstraints/JuCP.jl@acb90e3#diff-fce720c43af3c52c862fd7451c7374b8R312-R327

I hope someone has more imagination that I do to fix this!

@odow
Copy link
Member

odow commented Oct 4, 2021

Closing in favor of #2236 we should come up with a proper design and thoroughly document it.

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

No branches or pull requests

2 participants