ISIntersect — PETSc 3.23.0 documentation

Skip to main content
`Ctrl`+`K`

# ISIntersect

Computes the intersection of two index sets, by sorting and comparing.

## Synopsis

    #include "petscis.h"
    PetscErrorCode ISIntersect(IS is1, IS is2, IS *isout)

Collective

## Input Parameters

- is1 - first index set

- is2 - second index set

## Output Parameter

- isout - the sorted intersection of `is1` and `is2`

## Notes

Negative values are removed from the lists. This requires O(min(is1,is2)) memory and O(max(is1,is2)log(max(is1,is2))) work

`is1` and `is2` do not need to be sorted.

The operations are performed separately on each MPI rank

## See Also

Low-level Vector Communication, `IS`, `ISDestroy()`, `ISView()`, `ISDifference()`, `ISSum()`, `ISExpand()`, `ISConcatenate()`

## Level

intermediate

## Location

src/vec/is/is/utils/isdiff.c

Index of all IS routines
Table of Contents for all manual pages
Index of all manual pages