Actual source code: dmlabelimpl.h
petsc-3.10.5 2019-03-28
Report Typos and Errors

      1: #if !defined(_LABELIMPL_H)
      2: #define _LABELIMPL_H

      4:  #include <petscdmlabel.h>
      5:  #include <petscbt.h>
      6:  #include <petscistypes.h>
      7:  #include <petsc/private/hashseti.h>

      9: /* This is an integer map, in addition it is also a container class
     10:    Design points:
     11:      - Low storage is the most important design point
     12:      - We want flexible insertion and deletion
     13:      - We can live with O(log) query, but we need O(1) iteration over strata
     14: */
     15: struct _n_DMLabel {
     16:   PetscInt         refct;
     17:   PetscObjectState state;
     18:   char       *name;           /* Label name */
     19:   PetscInt    numStrata;      /* Number of integer values */
     20:   PetscInt    defaultValue;   /* Background value when no value explicitly given */
     21:   PetscInt   *stratumValues;  /* Value of each stratum */
     22:   /* Basic IS storage */
     23:   PetscBool  *validIS;        /* The IS is valid (no additions need to be merged in) */
     24:   PetscInt   *stratumSizes;   /* Size of each stratum */
     25:   IS         *points;         /* Points for each stratum, always sorted */
     26:   /* Hashtable for fast insertion */
     27:   PetscHSetI *ht;             /* Hash table for fast insertion */
     28:   /* Index for fast search */
     29:   PetscInt    pStart, pEnd;   /* Bounds for index lookup */
     30:   PetscBT     bt;             /* A bit-wise index */
     31: };

     33: PETSC_INTERN PetscErrorCode PetscSectionSymCreate_Label(PetscSectionSym);
     34: #endif