ISGetPointRange#

Returns a description of the points in an IS suitable for traversal

Synopsis#

#include "petscis.h"  
PetscErrorCode ISGetPointRange(IS pointIS, PetscInt *pStart, PetscInt *pEnd, const PetscInt **points)

Not Collective

Input Parameter#

  • pointIS - The IS object

Output Parameters#

  • pStart - The first index, see notes

  • pEnd - One past the last index, see notes

  • points - The indices, see notes

Notes#

If the IS contains contiguous indices in an ISSTRIDE, then the indices are contained in [pStart, pEnd) and points = NULL. Otherwise, pStart = 0, pEnd = numIndices, and points is an array of the indices. This supports the following pattern

  ISGetPointRange(is, &pStart, &pEnd, &points);
  for (p = pStart; p < pEnd; ++p) {
    const PetscInt point = points ? points[p] : p;
    // use point
  }
  ISRestorePointRange(is, &pstart, &pEnd, &points);

Hence the same code can be written for pointIS being a ISSTRIDE or ISGENERAL

See Also#

Low-level Vector Communication, IS, ISRestorePointRange(), ISGetPointSubrange(), ISGetIndices(), ISCreateStride()

Level#

intermediate

Location#

src/vec/is/utils/isltog.c


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