:orphan:
# VecAbs
Replaces every element in a vector with its absolute value.
## Synopsis
```
#include "petscvec.h"
PetscErrorCode VecAbs(Vec v)
```
Logically Collective
## Input Parameter
- ***v -*** the vector
## Level
intermediate
## Location
src/vec/vec/utils/vinv.c
## Examples
src/tao/tutorials/ex4.c
## Implementations
VecAbs_SeqKokkos in src/vec/vec/impls/seq/kokkos/veckok.kokkos.cxx
---
[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](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)