Skip to content

Commit 6db1605

Browse files
committed
Update sparse.md
1 parent 1aa7322 commit 6db1605

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

docs/src/sparse.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,7 @@ ucon = 0.5 * ones(T, ncon)
8989
J_backend = ADNLPModels.SparseADJacobian(nvar, f, ncon, c!, J)
9090
H_backend = ADNLPModels.SparseADHessian(nvar, f, ncon, c!, H)
9191
92-
nlp = ADNLPModel!(f, x0, lvar, uvar, c!, lcon, ucon, jacobian_backend=ADNLPModels.EmptyADbackend, hessian_backend=ADNLPModels.EmptyADbackend)
93-
# nlp = ADNLPModel!(f, x0, lvar, uvar, c!, lcon, ucon, matrix_free=true) # Equivalent to the previous line
94-
95-
set_adbackend!(nlp, jacobian_backend=J_backend)
96-
set_adbackend!(nlp, hessian_backend=H_backend)
92+
nlp = ADNLPModel!(f, x0, lvar, uvar, c!, lcon, ucon, jacobian_backend=J_backend, hessian_backend=H_backend)
9793
```
9894

9995
The package [`SparseConnectivityTracer.jl`](https://github.com/adrhill/SparseConnectivityTracer.jl) is used to compute the sparsity pattern of Jacobians and Hessians.

0 commit comments

Comments
 (0)