TaoTermComputeGradientSetUseFD — PETSc 3.25.0 documentation

Skip to main content
`Ctrl`+`K`

# TaoTermComputeGradientSetUseFD

Set whether to use finite differences instead of the user-provided or built-in gradient method in `TaoTermComputeGradient()`.

## Synopsis

    #include "petsctao.h"
    PetscErrorCode TaoTermComputeGradientSetUseFD(TaoTerm term, PetscBool use_fd)

Logically collective

## Input Parameters

- term - a `TaoTerm`

- use_fd - `PETSC_TRUE` to use finite differences, `PETSC_FALSE` to use the user-provided or built-in gradient method

## Options Database Keys

- -tao_term_gradient_use_fd - use finite differences for gradient computation

## See Also

TaoTerm: composable objective function terms, `TaoTerm`, `TaoTermGetFDDelta()`, `TaoTermSetFDDelta()`, `TaoTermComputeGradientFD()`, `TaoTermComputeGradientGetUseFD()`, `TaoTermComputeHessianFD()`, `TaoTermComputeHessianSetUseFD()`, `TaoTermComputeHessianGetUseFD()`

## Level

advanced

## Location

src/tao/term/interface/taoterm.c

## Examples

src/tao/unconstrained/tutorials/rosenbrock1_taoterm.c

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