# VecPermute
Permutes a vector in place using the given ordering. 
## Synopsis
```
#include "petscvec.h" 
PetscErrorCode VecPermute(Vec x, IS row, PetscBool inv)
```

## Input Parameters

- ***vec   -*** The vector
- ***order -*** The ordering
- ***inv   -*** The flag for inverting the permutation




Note: This function does not yet support parallel Index Sets with non-local permutations


## See Also
 `MatPermute()`

## Level
beginner

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex10.c.html">src/ksp/ksp/tutorials/ex10.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex18.c.html">src/ksp/ksp/tutorials/ex18.c.html</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)  
