# VecAbs
Replaces every element in a vector with its absolute value. 
## Synopsis
```
#include "petscvec.h" 
PetscErrorCode VecAbs(Vec v)
```
Logically Collective on Vec


## Input Parameters

- ***v -*** the vector





## Level
intermediate

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/tutorials/ex4.c.html">src/tao/tutorials/ex4.c.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/impls/seq/kokkos/veckok.kokkos.cxx.html#VecAbs_SeqKokkos">VecAbs_SeqKokkos in src/vec/vec/impls/seq/kokkos/veckok.kokkos.cxx</A><BR>


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