TaoTermComputeGradientFD#

Approximate the gradient of a TaoTerm using finite differences

Synopsis#

#include "petsctao.h" 
PetscErrorCode TaoTermComputeGradientFD(TaoTerm term, Vec x, Vec params, Vec g)

Collective

Input Parameters#

Output Parameter#

  • g - the computed finite difference approximation to the gradient

Options Database Keys#

Notes#

This routine is slow and expensive, and is not optimized to take advantage of sparsity in the problem. Although not recommended for general use in large-scale applications, it can be useful in checking the correctness of a user-provided gradient. Call TaoTermComputeGradientSetUseFD() to start using this routine in TaoTermComputeGradient().

See Also#

TaoTerm: composable objective function terms, TaoTerm, TaoTermGetFDDelta(), TaoTermSetFDDelta(), TaoTermComputeGradientSetUseFD(), TaoTermComputeGradientGetUseFD(), TaoTermComputeHessianFD()

Level#

advanced

Location#

src/tao/term/utils/taotermfdiff.c


Index of all TaoTerm routines
Table of Contents for all manual pages
Index of all manual pages