1 /* $Id: is.h,v 1.31 1996/09/28 20:21:29 curfman Exp bsmith $ */ 2 3 /* 4 An index set is a generalization of a subset of integers. Index sets 5 are used for defining scatters and gathers. 6 */ 7 #if !defined(__IS_PACKAGE) 8 #define __IS_PACKAGE 9 #include "petsc.h" 10 11 #define IS_COOKIE PETSC_COOKIE+2 12 13 typedef struct _IS* IS; 14 15 /* 16 Default index set data structures that PETSc provides. 17 */ 18 typedef enum {IS_GENERAL=0, IS_STRIDE=1, IS_BLOCK = 2} ISType; 19 extern int ISCreateGeneral(MPI_Comm,int,int *,IS *); 20 extern int ISCreateBlock(MPI_Comm,int,int,int *,IS *); 21 extern int ISCreateStride(MPI_Comm,int,int,int,IS *); 22 23 extern int ISDestroy(IS); 24 25 extern int ISSetPermutation(IS); 26 extern int ISPermutation(IS,PetscTruth*); 27 extern int ISSetIdentity(IS); 28 extern int ISIdentity(IS,PetscTruth*); 29 30 extern int ISGetIndices(IS,int **); 31 extern int ISRestoreIndices(IS,int **); 32 extern int ISGetSize(IS,int *); 33 extern int ISInvertPermutation(IS,IS*); 34 extern int ISView(IS,Viewer); 35 extern int ISEqual(IS, IS, PetscTruth *); 36 extern int ISSort(IS); 37 extern int ISSorted(IS, PetscTruth *); 38 39 extern int ISBlock(IS,PetscTruth*); 40 extern int ISBlockGetIndices(IS,int **); 41 extern int ISBlockRestoreIndices(IS,int **); 42 extern int ISBlockGetSize(IS,int *); 43 extern int ISBlockGetBlockSize(IS,int *); 44 45 extern int ISStride(IS,PetscTruth*); 46 extern int ISStrideGetInfo(IS,int *,int*); 47 48 /* 49 ISColorings are sets of IS's that define a coloring 50 of the underlying indices 51 */ 52 struct _ISColoring { 53 int n; 54 IS *is; 55 MPI_Comm comm; 56 }; 57 typedef struct _ISColoring* ISColoring; 58 59 extern int ISColoringDestroy(ISColoring); 60 extern int ISColoringView(ISColoring,Viewer); 61 extern int ISColoringCreate(MPI_Comm,int,int*,ISColoring*); 62 63 #endif 64 65 66 67 68