:orphan: # TaoLineSearchComputeGradient Computes the gradient of the objective function ## Synopsis ``` #include "petsctaolinesearch.h" PetscErrorCode TaoLineSearchComputeGradient(TaoLineSearch ls, Vec x, Vec g) ``` Collective ## Input Parameters - ***ls -*** the `TaoLineSearch` context - ***x -*** input vector ## Output Parameter - ***g -*** gradient vector ## Note `TaoComputeGradient()` is typically used within line searches so most users would not generally call this routine themselves. ## See Also [](ch_tao), `Tao`, `TaoLineSearch`, `TaoLineSearchComputeObjective()`, `TaoLineSearchComputeObjectiveAndGradient()`, `TaoLineSearchSetGradient()` ## Level developer ## Location src/tao/linesearch/interface/taolinesearch.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/tao/linesearch/interface/taolinesearch.c) [Index of all TaoLineSearch routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)