# TaoGetSolutionStatus
Get the current iterate, objective value, residual, infeasibility, and termination 
## Synopsis
```
#include "petsctao.h" 
PetscErrorCode TaoGetSolutionStatus(Tao tao, PetscInt *its, PetscReal *f, PetscReal *gnorm, PetscReal *cnorm, PetscReal *xdiff, TaoConvergedReason *reason)
```
Not Collective


## Input Parameter

- ***tao -*** the Tao context



## Output Parameters

- ***iterate -*** the current iterate number (>=0)
- ***f -*** the current function value
- ***gnorm -*** the square of the gradient norm, duality gap, or other measure indicating distance from optimality.
- ***cnorm -*** the infeasibility of the current solution with regard to the constraints.
- ***xdiff -*** the step length or trust region radius of the most recent iterate.
- ***reason -*** The termination reason, which can equal `TAO_CONTINUE_ITERATING`





## Notes
Tao returns the values set by the solvers in the routine `TaoMonitor()`.

If any of the output arguments are set to `NULL`, no corresponding value will be returned.


## See Also
 `TaoMonitor()`, `TaoGetConvergedReason()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/interface/taosolver.c.html#TaoGetSolutionStatus">src/tao/interface/taosolver.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/unconstrained/tutorials/burgers_spectral.c.html">src/tao/unconstrained/tutorials/burgers_spectral.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/unconstrained/tutorials/eptorsion2f.F90.html">src/tao/unconstrained/tutorials/eptorsion2f.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/unconstrained/tutorials/spectraladjointassimilation.c.html">src/tao/unconstrained/tutorials/spectraladjointassimilation.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/bound/tutorials/jbearing2.c.html">src/tao/bound/tutorials/jbearing2.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/tao/interface/taosolver.c)


[Index of all Tao routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
