Skip to content

Commit 19803b0

Browse files
committed
Add nonlinear_model function
1 parent 65e4a61 commit 19803b0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/Nonlinear/model.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ function set_objective(model::Model, ::Nothing)
7777
return
7878
end
7979

80+
"""
81+
nonlinear_model(backend::AbstractAutomaticDifferentiation)
82+
83+
Return a new nonlinear model appropriate for the given AD `backend`.
84+
85+
The default returns `Model()`. Custom AD backends can override this
86+
to return their own model type.
87+
"""
88+
nonlinear_model(::AbstractAutomaticDifferentiation) = Model()
89+
8090
"""
8191
add_expression(model::Model, expr)::ExpressionIndex
8292

0 commit comments

Comments
 (0)