CUTEstProblem.hess

CUTEstProblem.hess(x, v=None)

Evaluate the Hessian of the objective or Lagrangian. For constrained problems, the Hessian is L_{x,x}(x,v).

# Hessian of objective at x for unconstrained problems
H = problem.hess(x)
# Hessian of Lagrangian at (x, v) for constrained problems
H = problem.hess(x, v=v)

For unconstrained problems, v must be None. For constrained problems, v must be specified. To evaluate the Hessian of the objective for constrained problems use ihess()

For large problems, problem.sphess returns sparse matrices.

This calls CUTEst routine CUTEST_cdh or CUTEST_udh.

Note: in CUTEst, the sign convention is such that the Lagrangian = objective + lagrange_multipliers * constraints

Parameters:
  • x (numpy.ndarray with shape (n,)) – input vector

  • v (numpy.ndarray with shape (m,), optional) – vector of Lagrange multipliers (must be specified for constrained problems)

Returns:

Hessian of objective (unconstrained) or Lagrangian (constrained) at x

Return type:

numpy.ndarray(n,n)