Can an MOF file be read in to create a MOI.NLPBlock
In essence: JuMP -> MOF -> MOI -> AmplNLWriter
This would aid the creation of MOI NLP tests.
Here is a hacky way using Calculus.jl's symbolic differentiation:
https://gist.github.com/odow/58a3469c9119b58069ab708431426905
It's now significantly less hacky. The parsed functions are fast and non-allocating :)
Instead of writing an AD framework, I'd recommend letting JuMP do the work. Load the expressions via set_NL_objective and add_NL_constraint: http://www.juliaopt.org/JuMP.jl/dev/nlp/#Raw-expression-input-1.
That means having JuMP as a dependency of MathOptFormat? 😢
That means having JuMP as a dependency of MathOptFormat?
Or ReverseDiff or Zygote or Casadi or CppAD or pytorch or your favorite AD framework. Using Calculus with symbolic derivatives will not scale to reasonably large models.
I can say this because I tried using Calculus for JuMP before I knew about reverse-mode AD.