Conversation
|
Nice. Sorta vague question: could the rewriting/simplifying NL expressions be moved to where we do conceptually similar things for affine/quadratic functions? So we would be simplifying SNFs. Perhaps in some cases the rewrites could simplify an SNF to a SAF/SQF. |
|
Yeah open question. For now I've kept things separate from where we
Yes, this is on my TODO list. We can certainly do better at detecting linear subexpressions within a SNF. |
|
This would be very useful for: jump-dev/ParametricOptInterface.jl#144 POI only needs cubic function simplifcation, ideally in: sum of cubic terms + SQF. Then, POI would be used in DiffOpt so that we can easily differentiate wrt coefficients in the quadratic objective function. |
38c1810 to
1e4e207
Compare
|
Conclusion from last week's developer call was that we can merge this as-is for now. We can wait a while before tagging a new release of MOI that contains it. |
Twas prototyped in lanl-ansi/MathOptSymbolicAD.jl#39
I'm open to arguments against adding this. The evaluator could arguably remain in the separate MathOptSymbolicAD.jl package. But the simplification and symbolic derivative stuff is more widely useful. I occasionally get questions on the forum asking how to compute the derivative of a JuMP expression.
TODO
Related issues
This doesn't close any issues directly, but it relates to a number of open and previously closed issues:
It currently lacks support for multivariate user-defined functions, because these require #2402
Use with JuMP
We require only a few trivial helper methods in JuMP to link this all up: