# VecChop
Set all values in the vector with an absolute value less than the tolerance to zero 
## Synopsis
```
#include "petscvec.h"  
PetscErrorCode VecChop(Vec v, PetscReal tol)
```

## Input Parameters

- ***v   -*** The vector
- ***tol -*** The zero tolerance



## Output Parameters

- ***v -*** The chopped vector





## See Also
 `VecCreate()`, `VecSet()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/utils/vecio.c.html#VecChop">src/vec/vec/utils/vecio.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex12.c.html">src/snes/tutorials/ex12.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex13.c.html">src/snes/tutorials/ex13.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex63.c.html">src/snes/tutorials/ex63.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex77.c.html">src/snes/tutorials/ex77.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/vec/utils/vecio.c)


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