@@ -222,8 +222,8 @@ julia> new_expr = Nonlinear.add_expression(model, :(my_f($x + 1)))
222
222
MathOptInterface.Nonlinear.ExpressionIndex(2)
223
223
```
224
224
By default, ` Nonlinear ` will compute first- and second-derivatives of the
225
- registered operator using ` ForwardDiff.jl ` . Override this by passing functions
226
- which compute the respective derivative:
225
+ registered operator using [ ForwardDiff.jl] ( https://github.com/JuliaDiff/ForwardDiff.jl ) .
226
+ Override this by passing functions which compute the respective derivative:
227
227
``` jldoctest nonlinear_developer
228
228
julia> f′(x) = 2 * sin(x) * cos(x)
229
229
f′ (generic function with 1 method)
@@ -248,14 +248,15 @@ g (generic function with 1 method)
248
248
249
249
julia> Nonlinear.register_operator(model, :my_g, 2, g)
250
250
```
251
- Now, you can use ` :my_f ` in expressions:
251
+ Now, you can use ` :my_g ` in expressions:
252
252
``` jldoctest nonlinear_developer
253
253
julia> new_expr = Nonlinear.add_expression(model, :(my_g($x + 1, $x)))
254
254
MathOptInterface.Nonlinear.ExpressionIndex(3)
255
255
```
256
256
By default, ` Nonlinear ` will compute the gradient of the registered
257
- operator using ` ForwardDiff.jl ` . (Hessian information is not supported.)
258
- Override this by passing a function to compute the gradient:
257
+ operator using [ ForwardDiff.jl] ( https://github.com/JuliaDiff/ForwardDiff.jl ) .
258
+ (Hessian information is not supported.) Override this by passing a function to
259
+ compute the gradient:
259
260
``` jldoctest nonlinear_developer
260
261
julia> function ∇g(ret, x...)
261
262
ret[1] = 2 * x[1] + x[2]
@@ -292,7 +293,7 @@ Nonlinear.Evaluator with available features:
292
293
```
293
294
The functions of the [ Nonlinear programming] ( @ref ) API implemented by
294
295
[ ` Nonlinear.Evaluator ` ] ( @ref ) depends upon the chosen
295
- [ ` Nonlinear.AbstractAutomaticDifferentiation ` ] (@ref backend.
296
+ [ ` Nonlinear.AbstractAutomaticDifferentiation ` ] ( @ref ) backend.
296
297
297
298
The ` :ExprGraph ` feature means we can call [ ` objective_expr ` ] ( @ref ) and
298
299
[ ` constraint_expr ` ] ( @ref ) to retrieve the expression graph of the problem.
@@ -341,7 +342,7 @@ easily identify the arguments to an operator. However, it has a significant
341
342
draw-back: each node in the graph requires a ` Vector ` , which is heap-allocated
342
343
and tracked by Julia's garbage collector (GC). For large models, we can expect
343
344
to have millions of nodes in the expression graph, so this overhead quickly
344
- becomes prohibiative for computation.
345
+ becomes prohibitive for computation.
345
346
346
347
An alternative is to record the expression as a linear tape:
347
348
``` jldoctest expr_graph
0 commit comments