# TaoBoundSolution
Ensures that the solution vector is snapped into the bounds within a given tolerance. 
## Synopsis
```
#include "petsctao.h" 
PetscErrorCode TaoBoundSolution(Vec X, Vec XL, Vec XU, PetscReal bound_tol, PetscInt *nDiff, Vec Xout)
```
Collective on Vec


## Input Parameters

- ***X -*** solution vector
- ***XL -*** lower bound vector
- ***XU -*** upper bound vector
- ***bound_tol -*** absolute tolerance in enforcing the bound



## Output Parameters

- ***nDiff -*** total number of vector entries that have been bounded
- ***Xout -*** modified solution vector satisfying bounds to bound_tol





## See Also
 `TAOBNCG`, `TAOBNTL`, `TAOBNTR`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/bound/utils/isutil.c.html#TaoBoundSolution">src/tao/bound/utils/isutil.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/tao/bound/utils/isutil.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)  
