-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
Extend add_to_expression!
for NonlinearExpr
#3505
Comments
So one problem with this is that Should we try and throw an error if not? When is |
I see. I am incrementally building a nonlinear expression to reformulate a disjunct constraint in DisjunctiveProgramming.jl. I notice that when I initialize the expression with |
Are you just adding a sum of terms? I'd just do: julia> model = Model();
julia> @variable(model, x)
x
julia> y = 0
0
julia> for _ in 1:3
y += exp(x)
end
julia> y
((0.0 + exp(x)) + exp(x)) + exp(x)
julia> flatten!(y)
0.0 + exp(x) + exp(x) + exp(x) |
Yes, I'm currently using Perhaps a better error message could be provided telling the user that the in-place modification is not supported for nonlinear expressions if you want. However, the stack trace points to the issue anyways. |
See #3506 |
I think |
Hi, it would be nice to use
add_to_expression!
withNonlinearExpr
. The following currently errors on master:The text was updated successfully, but these errors were encountered: