You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If only a subset of the functions listed above is implemented, you can indicate which ones are not available when creating the [`NLPModelMeta`](@ref), using the keyword arguments
49
50
`grad_available`, `jac_available`, `hess_available`, `jprod_available`, `jtprod_available`, and `hprod_available`.
51
+
You can also specify whether the Jacobian of the constraints and the Hessian of the objective or Lagrangian are sparse using the keyword arguments `sparse_jacobian` and `sparse_hessian`.
-`hess_coord!(nlp, x, y, hvals; obj_weight=1)` (sparse Hessian)
80
+
-`hess_dense!(nlp, x, y, Hx; obj_weight=1)` (dense Hessian)
78
81
-`hprod!(nlp, x, y, v, Hv; obj_weight=1)`
79
82
80
83
The linear constraints are specified at the initialization of the `NLPModelMeta` using the keyword arguement `lin`.
81
84
The indices of linear and nonlinear constraints are respectively available in `nlp.meta.lin` and `nlp.meta.nln`.
82
85
If your model uses only linear (resp. nonlinear) constraints, then it suffices to implement the `*_lin` (resp. `*_nln`) functions.
83
86
Alternatively, one could implement only the functions without the suffixes `_nln!` (e.g., only `cons!`), but this might run into errors with tools differentiating linear and nonlinear constraints.
84
87
88
+
If the Jacobian or the Hessian of the Lagrangian is dense, there is no need to implement the corresponding `*_structure!` and `*_coord!` methods.
89
+
Only the corresponding `*_dense!` methods need to be implemented.
90
+
This is specified at the initialization of [`NLPModelMeta`](@ref) through the keyword arguments `sparse_jacobian` and `sparse_hessian`.
91
+
In the dense case, linear and nonlinear constraints are handled together.
92
+
Only an in-place API is available for dense Jacobians and Hessians (`jac_dense!` and `hess_dense!`).
93
+
85
94
## [Availability of the API](@id availability-api)
86
95
87
96
If only a subset of the functions listed above is implemented, you can indicate which ones are not available when creating the [`NLPModelMeta`](@ref), using the keyword arguments
0 commit comments