# ISComplement
Given an index set `IS` generates the complement index set. That is all all indices that are NOT in the given set. 
## Synopsis
```
#include "petscis.h"  
PetscErrorCode ISComplement(IS is, PetscInt nmin, PetscInt nmax, IS *isout)
```
Collective


## Input Parameters

- ***is -*** the index set
- ***nmin -*** the first index desired in the local part of the complement
- ***nmax -*** the largest index desired in the local part of the complement (note that all indices in is must be greater or equal to nmin and less than nmax)



## Output Parameter

- ***isout -*** the complement





## Notes
The communicator for this new `IS` is the same as for the input IS

For a parallel `IS`, this will generate the local part of the complement on each process

To generate the entire complement (on each process) of a parallel `IS`, first call `ISAllGather()` and then
call this routine.


## See Also
 [](sec_scatter), `IS`, `ISCreateGeneral()`, `ISCreateStride()`, `ISCreateBlock()`, `ISAllGather()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/is/utils/iscoloring.c.html#ISComplement">src/vec/is/is/utils/iscoloring.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/utils/tagger/tutorials/ex1.c.html">src/vec/vec/utils/tagger/tutorials/ex1.c.html</A><BR>


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


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