Closed blegat closed 3 years ago
So the issue is that a = [1, x, y]
promotes each element to an affine expression. a = Any[1, x, y]
works fine.
One fix would be to check if the expression a
contains any terms, or if the constant is zero and it contains a single term, and return the appropriate constant or variable index:
https://github.com/jump-dev/JuMP.jl/blob/52b1b385b6a02bb08964b35403b6d7aee4252281/src/parse_nlp.jl#L216-L220
cc @tweisser