diff --git a/src/Nonlinear/model.jl b/src/Nonlinear/model.jl index b570a0dcc3..023640625e 100644 --- a/src/Nonlinear/model.jl +++ b/src/Nonlinear/model.jl @@ -77,6 +77,16 @@ function set_objective(model::Model, ::Nothing) return end +""" + nonlinear_model(backend::AbstractAutomaticDifferentiation) + +Return a new nonlinear model appropriate for the given AD `backend`. + +The default returns `Model()`. Custom AD backends can override this +to return their own model type. +""" +nonlinear_model(::AbstractAutomaticDifferentiation) = Model() + """ add_expression(model::Model, expr)::ExpressionIndex