CUTEstProblem.sphess
- CUTEstProblem.sphess(x, v=None)
Evaluate sparse Hessian of objective or Lagrangian. For constrained problems, the Hessian is L_{x,x}(x,v).
# Hessian of objective (unconstrained problems) H = problem.sphess(x) # Hessian of Lagrangian (constrained problems) H = problem.sphess(x, 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 isphess()
The matrix H is of type scipy.sparse.coo_matrix.
For small problems, problem.hess returns dense matrices.
This calls CUTEst routine CUTEST_csh or CUTEST_ush.
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:
sparse Hessian of objective (unconstrained) or Lagrangian (constrained) at x
- Return type:
scipy.sparse.coo_matrix(n,n)