Next: Structure-based linear constraints, Previous: Structure-based user functions, Up: Parameter structures [Index]

### 10.2 Format of returned values of structure-based gradient and Hessian functions

Structure-based gradient or Jacobian functions, including Jacobians of general constraints, must return the partial derivatives as fields of a structure under the respective parameter names. For gradients, the partial derivatives are scalar. For Jacobians, the partial derivatives must be column vectors.

Structure-based Hessian functions must return the 2nd derivatives as subfields in a two-level structure of parameter names. For example, if the parameter names are `a` and `b`, the 2nd derivative with respect to `a` and `b` must be in the field `returned_structure.a.b` or `returned_structure.b.a` (there is no need to specify both).