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#
term - a
TaoTermx - a solution vector
params - parameters vector (may be
NULL, seeTaoTermParametersMode)
Output Parameter#
g - the computed finite difference approximation to the gradient
Options Database Keys#
-tao_term_fd_delta
- change inxused to calculate finite differences-tao_term_gradient_use_fd
- UseTaoTermComputeGradientFD()inTaoTermComputeGradient()
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