CUTEstProblem.isphess

CUTEstProblem.isphess(x, cons_index=None)

Evaluate the sparse Hessian of the objective or the i-th constraint.

# Hessian of the objective
H = problem.isphess(x)
# Hessian of the i-th constraint
H = problem.isphess(x, cons_index=i)

The matrix H is of type scipy.sparse.coo_matrix.

For small problems, problem.ihess returns dense matrices.

This calls CUTEst routine CUTEST_cish or CUTEST_ush.

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

  • cons_index (int, optional) – index of constraint (default is None -> use objective). Must be in 0..self.m-1.

Returns:

sparse Hessian of objective or a single constraint at x

Return type:

scipy.sparse.coo_matrix(n,n)