# ISSum
Computes the sum (union) of two index sets. 
## Synopsis
```
#include "petscis.h"  
PetscErrorCode ISSum(IS is1, IS is2, IS *is3)
```
Only sequential version (at the moment)


## Input Parameters

- ***is1 -*** index set to be extended
- ***is2 -*** index values to be added



## Output Parameter

- ***is3 -*** the sum; this can not be is1 or is2





## Notes
If n1 and n2 are the sizes of the sets, this takes O(n1+n2) time;

Both index sets need to be sorted on input.

The sum is computed separately on each MPI rank


## See Also
 [](sec_scatter), `IS`, `ISDestroy()`, `ISView()`, `ISDifference()`, `ISExpand()`

## Level
intermediate

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


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