# VecPow
Replaces each component of a vector by x_i^p
## Synopsis
```
#include "petscvec.h"
PetscErrorCode VecPow(Vec v, PetscScalar p)
```
Logically Collective on v
## Input Parameters
- ***v -*** the vector
- ***p -*** the exponent to use on each element
## Level
intermediate
## Location
src/vec/vec/utils/projection.c
## Examples
src/tao/constrained/tutorials/tomographyADMM.c.html
src/tao/tutorials/ex4.c.html
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/vec/utils/projection.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)