Actual source code: isimpl.h

      1: /*
      2:     Index sets for scatter-gather type operations in vectors
      3: and matrices.

      5: */

      7: #if !defined(_IS_H)
      8: #define _IS_H

     10:  #include petscis.h

     12: struct _ISOps {
     13:   PetscErrorCode (*getsize)(IS,PetscInt*);
     14:   PetscErrorCode (*getlocalsize)(IS,PetscInt*);
     15:   PetscErrorCode (*getindices)(IS,PetscInt**);
     16:   PetscErrorCode (*restoreindices)(IS,PetscInt**);
     17:   PetscErrorCode (*invertpermutation)(IS,PetscInt,IS*);
     18:   PetscErrorCode (*sortindices)(IS);
     19:   PetscErrorCode (*sorted)(IS,PetscTruth *);
     20:   PetscErrorCode (*duplicate)(IS,IS *);
     21:   PetscErrorCode (*destroy)(IS);
     22:   PetscErrorCode (*view)(IS,PetscViewer);
     23:   PetscErrorCode (*identity)(IS,PetscTruth*);
     24: };

     26: #if defined(__cplusplus)
     27: class ISOps {
     28:   public:
     29:     int getsize(PetscInt*) {return 0;};
     30: };
     31: #endif

     33: struct _p_IS {
     34:   PETSCHEADER(struct _ISOps);
     35: #if defined(__cplusplus)
     36:   ISOps        *cops;
     37: #endif
     38:   PetscTruth   isperm;          /* if is a permutation */
     39:   PetscInt     max,min;         /* range of possible values */
     40:   void         *data;
     41:   PetscTruth   isidentity;
     42: };

     45: #endif