CUTEstProblem.jprod

CUTEstProblem.jprod(p, transpose=False, x=None)

Evaluate product of constraint Jacobian with a vector p

# evaluate J*p where J is the last computed Jacobian
r = problem.jprod(p)
# evaluate J.T*p where J is the last computed Jacobian
r = problem.jprod(p, transpose=True)
# evaluate Jacobian at x, and return J(x)*p
r = problem.jprod(p, x=x)
# evaluate Jacobian at x, and return J(x).T*p
r = problem.jprod(p, transpose=True, x=x)

For unconstrained problems, r is None.

This calls CUTEst routine CUTEST_cjprod.

Parameters:
  • p (numpy.ndarray with shape (n,) or (m,) if transpose=True) – vector to be multiplied by the Jacobian of constraints

  • transpose (bool, optional) – if True, multiply by transpose of Jacobian (J.T*p)

  • x (numpy.ndarray with shape (n,), optional) – input vector for Jacobian (default=None -> use last computed Jacobian)

Returns:

Jacobian-vector product J(x)*p or J(x).T*p if transpose=True

Return type:

numpy.ndarray(m,) or numpy.ndarray(n,) if transpose=True