# TaoLineSearchGetNumberFunctionEvaluations
Gets the number of function and gradient evaluation routines used by the line search in last application (not cumulative). 
## Synopsis
```
#include "petsctaolinesearch.h" 
PetscErrorCode TaoLineSearchGetNumberFunctionEvaluations(TaoLineSearch ls, PetscInt *nfeval, PetscInt *ngeval, PetscInt *nfgeval)
```
Not Collective


## Input Parameter

- ***ls -*** the TaoLineSearch context



## Output Parameters

- ***nfeval   -*** number of function evaluations
- ***ngeval   -*** number of gradient evaluations
- ***nfgeval  -*** number of function/gradient evaluations





## Note
If the line search is using the Tao objective and gradient
routines directly (see TaoLineSearchUseTaoRoutines()), then TAO
is already counting the number of evaluations.


## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/linesearch/interface/taolinesearch.c.html#TaoLineSearchGetNumberFunctionEvaluations">src/tao/linesearch/interface/taolinesearch.c</A>


---
[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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
