:orphan: # ISEqual Compares if two index sets have the same set of indices. ## Synopsis ``` #include "petscis.h" PetscErrorCode ISEqual(IS is1, IS is2, PetscBool *flg) ``` Collective ## Input Parameters - ***is1 -*** first index set to compare - ***is2 -*** second index set to compare ## Output Parameter - ***flg -*** output flag, either `PETSC_TRUE` (if both index sets have the same indices), or `PETSC_FALSE` if the index sets differ by size or by the set of indices) ## Note Unlike `ISEqualUnsorted()`, this routine sorts the contents of the index sets (only within each MPI rank) before the comparison is made, so the order of the indices on a processor is immaterial. Each processor has to have the same indices in the two sets, for example, ```none Processor 0 1 is1 = {0, 1} {2, 3} is2 = {2, 3} {0, 1} ``` will return false. ## See Also [](sec_scatter), `IS`, `ISEqualUnsorted()` ## Level intermediate ## Location src/vec/is/is/utils/iscomp.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/is/is/utils/iscomp.c) [Index of all IS routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)